DSD on Linux can get tricky, so which is the easiest method?

Introduction:

Say you bought yourself, are curious or just want to know what that DSD album mess is and how to play it on anything not Windows? Well learn with me on this medium sized article on the matter. But first:

What is DSD?

DSD, or Direct Stream Digital is an audio carrier technology by Sony and Philips for the Super Audio CD format.
It has a completely different inner working compared to normal CD’s, as its a different way to store audio altogether.

DSD has a rich history of format wars and the like, where it competed mostly against DVD-Audio.

It was designed to be an archival system for interal use at first but soonafter got concidered for consumer use. This is how the Super Audio CD was born.

It did not grow as big as Sony hoped but still remains an active format, labels like Mobile Fidelity Sound Lab or Audio Fidelity are a couple that specialize in SACD music. Over in Japan, the SACD is still a popular format for more mainstream music as well.

Nowadays that still counts, and DSD is also used as ultra high fidelity formats on sites like NativeDSD.com, mora.jp, and many more. Digital unencrypted DSD tracks for digital distribution.

For more information you can look at this in-depth article on whathifi.com.

The setup:

But to listen to all of these tracks and albums, how the heck will you decode them?

Well there are two ways, you can:

  • Convert the files to PCM so you can listen to them anywhere without needing special chips, albeit this does hurt the ‘fidelity’ part of DSD a bit.
    Most DSD-capable players for the computer can already do this on-the-fly. Such as Foobar2000 (with SACD plugin), HQPlayer, JRiver and many more.
  • Or buy a DAC, Digital to Analog Converter that is capable of decoding DSD itself.
    This is mostly the preferred way as DSD needs a lot of filtering and other technology magic to work right.
    There are MANY, MANY MANY MANY options to choose from. Many YouTube and written revieuwers can give you information on the matter.

Hardware:

So with that out of the way, I tested DSD playback with a Topping D10s DAC on a bog standard HP laptop from ~2015.

Of course, you can also convert DSD audio so you do not ‘need’ to get a DAC but thats fairly simple to do on Linux as well.

And for perspective, I bought this one second hand for only €50! They really dont have to break the bank

Also tested was a Leaf Audio CMD-19, so chinese XMOS-based DAC’s should work just fine as well.

Software:

Now back to Linux, how do we set things up?

ALSA:

Note: If you dont need advanced hardware and software control you can probably skip this part to Playback.

ALSA, or Advanced Linux Sound Architecture is the backend we will be using.
This way we will be able to talk directly to the DAC just like ASIO on Windows does.

To get this to work, we will first need to figure out what your audio device is called on your PC.

Finding your DAC’s address:

To directly talk to your DAC, we will need to find its address.
We will need to to later set up and tell software what device to talk to.

First, ensure you have alsa and alsa-tools installed, alsa-utils might be needed as well.Find your card number:
The simplest way to see is to run ‘aplay -l’ to list your sound cards or external devices.

Display if your DAC reports DSD capability in ALSA:

Use this command to see features, where hw:3,0 is the ID, use step 1 to find what ID your device is. Such has hw1,0 or hw2,0.

aplay --dump-hw-params -D hw:3,0 -f cd /dev/zero

You should see after the FORMAT lines DSD_U32_BE be mentioned or a derivative of.
This means that yes your DAC should work just fine in linux using the ALSA system.

Another way is to run ‘ cat /proc/asound/card3/stream0’, where card3 is the number of the DAC you want to use as found in step 1.
You should see something among the lines of ” DSD raw:” followed by DoP support and other features.

Now we know what ID your device is, and that yes, it should do DSD as reported by ALSA and Linux!

Edit: Readers have found that you can also use your device name if supported by your Linux/ALSA installation. Please see the comments section for more information.

Using this address ‘hw’ settings:

So now that we have our device ID, you can use this to interface with things like aplay or anything that can use the ALSA platform.

Furthermore if you run aplay -L with a big L, you’ll get a bigger list of devices. Note the DEV= and plughw and hw variables.

To talk directly to the hardware without any conversion to say, PCM you use hw:, and to talk to the hardware but convert in software, you enter plughw. The DEV=0 variable can give various variations of the hardware or other additional inputs and outputs it might have.

So for example, to talk to device 3 without software conversions directly you use:

hw:CARD=3,DEV=0

And that should do the trick for configuring ALSA device outputs manually if you ever need to.

Playback:

Graphical players:

The purest way, but paid is via JRiver, which you can get here and read DSD settings here.

I tried DeaDBeeF and VLC, but VLC is mostly useful when using high res FLAC and other PCM media.
So my working configuration:

  1. Follow this guide and install MPD on your system.
  2. Also configure your media files location in the config file mentioned.
  3. This guide is also where the whole ALSA device ID’s come in to play.
  4. Next, install Cantata client. This in my case was just ‘sudo apt install cantata’ and done.
  5. Now open Cantata, select Folders, Browse Home Folders, browse to your DSF files and click on the play icon.
  6. Your DAC should now begin to play in DSD format. Tested up to DSD256!
Cantata

You can also setup a streaming service as explained in SACD Streaming via the internet, is it possible?, and even setup the external player with playlist to stream DSD anywhere!

Note: Clear the playlist in Cantata every time to want to play a new album when streaming, Cantata also doesnt seem to be able to read the metadata while streaming. When using Subsonic, Cantata wants to scan each entry which artifically ups the play count on Subsonic.

Console playback:

I had hoped to figure out an effecive way to play DSD from the command line as well and this is the closest I got.
It has a problem where the raw data sent is 32 bits wide while DSD transfers should be 24. This method as shown below is pitched higehr then the audio should be and also produces a lot of hiss. But it kind of works so here’s whats up:

aplay -D hw:CARD=3,DEV=0 -v -f DSD_U32_BE -c 2 -r 88200 [file]

aplay, -D is device ID, -v is verbose on, -f is format, -c is channels, and -r is samplerate.
For DSD64, use 88200, DSD128 is double that and so on. Replace [file] with your own DSD track of course.

Server method:

Another way to easily get DSD audio is via an audio distro, like Daphile.
Using Daphile, you can get a ‘low-powered’ PC, load it from an USB stick or install it and control your media library from any PC in your house. Another option for all you homelabbers out there is to virtualize it and send the USB port connected to your DAC to the virtual machine. The interface is via a web page. Turn on native DSD in the settings for audio outputs, and play a track!

Or on the topic of distro’s, you can also take a look at AudioPhile-Linux which is, as per usual a complete Linux distribution decidated to audio.

Conclusion:

Playing DSD on Linux has many solutions, but playing natively always has issues with beit, USB, drivers, hardware incompatibilities and so on.
But by using MPD, Music Player Deamon or even an audio focused Linux distribution, it can get you a long way!

Do tell in the comments if I got anything wrong or could improve upon!
I hope you found this useful, and thanks for reading!

6 Replies to “Native DSD On Linux via MPD: a mini guide”

  1. Great guide, thank you!
    There is only one problem, which unfortunately is not mentioned anywhere. After system reboot, the system swaps the audio devices, so for example the hw:2,0 to hw:0,0
    Otherwise I am using Arc Linux with an iFi ZEN DAC

    Sorry for my very bad English!

    1. Hello Archttila!

      The comments are not broken, but I do get why you might think so. Each posted comments needs approval to get posted to the blog due to bots.
      As for the audio switching problem, I do not use Arch myself, it may be a distro based problem?

      https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture/Troubleshooting

      This might be of assistance. I have asked around a bit, another possibility might be your USB port or hub. (If you use a hub)

      I’m hoping that helps you in your troubles, since I’m not quite sure what the ‘fault’ could be. Asking around on a forum might also help.

      Greeting from the Netherlands, Quintus!

    2. I came across the same problem. With ALSA it is possible to use the name of the device instead of the HW: address. If you run “aplay -L” (that is a capital L), you should see the name of your DAC. Mine is called “PRO”, so instead of HW:0,0 in which you use the ID of the device, you can use: “device=hw:CARD=Pro,DEV=0”. That way, it doesn’t matter what ID your card gets after a system reboot!

  2. Hello
    I have made it working on RaspberryPi but it doesn’t work on my gentoo machine, it doesn’t show the DSD raw DoP lines in my stream0
    I would like to know which kernel options or additional software is needed to have it working
    I use kernel 5.4.225 x86_64 and Topping D10b (similar to your s-version)

Leave a Reply