DSD on Linux can get tricky, so which is the easiest method?
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:
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.
For more information you can look at this in-depth article on whathifi.com.
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.
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.
Now back to Linux, how do we set things up?
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.
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.
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.
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:
And that should do the trick for configuring ALSA device outputs manually if you ever need to.
I tried DeaDBeeF and VLC, but VLC is mostly useful when using high res FLAC and other PCM media.
So my working configuration:
- Follow this guide and install MPD on your system.
- Also configure your media files location in the config file mentioned.
- This guide is also where the whole ALSA device ID’s come in to play.
- Next, install Cantata client. This in my case was just ‘sudo apt install cantata’ and done.
- Now open Cantata, select Folders, Browse Home Folders, browse to your DSF files and click on the play icon.
- Your DAC should now begin to play in DSD format. Tested up to DSD256!
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.
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.
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.
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!