A lot of people believe DSD to be the format of choice when it comes to real high quality audio. If the provenance is right (e.g. if it has been recorded directly to DSD) DSD will deliver an amazing sound experience (see the differences between digital audio formats) . If you are a Linux user, you can use a modified MPD sound server to play DSD data. But it’s a bit of overkill for those of us who don’t want a complex sound server just to send a DSD /DSF files to an USB DAC. Here’s how you can play those files with ffmpeg and some glue.
To be honest: I don’t like to move files around, refresh servers or create playlists. I am old fashioned. I just type play this or play that and I expect sound to come from my speakers. So far – this works great with FLACs, MP3s or WAVs. Not so good for DSD or DSF files. Quit frankly – I didn’t find anything to work -out of the box- on my little Linux laptop. While ffmpeg is able to decode dsd, it is still missing the crucial part to convert the audio into DOP (dsd over pcm).
Believe me – i tried almost everything. I even sent a “mayday” over the ffmpeg mailing list – but .. to no avail (yet). So – if everything else fails – one has to sit down and find the solution herself.
Here’s what we want:
A converter that converts a DSD file into a DOP file and pushes this DOP data over alsa to a USB dac. Well – there’s DSF2FLAC and this little tools has a neat feature: It allows to pack DOP files into the Flac-Container.
dsf2flac -d -r 176400 -i thedsdaudio.dsf -o thedsdaudio.flac
Cool. Took about another hour or so to be able to play that flac via ffmpeg.
ffmpeg -i thedsdaudio.flac -r 176400 -c pcm_s32le -f alsa hw:1
Voila. The DSD light on my DAC turns on and I am happy. But not happy enough. It takes time to convert a DSD into a flac. And I don’t wont to wait. So – I went ahead and patched dsf2flac to be able to dump the DOP data to stdout.
So, it looks like that now:
dsf2flac -d -r 176400 -i thedsdaudio.dsf -o - 2>/dev/null | ffmpeg -i - -r 176400
-c pcm_s32le -f alsa hw:1
Now we’re talking. No more MPD. Knit yourself a little shell script around it and you are ready to go.
Here’s the replacement main.cpp that you should copy over the original before compiling.
That’s all folks. Have fun.
UPDATE: I have found “deadbeef” and downloaded the pre-compiled binary from sourceforge. Didn’t really expect it to work out of the box on my Centos7 computer. But it did. And it plays DSD just fine. We’ve got ourselves a solution to play DSD on Linux.
11 thoughts on “Playing DSD files directly on Linux”
Thanks, very useful! Works for my mojo baby 😉
Does it have to be played back with ffmpeg? Can it be SoX, foobar2000 or Korg AudioGate?
I am going to answer both questions with one post if you don’t mind. Does it have to be played back with ffmpeg? Not necessarily. I use ffmpeg because it allows me to pass the DOP (DSD over PCM) via USB to the DSD decoder. I didn’t investigate if other tools are able to do that. ffmpeg word just fine. How does it compare in performance to Korg AudioGate, foobar2000, and HQPlayer? There’s no real answer to that. Because in this environment the audio file is _NOT_ being played using internal Linux analog audio. I feed the DOP via USB to an external decoder who is able to handle DSD/DOP. It is running on an older laptop and there’s no performance issue because the final decoding (into analog audio) is being done by a TEAC UD-301 .
Greetings! How does it compare in performance to Korg AudioGate, foobar2000, and HQPlayer?
deadbeef does not play dsd native or dop. it converts it to pcm the oold fashioned way, doesn’t even bring it 6db up. so it’s not a solution.
Well – it IS playing my DSD audios just fine. Of course it needs to convert it to PCM because that’s all most sound cards can handle. So – at least for me to casually listen to DSD audio on my computer, deadbeef is a viable solution. If I want to listen to DSD in all it’s glory, I am using my hardware DSD capable DAC and convert the audio to DOP as described in the article.
Hello everyone, Recently I bought an rme ADI 2 DAC. I tried deadbeef and with flac files converted by the tool everything works fine. Anyway I was unable to play dsf file directly with deadbeef with either version of it. Actually none of the free hi quality audio software players I have tried was able to play dsf or dff DSD256 via DoP nor dsf2flac tool is able to convert DSD256 to dop flac. The fact is that flac still not able to convert DSD256 and above. This mainly due flac does not support rates above 6…mpling rate of 705600hz, 24 bits. Magically my dac displayed the funny DSD256 label. Altought not optimized for memory usage (wav conversion still done completely in memory before outputting the wav data to output file) this version can also “pipe” wave file output with ffmpeg. Tested and works fine with ADI 2 DAC dsds64, dsd128, dsd256 using wav conversion instead of flac. Any one interested in this new tool email me at (removed), I will send the source code. Regards Massimo.
Edit by admin: Massimo’s Email removed for security reasons. Anybody interested in the source can contact us and we’ll forward it to massimo.
Thanks Massimo. Great work. I have edited your post to remove email.
I have made publicy available sources here: https://github.com/dhalsimax/dsf2flac
Comments are closed.