Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: DSD-2-PCM -- proof of concept (Read 151104 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

DSD-2-PCM -- proof of concept

Reply #100
Has anyone so far noticed that when creating a 24 bit /352.8 kHz WAV file using
Code: [Select]
cat input.dff | dsd2pcm 2 m 24 | sox -t raw -r 352.8k -s -3 -c 2 - output.wav

the output file has a loud click at the very beginning lasting for only about 60 samples or so?


Yes. This is due to the DSDIFF file header/metadata being treated as audio by this command line. The length, of course, depends on the size of the header and could be much longer if, e.g., there is a comments chunk in the file. It is also possible that such metadata follows the audio.

Quote
I also noticed that there seems to be an issue when trying to convert larger files (say a .dff of the whole WYWH album) which limits the output to only a clip of about 10 minutes or so (I've checked that the conversion doesn't stop due to lack of space or anything like that).


Does it stop always at exactly the same time, or output file size?

DSD-2-PCM -- proof of concept

Reply #101
Has anyone so far noticed that when creating a 24 bit /352.8 kHz WAV file using
Code: [Select]
cat input.dff | dsd2pcm 2 m 24 | sox -t raw -r 352.8k -s -3 -c 2 - output.wav

the output file has a loud click at the very beginning lasting for only about 60 samples or so?


Yes. This is due to the DSDIFF file header/metadata being treated as audio by this command line. The length, of course, depends on the size of the header and could be much longer if, e.g., there is a comments chunk in the file. It is also possible that such metadata follows the audio.


So would it be possible to rewrite the program so that it only converts the data chunk?

Quote
Quote
I also noticed that there seems to be an issue when trying to convert larger files (say a .dff of the whole WYWH album) which limits the output to only a clip of about 10 minutes or so (I've checked that the conversion doesn't stop due to lack of space or anything like that).


Does it stop always at exactly the same time, or output file size?


As it seems right now dsd2pcm is actually working properly, it's SoX which seems to have issues. On my rip of WYWH the dsd2pcm filter gave me a 5.76 GB raw PCM file which when played in SoX with the appropriate parameters showed a length of a bit more than 10 minutes. I now tried my rip of Dire Straits and dsd2pcm gave me a 5.34 GB raw PCM file which showed in SoX a length of a bit more than 8 minutes. Puzzled I opened the raw file with Audacity and the right parameters to discover that actually all 9 tracks of Dire Straits were contained in the raw file (I could only tell from the waveform since Audacity has issues with 352.8 kHz files apparently). So now it seems that SoX can't handle that big a raw PCM file and hence this whole procedure seems unworkable for range rips of an album. Anybody any ideas on how to remedy this?

DSD-2-PCM -- proof of concept

Reply #102
I once had a filesize-limit problem with a huge wav and converted it to wavpack before feeding sox. I don´t know if wavpack handles 352.8kHz but it should do fine.
Besdides that i wonder what you want to try to reach? Isn´t there a plugin for foobar for dff? Combined with the sox plugin it should do the same besides the dithering choices.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

DSD-2-PCM -- proof of concept

Reply #103
I once had a filesize-limit problem with a huge wav and converted it to wavpack before feeding sox. I don´t know if wavpack handles 352.8kHz but it should do fine.
Besdides that i wonder what you want to try to reach? Isn´t there a plugin for foobar for dff? Combined with the sox plugin it should do the same besides the dithering choices.

I figured out how to circumvent the issue. I just had to add --ignore-length before the input filename in SoX, then it processes the raw PCM file as intended. Also the reason I'm trying to do this is because I'm on a Mac and
foobar is hence out of question. Luckily I could easily compile dsd2pcm to work on OS X and now I have an alternative (and faster) converter for PCM which doesn't filter as heavily as Saracon, that way I can experiment to see what sounds better to me. The only issue remaining is the click in the beginning...

DSD-2-PCM -- proof of concept

Reply #104
I once had a filesize-limit problem with a huge wav and converted it to wavpack before feeding sox. I don´t know if wavpack handles 352.8kHz but it should do fine.
Besdides that i wonder what you want to try to reach? Isn´t there a plugin for foobar for dff? Combined with the sox plugin it should do the same besides the dithering choices.

I figured out how to circumvent the issue. I just had to add --ignore-length before the input filename in SoX, then it processes the raw PCM file as intended. Also the reason I'm trying to do this is because I'm on a Mac and
foobar is hence out of question. Luckily I could easily compile dsd2pcm to work on OS X and now I have an alternative (and faster) converter for PCM which doesn't filter as heavily as Saracon, that way I can experiment to see what sounds better to me. The only issue remaining is the click in the beginning...

Ah, ok. On a MAC this is different of cause, sorry for not taking this possibility into account.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

DSD-2-PCM -- proof of concept

Reply #105
Actually screw what I said so far, the resulting .wav file is too big to be handled properly by most software: it always reports the wrong length. Is there any uncompressed audio format out there that does not have this size limit as WAV and AIFF do?

DSD-2-PCM -- proof of concept

Reply #106
So would it be possible to rewrite the program so that it only converts the data chunk?


Yes, that is possible. I hope SoX (git snapshot) will support it directly by next week or so.

Quote
As it seems right now dsd2pcm is actually working properly, it's SoX which seems to have issues. … So now it seems that SoX can't handle that big a raw PCM file and hence this whole procedure seems unworkable for range rips of an album. Anybody any ideas on how to remedy this?


I assume you are using the latest release of SoX, version 14.3.2. There have been improvements regarding large-file support (see this commit), but that was after the release of 14.3.2.

Additionally, WAV itself has limited support for files > 4 GB, as it is using only 32 bits for storing size values.

DSD-2-PCM -- proof of concept

Reply #107
So would it be possible to rewrite the program so that it only converts the data chunk?


Yes, that is possible. I hope SoX (git snapshot) will support it directly by next week or so.

Quote
As it seems right now dsd2pcm is actually working properly, it's SoX which seems to have issues. … So now it seems that SoX can't handle that big a raw PCM file and hence this whole procedure seems unworkable for range rips of an album. Anybody any ideas on how to remedy this?


I assume you are using the latest release of SoX, version 14.3.2. There have been improvements regarding large-file support (see this commit), but that was after the release of 14.3.2.

Additionally, WAV itself has limited support for files > 4 GB, as it is using only 32 bits for storing size values.


Yes I'm using 14.3.2 and have already found out that with --ignore-length I can at least play large raw PCM files and convert them to proper WAV files. The thing that bothers me now is that Saracon won't handle these large WAV files properly when trying to downsample. Ultimately what I want is to be able to convert a .dff of a full album to raw PCM using dsd2pcm, then convert the raw file as quickly as possible to a format that Saracon can work with without errors (currentyl I'm trying FLAC but it's just so much slower than converting the raw file to WAV obviously) and finally downsample the resulting file to a something I like. The reason I want to do this is so that I can compare what the result of the described process sounds compared to Saracon's DSD to PCM conversion. I am well aware that Saracon's DSD to PCM conversion capabilities are regarded as quite good, but I'm interested in what DSD to PCM conversion might sound like if one doesn't filter out as much of the noise as Saracon does. Finally the reason I'm not using Audiogate for the "unfiltered" conversion is that it's downsampling capabilities are quite awful and it doesn't offer anything above 192 kHz output.

DSD-2-PCM -- proof of concept

Reply #108
To my surprise I found out that both SoX and Saracon support CAF files, hence I can now easily and quickly to the procedure I described above. I want to thank Sebastian for his great work on dsd2pcm! If additionally it could be changed so that only the data chunk is read from .dff files we would have a great little utility for DSD to PCM conversions on UNIX based systems and maybe even Windows. Coupled with the resampling capabilities of SoX this might be a true alternative to the more expensive options out there.

DSD-2-PCM -- proof of concept

Reply #109
Spoon,
which version are you using of SSRC - the "normal SSRC" or the "HD"/high quality SSRC_HD resampling? Are you doing two-pass? In case of "normal": any plans to wrap the HD-version + 2-pass to get better audio quality?
Based on Sebastians good work I have wrapped the decoder in to a dBpoweramp decoder (with a few enhancements):

http://forum.dbpoweramp.com/showthread.php?p=94899#post94899

The DFF header is read to extract sample rate, channel count and if the file is uncompessed, also only the data chunk is read. Resampling takes place by default with SSRC to 88KHz (with the option to change).

DSD-2-PCM -- proof of concept

Reply #110
We use our own compiled version of SSRC, off the top of my head the HQ switch used double + extra filter lengths, I am 99% sure we use doubles as there is no difference in speed on modern processors, did nto include extra filter length.

DSD-2-PCM -- proof of concept

Reply #111
Just as a little status update: I was notified that there is interest in integrating dsd2pcm into SoX. Therefore, I added proper licensing terms ("New BSD") and put the source code on google code here.

I also received a patch that includes some dsdiff header handling. You'll probably see this one integrated as well as some simple WAV header output which would then remove the click/pop at the beginning and the need th specify the raw format manually in the command line. Maybe I'll even add an optional lowpass filter and some nicely named presets...

Cheers!
SG

DSD-2-PCM -- proof of concept

Reply #112
Just as a little status update: I was notified that there is interest in integrating dsd2pcm into SoX. Therefore, I added proper licensing terms ("New BSD") and put the source code on google code here.

I also received a patch that includes some dsdiff header handling. You'll probably see this one integrated as well as some simple WAV header output which would then remove the click/pop at the beginning and the need th specify the raw format manually in the command line. Maybe I'll even add an optional lowpass filter and some nicely named presets...

Cheers!


Nice to hear. I lately purchased an album online to play around with that format and it was not that easy to get it to the right format feeding sox.
btw. the album i purchhased was coming as *.dsf files that weren´t recognized by dbpoweramp, foobar and others. I had to use Korg to convert this to *.dff
I am pretty new to this and wonder if dff is some kind of container and *.dsf files pure audio files only.

Edit: wrong file endings corrected
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

DSD-2-PCM -- proof of concept

Reply #113
Nice to hear. I lately purchased an album online to play around with that format and it was not that easy to get it to the right format feeding sox.

In my opinion, if you have the option between PCM (88/16 or 176/8 or higher) and DSD, you should go with PCM as you get more bang for the buck with PCM (higher theoretical quality for less bits).

btw. the album i purchhased was coming as *.dsf files that weren´t recognized by dbpoweramp, foobar and others. I had to use Korg to convert this to *.dff
I am pretty new to this and wonder if dff is some kind of container and *.dsf files pure audio files only.

According to Wikipedia, "DSF is a stereo-only, simplified form of DFF". Though, I did not yet find any specs. Pointers are welcome!

DSD-2-PCM -- proof of concept

Reply #114
In my opinion, if you have the option between PCM (88/16 or 176/8 or higher) and DSD, you should go with PCM as you get more bang for the buck with PCM (higher theoretical quality for less bits).

I know a bit about these things, thanks. I always smile when someone reports the unbelievable better sound of the SACD version that in reality just cam from some PCM master
The recording i purchased is "David Elias - The Window" to purchase at his homepage.
Since the recording was done in pure DSD it shouldn´t be false to buy the DSD release and create versions for my personal use at any format i like.

btw. It is nice to buy something from such a person that marketing himself and cares about customers. He even wrote me an Email (most likely automated) thanking me for the purchase and answered me again about some comments i made. I can´t remember Tom Waits did Email me after i purchased his new Deluxe Edition last week.

At his page he sells the DSD version as ISO file that can be burned and played on the PS3. In this ISO the fiels are in *.dsf format. Maybe you find something about the format on some PS3 info pages.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!


DSD-2-PCM -- proof of concept

Reply #116
sacd-ripper has the specification: [...]

Thanks. It seems they also have implemented some of this (at least for writing these streams, I suppose).

DSD-2-PCM -- proof of concept

Reply #117
Finaly some code that allows direct dsd support in SoX. http://sourceforge.net/p/sox/mailman/message/34396792/
Thanks to Måns Rullgård for offering the code! https://github.com/mansr/sox
I had some probs getting the compiling enviroment running in Win10 but the dsf to PCM path now works nicely
No idea how the idea feeding the rate function directly differs from Sebastians 8:1 decimation and resampling from there.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!