Playing DSD files directly on Linux

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 trieddsdx600-300x130_weg 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.

 

 

 

5 thoughts on “Playing DSD files directly on Linux

    • 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 .

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.