Tuesday, September 3, 2024

Bit-perfect playback on Linux without interruptions, for at least a few hours

In the course of searching for information about preventing music-players and the underlying audio services/processes from altering data on its way from some music-file on a PC to an external DAC, I realized that "bit perfect" was the key to unlocking the information I sought. Using this term, I soon found a page entitled Bit Perfect Audio from Linux. After my previous unsuccessful experiences with attempting to attain bit-perfect playback with Linux, I was highly skeptical about whether this was actually possible, because I assumed that there was some music-industry conspiracy which had left no stone unturned in forcing us to pay big bucks for bit-perfect playback without interruptions ("musicus interruptus"). So, I suspected that the page's recommendations were no longer valid, but I decided to try one of them, namely installing the music player named Deadbeef (a name based on a hexadecimal code of some significance to coders) on a live installation of MX-Linux 23.3, setting its preferences as instructed, and then creating a Snapshot-ISO of the installation, which I then used to create another live installation which contains Deadbeef and the aforementioned settings by default.

The instructions for setting-up Deadbeef were apparently based on an earlier version of Deadbeef, so I've revised them for the version I was using (1.9.5):

(a) Click on the Edit, then Preferences.

(b) In the Preferences window, select the "Sound" tab and set "Output plugin" to "ALSA output plugin" and "Output device" to the relevant device, which in my case was the Zen DAC driver described as "iFi (by AMR) HD USB Audio - Direct hardware device without any conversions" (my Zen DAC V2 was plugged into the PC, so its drivers were added to the list).                      

(c) Then select the "Plugins" tab, click "ALSA output plugin" in the list until its settings appear in the window, and un-check "Use ALSA resampling."

After creating and booting the aforementioned live installation with Deadbeef, I put Deadbeef to use, and found that it's utterly simple - just drag the files or folders to be played onto the player, and the rest is obvious. At first, I wasn't impressed by the sound quality, but listening is very subjective and the sound quality you hear at first largely depends on what you expect to hear (the placebo effect), until reality overcomes your expectations.

So, I looked for some opinions on Deadbeef's sound quality, and got sidetracked by a bogus speed-error issue until I realized that it's irrelevant when using a DAC with an asynchronous interface (which probably includes any new DAC on the market), in which case the player's output data goes into a buffer, and the DAC, which has its own clock, pulls the data from the buffer as it needs it, in the course of clocking it out at precisely the right speed.

After eliminating the "speed-error" mental block, I listened some more using Steely Dan's Alive in America, which is my reference for cymbals, and realized that the sound quality is as good as I've ever heard through my Zen DAC V2, and that's very good.

But the icing on the cake is that there were no interruptions while listening for hours. There was an interruption at first, but it was apparently caused by something I did, and hasn't happened again.

So, this might be the solution to attaining bit-perfect playback, without interruptions, on Linux. But I wouldn't bet on it, because I thought I was in the clear with Celluloid on a full installation of Ubuntu Mate on a µSD card, until it started cutting out on the first day of the Labor Day 3-day weekend. If the interruptions are triggered by the system's calendar, they could still happen.

In case the interruptions strike again, I've ordered an Android tablet which I would use for running the Neutron player, which has bit-perfect capability and actually has a polarity ("phase") inversion function, which I thought the music industry had forbidden on mass-market gear. I plan on using the tablet to drive the 15-foot (or so) USB3 cable which I've been using between my mini-PC and the Zen, which works because the frequencies involved are relatively low (all my files are CD-grade). For best sound quality, I leave the Zen powered up constantly using a 5V wall-wart plugged into the back, so the tablet wouldn't have to supply any power to it.

1 comment:

  1. I've been using Deadbeef for a few years now. and indeed have bit perfect reproduction, without any problem. I have an old netbook loaded with XFCE linux mint 16 I believe, stripped back to the bare minimum, and using deadbeef 0.6xx, files sent by USB to a Cambridge Audio DAC, I've recently changed the DAC to a Douk Audio K5, so I can add my Sony XE220 CD player via optical to my Vintage Marantz receiver as well.
    The result is as good as the equipment I have will allow, I have flac, high bit rate Mp3's, and a few DSD files all play without problems. Others have mentioned to me how do you know that bit perfect is being achieved, 1) the DAC shows the right sampling rate, and 2) the system volume control doesn't work, suggesting that no external sampling etc. is taking place. One thing I have noticed however is that deadbeef's own volume control needs ro be reduced by about -2db to avoid clipping with my Douk DAC as the signal is converted, something that wasn't necessary with the Cambridge audio.
    I'm happy with the sound, which is the important thing, and a darn sight easier to obtain with my Windows system using Foobar.

    ReplyDelete