IPB

Welcome Guest ( Log In | Register )

> Upload forum rules

- No over 30 sec clips of copyrighted music. Cite properly and never more than necessary for the discussion.


- No copyrighted software without permission.


- Click here for complete Hydrogenaudio Terms of Service

5 Pages V  « < 3 4 5  
Reply to this topicStart new topic
DSD-2-PCM -- proof of concept, test sample and source code here
chi
post Nov 27 2011, 22:55
Post #101





Group: Members
Posts: 45
Joined: 27-November 11
Member No.: 95439



QUOTE (Sik_Lescinovid @ Nov 27 2011, 18:28) *
Has anyone so far noticed that when creating a 24 bit /352.8 kHz WAV file using
CODE
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?
Go to the top of the page
+Quote Post
Sik_Lescinovid
post Nov 27 2011, 23:40
Post #102





Group: Members
Posts: 12
Joined: 27-November 11
Member No.: 95433



QUOTE (chi @ Nov 27 2011, 22:55) *
QUOTE (Sik_Lescinovid @ Nov 27 2011, 18:28) *
Has anyone so far noticed that when creating a 24 bit /352.8 kHz WAV file using
CODE
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?
Go to the top of the page
+Quote Post
Wombat
post Nov 27 2011, 23:50
Post #103





Group: Members
Posts: 983
Joined: 7-October 01
Member No.: 235



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.
Go to the top of the page
+Quote Post
Sik_Lescinovid
post Nov 27 2011, 23:57
Post #104





Group: Members
Posts: 12
Joined: 27-November 11
Member No.: 95433



QUOTE (Wombat @ Nov 27 2011, 23:50) *
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...
Go to the top of the page
+Quote Post
Wombat
post Nov 28 2011, 00:14
Post #105





Group: Members
Posts: 983
Joined: 7-October 01
Member No.: 235



QUOTE (Sik_Lescinovid @ Nov 28 2011, 00:57) *
QUOTE (Wombat @ Nov 27 2011, 23:50) *
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.
Go to the top of the page
+Quote Post
Sik_Lescinovid
post Nov 28 2011, 00:27
Post #106





Group: Members
Posts: 12
Joined: 27-November 11
Member No.: 95433



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?
Go to the top of the page
+Quote Post
chi
post Nov 28 2011, 00:37
Post #107





Group: Members
Posts: 45
Joined: 27-November 11
Member No.: 95439



QUOTE (Sik_Lescinovid @ Nov 27 2011, 23:40) *
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.
Go to the top of the page
+Quote Post
Sik_Lescinovid
post Nov 28 2011, 01:41
Post #108





Group: Members
Posts: 12
Joined: 27-November 11
Member No.: 95433



QUOTE (chi @ Nov 28 2011, 00:37) *
QUOTE (Sik_Lescinovid @ Nov 27 2011, 23:40) *
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.
Go to the top of the page
+Quote Post
Sik_Lescinovid
post Nov 28 2011, 03:08
Post #109





Group: Members
Posts: 12
Joined: 27-November 11
Member No.: 95433



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.
Go to the top of the page
+Quote Post
dvdr
post Nov 29 2011, 16:22
Post #110





Group: Members
Posts: 14
Joined: 20-June 04
Member No.: 14800



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?
QUOTE (spoon @ Dec 1 2009, 17:49) *
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).


This post has been edited by dvdr: Nov 29 2011, 16:24
Go to the top of the page
+Quote Post
spoon
post Nov 29 2011, 16:37
Post #111


dBpowerAMP developer


Group: Developer (Donating)
Posts: 2741
Joined: 24-March 02
Member No.: 1615



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.


--------------------
Spoon http://www.dbpoweramp.com
Go to the top of the page
+Quote Post
SebastianG
post Dec 4 2011, 18:00
Post #112





Group: Developer
Posts: 1317
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



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
Go to the top of the page
+Quote Post
Wombat
post Dec 4 2011, 19:27
Post #113





Group: Members
Posts: 983
Joined: 7-October 01
Member No.: 235



QUOTE (SebastianG @ Dec 4 2011, 19:00) *
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

This post has been edited by Wombat: Dec 4 2011, 19:39
Go to the top of the page
+Quote Post
SebastianG
post Dec 5 2011, 11:31
Post #114





Group: Developer
Posts: 1317
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (Wombat @ Dec 4 2011, 20:27) *
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).

QUOTE (Wombat @ Dec 4 2011, 20:27) *
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!
Go to the top of the page
+Quote Post
Wombat
post Dec 5 2011, 14:37
Post #115





Group: Members
Posts: 983
Joined: 7-October 01
Member No.: 235



QUOTE (SebastianG @ Dec 5 2011, 12:31) *
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 smile.gif
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.
Go to the top of the page
+Quote Post
chi
post Dec 6 2011, 00:29
Post #116





Group: Members
Posts: 45
Joined: 27-November 11
Member No.: 95439



QUOTE (SebastianG @ Dec 5 2011, 11:31) *
According to Wikipedia, "DSF is a stereo-only, simplified form of DFF". Though, I did not yet find any specs. Pointers are welcome!


sacd-ripper has the specification: http://sacd-ripper.googlecode.com/svn/trun...ification_E.pdf
It seems Wikipedia is not completely right, as there is a “Channel num” field supporting values from 1 to 6.
Go to the top of the page
+Quote Post
SebastianG
post Dec 7 2011, 12:04
Post #117





Group: Developer
Posts: 1317
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (chi @ Dec 6 2011, 01:29) *
sacd-ripper has the specification: [...]

Thanks. It seems they also have implemented some of this (at least for writing these streams, I suppose).
Go to the top of the page
+Quote Post

5 Pages V  « < 3 4 5
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 29th July 2014 - 01:38