Hydrogenaudio Forums

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: kode54 on 2009-11-10 19:15:47

Title: DSDIFF Decoder
Post by: kode54 on 2009-11-10 19:15:47
I have released a component here (http://www.foobar2000.org/components/view/foo_input_dsdiff) which can decode .DFF files. Beware, DST encoded files play back at sub-realtime on most systems because the reference DST decoder really sucks. Oh, and it may be buggy on bad DST encoded files, I haven't completely rewritten the crappy decoder.

Here (http://www.2l.no/hires/index.html) is some test material. I don't really know of any other free sources of .DFF files.

Updated to 1.1: Now resets the foobar2000 resampler on seek.
Title: DSDIFF Decoder
Post by: vincefalks on 2009-11-26 09:40:57
w00t! Thank you SO much for developing this one!

- What methods/code are you using to convert the DSD to PCM? Has it got anything to do with the DSD-2-PCM converter?

- would you be able to add options for 176400 and 192000 output? And I assume it's 24-bit output too?

- Would DSF support be possible? DSF file specification is here (http://www.dsd-format.sony.net/data/DSFFileFormatSpec_E.zip) - difference to DSDIFF is merely the header info, I think - you can rename DFF to DSF and it will still play in the WMP plugin. A good way to make make your own real sample DSF files would be using Sony's DSD Direct which can create DSF files from stereo 16/24-bit 44.1kHz WAV files. It's free software and is not restricted to sony computers so I think it's legal to share it - here (http://www.sendspace.com/file/ru47of) is a copy of it.

- Support for .DSD file format? This is apparently the old, original DSD file format, supported by some opf the older SACD authoring programs applications before DSDIFF became the standard. I'm not sure if it has its own file header specifications like DSDIFF and whether it is different to straight "raw DSD" data like LukeS' sample but perhaps it's the same thing. :S Samples are at this (http://www.hydrogenaudio.org/forums/index.php?showtopic=37717&st=0&p=669402&#entry669402) thread.

- Support for .WSD possible? This is another DSD format supported by Korg's Audiogate and DSD recorders. See the WSD info at bottom of this (http://www.korg.com/product.aspx?pd=289) page. I don't actually have a Korg so I don't know of any way to try out WSD files...maybe it's useless if no one even uses it 

- Lastly, how about DXD playback. If you use the Resampler (PPHS) DSP plugin you can actually play back DXD files in foobar. However it means you have to play every single different file in the one sampling rate that you choose. Would there be a way to somehow detect DXD WAV files (maybe DXD has different header info in the wav container?) and include them in the DSD decoder's resampler so that they can be played back without you having the overall foobar resampling everything?

Thanks once again!
Title: DSDIFF Decoder
Post by: kode54 on 2009-11-26 11:59:45
What methods/code are you using to convert the DSD to PCM? Has it got anything to do with the DSD-2-PCM converter?

I used SebastianG's stage 1 decimation filter to reduce the sample rate to 352800Hz, then I use foobar2000's resampler service to go the rest of the way. This results in the best quality, while maintaining some semblance of speed.

I did make one change to the filter, though. Since this DSD is most-significant-bit first, I changed the filter initialization accordingly.

would you be able to add options for 176400 and 192000 output? And I assume it's 24-bit output too?

The configuration page supports any rate between 6KHz and 192KHz. And it output 32-bit floating point.

Would DSF support be possible?
...
Support for .DSD file format?
...
Support for .WSD possible?

I'll look into it.

Lastly, how about DXD playback.

Unless the files are renamed to something other than .wav, then no, they'll always be handled by the standard .wav input. I'll look at a DXD file anyway, though.
Title: DSDIFF Decoder
Post by: vincefalks on 2009-11-26 12:20:43
The configuration page supports any rate between 6KHz and 192KHz. And it output 32-bit floating point.

Oh ok. I can see how you can put it in manually. What you should do though, is add 176400 and 192000 to the drop-down list.

Quote
I'll look into it.

Thanks <3

Quote
Unless the files are renamed to something other than .wav, then no, they'll always be handled by the standard .wav input.

Wouldn't it be like DTS-WAV files and the DTS plugin though? detect header? Or maybe I'm not getting how it works with the sampler and order of detecting and then processing...

Quote
I'll look at a DXD file anyway, though.

Thanks. I love that 2L page
Title: DSDIFF Decoder
Post by: kode54 on 2009-11-26 12:48:20
Wouldn't it be like DTS-WAV files and the DTS plugin though? detect header? Or maybe I'm not getting how it works with the sampler and order of detecting and then processing...

Currently, the DTS-WAV input either requires you to rename the files to .dts or .dtswav, or use a DSP. Since DXD is merely PCM at a high sample rate, it should probably be up to a resampler DSP that only resamples material over a given sample rate.
Title: DSDIFF Decoder
Post by: vincefalks on 2009-11-26 13:31:58
Currently, the DTS-WAV input either requires you to rename the files to .dts or .dtswav, or use a DSP.

Ah yes sorry I forgot. You need to employ the DTS decoder DSP. Which btw (I think you're the developer for that too? <3), DTS-WAV files (.WAV) have a very loud click when you start playing a track, which upon close listen sounds like a brief split second of undecoded dts hiss before it realises it's dts data and not pcm data. But DTS-FLAC files are perfect without the split second "chink" sound.

Any thoughts on that?

Quote
Since DXD is merely PCM at a high sample rate, it should probably be up to a resampler DSP that only resamples material over a given sample rate.

I thought it was a little more than that, though. As per this white paper (http://www.digitalaudio.dk/technical_papers/axion/dxd%20Resolution%20v3.5.pdf) (and other explanations upon googling), it uses a more relaxed anti-alisasing filter on top and independent of the higher sampling rate (which gives it a closer DSD-like pulse response as well as and frequency response, and would be a different (not sure to what degree) when comparing it to a "normal" 352.8kHz PCM file).

Yet, you can play it back as "normal" PCM if you simply bring the sampling rate back down to earth a little (and I guess, ignoring the intended relaxed anti-aliasing filter). Which makes me wonder about the strictness of the DXD format implementation and how you're supposed to play it back it in its (on a technical level) "pure" intended form with the DSD-like roll-off filter. I know the Sony Sound Reality chip supports "native" DXD playback...

But anyway, in terms of the difference in the file (that a possible foobar DXD DSP could detect), are there no header differences from say a "normal" 352.8kHz PCM WAV file?
Title: DSDIFF Decoder
Post by: audiodesignguide on 2009-11-30 09:47:31
oops. wrong post


I cannot set a frequency more than 96000 in my Foobar2000 DSDIFF DEcoder windows after the dll installation

why ?
Title: DSDIFF Decoder
Post by: kode54 on 2009-11-30 11:33:54
Type the value you want in. I only added presets up to 96KHz. I'll add 176400 and 192000 for the next release.
Title: DSDIFF Decoder
Post by: audiodesignguide on 2009-11-30 13:02:18
Type the value you want in. I only added presets up to 96KHz. I'll add 176400 and 192000 for the next release.

Perfect, but please add the new values.

In 2 words, Are the dff are better than normal pcm 192KHz 24bit  ?

I have found the dff2wav.exe software to conver dff to pcm but it have created an output file at only 88KHz giving a dff at 2.5MHz
Title: DSDIFF Decoder
Post by: GeSomeone on 2009-12-01 15:06:47
I have found the dff2wav.exe software to conver dff to pcm but it have created an output file at only 88KHz giving a dff at 2.5MHz

The DSD stream from an normal SACD matches about the information of 88kHz/24bit in PCM (with ultrasonic distortion of course)
Title: DSDIFF Decoder
Post by: audiodesignguide on 2009-12-02 08:23:25
If someone is interested to the dff to wav software
----------------------------------------------------------------

check all the link inside this webpage
http://fpga.cool.coocan.jp/wordpress/index.php/2009/01/ (http://fpga.cool.coocan.jp/wordpress/index.php/2009/01/)
you will find
dff2wav09b.zip
Title: DSDIFF Decoder
Post by: hr_muadib on 2009-12-03 14:15:46
If someone is interested to the dff to wav software
----------------------------------------------------------------

check all the link inside this webpage
http://fpga.cool.coocan.jp/wordpress/index.php/2009/01/ (http://fpga.cool.coocan.jp/wordpress/index.php/2009/01/)
you will find
dff2wav09b.zip


Hello audiosesignguide.
Is there any convertion tool that can convert any .dsf file into WAV or into .dff ?

Does anyone have such a FREE tool? (for the moment the commercial tools are too expensive...)

Thank you in advance.

Best regards,

hr_muadib
Title: DSDIFF Decoder
Post by: vincefalks on 2009-12-08 01:35:20
If it helps, here's a compilation of all the software (I think it might be based on the audiogate converter?) that is found at http://fpga.cool.coocan.jp/wordpress/ (http://fpga.cool.coocan.jp/wordpress/). That japanese guy seems to be doing some very interesting stuff with DSD files, including his own SACD player DSD output board.

dff2wav: http://fpga.cool.coocan.jp/electrart/dff2wav.exe (http://fpga.cool.coocan.jp/electrart/dff2wav.exe)

wsd2wav: http://fpga.cool.coocan.jp/electrart/wsd2wav.exe (http://fpga.cool.coocan.jp/electrart/wsd2wav.exe)

wsd2wav1: http://fpga.cool.coocan.jp/electrart/wsd2wav1.zip (http://fpga.cool.coocan.jp/electrart/wsd2wav1.zip)

wsd2dsf: http://fpga.cool.coocan.jp/electrart/wsd2dsf.exe (http://fpga.cool.coocan.jp/electrart/wsd2dsf.exe)

WSD file format specifications: http://www.acoust.rise.waseda.ac.jp/1bitco...f/020917wsd.pdf (http://www.acoust.rise.waseda.ac.jp/1bitcons/pdf/020917wsd.pdf)

It would be interesting to compare the output files of dff2wav to the DSD2PCM-based converter in foobar. In fact I tried to do this, and, Kode54, how do you convert a DSD file to 24-bit PCM in foobar? I tried the foobar converter and it could only seem to produce a 16-bit output file (sampling rate was whatever I set the DSDIFF decoder to). I wonder how you could control it so you could allow 16, 24 or 32-bit PCM output...

Is there any convertion tool that can convert any .dsf file into WAV or into .dff ?

Does anyone have such a FREE tool? (for the moment the commercial tools are too expensive...)

Thank you in advance.

Best regards,

hr_muadib

kode54 is looking into adding DSF playback to foobar anyway. If/once that happens, you can then simply use foobar's convert operation to essentially convert it to a wav file if you need to.

As for DSF to DFF, that should be pretty simple actually, it looks like just a change of header info (http://www.ps3sacd.com/forums/viewtopic.php?p=655#655)...One can even do it manually, I think. Audiogate can do it in a GUI environment, but it's far from free...perhaps some time we will have one of these great little free plugins/programs popping up at HA to do it...like the dbPoweramp DSD plugin...
Title: DSDIFF Decoder
Post by: zenmastering on 2009-12-08 04:08:56

Quote
As for DSF to DFF, that should be pretty simple actually, it looks like just a change of header info (http://www.ps3sacd.com/forums/viewtopic.php?p=655#655)...One can even do it manually, I think. Audiogate can do it in a GUI environment, but it's far from free...perhaps some time we will have one of these great little free plugins/programs popping up at HA to do it...like the dbPoweramp DSD plugin...


A DSF file is a DSDIFF file (content-wise) that is re-formatted as a WAV-RIFF structured file. Nothing more (or less)...

Best,

Graemme

Title: DSDIFF Decoder
Post by: zenmastering on 2009-12-08 04:19:15

Quote
Since DXD is merely PCM at a high sample rate, it should probably be up to a resampler DSP that only resamples material over a given sample rate.


Quote
I thought it was a little more than that, though. As per this white paper (http://www.digitalaudio.dk/technical_papers/axion/dxd%20Resolution%20v3.5.pdf) (and other explanations upon googling), it uses a more relaxed anti-alisasing filter on top and independent of the higher sampling rate (which gives it a closer DSD-like pulse response as well as and frequency response, and would be a different (not sure to what degree) when comparing it to a "normal" 352.8kHz PCM file).


That first link that you quoted with regards to 'relaxed filtering' is referring to the hardware implementation of their ADC. As noted by the OP, DXD is merely a name given to the 8fs family of PCM sample rates, by Claude Cellier, the founder of Merging Technologies (Pyramix DSD DAW). The wordlength of a 'DXD' file can be from 16-24 bits fixed and 32 bits floating point. Any DXD file that I've ever seen, when written as a .WAV or BWF, is exactly the same as any other PCM WAV or BWF, with regards to structure. It's only 'difference' is the sampling rate.

Best,

Graemme
Title: DSDIFF Decoder
Post by: BOBCHEWIE on 2010-01-03 10:01:25
ok guys call me stupd..."The configuration page supports any rate between 6KHz and 192KHz. And it output 32-bit floating point."

er where exactly is the dsdiff configuration page and/or how to i access it...when i play dsd dff files (downloaded and ones ive created or converted) they all play back at 882000 (88.2khz) and i did wonder if this could be changed  for 96khz 24bit or 192/24  of which if im playing back in foobar using audigy 2ZS is it REALLY playing back at 96khz 24bit or downsampling then upiing as i heard about creative  cards.

Title: DSDIFF Decoder
Post by: BOBCHEWIE on 2010-01-05 23:58:42
I have released a component here (http://www.foobar2000.org/components/view/foo_input_dsdiff) which can decode .DFF files. Beware, DST encoded files play back at sub-realtime on most systems because the reference DST decoder really sucks. Oh, and it may be buggy on bad DST encoded files, I haven't completely rewritten the crappy decoder.

Here (http://www.2l.no/hires/index.html) is some test material. I don't really know of any other free sources of .DFF files.

Updated to 1.1: Now resets the foobar2000 resampler on seek.



Dont know if this is anygood to anyone....

Weiss SARACON-DSD: http://www.weiss.ch/p2d/p2d.html (http://www.weiss.ch/p2d/p2d.html)

Sonic nexStage (Mac only): http://sonicstudio.net/products/dsd/dsdformac.html (http://sonicstudio.net/products/dsd/dsdformac.html)
Title: DSDIFF Decoder
Post by: BOBCHEWIE on 2010-01-06 00:12:00
- Support for .WSD possible? This is another DSD format supported by Korg's Audiogate and DSD recorders. See the WSD info at bottom of this (http://www.korg.com/product.aspx?pd=289) page. I don't actually have a Korg so I don't know of any way to try out WSD files...maybe it's useless if no one even uses it 
ive heard that audiogate is also mediaplayer

Moderation: Replaced a full quote with only the relevant part of the post (hopefully).
Title: DSDIFF Decoder
Post by: abhingp01 on 2010-02-04 11:33:35
How to run dff2wav.exe ?
Title: DSDIFF Decoder
Post by: abhingp01 on 2010-02-04 11:50:35
If it helps, here's a compilation of all the software (I think it might be based on the audiogate converter?) that is found at http://fpga.cool.coocan.jp/wordpress/ (http://fpga.cool.coocan.jp/wordpress/). That japanese guy seems to be doing some very interesting stuff with DSD files, including his own SACD player DSD output board.

dff2wav: http://fpga.cool.coocan.jp/electrart/dff2wav.exe (http://fpga.cool.coocan.jp/electrart/dff2wav.exe)

wsd2wav: http://fpga.cool.coocan.jp/electrart/wsd2wav.exe (http://fpga.cool.coocan.jp/electrart/wsd2wav.exe)

wsd2wav1: http://fpga.cool.coocan.jp/electrart/wsd2wav1.zip (http://fpga.cool.coocan.jp/electrart/wsd2wav1.zip)

wsd2dsf: http://fpga.cool.coocan.jp/electrart/wsd2dsf.exe (http://fpga.cool.coocan.jp/electrart/wsd2dsf.exe)

WSD file format specifications: http://www.acoust.rise.waseda.ac.jp/1bitco...f/020917wsd.pdf (http://www.acoust.rise.waseda.ac.jp/1bitcons/pdf/020917wsd.pdf)

It would be interesting to compare the output files of dff2wav to the DSD2PCM-based converter in foobar. In fact I tried to do this, and, Kode54, how do you convert a DSD file to 24-bit PCM in foobar? I tried the foobar converter and it could only seem to produce a 16-bit output file (sampling rate was whatever I set the DSDIFF decoder to). I wonder how you could control it so you could allow 16, 24 or 32-bit PCM output...

I was able to download that dff2wax.exe. But it's in japnese
Also I download the *.dff sample file from http://www.2l.no/hires/index.html (http://www.2l.no/hires/index.html)

Now how to run that dff2wav.exe ?

I tried as c:\...\dff2wav.exe source.dff desti.wav ................ !!! Is this correct way ?
I got FILE CANNOT BE OPENED message.

Kindly reply ASAP, will be very thankful.

Regards,
Abhi
Title: DSDIFF Decoder
Post by: cc_bbs on 2010-02-05 13:00:44
my foobar says
"Failed to load DLL: foo_input_dsdiff.dll",
Reason: 找不到指定的程序。 

why?
Title: DSDIFF Decoder
Post by: AudioHornGuy on 2010-02-11 17:13:40
I am also interested in this conversion stuff.  I happen to be a linux user and am looking for playback options of dsd files on ubuntu.  If it would be helpful to anyone I can give some audio samples in the different formats.  I have a Korg MR1000.  I can give sample files of anything it can create. 

I would also be interested in helping with a software or playback hardware project if there are any being worked on right now.

Title: DSDIFF Decoder
Post by: emte on 2010-12-15 10:59:01
When I play multichannel dff files I get only stereo channels. Anyone knows what's wrong?
Title: DSDIFF Decoder
Post by: vincefalks on 2010-12-15 11:28:20
I am also interested in this conversion stuff.  I happen to be a linux user and am looking for playback options of dsd files on ubuntu.  If it would be helpful to anyone I can give some audio samples in the different formats.  I have a Korg MR1000.  I can give sample files of anything it can create. 

I would also be interested in helping with a software or playback hardware project if there are any being worked on right now.

what sort of help would that be. technical, or just testing/feedback/moral support etc?
Title: DSDIFF Decoder
Post by: 000811zhf on 2011-04-15 07:55:59
i add foo_input_dsdiff.dll in C:\Program Files\foobar2000\components ,then play ONE  **.dff doc. display playback error: Decoding failure at 0:00.000 (Unsupported sample rate, no resampler present):.in preferences i have set in playback input - dsdiff decoder in 96k: output ds output 24 bit.do i make any mistake setting in foobar2000 1.1.5?please help me !!!
Title: DSDIFF Decoder
Post by: kode54 on 2011-04-15 08:06:18
You must install either the standard DSP array component, or the SoX resampler component. That, or put up with 352800Hz output somehow.
Title: DSDIFF Decoder
Post by: 000811zhf on 2011-04-15 08:51:58
Thanks .  i add foo_dsp_resampler.dll ,now **.dll can play now. thanks again.
Title: DSDIFF Decoder
Post by: oynu on 2011-05-07 02:41:25
.
Title: DSDIFF Decoder
Post by: oynu on 2011-05-18 23:16:23
Thanks for great plugin! Any chance fixing these bugs?

Files here (http://hotfile.com/dl/117000113/0a6ee1b/sample.7z.html)

1) In attached files channel order should be FL-FR-FC-LFE-RL-RR instead of FC-LFE-RL-RR-SL-SR

2) sample dsd.dff encoded to sample dst.dff using reference encoder
then both files converted to wav using this plugin
resulting wavs match when converted at 44 kHz and differ by 1 when at 96 kHz
Quote
23234:   4F   4E
  23300:   F5   F4
  23378:   DF   DE
  24011:   0A   0B
  24224:   EC   ED
  24623:   2A   29
  24629:   4A   49
  24896:   EF   F0

Title: DSDIFF Decoder
Post by: kode54 on 2011-05-19 04:07:43
1) Upon inspection of a proper DSDIFF specification, I see that MLFT and MRGT are "multi-channel" left and right. So, identical to the SLFT and SRGT in behavior, except that they just had to make separate channel flag names for surround files. Fixed, thank you.

2) I set the maximum output sample rate to 96000Hz, then ran a bit compare. The only difference found between the two files is that the DSD is .004 longer than the DST. Also, I only implemented DST support based on a crappy reference decoder that will probably never achieve real time until 10GHz machines come along, so it's probably not too useful for every day use. Maybe the problem is your resampler component? I only have the standard DSP component installed, so just the polyphase resampler.
Title: DSDIFF Decoder
Post by: vincefalks on 2011-05-19 19:55:17
1) Upon inspection of a proper DSDIFF specification, I see that MLFT and MRGT are "multi-channel" left and right. So, identical to the SLFT and SRGT in behavior, except that they just had to make separate channel flag names for surround files. Fixed, thank you.

2) I set the maximum output sample rate to 96000Hz, then ran a bit compare. The only difference found between the two files is that the DSD is .004 longer than the DST. Also, I only implemented DST support based on a *****y reference decoder that will probably never achieve real time until 10GHz machines come along, so it's probably not too useful for every day use. Maybe the problem is your resampler component? I only have the standard DSP component installed, so just the polyphase resampler.

hey kode54, appreciate you updating this.

Maybe a better open-source/GNU-licence DST decoder is coming (or is already here). check if it's already there, or will be: http://code.google.com/p/sacd-ripper/updates/list (http://code.google.com/p/sacd-ripper/updates/list). it's at least in the to-do (http://code.google.com/p/sacd-ripper/source/browse/trunk/todo?r=48) list. the guy is active and will make it happen.

hrm, actually, maybe since this is only file conversion that he's dealing with, this guy will just use the reference decoder. still worth checking the updates to see what he ends up using, or even writing himself.

maybe just email him to see what his plans are...he will likely answer...
Title: DSDIFF Decoder
Post by: vincefalks on 2011-06-01 22:21:23
hey kode54, appreciate you updating this.

Maybe a better open-source/GNU-licence DST decoder is coming (or is already here). check if it's already there, or will be: http://code.google.com/p/sacd-ripper/updates/list (http://code.google.com/p/sacd-ripper/updates/list). it's at least in the to-do (http://code.google.com/p/sacd-ripper/source/browse/trunk/todo?r=48) list. the guy is active and will make it happen.

hrm, actually, maybe since this is only file conversion that he's dealing with, this guy will just use the reference decoder. still worth checking the updates to see what he ends up using, or even writing himself.

maybe just email him to see what his plans are...he will likely answer...
update: he's writing his own DST decoder, and since it's under GNU and he's a nice guy, I'm sure he's fine for it to be put into the foobar player.

I don't have time to ask (and report back), but I expect it would be much higher performance than the reference MPEG4 one (otherwise why would he write his own one). he wants good ripping speed.

so kode, just look out for it.
Title: DSDIFF Decoder
Post by: vincefalks on 2011-06-06 01:15:48
update: he's writing his own DST decoder, and since it's under GNU and he's a nice guy, I'm sure he's fine for it to be put into the foobar player.

I don't have time to ask (and report back), but I expect it would be much higher performance than the reference MPEG4 one (otherwise why would he write his own one). he wants good ripping speed.

so kode, just look out for it.

since i can't edit my last post, posting a correction to this last report.

he's not writing his own decoder from scratch. he's harnessing the ps3's own decoding software. however. another one (for windows use) is being written up by the 'team' right now. based on other code from existing decoders, but changed significantly to improve it muchly. so it'll be its own decoder in its own right. all is rosey.
Title: DSDIFF Decoder
Post by: deathlord on 2011-06-13 13:51:19
Hi kode54

Thanks a lot for this great plugin!

Quote
The configuration page supports any rate between 6KHz and 192KHz. And it output 32-bit floating point.


When I convert to flac, I get 16 bit files. Does this mean foo_dsp_resampler.dll outputs 16 bit in this case? Or is the conversion from 32 float to 16bit done in the flac encoder?

And what dithering mechanism is applied (if any)?
Title: DSDIFF Decoder
Post by: kode54 on 2011-06-13 23:09:53
The converter is using the preset for lossy files, since conversion from DSD is a computationally lossy process. You'll need to specify 24 bits for lossy files in the converter setup dialog.
Title: DSDIFF Decoder
Post by: deathlord on 2011-06-14 07:58:16
The converter is using the preset for lossy files, since conversion from DSD is a computationally lossy process. You'll need to specify 24 bits for lossy files in the converter setup dialog.

Hm, I can specify the output  bitdeph in the converter setup explicitly. When I use a custom preset, I can also specify the encoders maximum input bitdepth.
What I do not quite understand is the following:
According to the documentation (http://flac.sourceforge.net/documentation_tools_flac.html), the flac command line encoder does not support floating point (only integer up to 24 bit).
So I assume foobar will convert the input to a format the encoder understands based on the settings in the converter setup. Or does it just tell the component in the chain before the converstion (in this case foo_dsp_resampler) to produce a suitable output?
Interestingly, it also works if I set the maximum input bitdepth to 32 bit (in which case I expect the 32 bit float from foo_input_dsdiff to be converted to 32 bit int, which flax.exe should not support). Maybe the input is then just truncated.

In any event, I think it is probably best to limit input to 24 bit and then let the flac encoder dither down to 16 bit (I want 16 bit, not 24).
Title: DSDIFF Decoder
Post by: lvqcl on 2011-06-14 08:53:39
Quote
let the flac encoder dither down to 16 bit


Not possible: flac doesn't alter its input.
Title: DSDIFF Decoder
Post by: kode54 on 2011-06-14 19:31:55
When selecting a bit depth for the output format, I think the "auto" selection always assumes 16 bits for lossy files. I could be wrong, though.
Title: DSDIFF Decoder
Post by: deathlord on 2011-06-14 19:47:09
When selecting a bit depth for the output format, I think the "auto" selection always assumes 16 bits for lossy files. I could be wrong, though.


Yes, I think you are right.

Quote
let the flac encoder dither down to 16 bit


Not possible: flac doesn't alter its input.


Well, it does accept up to 24 bit input and it does output what I tell it to, i.e. 16 or 24 bit.
So if flac.exe does not do anything, the conversion has to happen somwhere else.
Maybe foobar loads instances of some filter as needed?

Example:
I want to convert DSDIFF to 16 bit flac.
I set the input for flac conversion to 24 bit and the output bitdepth to 16 bit, dither to "always".
Then foobar would convert the 32 bit floating point output from DSDIFF decoder to 24 bit int, pass that on to flac.exe which converts it to 24 bit flac, which foobar would then dither down to 16 bit.
Does this sound likely?
Title: DSDIFF Decoder
Post by: lvqcl on 2011-06-14 20:13:19
Quote
Does this sound likely?


Definitely not. If max. output bitdepth for flac is 24 and output bitdepth is 16 bit, foobar2000 chooses the lower bit depth: 16 bit.

So foobar2000 converts 32-bit floating point to 16-bit integer (using dither) and sends output to flac.exe.

Title: DSDIFF Decoder
Post by: exa065 on 2011-06-16 23:41:34
kode54,
Would you be interested to explore the possibility to alter your plug-in for producing native DSD output for use with ASIO devices? See experiments for native DSD playback here: http://www.diyaudio.com/forums/digital-lin...tml#post2608599 (http://www.diyaudio.com/forums/digital-line-level/183374-exau2i-multi-channel-asynchronous-usb-i2s-interface-57.html#post2608599)



Title: DSDIFF Decoder
Post by: Sandrine on 2011-07-25 19:03:04
hey kode54, appreciate you updating this.

Maybe a better open-source/GNU-licence DST decoder is coming (or is already here). check if it's already there, or will be: http://code.google.com/p/sacd-ripper/updates/list (http://code.google.com/p/sacd-ripper/updates/list). I don't have time to ask (and report back), but I expect it would be much higher performance than the reference MPEG4 one.

The performance for decoding DST encoded files is about the same: You'll need a Dual Core CPU for stereo playback, and a Quad Core CPU for multichannel playback.

The new foo_input_sacd uses this code. Since that component can now also decode DSDIFF, it would be interesting to know which plug-in produces a higher quality conversion. kode54's with foobar resampler and free choice of sample rate or max's component which is based on the Philips decoder and has the sample rate fixed at 88.1khz.
Title: DSDIFF Decoder
Post by: oynu on 2011-08-12 23:24:36
it appears this plugin applies 6db gain or this assumption is incorrect? respecfully requesting to make that optional if possible?
Title: DSDIFF Decoder
Post by: kode54 on 2011-08-13 01:17:41
This component does not apply any gain. It merely downsamples the stream as-is. The resulting sample data will be guaranteed to be at no higher than the configured sample rate, which defaults to 88200Hz. It will also be floating point, although there may be imperceptible noise in the resulting signal.
Title: DSDIFF Decoder
Post by: mudlord on 2011-08-13 07:32:08
Would it be possible to have a advanced setting to pick which resampler service to use?
I wouldn't mind using this for testing of the resampler in my DSP.
Title: DSDIFF Decoder
Post by: lvqcl on 2011-08-13 08:41:36
Code: [Select]
class mudlord_resampler : public resampler_entry
{
public:
//...
    virtual float get_priority() { return 1; } // or something  > 0 and <= 1
};

should do what you want.

Added: so this resampler will have priority over built-in PPHS. Yet it is necessary to remove other resampler components such as SSRC, SoX, ...
Title: DSDIFF Decoder
Post by: mudlord on 2011-08-13 11:31:06
Excellent, thanks.
Title: DSDIFF Decoder
Post by: ingosl on 2011-08-17 16:13:47
Hi,

I just played a DSD (DSDIFF) file and tried to change the Tag information by opening the tag window.

But changes are not accepted - when I click on "Apply" and/or "OK" it shows up "1" even if I typed in something else.

All the best

ingosl
Title: DSDIFF Decoder
Post by: lvqcl on 2011-08-17 16:31:38
Quote
it shows up "1"


This means that you use foo_input_sacd, not foo_input_dsdiff.
Title: DSDIFF Decoder
Post by: ingosl on 2011-08-18 08:55:05
Quote
it shows up "1"


This means that you use foo_input_sacd, not foo_input_dsdiff.



OK, and what do I have to do to change DSDIFF ID3 Tags correctly?

Best,

ingosl
Title: DSDIFF Decoder
Post by: koon3876 on 2011-11-21 03:47:04
Hi kode54,
I came from DIYAudio.
Now I'm making fully DSD playback system
https://sites.google.com/site/koonaudioproj...playback-system (https://sites.google.com/site/koonaudioprojects/dsd-playback-system)
and, now trying to write WAV PCM TO DSD converter.
There is the link on the bottom, for Wav2DSFconverter01(2).cpp.txt
I'm stacking at 7th order noise shaper IIR filter.
If anyone knows how to implement IIR filter in C, Please Help
Title: DSDIFF Decoder
Post by: Sandrine on 2011-11-21 09:48:22
Oh no, please let that project die quickly, lest we get swamped with fake PS3 rips. Also
- DSD format is not public domain
- DSD/DST has no compression advantage over FLAC
- PCM to DSD conversion is a lossy process
- for high end audio, MLP (DVD-Audio) at 24/96/5.1 or even 24/192/2.0 is a much better choice
Title: DSDIFF Decoder
Post by: itisljar on 2012-05-03 16:19:26
Today I got some dff files from shady sources; the source is not relevant for discussion.

I noticed one strange thing; when playing back the song, everything is OK, sound is good; but when I try to convert it to wavpack (set to 32 bit, 88.2 kHz, normal compression), I get quite a bit of audible errors and distortions in the resulting file. I've tried the Korg AudioGate, and the errors aren't there. but I yet have to test this.
When I scan the file in foobar, it reports that the end of file is not where it is reported. And that is all.

What to do? Where to search for errors?
Title: DSDIFF Decoder
Post by: itisljar on 2012-05-04 07:53:57
Korg AudioGate decoded the files perfectly, without any glitch.
I would say that the problem seems to be internal, after decoding, when piping output to wavpack.
Oh well. I will try to see where the problem lies...
Title: DSDIFF Decoder
Post by: kode54 on 2012-05-04 15:50:52
Maybe the built-in WavPack preset doesn't know that WavPack supports floating point input. Or maybe whatever quality preset you're using doesn't support that. Perhaps hybrid lossless?
Title: DSDIFF Decoder
Post by: SoNic67 on 2012-05-06 15:29:21
but when I try to convert it to wavpack (set to 32 bit, 88.2 kHz, normal compression), I get quite a bit of audible errors and distortions in the resulting file.

Why 32 bit? The normal conversion would be 24bit/88.2kHz (or 176.4kHz).
Title: DSDIFF Decoder
Post by: tascamtom on 2012-11-16 02:03:23
DSDIFF files created via the TASCAM DV-RA1000HD  http://tascam.com/product/dv-ra1000hd/ (http://tascam.com/product/dv-ra1000hd/)  don't play back correctly in Foobar2000.

We think it's because the Compression Chunk is an odd length, and the foo_input_dsdiff plugin isn't jumping over the pad byte correctly.
(see DSDIFF 1.5 spec, page 9:  http://www.sonicstudio.com/pdf/dsd/DSDIFF_1.5_Spec.pdf) (http://www.sonicstudio.com/pdf/dsd/DSDIFF_1.5_Spec.pdf))

Since ripped SACDs are almost always going to be DST Encoded (and hence have an even length chunk which doesn't need a pad byte), I doubt this code has ever seen an uncompressed dff file.

Any chance of fixing this?

Send me a message if you want a sample file.
Title: DSDIFF Decoder
Post by: misha0209 on 2012-12-30 17:13:05
Hi kode54,

Great plugin  thanks much
One problem i have one small problem. On some tracks that are mastered a bit louder, i can see some clipping. i set the sample rate to 176400, and output 24 bit. Could the clipping be generated by the resampling process itself?
Would you be willing to provide a "preamp" like control, so that the DSD stream can be slightly attenuated by 1~2db, before the resampling process so that clipping may be avoided?
Also, the ability to select what resampler the component uses would be grate! i much prefer the SoX resampler
Title: DSDIFF Decoder
Post by: kode54 on 2012-12-30 18:35:31
The resampler produces floating point output, so it won't clip if you apply a gain level to the tracks, or use a DSP that applies limiting.
Title: DSDIFF Decoder
Post by: misha0209 on 2012-12-30 19:26:30
The resampler produces floating point output, so it won't clip if you apply a gain level to the tracks, or use a DSP that applies limiting.


Big thank you for the fast answer, should have done this from the start, instead of PM

Could you please elaborate a bit on that?
How do i apply gain? the classic way? over foobar? i would like a DSD targeted solution.
i don't use gain at all in foobar, and it would be quite the bother to change the gain settings every time i listen to a dff file, as i also have vinyl rips in the high quality folder. not to mention the rest of the 16/44.1 material...

Limiting, on the other hand is useless... soft limiting like the advanced limiter kind of compresses things, and hard limiting, would be like shutting my eyes while whispering "it's not clipping"... the clipping will still be there.

Seems dff files do not support storing gain info... so i can't create a special case for dff files. also, would it not be better if the gain setting would be done before PCM conversion? or due to the fact that the system works with 32 float, this becomes irrelevant?

About the resampler.
I have sox mod 0.7.6. i did load it and set it to 96k. i went to the components folder of foobar, and removed the f00_dsp_std.dll. when i try to play a dff file, i now get this:
"Decoding failure at 0:00.000 (Unsupported sample rate, no resampler present):"
Can i make the component realise that sox is there? do i need a specific version, or a do i need to tick a box somewhere?
I would like to use sox as resampler, because over time, it has given me the most pleasing results, and seeing that the downsampling is done from such i high sample rate, i'd prefer the one i think is best
Title: DSDIFF Decoder
Post by: lvqcl on 2012-12-30 19:42:34
Only regular (not mod or mod2 versions) SoX resampler plugin can be used by other components.
(btw, the current version is 0.8.2)
Title: DSDIFF Decoder
Post by: kode54 on 2012-12-30 19:47:01
Incidentally, you should be able to have both regular and mod versions installed, and only use mod versions in your DSP chain.

Also, if you have both the standard DSP array and regular SoX resampler installed, SoX will take priority when any other component requests a resampler, due to priority levels in the resampler services. Well, assuming that the component requested at least a level 0 of quality, I think.
Title: DSDIFF Decoder
Post by: misha0209 on 2012-12-30 20:12:59
Damn you people are fast with your replies

@lvqcl:
thanks a bunch for letting me know about the new version. updated right away. big THANK YOU for the component.
yes, with the regular sox installed, and the the dsp_std removed DFFs sing again

i have one question for you since you are... here
i was doing something quite stupid, thank god i started poking around - just recently started listening to sacds.
apparently my stagedac does not support 176400  i had set up sox mod as the only plugin in my dsp chain to safeguard this. it would let all frequencies my dac supports go by untouched, and resample everything else at 192k. so i was listening to dsd transcoded to 176400 pcm, and then upsampled to 192... stupid me...
what i would like from you is a bit of advice. should i downsample dsd to 88200 so it's symmetrical, or 192k? i would go symmetrical by ear, but i never downsampled so 2mhz before

@kode54:
thanks for the priority tip, going to make a short experiment to make sure, and if all goes well, everyone goes back to the components folder.
about the gain thing though... the fact you did not say anything leads me to understand that the gain settings in the properties->playback dialogue are all i can use...
that true? does foobar have anything else i can use to automate the process of applying gain to dff files only?

Thanks to both of you for the support!
Title: DSDIFF Decoder
Post by: kode54 on 2012-12-30 20:54:30
You can downsample with this component to any arbitrary sample rate. The SACD input component may or may not support arbitrary rates.

No, this component does not have a gain setting. You may set a ReplayGain offset level for untagged files, and that will reduce their volume. Or you can use the Advanced Limiter DSP. Since these files aren't taggable, you can't exactly ReplayGain scan them.
Title: DSDIFF Decoder
Post by: misha0209 on 2012-12-30 21:04:33
You can downsample with this component to any arbitrary sample rate. The SACD input component may or may not support arbitrary rates.


I was asking what would give the "best" sonic result. should i be using symmetric values although they are small (88200), or go for the higher 192k.

So foobar replay gain is the only chance i have... sad...
suppose there is no chance you could make the component use the gain part of foobar internally, like you did with the sox resampler? or would that be too much of a hassle?
Title: DSDIFF Decoder
Post by: lvqcl on 2012-12-30 21:42:58
you could make the component use the gain part of foobar internally


But what's the point in this?
Title: DSDIFF Decoder
Post by: misha0209 on 2012-12-30 22:26:33
you could make the component use the gain part of foobar internally


But what's the point in this?


point would be to only apply gain to .dff files only.
i try as much as i can to get bit perfect to my dac. unless i make a stupid mistake like the one i described above... but those i fix in a day or 2... takes me some time to notice.
the idea was to apply an attenuation of ~1db to all .dff files. and only the .dff files. since i can't tag them, the easiest possible way would be for the component to offer the possibility to "clean" it's output.
I realise though that this component is made for free, so i can not impose... i can just bitch about it here, and if the developer sees fit, the thing will get implemented. if not... well... i tried

though i think i am not the only one using this component. and the fact that you get clipping is a problem. as i try to get bit perfect, i don't use replaygain at all. and i do have vinyl rips, and normal redbook disks.
it would be a real bother to change replay gain settings every time i switch input file format... but then again, that may be just me...
Title: DSDIFF Decoder
Post by: misha0209 on 2013-01-01 18:06:48
Hello again,
Let me start off with best wishes for the new year!

Now, i'm taking the silent treatment here as a definite no to implementing the above discussed things. too bad...

So, i'm trying to find other solutions... are there any cabinets these .dff files could be put in? or any sort of file where i can store the replay gain info for these tracks?
The plan would be to store info on the dff files, and not scan the rest of my collection
Some songs can be saved by 1.5db attenuation, but others... for example i have Hotel California over here, and on a sharp attack, the peak clips for ~30 consecutive samples. i'm thinking it will go much higher than even 3db can save. so it would be best to be able to use something like apply gain and prevent clipping according to peak... but you need to know where the peak is for that one

i read that dsf files support idv3 tags. but i can not play dsf files in foobar. guessing the component can not decode those?

Any insight?
Title: DSDIFF Decoder
Post by: markanini on 2013-01-01 20:23:57
Try foo_input_sacd
Title: DSDIFF Decoder
Post by: misha0209 on 2013-01-01 22:30:36
Try foo_input_sacd


Thanks, this one seems to consider the clipping problem.
And idea what resampler it uses?
[Seems it was made to decode iso files only though... bummer... need more storage ]
scratch the above comment. i deleted foo_input_dsdiff.dll and i can still play dff files. hello
Title: DSDIFF Decoder
Post by: Lupin 3rd on 2013-08-24 16:04:09
Hi guys,
I'm new about foobar and DSD playback.
I've some general question:

1) This add on works always like a converter to PCM format? and then the PCM signal is sent via HDMI to compatible receivers?

2) This add on is a quality paragonable to an OPPO 103 in DSD playback?

3) There is a simple configuration guide for FOOBAR+DSD Addon ?

many thanks to all.
Title: DSDIFF Decoder
Post by: tonychau on 2015-04-20 19:11:30
May DSDIFF Decoder also play DSF format? 
Title: Re: DSDIFF Decoder
Post by: exwound on 2019-02-15 07:13:16
Don't know what resampling method author have used when he created this plugin, but it seems like there's a clipping problem.
While sacd-decoder doesn't have this problem. Sorry for my English.
https://a.radikal.ru/a29/1902/a7/273b2719bc70.jpg
Title: Re: DSDIFF Decoder
Post by: kode54 on 2019-02-15 08:13:41
There's no such thing as clipping when it comes to floating point samples. There is no technical limitation to stop a downsampled DSD signal from clipping in PCM form, since high intersample peaks can cause the downsampled signal to clip. The only way a DSD downsampler would avoid hitting greater peaks is for it to be performing signed saturation of samples that would otherwise clip, which it shouldn't need to do when processing in floating point.
Title: Re: DSDIFF Decoder
Post by: exwound on 2019-02-15 12:42:26
https://b.radikal.ru/b16/1902/aa/80d69631df0d.jpg
With Sacd decoder I do not hear any clipping, and look at the RG info.
Title: Re: DSDIFF Decoder
Post by: tedsmith on 2019-02-15 13:58:33
SACDs can go about 4dB higher than PCM by spec.  6dB if the spec is violated.  To convert to PCM you'll need to lower the level by some number from about 0dB (for quietly recorded material) to about 4dB (for "normal" level material) to 6dB for the few albums that really push it (e.g. Michael Jackson's "Thriller")
Title: Re: DSDIFF Decoder
Post by: exwound on 2019-02-15 14:10:36
you'll need to lower the level

Are u sure I'll need to lower?
But yes, with DSDIFF plugin I need to use prevent clipping according to track peak foobar option.

Anyway, I just wanted to say that SACD decoder( foobar plugin) plays sacd iso's quite well, while DSDIFF decoder does the same task with clipping (not in all cases), but  for example - Playing The Angel by DM SACD.
You can see it at the screens I've sent in earlier posts.
Thank you for explanations btw.
Title: Re: DSDIFF Decoder
Post by: kode54 on 2019-02-15 23:41:54
Throw mine away, then, it's clearly producing too loud a result. And I'm not going to bother swiping it from them again to fix it.
SimplePortal 1.0.0 RC1 © 2008-2019