The Audioquest DragonFly and Linux

I’m back in the US for a few weeks, and I treated myself to an external USB DAC: the Audioquest DragonFly (version 1.2). It was getting good reviews online and the price was within reach. But, as ever, it was a concern as to how it would play with Linux. There is not a lot of information about the DragonFly and Linux/ALSA online, so here’re some notes on what I’ve found out (using Arch Linux).

It works! The sound is truly leagues ahead of my (good) portable MP3 player (a Sony ICD-SX1000), and ahead of the built-in DAC on my ThinkPad (X220). All the problems I had stemmed from not yet understanding that the device demands to be fed S24_3LE data (24-bit, 3-byte Little Endian). If you have a software player that can supply this, or use a conversion in ALSA, all is great. The built-in LED indeed changes with the sampling rate: green = 44.1 kHz (CD), blue = 48 kHz (some streaming stations), orange = 88.2 kHz (2 x CD), pink = 96 kHz (Blu-Ray; see here). Note: if your file is 192 kHz, you’ll need to downsample 2 or 4 times.

mplayer (my default player) will not make the S24_3LE conversion on the fly (as far as I’ve found out), and claims it cannot open the device. Neither will alsaplayer. The player that works fine as is for standard 44.1 kHz (MP3/FLAC) files (both 16-bit and 24-bit) is deadbeef; just select the DragonFly as output in the preferences. However, it seems to downsample higher sampling-rate files to 44.1 kHz and so the DF light never changes color. Also, 88.2 kHz files sound very ‘hissy.’

To play higher sample-rate files in full sound quality, I have found two solutions. The first is to convert the original file to a temporary S24_3LE WAV file (with sox) and them play that with aplay. Here’s a simple script (e.g., ~/bin/dragonflyplay):

  sox "$1" -b 24 -L /tmp/tmpdf.wav
  aplay -vD hw:1,0 /tmp/tmpdf.wav
  rm -f /tmp/tmpdf.wav

This method, though it is fun to see the sampling-rate info from the aplay -v option, is not perfect: it creates a large temp file, takes time to convert, and does not work with streaming services (i.e. spotify or via a browser). But I just realized that ALSA will do the conversion on the fly! So the second, universal solution is to simply route all sound output via a conversion plugin in ~/.asoundrc:

  pcm.!default {
  type plug
  slave {
    format S24_3LE
    pcm "hw:1,0"

Both of these solution assumed that ALSA has placed the DF at hw:1,0 (Card 1, device 0). Use aplay -l to find the card and device number. Finally, to control the volume on the DF (the ‘analog volume control’ of the DF publicity), use alsamixer -c 1. Now mplayer, deadbeef and spotify will play any file and the DF light follows the original file sampling-rate every time. And the sound... Ahhhh!