Wednesday, May 15, 2019

Foobar2000

https://diyaudioheaven.wordpress.com/digital/pc-software/foobar-2000-for-dummies-part-3-new-experimental-sacd-plugin-v-0-9-x/


Foobar 2000 for Dummies (Part 2) – Playing DSD – New SACD plugin (0.9.x and 1.x.x Series)

(Last updated May 14th 2019)
For a guide on how to losslessly compress DSD file size by 50% very easily with Wavpack 5.1, BatchEncoder and SACD plugin 1.04 (or later) click -> HERE 
This tutorial is divided in two sections, the first one is intended for those who have DACs that support DSD and want to configure Foobar to play and output DSD. The second section (scroll down) is  for those who either have PCM only DACs or for some reason want their DSD files to be converted to PCM.
SECTION I

Since version 0.9.8 the SACD plugin outputs DSD in DoP format either through WASAPI or through ASIO. There are still some people who are confused by how DoP works and probably because “PCM” is involved they think there is some sort of intermediate format conversion involved but there isn’t any DSD stays DSD all the time. Let me try to explain as simply as I can the difference between native DSD and DoP.
Imagine you want to send a pair of shoes to some one. There are two courrier companies available, one will take them “as is”, the other requires them to be in a box in order to accept them. The former is clearly more efficient at managing space in the transport van and can transport more goods in each trip than  the latter which is not as efficient as the boxes takes more space. When the shoes arive at their destination, if the efficient courrier was used they can be used straight away as delivered, if the less efficient courrier was used it will be necessary to remove teh shoes from the box before they can be used but in both cases the shoes would be exactly the same pair. In this example DoP would be the shoe box, it is just a “wrapper” to trick non native DSD compatible USB chips into delivering DSD by making them believe they are transporting PCM. Another chip inside the DAC will strip this wraper and send the native DSD to the decoding chip. This process is less efficient as it requires much more USB bandwidth (van space in the example) thus lowering the maximum supported DSD sample rate. Most DoP only DACs tend to be limited to 384K PCM which means DSD128 will be the maximum DSD rate. DACs supporting native DSD  can easily achieve DSD256 or even DSD512. Thankfuly it is possible to output native DSD should one want to thanks to either through the old foo_asio_dsd proxy or through the newer DSDTranscoder which is easier to setup and performs just as well.
I will consider three different configuration objectives in the following sections ordered from simplest to most complex:
  1. Bit perfect with DoP output
  2. Bit perfect with native DSD output
  3. Bit perfect DSD plus  “PCM to DSD” upsampling
For the time being I will keep the two old foo_dsd_asio  modes (now renamed to mode 4 and 5) in case some one has trouble with the DSDTranscoder component but they will be eventually removed as they are now redundant.

SACD Plugin versions 0.9.x and 1.0.x release log:
05/11/19: Version 1.1.2 (& DSD Processor v.1.1.3) – “DoP for Converter” option (When box is checked it allows to save DSD files to DoP FLAC, WAV, MP3, etc. when converting, resulting files will not play in PCM only players) and support for WavPack embedded CUE added.
03/07/19: Version 1.1.1a (& DSD Processor (v.1.1.2) now selects Hann window type as default instead of Rectangular.
02/25/19: Version 1.1.1 – Uneven padding error in DSDIFF fixed. Includes a new version of DSD Processor (v. 1.1.1)that includes 48KHz->44.1KHz resampling with 2 new configurable paramenters; Window Length (8-8192 samples) and Window Type (Barlett, Blackman, Hamming, Hann & rectangular).
01/26/18: Version 1.1.0 – Experimental: Foobar 1.4.x SDK.
11/07/17: Version 1.0.11 – Experimental: Upgraded DSD processor plugin.
08/14/17: Version 1.0.10 – DSD stream handling reverted back to 1.0.7. DSDTranscoder now included in SACD plugin zip.
06/04/17: Version 1.0.9 – DSD stream handling modified.
05/31/17: Version 1.0.8 – WavPack library updated to 5.1.0.
03/24/17: Version 1.0.7 – DSD stream handling simplified.
02/22/17: Version 1.0.6 – +-10dB volume adjustment for LFE channel. (see last section)
12/31/16: Version 1.0.5 – Experimental: DFF/DSF ID3v2 tags supported.
12/30/16: Version 1.0.4 – Experimental: WavPack DSD playback.(Details HERE)
12/15/16: Version 1.0.3 – DSDIFF track length fixed.
10/19/16: Version 1.0.2 – SACD metabase creation fixed.
10/18/16: Version 1.0.1 – Freezing on pause fixed.
10/13/16: Version 1.0.0 – Experimental: Installable DSD Processor plugins.
08/10/16: Version 0.9.11 – Crash when no output device fixed.
08/08/16: Version 0.9.10 – WASAPI push/event output mixup fixed.
08/03/16: Version 0.9.9 – Metadata setup fixed.
06/17/16: Version 0.9.8 – DSD and PCM modes have the same number of output channels.
29/04/16: Version 0.9.7 – DoP for ASIO/WASAPI/DS, direct DSD for ASIO removed.
12/09/15: Version 0.9.6 – Monoaural playback supported.
11/23/15: Version 0.9.5 – Crash when no ASIO devices are presented in the system fixed.
11/20/15: Version 0.9.4 – Device channel names/types in channel mapping fixed.
11/13/15: Version 0.9.3 – DSD output trace into foobar console added.
10/28/15: Version 0.9.2 – PCM overload fixed.
10/27/15: Version 0.9.1 – ASIO handling changed.
10/22/15: Version 0.9.0 – Sketchy: Direct DSD output for compatible ASIO devices (ASIO Proxy driver is not required).

  • Mode 1: Bitperfect
Using this configuration, all PCM and DSD formats will be sent “as is” (ie. unprocessed) to the DAC. 
Once the SACD plugin zip file is dowloaded from his Sourceforge site (https://sourceforge.net/projects/sacddecoder/files/foo_input_sacd/) the contents need to be extracted to a folder and installed (see Part 1 of the tutorial). For Bitperfect mode only “foo_input_sacd.fb2k-component” needs to be installed.
Important note:  Remember the plugin only supports standard DoP format for DSD. Some older DACs may no support this mode.
First step  would be configuring the plugin to use “DSD output” or “DSD+PCM” modes. Go to the menu “File” and click “Preferences”, in the left pane of the window that pops up look for Tools and, if closed, click the “+” sign to the left of the word to expand it and then click on SACD:
dsd_out_zpsys91x6yb
The difference between “DSD” and “DSD+PCM” is that the latter will send a converted to PCM stream to Foobar so graphic add-ons like VU-meters, spectrographs and so on will work as they do when playing regular PCM files
Other available items are:
  • Preferable Area: Options are: – None: it will show all available tracks on the SACD – Stereo: only stereo tracks are displayed – Multi channel: limits shown tracks to multi channel ones
  • Editable tags: Yes/No
  • Edited Master Playback: Yes/No
  • Store Tags With ISO: Yes/No (it actually doesn’t write to the ISO, it stores tag info in the plugin folder)
  • Linked 2CH/MCH Tags: When selected, tag editing of ISO files will apply to both stereo and multi channel versions of the track/tracks saving time.
Second step would be selecting to our preference or our DAC’s driver options either “DSD:ASIO:xxxxxxxxx”, “DSD:WASAPI (Event):xxxxxxxxx” or “DSD:WASAPI (Push):xxxxxxxxx” (where xxxxxxxxx our DAC’s driver name) as Foobar’s output device:
outputs_zpsyoxcjuld

  • Mode 2:  Bitperfect outputting native DSD through DSDTranscoder
If your DAC has ASIO drivers compatible with native DSD it is possible to strip the DoP output from the SACD plugin of its PCM wrapper using the DSDTranscoder component and send native DSD instead.
To enable this, run the installer from the DSDTranscoder folder of the extracted SACD plugin location or download the component  from https://sourceforge.net/projects/sacddecoder/files/dsd_transcoder/ , extract the content from the zip and run  the DSDTranscode executable file, accept all default options until installation is complete.
DSDTranscoder release history:
08/14/17: Version 1.0.10 – Start/Stop reentrance fixed.
08/01/17: Version 1.0.9-1 – Transition delay handling fixed.
07/13/17: Version 1.0.8 – Transition delay handling changed (broken, do not use)
06/07/17: Version 1.0.7 – Null output added.
06/04/17: Version 1.0.6 – Transition delay and sample position override options added.
05/31/17: Version 1.0.5 – Data tap added.
05/15/17: Version 1.0.4 – Auto mode removed.
05/11/17: Version 1.0.3 – Experimental: Switching between DSD and PCM modes reduced.
05/07/17: Version 1.0.2 – Experimental: Support for non-DoP devices added, not stable yet.
05/02/17: Version 1.0.1 – Experimental: DSD->DoP path added, still in test bed.
04/26/17: Version 1.0.0 – Experimental: The test bed.

Open Foobar, go to “File” in the menu and select “Preferences” then look for “Output” and select the component as the output device as shown here:
asiotrans_zpsj4uyckja
Next, to configure the DSDTranscoder double click it in the ASIO devices:
asio_zpsq2aijrtg
The following pop up window will appear:

4448_zpstyixs5sx
At this point you can set the desired output mode individually for each DSD input rate and sample rate family (44.1K or 48K) so it can accomodate every DAC’s supported formats.
My iFi iDSD micro supports native DSD through ASIO up to DSD512 but only for 44.1K based sample rates like SACD rips or upsampled CDs, for 48K based sample rates like those generated by upsampling 16/48, 24/96 or 24/192KHz to DSD it only supports up to DSD256 through DoP. With this component it takes very little time and effort to configure all 44.1K family to output native DSD and leave all 48K family in bypass (leaving the default dash, “-“).

  • Mode 3:  Upsampling with the new “DSD Processor” component (v. 1.1.1 or newer)
Version 1.0.0 of the plugin introduced an component named “DSD Processor” which provides a very simple way to upsample PCM and/or DSD to DSD (though purists be warned, DSD to DSD upsampling involves an intermediate PCM conversion step). As with the plugin by itself, “standard” DoP is the only available output so it may limit sample rate choice options for those using DACs that perform better with “native DSD” e.g.  Amanero adapter based DACs or the iFi iDSD micro (See Mode 2 for native or mixed DoP/native output).
Version 1.1.1 introduces two new user configurable fields (Window Length and Window Type) plus the possibility of performing sample rate conversion in the upsampling process, more on these a few paragraghs down.
In order to enable the DSD Processor it needs to be selected in the SACD plugin configuration pane:
processor2_zpseqnqkcjk
Then proceed to the “DSD Processor” pane and check the “Use DSD Processor” box:
DSDProcessor

Now you can configure the output you want for each input indepedently. In the capture above all PCM input formats are upsampled to DSD256 using “SDM type D” without resampling their fundamental frequency and with no “Sample & Hold” but all incomming DSD is left unprocessed.
a) The “Output” column sets the output sample rate and should not be configured to output rates beyond the maximum soported DoP rate of your DAC.
DSDoutput
When upsampling DSD Processor allows the user to choose whether to upsample using the same fundamental as the source or change to the alternative one.  If one doesn’t want resampling, output should be set to any of the rates that don’t have the “/48” at the end for 44.1KHz based sources (44.1, 88.2, 176.4 and 352.8KHz) and with it for 48KHz based music (48,96,192 and 384KHz). This can be a very useful option for those who own DACs that do not support 48KHz based DSD or those who want to experiment with the the different combinations de processor engine offers.
b) Windows Length: refers to Sample Rate Converter (Low frequency FIR, Fc is set to 0.5 Fs) Lentgh measured in samples. Value can range from 8 to 8,192 samples with the default being 27 (which is the recommended value). Increasing the lentgh value makes the filter steeper narrowing transition area (between passband and stopband), flatter passband and ading more suppression in stopband but it has the downside of increasing “ringing” (because of more fluctuation in transition area) and a heavier CPU load for longer windows.
c) Window Type:
The following values can be chosen:
WindowT
The dafult value is Hann (v. 1.1.2, in v. 1.1.1 default value is Rectangular and not recommended). For in depth information please  see here:  Window Function
d) The “Converter” coulmn sets the algorithm to be used for upsampling. Four different algorithms to convert PCM to DSD based on Philips ProTech tools are provided.:
SDM_Type
There are no details as to how each of them works and Philips only provides the following table:
102
It is up to you to test and decide which one you like best or works best in your system though types “B” and “D”are good starting points
c) The “Sample & Hold” column provides an alternative upsampling version for power limited computer processors. Turning on “Sample & Hold” just propagates one PCM sample several times in SDM. It is a “cheap” way of up-sampling “at no cost” to get 2.8 or 5.6 MHz PCM. It’s for PCM->DSD and DSD->DSD. Only suited to low performance systems. Available options are:
S&Hold
The number defines the times each sample is held. Default value is 8X which is recommended for the least powerful CPUs, if your computer can handle it NONE the prefered option
d) The “Precission” field refers to the type of number used to perform all upsampling calculations. Options are 32 bit floating point (32fp), 64 bit floating point (64fp) and integer (Int). Default value is 32fp.

OLD MODES (for those with DACs not compatible with the DSDTranscoder)
  • Mode 4: upsampling with the plugin and the “foo_dsd_asio” proxy
Note: In order to use this mode requires your DAC needs to have ASIO drivers
Since the plugin is not included any longer in the plugin zip file, it needs to be downloaded separately from here ( version 0.9.4 is strongly recommended), decompressed to a folder and installed separately as a any other program.
The advantages of using this Mode 3 over Mode 2 are:
  • Three selectable DoP modes instead of one: Standard DoP – 0x05/0xFA, dCS – 0xAA and eXD
  • Native DSD output available
  • Mixed output modes depending on input, useful in case your DAC supports different sampling rates depending on base frquency like most XMOS based DACs which do not support native DSD if it is 48K based but accept 48K based DoP
  • Selectable transition silence between formats
  • Trace file creation for error debugging
Proxy releases:
11/03/16: Version 0.9.4 – DoP to native DSD path fixed.
11/01/16: Version 0.9.3 – DoP256/DoP512 samplerates added. (Broken functionality. Do not use)
08/09/16: Version 0.9.2 – DSD256/DSD512 converter samplerates fixed.
08/05/16: Version 0.9.1 – DoP input handled.
09/04/15: Version 0.8.3 – Stereo playback for mono DSD sources added.
08/31/15: Version 0.8.2 – More detailed tracing, reset button added.
08/25/15: Version 0.8.1 – Floating point SDMs.
05/29/15: Version 0.7.3 – ASIO API tracing for downstream driver added.
04/06/15: Version 0.7.2 – Bypass for unsupported samplerates in PCM to DSD converter.
05/12/14: Version 0.7.1.2 – DSD/PCM switching fixed.
05/08/14: Version 0.7.1.1 – Experimental: PCM upsampler is removed from DSD to DSD converter.
05/05/14: Version 0.7.1 – Experimental: DSD to DSD converter, DSD path redesigned.
07/29/13: Version 0.6.5 – Optional delay when switching between DSD and PCM modes.
05/06/13: Version 0.6.4 – PCM to DSD multithreading, floating point SDMs.
04/24/13: Version 0.6.3 – PCM to DSD converter fixed.
04/22/13: Version 0.6.2 – Incompatibility with foo_input_sacd 0.6.4 fixed.
03/26/13: Version 0.6.1 – Experimental: PCM to DSD for x48000 samplerates (requires comatible DSD DAC).
10/31/12: Version 0.6.0 – Experimental: PCM to DSD converter added.
Once the plugin has been installed, the first step will be selecting it as Foobar’s output device:
proxy3_zpszxvvdvmd
Then go to ASIO and double click foo_dsd_asio:
proxy4_zpssfjamoor
A new independent window appears where the component can be configured to preference (make sure you select your DAC ASIO driver under “ASIO Device)”:
proxy2_zps2qys6r9g
As you can see this is almost identical to the “DSD Processor” configuration pane though it has an additional column for “DSD Mode” selection and the mentioned additional options for format to format transition “Transition (s)” and “Debug Output”.
Please see Mode #2 for details on how to configure columns a,b & c.
d) The “Output mode” column has the following options:
Out_mode
  • DSD -> Native DSD output, if supported by your DAC it is the most bandwidth efficient mode. This is a very convenient way to convert DoP from the SACD plugin to native DSD. Recommended whenever possible.
  • DoP -> standard DSD over PCM (0x05/0xFA) marker. If your DAC supports DoP only it is most likely you will need to select this one. Also very convenient for XMOS based DACs that don’t support 48KHz based DSD through native DSD like iFi DACs. Is the one I use to upsample 48, 96 or 192KHz PCM to DoP DSD256 for my iDSD micro as can be seen in the screen capture.
  • dCS AA-> DoP marker for dCS DACs (0xAA)
  • exD AA/BB -> DoP marker for exD DACs
Note: Since the SACD plugin outputs DSD in DoP format,  foo_asio_proxy will process incoming DSD as per the configuration set for the incomming PCM sample rate:
  • Incoming DSD64 in DoP format will use the upsampling configuration for 176400
  • Incoming DSD128 in DoP format will use the upsampling configuration for 352800
  • Incoming DSD256 in DoP format will use the upsampling configuration for 705600
  • Incoming DSD512 in DoP format will use the upsampling configuration for 1411200
So should you want to leave DSD unprocessed make sure you have all these PCM  rates with no up/downsampling configured like in the shown screen capture. This may be a little of a nuisance if you have plenty 176.4 or 352.8K PCM music you want to convert to DSD but  presently there is no alternative solution other than resampling these files with SOX to a 48KHz base, e.g. 176.4K->192K and 352.8->384K.
  • Mode 5: Hybrid upsampling with both DSD Processor and the “foo_dsd_asio” proxy
Note: In order to use this mode requires your DAC needs to have ASIO drivers
For the most demanding users Mode 4 provides a little extra tweaking possibilies the previous 3 modes can’t. On the other hand, tough the combination of both components provides the highest degree of flexibility though it may in some cases be less stable.
One example of what can be done with this mode is upsampling 176.4 or 352.8 KHz PM to DSD while being able to output true DSD without intermediate conversions. This cannot be done in any of the previous modes as this sample rates are shared by PCM and DSD64/128 in DoP mode output by the plugin.
Depending on the maximum DSD rate your DAC supports this means upsampling 176.4 and/or 352.8KHz PCM to DoP DSD256 or DSD512 in the DSD Processor component leaving those sample rates free in the foo_dsd_asio proxy for stripping DSD64/128 coming in 176.4/352.8 DoP from their PCM wrapper.
This is how the above would look like aiming to upsample all PCM to the maximum DSD rate supported by my iFi iDSD micro (native DSD512 for 44.1 based PCM and DSD256 DoP for 48K based PCM) while leaving DSD unmolested:
DSD Processor configuration:
dsdproc_zpsq86uorsy
Foo_dsd_asio configuration:
proxy_zpsweawzhtv
….and the missing DSD512 line (Proxy window is not resizeable):
dsd512_zpsbzec3yd4
In the table below you can see in red where PCM is upsampled to DSD and in blue where DoP to converted to native DSD.
SourceSACD Plugin-> DSD Processor-> foo_dsd_asio Proxy
OutputInputOutputInputOutput
44.1 PCMsame as sourcesame as sourcesame as sourcesame as sourceDSD512
48 PCMsame as sourcesame as sourcesame as sourcesame as source(DoP DSD256)
88.2 PCMsame as sourcesame as sourcesame as sourcesame as sourceDSD512
96 PCMsame as sourcesame as sourcesame as sourcesame as source(DoP DSD256)
176.4 PCMsame as sourcesame as source(DoP DSD512)(DoP DSD512)DSD512
192 PCMsame as sourcesame as sourcesame as sourcesame as source(DoP DSD256)
352.8 PCMsame as sourcesame as source(DoP DSD512)(DoP DSD512)DSD512
384 PCMsame as sourcesame as sourcesame as sourcesame as source(DoP DSD256)
DSD64(DoP DSD64)(DoP DSD64)(DoP  DSD64)(DoP DSD64)DSD64
DSD128(DoP DSD128)(DoP DSD128)(DoP DSD128)(DoP DSD128)DSD128
DSD256(DoP DSD256)(DoP DSD256)(DoP DSD256)(DoP DSD256)DSD256
DSD512(DoP DSD512)(DoP DSD512)(DoP DSD512)(DoP DSD512)DSD512


SECTION II
Using this configuration, all DSD formats will be sent as PCM to the DAC.
Once the SACD plugin zip file is dowloaded from his Sourceforge site (https://sourceforge.net/projects/sacddecoder/files/foo_input_sacd/) the contents need to be extracted to a folder and installed (see Part 1 of the tutorial). Only  the “foo_input_sacd.fb2k-component” needs to be installed.
First step  would be configuring the plugin to use “PCM” as output mode.
Go to the menu “File” and click “Preferences”, in the left pane of the window that pops up look for Tools and, if closed, click the “+” sign to the left of the word to expand it and then click on SACD:
dsd_out_zpsys91x6yb
Since Version 1.0.6 a LFE configuration option has been added:
lfe_zps9zwgaeqp
Once PCM is selected from the drop down list it will be possible to configure the desired PCM options such as:
  • PCM Volume: Compensates for the lower volume of most SACDs compared to PCM files. Can be configured to any desired value from +0 to +6dB. Choose by personal preference unless you get distortion, recommended value is +0dB because it leaves more headroom to avoid conversion overloads but it may make DSD tracks sound quieter and can be annoying in a mixed PCM/DSD playlist. If only SACD ISOs or SACD-R is used, there is a replay gain database file that can be used to normalize volume levels.
  • LFE: Allows to adjust the Low Frequency Effects channel (aka the .1 in 5.1 multi-channel recordings) output level when converting to PCM. This can be very useful when sending DSD converted to PCM to a multi-channel receiver which may apply a +10dB boost or a -10dB reduction to this channel. Possible values are -10dB, pass through or “As is” and +10dB.
  • Sample rate: 44.1KHz, 88.2KHz, 176.4KHz or 352.8KHz, ideally as high as our DAC allows.
  • Log Overloads: Registers in a file DSD-PCM over 0dB errors, interesting to know if PCM Volume sttings over deafult +0dB is producing errors even if not hearable.
  • DSD2PCM mode, avilable options are:
    • Multistage (32fp) and (64fp): Being SSE coded it doens’t demand much from the CPU, 32fp means 32 bit floting point and 64 well, you guessed it, the same but using 64 bit precission for calculations
    • Direct (32fp, 30KHz LF) and (64fp, 30KHz LF): The name says it so no extra description needed, this one is also SSE optimized. Being 30KHz low pass filtered means all DSD noise above that frequency is removed and does not reach the amp. A very good balance between SQ and CPU usage.
    • Installable FIR (32fp & 64fp): these allow custom filters to be used for the DSD->PCM conversion. Some sample FIR filters with different Freq cut points are provided along with the plugin inside the “Filters” folder created when extracting the plugin the zip. Those with the required knowledge can write their own filters using a program like Mathlab and use them here. If this option is selected the “Load” button will be enabled and when clicked it will open a window to point where the filter files we want to upload are located.
Included filter files in the plugin zip file are:
filters_zps6oqlpxlf
Other available items are:
  • Preferable Area: Options are: – None: it will show all available tracks on the SACD – Stereo: only stereo tracks are displayed – Multi channel: limits shown tracks to multi channel ones
  • Editable tags: Yes/No
  • Edited Master Playback: Yes/No
  • Store Tags With ISO: Yes/No (it actually doesn’t write to the ISO, it stores tag info in the plugin folder) Linked 2CH/MCH Tags: When selected, tag editing of ISO files will apply to both stereo and multi channel versions of the track/tracks saving time.
  • Linked 2CH/MCH Tags: Tags added to a SACD ISO will be shared between stereo and multichannel tracks

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]