Steps towards a near-audiophile, bit-perfect Linux audio setup

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

I am working my way towards turning my computer into a "near-audiophile", "close-to bit-perfect" source for playing audio and video. In opening this thread, I am seeking help from the community here. To begin with, I am fully aware that there are many forums, blogs etc for computer audiophiles covering all operating systems, and that operating system forums such as this one might not be the obvious first choice to look for help. But I am also aware of the varying quality, applicability, correctness and up-to-date status of contributions literally anywhere, to say the least. Thus, please bear with me and try to give as much feedback as you might have. Be aware that I am going much further than the initial plug-and-play which nowadays works on any operating system, Linux included. I guess everybody agrees that the Linux audio stack is very convoluted and maybe even messy..., thus hard to comprehend.

I will organize this thread and post into several topics, which I will spread over several posts. Questions will be asked all along the way.


1. The Goal: "Near-audiophile", "close-to bit-perfect" Setup for a Computer

Definition of this term: For now, I am seeking to set up my (single) computer and an external USB-DAC for the best replay possible, taking the DAC output to a headphone or a home stereo. As Ronald van Engelen points out in one of his brilliant blog posts http://lacocina.nl/bitperfect-audio, bit-perfect audio in the end is a bit of an unreachable dream, and for sure there are many more steps to be taken beyond my goal defined above.


2. Choice of Hardware (USB-DAC)

In order to start, I did chose an Audioquest Dragonfly Red, due to its sound as per the reviews, its capabilities and its fit to a budget. This one is capable of digesting up to 24 bits and sample rates of 44.1, 48.0, 88.2, 96.0 kHz. The company states that it can do the desirable isochronous/asynchronous data transfer which is a characteristic of USB Audio Class-2 (UAC2) devices (instead of isochronous/adaptive in UAC1), although it maxes out at 96k in order to let it operate with the standard MS Windows UAC1 driver. Windows began offering a UAC2 driver only from the Windows 10 Creators Update (04/2017) onwards, s.th. like 10 years after that standard had been defined. Apple and Linux do know UAC2 since long... For a comparison of UAC1 and UAC2, please refer to https://lacocina.nl/detect-alsa-output-capabilities, which has a comparison table near the end.

A nice feature of this DAC is that it shows the sample rate coming in by lighting its LED in different colors - very useful for setting up and debugging the system.


3. Windows 10 as a Not-So-Perfect Role Model

I think WIndows can be more easily set up to almost do what I want, certainly more easily than Linux. (I don't think I would need to reiterate the advantages of Linux as an answer to "why don't you stick to Windows then?" here.)

The go-to audio player is foobar2000, which I use with the WASAPI plugin. This circumvents the WIndows Mixer and outputs all sample rates 44.1, 48, 88.2 and 96k from the music source file (FLAC) directly to the USB-DAC. Bit depth to my findings cannot be made agree automatically with the source, but needs to be set in foobar2000 (I use 24 bits). For higher sample rates, with my Dragonfly Red DAC one has to retreat to Direct Sound and its downsampling, where - I think - the target sample rate needs to be set in the Windows Hardware & Sound setup.

Important points: Make the operating system sound mixers stay out of the way, and avoid resampling wherever possible. I think one can more easily live with requantization (changing bit depth) than with resampling (changing the time domain).

I put one problem with Windows 10 aside for the time being: When installing the USB-DAC driver, WIndows 10 Creators Update did pick the USB Audio Class-1 driver. I couldn't find a way yet to install the MS UAC2 driver manually...


4. Choice of Audio and Video Player Software under Linux

VLC is quite the most obvious choice for a video player.

Chosing an audio player under Linux is not that easy: (1) I want optimum playback capabilities, and I want to be able to see and influence what it does. Blind trust in out-of-the-box plug-and-play isn't the way to get towards better sound. (2) I want gapless playback, as foobar2000 has. (3) I don't need music library, tagging and other on-top capabilities (although foobar2000 has those). My library management is perfectly accomplished by the file manager. For tagging, there is nothing better than the Windows application Mp3tag, although puddletag is on a good way to replicate it under Linux. Anyway, I need to resort to Windows anyway, e.g. for AccurateRip ripping of CDs using dBpoweramp.

Currently, I have two audio players in use under Linux: Audacious and DeadBeeF. Both have extensive output choices (ALSA, PulseAudio, Jack). I have Audacious under Linux Mint 18.2 Cinnamon and under openSUSE Tumbleweed, while DeaDBeeF yet is only under Tumbleweed since I want to avoid adding a PPA in Mint.

I am aware of many people recommending MPD (Music Player Daemon) for these purpose, but I am not yet ready to venture into this territory.

Please, any suggestions for player software are highly welcome, considering the requirements mentioned above.
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

5. ALSA Looking at my Hardware

First, here's my computer:

Code: Select all

$ inxi -Fxzd
System:    Host: minty182ce Kernel: 4.10.0-33-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.4.6 (Gtk 3.18.9-1ubuntu3.3) Distro: Linux Mint 18.2 Sonya
Machine:   System: Hewlett-Packard (portable) product: HP EliteBook 8560w v: A0001C02
           Mobo: Hewlett-Packard model: 1631 v: KBC Version 01.3F
           Bios: Hewlett-Packard v: 68SVD Ver. F.63 date: 10/27/2016
CPU:       Dual core Intel Core i5-2540M (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 10376
           clock speeds: max: 3300 MHz 1: 802 MHz 2: 817 MHz 3: 810 MHz 4: 983 MHz
Graphics:  Card: NVIDIA GF108GLM [Quadro 1000M] bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 drivers: nouveau (unloaded: fbdev,vesa)
           Resolution: 1600x900@59.98hz
           GLX Renderer: Gallium 0.4 on NVC1 GLX Version: 3.0 Mesa 17.0.7 Direct Rendering: Yes
Audio:     Card-1 NVIDIA GF108 High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 01:00.1
           Card-2 Intel 6 Series/C200 Series Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Sound: Advanced Linux Sound Architecture v: k4.10.0-33-generic
Network:   Card-1: Intel 82579LM Gigabit Network Connection
           driver: e1000e v: 3.2.6-k port: 5020 bus-ID: 00:19.0
           IF: enp0s25 state: down mac: <filter>
           Card-2: Intel Centrino Ultimate-N 6300 driver: iwlwifi bus-ID: 25:00.0
           IF: wlo1 state: up mac: <filter>
Drives:    HDD Total Size: 2048.4GB (49.5% used)
           ID-1: /dev/sda model: Samsung_SSD_850 size: 2048.4GB
           Optical: /dev/sr0 model: PIOR BD-RW BDR-TD05AS
           rev: 1.01 dev-links: cdrom,cdrw,dvd,dvdrw
           Features: speed: 62x multisession: yes
           audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition: ID-1: / size: 95G used: 5.9G (7%) fs: ext4 dev: /dev/sda2
           ID-2: /home size: 48G used: 95M (1%) fs: ext4 dev: /dev/sda3
           ID-3: swap-1 size: 20.15GB used: 0.00GB (0%) fs: swap dev: /dev/sda9
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 39.0C mobo: 35.0C gpu: 33.0
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 210 Uptime: 2 min Memory: 550.6/15991.4MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0 Client: Shell (bash 4.3.481) inxi: 2.2.35
Using the alsa-capabilities script provided by Ronald van Engelen https://lacocina.nl/detect-alsa-output-capabilities, the following output is seen under Linux Mint 18.2 Cinnamon:

Code: Select all

$ bash alsa-capabilities -l usb -s
 0) USB Audio Class Digital alsa audio output interface `hw:2,0'
 - device name       = AudioQuest DragonFly Red v1.0                               
 - interface name    = USB Audio                                                   
 - usb audio class   = 2 - isochronous asynchronous                                
 - character device  = /dev/snd/pcmC2D0p                                           
 - samplerates (kHz) = S24_3LE:             44100Hz 48000Hz 88200Hz 96000Hz        
 - monitor file      = /proc/asound/card2/pcm0p/sub0/hw_params                     
 - stream file       = /proc/asound/card2/stream0
Everything does look the way it is supposed to. With this script one can also continuously watch the digital stream output characteristics during replay.


6. How to Optimize the Audio Player and System Settings under Linux?

Now for a harder task, which I need your help with. The Linux audio stack is hard to comprehend, at least for me as of now. Here are two diagrams, one by Ronald van Engelen https://lacocina.nl/wp-uploads/2014/09/ ... 01-pub.png and one by Manuel Amador https://rudd-o.com/linux-and-free-softw ... udio-works.

In general, the worst case would happen if the audio player as well as several components of the audio stack (PulseAudio, ALSA) all would tamper more or less automatically with the bits and bytes coming from the audio (FLAC) file, i.e. if several resamplings would be applied one after the other.

So, to you out there, what's the best - i.e. purest - way to go? The purest way would be to not resample/requantize anything for audio files which my DAC could handle intrinsically, and to downsample those sample rates it cannot handle (integer multipliers). The next desirable way could be to resample everything up or down to the two highest sample rates (88.2, 96k, integer multipliers) which my DAC can handle. However, any resampling does distort sound a bit, cf. e.g. http://src.infinitewave.ca/ for a comparison of SRC ("Secret Rabbit Code") versions.

So this is the point where my knowledge is thinnest. I understand I could do settings within the audio players, I could do settings for PulseAudio and/or for ALSA, the latter two by modifying certain configuration files. However, modifying such files all too easily turns into messing them up... Thus, I am asking a whole set of questions now which I try to outline according to my little knowledge:

First route and set of questions here: What happens if I set the audio player to output to ALSA, and set things within the audio player as good as can be set? Would PulseAudio nevertheless grab the digital stream and modify it? Would it be best to somehow disable PulseAudio in that case? (I did read that disabling is possible, though I saw contradictory things out there. The worst idea would be to uninstall PulseAudio, that would break the entire system.) How would I set up ALSA then?

Second route and set of questions: A different route would be to set the audio player output to PulseAudio, and do any settings there if there are any. How would I set up PulseAudio then? How would I be able to make ALSA just transport the digital 1:1 then?


A final word now: For sure, I am bothering you with a long write-up. But I feel the convoluted Linux audio stack warrants this, and I hope that your answers will help in putting something together which might prove useful not only for me, but for other like-minded people, too. I have always experienced that the Mint community is an active, resourceful and helpful one. My next big step would be to transfer things learned here to openSUSE Tumbleweed, but that's for some day later...
User avatar
TeaSwigger
Level 3
Level 3
Posts: 132
Joined: Mon Feb 06, 2012 6:42 am
Location: CA

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by TeaSwigger »

Hello, 111MilesToGo. Not being an expert, perhaps the best I can do is offer what I do, as far as I've figured it; hope it's of some help or at least some interest for you.

Though I'm an "audiophile," Windows just isn't an option for me on personal principals. Linux Mint is my OS of choice so I work with it. To my view, it's amazing how good it is; the devices and uses it successfully works for is mind-boggling. It's also so versatile that, to my opinion and experiences, it can work great in audiophile sound contexts.

The system is a (self-built) PC with the best in sound cards, ASUS Xonar ST (PCI). It handles anything up to 24/192k, has its own clock, its own 'rail' to the PSU, extra shielding, decent quality parts etc. Sounds so good I'm sticking with it until whatever time in the future I move to an incompatible form factor like a mini-pc or something. It also has an unusually high quality built-in headphone amp, though I use the RCAs out to my tube amp for either speakers or 'phones (Sennheiser HD600s).

The device was determined via the commands aplay -l and aplay -L. For example, here is the output on my system:

Code: Select all

me@myoldbox ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ST [Xonar ST], device 0: Multichannel [Multichannel]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ST [Xonar ST], device 1: Digital [Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
This shows the desired card is "ST".

Code: Select all

me@myoldbox ~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=ST
    Xonar ST, Multichannel
    Default Audio Device
front:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Front speakers
surround21:CARD=ST,DEV=0
    Xonar ST, Multichannel
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=ST,DEV=0
    Xonar ST, Multichannel
    4.0 Surround output to Front and Rear speakers
surround41:CARD=ST,DEV=0
    Xonar ST, Multichannel
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=ST,DEV=0
    Xonar ST, Multichannel
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=ST,DEV=0
    Xonar ST, Multichannel
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=ST,DEV=0
    Xonar ST, Multichannel
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=ST,DEV=0
    Xonar ST, Multichannel
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct sample mixing device
dmix:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct sample mixing device
dsnoop:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct sample snooping device
dsnoop:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct sample snooping device
hw:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct hardware device without any conversions
hw:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct hardware device without any conversions
plughw:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Hardware device with all software conversions
plughw:CARD=ST,DEV=1
    Xonar ST, Digital
    Hardware device with all software conversions
hdmi:CARD=HDMI,DEV=0
    HDA ATI HDMI, HDMI 0
    HDMI Audio Output
dmix:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct sample mixing device
dsnoop:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct sample snooping device
hw:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Hardware device with all software conversions
This shows that the desired device, for direct-as-possible sound in this situation, is "hw:CARD=ST,DEV=0" which is described as "Xonar ST, Multichannel" "Direct hardware device without any conversions".

For media players, I use moc (a CLI app available in the repositories as 'mocp') for music and mpv (although I choose to use a recent vers available at ppa:mc3man/mpv-tests, the one in the repositories is probably fine) for videos. They can be configured to pipe the output to the hardware device via ALSA, bypassing pulseaudio, resampling and all that. If you're interested, the relevant bits in their respective config files:

moc config file is: /home/me/.moc/config

Code: Select all

SoundDriver = ALSA
ALSADevice = "hw:CARD=ST,DEV=0"
ResampleMethod = SincBestQuality
ForceSampleRate = 0
Allow24bitOutput = yes
UseRealtimePriority = yes
"ForceSampleRate = 0" will only work, of course, if the target device can accept the source file's sample rate and "Allow24bitOutput = yes" will only work if the target device can accept 24-bit depth.

/home/me/.config/mpv/mpv.conf

Code: Select all

audio-device='alsa/hw:CARD=ST,DEV=0'
Odds and ends:

Because it appeared to affect the sound and I couldn't find clear instructions for totally disabling and bypassing it, I've uninstalled pulseaudio. If one choses to leave pulseaudio installed, one may:
- chose to suspend it during playback (one adds "pasuspender -- " to the execution line, so for example, mpv is started with "pasuspender -- mpv", or in mpv's .desktop file the line "Exec=mpv" becomes "Exec=pasuspender -- mpv";
- chose to keep pulseaudio from autostarting ("spawning"). In /etc/pulse/client.conf, edit the entry ; autospawn = yes to autospawn = no. This link explains in more detail: http://kodi.wiki/view/PulseAudio/HOW-TO ... for_Ubuntu

Also, I have all other sound, system sounds etc, piped to the unused HDMI so they don't interrupt, using a system-wide ALSA config file, /etc/asound.conf , which has the following content:

Code: Select all

pcm.!default {
	type hw
	card HDMI
}

ctl.!default {
	type hw           
	card HDMI
}
Currently I'm using the 4.10.0-33 kernel.
If you would like to use deadbeef, one thing you could do is to grab the 'portable build', unpack it to say, /home/you/bin/deadbeef and use it from there. Look into options & DSP plug ins to work out the best setup for your needs.
moc is a CLI (terminal) app. It's extremely fast and "light" resource wise. Since I have my media library organized and tagged (more or less...) on the system, I don't need a "media library" manager app; moc lets one quickly browse the files, has gapless playback and doesn't seem to do anything to the sound if you have it so configured (you don't have the eq on etc).
As for mpv, when configured optimally for my system/drivers etc, it seems to offer the best image quality. I do keep the versatile vlc around "in case."

ps, re: the script you refer to above, you can also see the sample rate in action, so to speak, at any time without a script by entering in the terminal:

Code: Select all

cat /proc/asound/card*/pcm*p/sub0/hw_params
“You can make a strong business case for equality but not everyone wants to hear it.” - Prof. Kate Pickett

Mint 20.2 xfce w/nemo - AMD A10 7700K APU - spdif to Bifrost DAC - Dell U2415
some favs: Zim, deadbeef, kid3, gimp, artha, deluge, handbrake, mc
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by Hoser Rob »

While the underlying architecture of Linux audio is a bit convoluted, it's actually pretty easy to get proper quality audio if you use an external USB DAC, as you are. Like in WIndows or OS X you do have to forego software mixing. And you need to use a volume control downstream of the DAC ... leave the computer's volume at 100%.

I use a USB DAC as well, and all you really have to do is use software that has an option to just stream the audio through ALSA with no conversions. Typically this will look like "USB Audio codec" under audio output module selection. VLC, Smplayer, Audacious and Clementine all do this. I rarely use VLC but the others are my main ones. I wouldn't consider an app without that capability at all.

This way you completely bypass Pulseaudio. If you really want system sounds (I disable them myself) you could still have them by setting pavucontrol to always output to the built in speakers I suppose. But it's a simple bit stream with no conversions, through the kernel straight to the DAC. How much bit perfect can it get?

BTW it's a complete myth that pulseaudio always resamples. It only does so if there's software mixing needed ... there's no way around that which is why I avoid software mixing. But it's easy to prove this by showing the current ALSA sample rate while playing a file (all audio ends up at ALSA anyway). Set the output module in your app to Pulse. Play a 44.1K sample audio file and execute this in the terminal:

Code: Select all

cat /proc/asound/card?/stream0 | grep Momentary
Then repeat with a 48K file. I've done this test many times and it's never resampled.

I've found there are two main things here to get a good clean signal. One, avoid resampling of you audio, period. Two, don't use the volume control on your panel or in the app software. Those almost never work well and an analog volume control is best.

You'll know it's right when you stop listening to your playback system and find yourself just listening to the tune.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
MintBean

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by MintBean »

I'm really surprised there's so much issue with the way USB DACs operate. Surely the smart (and easy) way is for the DAC to maintain a small buffer and totally control its own output rate whilst the music player makes sure it keeps the buffer pretty full at all times- much like DVD burners that can't afford to wait for data.
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

I'm glad to find like-minded people here on this forum, understanding what "good sound" really means and knowledgeable about Linux. Thanks for your help up to now, and bear with me further on when I continue to draw on your expertise.
Hoser Rob wrote:... Like in WIndows or OS X you do have to forego software mixing. And you need to use a volume control downstream of the DAC ... leave the computer's volume at 100%.

I use a USB DAC as well, and all you really have to do is use software that has an option to just stream the audio through ALSA with no conversions.
...
I've found there are two main things here to get a good clean signal. One, avoid resampling of you audio, period. Two, don't use the volume control on your panel or in the app software. Those almost never work well and an analog volume control is best.
You are absolutely right. I'm working towards the first point. The second one is impossible for me since the Audioquest Dragonfly Red has a 64-bit digital volume control in the DAC itself which is set "via proxy" from the computer volume control. I asked Audioquest for specifics, and they did answer promptly, but didn't address this topic. So this is at it is for starting into computer middle to high-end audio. (Side remark: A "dream" USB-DAC like the Chord Hugo 2 would be a factor of 10 in budget...; I have auditioned the first Hugo a little while ago.)

My progress up to now is as follows: I'll limit myself to Linux Mint 18.2 Cinnamon 64-bit for the time being in order to tackle matters step by step. I have worked on the same things under openSUSE Tumbleweed (KDE) as well as Ubuntu Studio, but no two Linux distros are created equal - but I'll defer that to a later post. And I'll limit myself to audio players for now.

Important: I did not modify any configuration files for ALSA and PulseAudio yet.

Here are my ALSA devices with respect to the Dragonfly Red:

Code: Select all

$ aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: PCH [HDA Intel PCH], Gerät 0: 92HD81B1X5 Analog [92HD81B1X5 Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 7: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 8: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 9: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 2: v10 [AudioQuest DragonFly Red v1.0], Gerät 0: USB Audio [USB Audio]
  Sub-Geräte: 0/1
  Sub-Gerät #0: subdevice #0

Code: Select all

$ bash alsa-capabilities -l usb -s
 0) USB Audio Class Digital alsa audio output interface `hw:2,0'
 - device name       = AudioQuest DragonFly Red v1.0                               
 - interface name    = USB Audio                                                   
 - usb audio class   = 2 - isochronous asynchronous                                
 - character device  = /dev/snd/pcmC2D0p                                           
 - samplerates (kHz) = S24_3LE:             44100Hz 48000Hz 88200Hz 96000Hz        
 - monitor file      = /proc/asound/card2/pcm0p/sub0/hw_params                     
 - stream file       = /proc/asound/card2/stream0

Code: Select all

$ aplay -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=PCH
    HDA Intel PCH, 92HD81B1X5 Analog
    Default Audio Device
    
... Stuff removed ...

sysdefault:CARD=v10
    AudioQuest DragonFly Red v1.0, USB Audio
    Default Audio Device
front:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    Front speakers
surround21:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    Direct sample mixing device
dsnoop:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    Direct sample snooping device
hw:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    Direct hardware device without any conversions
plughw:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    Hardware device with all software conversions
So the three Dragonfly ALSA device to be considered are "Direct hardware without any conversions", "Hardware with all software conversions", and "Default audio device". The "direct hardware without any conversions" seems to be the most desirable one. Thank you:
TeaSwigger wrote:This shows that the desired device, for direct-as-possible sound in this situation, is "hw:CARD=ST,DEV=0" which is described as "Xonar ST, Multichannel" "Direct hardware device without any conversions".
Plus, of course, no two audio players are created equal - not even Audacious and DeaDBeeF. As mentioned above, these two would fulfill the requirements of gapless playback and ALSA output with assorted settings available. I chose ALSA as their output module; pls remember that I didn't modify config files yet, so the question is whether and how PulseAudio remains in the game of transporting sound bits and bytes to the DAC. In DeaDBeeF, I removed the Resampler (SRC) DSC in order to get as much as possible out of the way.

DeaDBeeF works for all three ALSA devices Default, hw and plughw; but Audacious unfortunately throws a "configuration error" for the Direct hardware. Why that?

Using the "Default audio device", both applications do feed 24bits/48kHz to the DAC regardless of the audio file resolution. (Cf. above: Config files not modifed yet.) Who is responsible for doing so?

Using the "Direct hardware device" in DeaDBeeF and the "Hardware with all software conversions" in both Audacious and DeaDBeeF, all samplerates the DAC is capable of (44.1, 48, 88.2, 96) are being served properly. Those outside its range are a mixed bag: 192kHz is being downsampled to 96k - okay, but for 176.4 the downsampling is ill-chosen to 96. Who is doing that, and how could it be fixed to go to 88.2?

So these are my questions for now.

I should also gratefully note two previous threads here, viewtopic.php?f=49&t=251340 and viewtopic.php?f=6&t=230975. Hoser Rob, a link you posted over there doesn't work:
Hoser Rob wrote:This is a good guide to linux audio architecture: https://jan.newmarch.name/LinuxSound/Sa ... hitecture/.
Any remedy?

Anyway, I trust I can get to the point where
Hoser Rob wrote:You'll know it's right when you stop listening to your playback system and find yourself just listening to the tune
as well as "everything is just exactly perfect" (quoting a standard phrase by the Grateful Dead, probably my most beloved band)...
User avatar
TeaSwigger
Level 3
Level 3
Posts: 132
Joined: Mon Feb 06, 2012 6:42 am
Location: CA

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by TeaSwigger »

It would seem you'll want to use:

Code: Select all

hw:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    Direct hardware device without any conversions
In DeaDBeeF, I removed the Resampler (SRC) DSC in order to get as much as possible out of the way.
If you haven't done so, you may also consider:
- select ALSA output plugin and whatever is to the effect of "Direct hardware device without any conversions" for output device
- Under preferences > plugins tab > ALSA output plugin > configure button > uncheck "use ALSA resampling" and check "release device while stopped"
- deselect "always convert 16 to 24 bit"
- disable/deselect replaygain
- ditch the EQ as well
- be sure the player's volume is set at 100%

Quod Libet (sp?) and Clementine are other players which can be configured to use a specific output. Audacious is my current preferred gui audio player.
Using the "Default audio device", both applications do feed 24bits/48kHz to the DAC regardless of the audio file resolution. (Cf. above: Config files not modifed yet.) Who is responsible for doing so?
My guess is that option passes everything through the mixer, which is configured to resample everything to 48khz, a default for general purpose use.

ALSA's volume and related settings are accessable 'directly' from the terminal. Just enter alsamixer.
You'll know it's right when you stop listening to your playback system and find yourself just listening to the tune.
Wise words from Hoser Rob. :)
Last edited by TeaSwigger on Sun Nov 26, 2017 8:39 am, edited 1 time in total.
“You can make a strong business case for equality but not everyone wants to hear it.” - Prof. Kate Pickett

Mint 20.2 xfce w/nemo - AMD A10 7700K APU - spdif to Bifrost DAC - Dell U2415
some favs: Zim, deadbeef, kid3, gimp, artha, deluge, handbrake, mc
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

Thanks to you both for helping. Please, some more help is needed nevertheless!

Summarizing the situation in short:
  • Linux Mint 18.2 Cinnamon 64-bits
  • No manual changes to any system-wide / user-specific configuration files for ALSA and for PulseAudio yet
  • Using the ALSA devices

    Code: Select all

    hw:CARD=v10,DEV=0
        AudioQuest DragonFly Red v1.0, USB Audio
        Direct hardware device without any conversions
    as the optimum choice, and

    Code: Select all

    plughw:CARD=v10,DEV=0
        AudioQuest DragonFly Red v1.0, USB Audio
        Hardware device with all software conversions
    as an alternate secondary choice
  • Using
    • DeaDBeeF (0.7.2 current from the PPA)
    • Audacious (3.6.2 from Mint repo, while 3.9 is the most recent one - Mint is FAR behind!)
    • and now also Clementine (1.2.3 from Mint repo, while 1.3.1 is the most recent one)
    for audio player testing, with a tendency to prefer DeaDBeeF
  • Setting all players to use the ALSA Output Plugin and tweaking the settings available then as seems appropriate. Yes, they can be set to
    • deselect "always convert 16 to 24 bit"
    • disable/deselect Replaygain
    • ditch the EQ
    • set the player's volume to 100%,
    BUT under Linux 18.2 and DeaDBeeF as well as Audacious I DON'T have
    • "use ALSA resampling" which should be unchecked
    • "release device when stopped" which should be checked,
    while Clementine has even fewer options to set for its ALSA output
    • just a setting "automatic or fixed samplerate".
Unfortunately, my questions and even issues remain:
  1. Why does Audacious choke on the desired "Direct hardware device without any conversions" and throw the error "ALSA error: snd_pcm_hw_params_set_format failed: Invalid argument"? DeaDBeeF is perfectly happy taking the Direct hardware device.
  2. For both Audacious and DeaDBeeF (haven't checked this for Clementine yet): Who is doing the downsampling in case of Audio file (FLAC) samplerates outside the capabilities of my DAC, i.e. for 176.4 and 192kHz? How to get this downsampling to be done properly, i.e. doing 176.4 -> 88.2 and 192 -> 96? Currently my system downsamples BOTH 176.4 and 192 to 96, where the 176.4 -> 96 of course is ill-chosen.
Finally, I should like to get acquainted more with the various configuration files, still for Linux Mint:
  • System-wide and user-specific config files for both ALSA and PulseAudio: What is the config file hierarchy, and which one supersedes which others?
  • Most probably, I can do more to get PulseAudio out of the way, e.g. that "autospawn = no" setting
Just a glimpse on what I am encountering, but deferred to sometime later: Actually, openSUSE Tumbleweed is my main Linux OS for a couple of reasons; (1) being a die-hard Total Commander user on Windows leading to Krusader on Linux leading to KDE leading to openSUSE, (2) a desire to use the latest but stable software versions, s.th. which Mint often isn't up to, leading to Tumbleweed. O my god, Tumbleweed just DOESN'T have the "Dragonfly Direct hardware device without any conversions" and the "Hardware device with all software conversions", just the sick "Default audio device" which outputs everything as 48kHz ... will have to figure that one out ...

In my search for documentation, I have found the Arch Linux Wiki and also the Kodi WIki to be quite helpful. I must say, the main websites by the ALSA and PulseAudio developers are not overly helpful. Hydrogenaudio's thread https://hydrogenaud.io/index.php/topic,94080.0.html does point in the same direction we are taking here, in particular the post https://hydrogenaud.io/index.php/topic, ... #msg825018. Another thread showing up in Google, https://hydrogenaud.io/index.php/topic,104223.0.html, has some config files, but not in agreement to my route (wants to output everything to 24/96 with PulseAudio).

And anyway, regarding the wise words by Hoser Rob: Already by now, I do like my Linux Mint sound box a lot and I can already dive into the music itself. :D It just takes forgetting about question 2 in this post for a little bit in time :( , since 176.4kHz audio files are not found too often, although they do show up (I was hinting at the Grateful Dead, with the famous taper scene all around).

PS: I was running into funny effects along the way. Just doing some settings in the audio player applications' GUIs (not even the config files!), I was treated to "mickey mouse" and "grizzly bear" sounds when something went wrong. Very wrong indeed: The /proc/asound/... samplerate output did show the desired value, nothing wrong. Uuuuuhhh... :lol:
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

Regarding Audacious: I will switch to version 3.9 from the Webupd8 PPA on Monday. MAYBE the issue with "Direct hardware device" disappears?
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

111MilesToGo wrote:Regarding Audacious: I will switch to version 3.9 from the Webupd8 PPA on Monday. MAYBE the issue with "Direct hardware device" disappears?
YES, jumping 2.5 years down the road from the Mint repo version to the current one does in fact cure the Audacious problem with the "Direct hardware device without all conversions". There had been a report in the Audacious Bug Tracker http://redmine.audacious-media-player.o ... opics/1963. Seems to have solved the sample rate problem; going further, however, setting the bit-depth to "automatic" in the ALSA settings exposed by Audacious doesn't work, "24 bits always" are just fine. Not too bad, ... Some more steps to take for the Audacious folks.

Side remark: Another bad issue where Mint (and for such matters their upstream guys at Ubuntu) being so much behind turned out to be quite a hurdle. The other instance for me had been VirtualBox, which to many is more crucial than some specialists' audio settings.

Thus, out of my three big items only the first one is solved. Two are currently left directly related to Mint, and I am still seeking your help:
111MilesToGo wrote:... For both Audacious and DeaDBeeF (haven't checked this for Clementine yet): Who is doing the downsampling in case of Audio file (FLAC) samplerates outside the capabilities of my DAC, i.e. for 176.4 and 192kHz? How to get this downsampling to be done properly, i.e. doing 176.4 -> 88.2 and 192 -> 96? Currently my system downsamples BOTH 176.4 and 192 to 96, where the 176.4 -> 96 of course is ill-chosen.
...

Finally, I should like to get acquainted more with the various configuration files, still for Linux Mint:
System-wide and user-specific config files for both ALSA and PulseAudio: What is the config file hierarchy, and which one supersedes which others?
Most probably, I can do more to get PulseAudio out of the way, e.g. that "autospawn = no" setting
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

In order to bring this thread to a - preliminary! - conclusion, I should like to add two posts, one regarding the ALSA stuff under openSUSE Tumbleweed and Leap 42.3, one giving a summary of the setups that do work for me in getting closer to a near-audiophile, bit-perfect Linux audio setup.

Please bear with me in looking at openSUSE. This is done in order to show that now two Linux distros are created equal. This is my openSUSE Tumbleweed system:

Code: Select all

inxi -Fxzd
System:    Host: susytmblwdke.fritz.box Kernel: 4.12.11-1-default x86_64 (64 bit gcc: 7.1.1)
           Desktop: KDE Plasma 5.10.5 (Qt 5.9.1) Distro: openSUSE Tumbleweed 20170909
Machine:   Device: laptop System: Hewlett-Packard product: HP EliteBook 8560w v: A0001C02
           Mobo: Hewlett-Packard model: 1631 v: KBC Version 01.3F
           UEFI: Hewlett-Packard v: 68SVD Ver. F.63 date: 10/27/2016
Battery    BAT0: charge: 35.8 Wh 92.0% condition: 38.9/38.9 Wh (100%)
           model: Hewlett-Packard Primary status: Discharging
           hidpp__0: charge: 95% condition: NA/NA Wh model: Logitech M705 status: Discharging
CPU:       Dual core Intel Core i5-2540M (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 10376
           clock speeds: max: 3300 MHz 1: 1141 MHz 2: 1243 MHz 3: 1952 MHz 4: 1838 MHz
Graphics:  Card: NVIDIA GF108GLM [Quadro 1000M] bus-ID: 01:00.0
           Display Server: x11 (X.Org 1.19.3) drivers: nouveau (unloaded: modesetting,fbdev,vesa)
           Resolution: 1600x900@59.98hz
           OpenGL: renderer: llvmpipe (LLVM 4.0, 256 bits)
           version: 3.3 Mesa 17.2.0 Direct Render: Yes
Audio:     Card-1 NVIDIA GF108 High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 01:00.1
           Card-2 Intel 6 Series/C200 Series Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Sound: Advanced Linux Sound Architecture v: k4.12.11-1-default
Network:   Card-1: Intel 82579LM Gigabit Network Connection (Lewisville)
           driver: e1000e v: 3.2.6-k port: 5020 bus-ID: 00:19.0
           IF: enp0s25 state: down mac: <filter>
           Card-2: Intel Centrino Ultimate-N 6300 driver: iwlwifi bus-ID: 25:00.0
           IF: wlo1 state: up mac: <filter>
Drives:    HDD Total Size: 2048.4GB (49.7% used)
           ID-1: /dev/sda model: Samsung_SSD_850 size: 2048.4GB
           Optical-1: /dev/sr0 model: PIOR BD-RW BDR-TD05AS
           rev: 1.01 dev-links: cdrom,cdrw,dvd,dvdrw
           Features: speed: 62x multisession: yes
           audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition: ID-1: swap-1 size: 20.15GB used: 0.00GB (0%) fs: swap dev: /dev/sda9
Sensors:   System Temperatures: cpu: 50.0C mobo: 48.0C gpu: 44.0
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 163 Uptime: 0:05 Memory: 1114.9/15989.1MB
           Init: systemd runlevel: 5 Gcc sys: N/A Client: Shell (bash 4.4.121) inxi: 2.3.25
The ALSA cards don't look different from what Linux Mint 18.2 sees:

Code: Select all

aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****                                                  
Karte 0: PCH [HDA Intel PCH], Gerät 0: 92HD81B1X5 Analog [92HD81B1X5 Analog]                    
  Sub-Geräte: 1/1                                                                               
  Sub-Gerät #0: subdevice #0                                                                    
Karte 1: NVidia [HDA NVidia], Gerät 3: HDMI 0 [HDMI 0]                                          
  Sub-Geräte: 1/1                                                                               
  Sub-Gerät #0: subdevice #0                                                                    
Karte 1: NVidia [HDA NVidia], Gerät 7: HDMI 0 [HDMI 0]                                          
  Sub-Geräte: 1/1                                                                               
  Sub-Gerät #0: subdevice #0                                                                    
Karte 1: NVidia [HDA NVidia], Gerät 8: HDMI 0 [HDMI 0]                                          
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 9: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 2: v10 [AudioQuest DragonFly Red v1.0], Gerät 0: USB Audio [USB Audio]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
and

Code: Select all

bash alsa-capabilities -l usb -s
 0) USB Audio Class Digital alsa audio output interface `hw:2,0'
 - device name       = AudioQuest DragonFly Red v1.0                               
 - interface name    = USB Audio                                                   
 - usb audio class   = 2 - isochronous asynchronous                                
 - character device  = /dev/snd/pcmC2D0p                                           
 - samplerates (kHz) = S24_3LE:             44100Hz 48000Hz 88200Hz 96000Hz        
 - monitor file      = /proc/asound/card2/pcm0p/sub0/hw_params                     
 - stream file       = /proc/asound/card2/stream0
However, openSUSE DOES have a different configuration of ALSA devices and aliases underneath:

Code: Select all

aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=PCH
    HDA Intel PCH, 92HD81B1X5 Analog
    Default Audio Device
    
... Stuff removed ...

sysdefault:CARD=v10
    AudioQuest DragonFly Red v1.0, USB Audio
    Default Audio Device
front:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    Front speakers
surround21:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=v10,DEV=0
    AudioQuest DragonFly Red v1.0, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
As can be seen, openSUSE - as opposed to Mint - does not offer the most desirable "Direct hardware device without any conversions" and that "Hardware device with all software conversions". The closest I can get to my goal is the "IEC958 (S/PDIF) Digital Audio Output" device on the Dragonfly Red USB-DAC. This holds for both openSUSE Leap 42.3 and Tumbleweed.
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

Now for a summary on my findings under both Linux Mint and openSUSE and for two audio players, DeaDBeeF and Audacious. It's important to use the latest versions of both players, 0.7.2 and 3.9, resp. Both players are configured to do their output to ALSA. For the following, please remember that my USB-DAC is an Audioquest Dragonfly Red, capable of 16-24 bits and sample rates of 44.1, 48, 88.2 and 96 kHz, but not 176.4, 192k and higher.

These are my findings:
  • Linux Mint 18.2 Cinnamon:
    1. DeaDBeeF 0.7.2:
      1. Direct hardware device without any conversions:
        All input sample rates of 44.1 to 96kHz are sent identical, and 176.4 and 192kHz are both downsampled to 96kHz (176.4->96 being ill-chosen)
      2. IEC958 S/PDIF Digital Out:
        Same as 1.a here
      3. Hardware device with all software conversions:
        Same as 1.a here
    2. Audacious 3.9:
      1. Direct hardware device without any conversions:
        All input sample rates of 44.1 to 96kHz are sent identical, but 176.4 and 192kHz throw an ALSA error
      2. IEC958 S/PDIF Digital Out:
        Same as 2.a here
      3. Hardware device with all software conversions:
        All input sample rates of 44.1 to 96kHz are sent identical, and 176.4 and 192kHz are both downsampled to 96kHz (176.4->96 being ill-chosen)
  • openSUSE Leap 42.3 / Tumbleweed:
    1. DeaDBeeF 0.7.2
      1. IEC958 S/PDIF Digital Out:
        All input sample rates of 44.1 to 96kHz are sent identical, and 176.4 and 192kHz are both downsampled to 96kHz (176.4->96 being ill-chosen)
    2. Audacious 3.9:
      1. IEC958 S/PDIF Digital Out:
        All input sample rates of 44.1 to 96kHz are sent identical, but 176.4 and 192kHz throw an ALSA error
Under both Linux systems, both players send 24 bits / 48 kHz to the USB-DAC when selecting the "Default audio device" - undesirable, of course.

Current result: DeaDBeeF is preferable as compared to Audacious. ALSA device setups can be found under both operating systems which seem to be fulfilling the goal of near-audiophile, bit-perfect output to my USB-DAC. These devices are "Direct hardware device without any conversions" under Mint, and "IEC958 S/PDIF Digital Out" under openSUSE. I did check via the "top" command that PulseAudio doesn't show up in the list of CPU-time consuming processes in these setups. (PulseAudio does show up as a process when the player is set to output to PulseAudio.) CPU usage on my system is reasonably in the 10-20% range, in particular in Mint, and it increases up to 40% in openSUSE with its heavy KDE/Plasma overhead when downsampling the highest input rates has to be done.

Nevertheless, the "bugaboo" questions asked above do remain: Who is doing the ill-chosen 176.4->96kHz downsampling, and how could this be cured in some configuration setting.
jlindgren

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by jlindgren »

For Audacious, use "Direct hardware device without any conversions". That prevents ALSA from doing any resampling.

Then, for the high sample rates that the USB-DAC doesn't support directly, you can configure resampling in Audacious as follows:
1. Go to Output -> Effects
2. Enable the Sample Rate Converter, then click on Settings
3. Check the "Use rate mappings" box and adjust the mappings as desired:

Image
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

jlindgren wrote:For Audacious, use "Direct hardware device without any conversions". That prevents ALSA from doing any resampling.

Then, for the high sample rates that the USB-DAC doesn't support directly, you can configure resampling in Audacious as follows:
1. Go to Output -> Effects
2. Enable the Sample Rate Converter, then click on Settings
3. Check the "Use rate mappings" box and adjust the mappings as desired:
Great, thanks a lot! Works in Audacious under Linux Mint with the "Direct hardware device without any conversions", and - from giving it just a moment's ear - it also seems to work under openSUSE with the "IEC958 S/PDIF Digital Out".

Now DeaDBeeF is a notch behind Audacious, unless I find a similar samplerate mapping in that application. DeaDBeeF internally uses the "Secret Rabbit Code" samplerate converter.

PS: Bringing your alias on this forum and the copyright info for the Audacious Samplerate Converter Plugin together, I am tempted to suppose you are the author of this plugin. If that's true: Great thing to have!
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

To summarize my current progress and status: I got what I called a "near-audiophile, bit-perfect Linux audio setup" working fine under both Linux Mint 18.2 and openSUSE Tumbleweed, employing four audio players under each operating system. Audacious 3.9 and DeaDBeeF 0.7.2 are slim players operating from simple tabbed playlists, while gmusicbrowser 1.1.15 and QuodLibet 3.9.1 are full-scale music management and player apps. In order to install the latest versions, one has to resort to three PPAs under Mint, and one unofficial repo under Tumbleweed; Mint has only one current-version app (gmusicbrowser) in the official repo, Tumbleweed three (Audacious, DeaDBeeF, gmusicbrowser).

All players can be set to do the best possible bit-perfect output to my Dragonfly Red USB-DAC. Some settings have been posted in this thread, while the most comprehensive ones are over at https://www.head-fi.org/threads/bit-per ... ux.561961/. In particular, two posts by Rizlaw have the full settings guide for these players: https://www.head-fi.org/threads/bit-per ... st-7596268 and https://www.head-fi.org/threads/bit-per ... st-7596563.

As of now and to the best of my knowledge, only Audacious has this Samplerate Converter plugin that can be set up for proper downsampling (samplerate mapping) in the case of a DAC which - like the Dragonfly - is limited in its samplerate capabilities.
Faust

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by Faust »

111MilesToGo wrote:To summarize my current progress and status: I got what I called a "near-audiophile, bit-perfect Linux audio setup" working fine under both Linux Mint 18.2 and openSUSE ........
Thank you very much for sharing your work with us here , and taking the time to give so many details .
I've been following your posts since the first one .

As an old-time Hi-Fi nut , I'm fascinated by all of this .
I have a part of my music collection on my laptop , for traveling , and some good quality headphones , but I just assumed that the quality I get is simply
what is available .
I never realized that audiophile quality was a possibility.
This thread has convinced me that it's worth the price of the Audioquest Dragonfly Red just to try it
( I have spent much more on a new cartridge for my turntable in the past ! )

One question comes to mind ( and it may be a dumb one because all of this is new to me ) :-
What music file formats are required to get the full advantage from the Dragonfly Red ?

Thanks again :)
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by 111MilesToGo »

Faust wrote:As an old-time Hi-Fi nut , I'm fascinated by all of this .
Me too.
Faust wrote:I never realized that audiophile quality was a possibility.
This thread has convinced me that it's worth the price of the Audioquest Dragonfly Red just to try it
( I have spent much more on a new cartridge for my turntable in the past ! )
No advertising for a particular brand or device intended, but the Dragonfly Red is just fine and it's very friendly to one's budget given what it does. I had been reading many reviews (What Hifi? in particular), which convinced me to buy it without auditioning. No regrets!
Faust wrote:One question comes to mind ( and it may be a dumb one because all of this is new to me ) :-
What music file formats are required to get the full advantage from the Dragonfly Red ?
The go-to lossless format is FLAC, both in Linux and Windows. It gives a lossless compression of approx. 50% as compared to the uncompressed file format. I must admit that I don't know much about the Apple world - a closed-shop world in contrast to our open-source Linux world, and iTunes to me is shiny bloatware (sorry, folks). IMHO, never go for MP3 or other lossy compressions, even if many people claim they don't hear a difference between the best MP3 and lossless, though some do hear that in a blindfold test. There are two reasons to strictly stick to lossless, e.g. FLAC: (1) Lossless can always be reconverted to the uncompressed full information, lossy never again. (2) In the times of cheap mass storage like HDs, SSDs or big USB sticks, there is no need any longer to compress audio files to s.th. like <10% of the original. So any first step in getting audio files onto your computer shall be lossless, period. If need arises (e.g. for a small phone or a car with a small entertainment system) one can compress FLAC to MP3 or anything else in a second step.

How to get music in lossless FLAC format, and in CD quality (16 bits / 44.1 kHz) or high-resolution (PCM up to 24 bits / 192 kHz or even higher, DSD)? Commercial stuff is available from many record companies (I guess that would be first choice), or web traders (sometimes uhmmm). Legal bootlegs nowadays are available on many websites, and in all sorts of lossless formats and resolutions (cf. e.g. the music of the Grateful Dead). When purchasing hi-rez files on the web, one must be aware that rumor has it that there are some ppl out there who sell upsampled CD quality at a price premium... Looking at the spectrogram of your files (e.g. via tha Spek app available in the official Mint repo) helps discern the good from the bad.

How to get your CD silvers onto the computer? Unfortunately, the go-to application is dBpoweramp (CD ripper and format converter, licensed), which exists only for Windows and Mac. I am running it fine in a Windows 10 machine under VirtualBox in Linux Mint or openSUSE Tumbleweed. dBpoweramp has a huge advantage: It does not only rip the 0's and 1's from a CD onto hard disk, but it does compare the checksum over the audio portion of the ripped file (excluding the metadata) to its database "at home". This process is called AccurateRip, and it is mandatory since the CD Red Book standard was developed with inferior error handling. There is one other app on Windows for the same purpose, EAC (for free), but to me it always seemed hard to handle and slow. dBpoweramp stores FLAC files and many others, but you want FLAC... I am not aware of anything comparable for Linux; and apps like CUEtools do have only part of those features.

What I said here up to this point has the character of being quite definitive, small deviations included. The next thing is a matter of taste: It is really advisable to "tag" your audio files on the computer as thoroughly as possible, i.e. putting textual information into the metadata of the audio files. This greatly helps music management apps like the two mentioned above, and it simply helps you. To my taste, the best tagging app still is Mp3tag (Windows only), with puddletag on Linux being an 80% clone of it (the latter can't read tags from / write tags to external text files). There are many more tagging apps out there, and some audio players as well as the music managers can do tagging as well. Out of habit, I do still stick to Mp3tag on my Windows 10 virtual machine.

For an audio player under Windows, I did mention foobar2000, the go-to solution. And I did mention WASAPI, too.

Hope that helps.

Cheers!
organics1

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by organics1 »

I'm a little late to your party, so forgive me if you've already heard this by now.
Audiophile Linux is "THE" absolute best.
I, too, know next to nothing about linux. I've tried various distros over the last few years. Most have been easy enough to get up and running, but digging in deep hasn't been easy for me. I'm retired and perhaps a bit slow, but the time required for some of this stuff is just beyond me, and mostly because of all the other hobbies that gobble up every minute I can spare.
Several months ago I tried Audiophile Linux. Got it to work after two or three tries. But then I broke it. I reloaded again. And again. And finally got it where I wanted it. I'm not saying I don't goof it up from time to time, but the learning curve for this distro isn't that bad...AND IT'S WORTH EVERY MINUTE! This is, by far, the best sound of anything I've ever encountered. It handles just about every format there is, which is great for me since I use lots of FLAC and DSD downloads. It is incredibly lightweight and will work with the most measeley resources you have available.
I am using a Partaker fanless mini pc with a Celeron processor, 4GB RAM, 256GB M.2 hard drive, and an external hard drive for additional storage.

Another really wonderful sounding distro is DAPHILE. Also extremely lightweight, works on minimal resources, and handles HI-RES audio files with ease.
DAPHILE is the easiest to use. No knowledge of anything necessary. :lol: I use DAPHILE on an old laptop I have.
I have tried a bunch of the usual suspects in the player division, including Media Monkey, JRiver Windows and JRiver Linux, Foobar, VLC, and much of the rest of it. None get even close to the superb, crystal clear sound of Audiophile Linux and DAPHILE. I think a lot of it has to do with the fact that the these two are stand-alone, minimalist operating systems that don't have to do things that can deteriorate the sound.

For regular computing I dual boot WIN7 and Linux Mint. I have Ubuntu on a separate drive that I swap into my big rig when I'm feeling intelligent. :D

Good Luck!
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by Hoser Rob »

organics1 wrote: Wed Jun 06, 2018 12:48 pm I'm a little late to your party, so forgive me if you've already heard this by now.
Audiophile Linux is "THE" absolute best....
"Golden eared" 'audiophile' subjectivist dribble.

It's easy to get bit perfect sound on Linux. The easiest way is to use an external DAC and select the ALSA-USB audio codec in your player if the player supports it. ANy player that doesn't include this is going to be rubbish because it's a complete no brainer for Linux, where all I/O is really just a bit stream.

The #1 thing for computer audio is to avoid resampling. Unlike Windows, where you need the Wasapi/ASIO driver to avoid this, Linux doesn't resample unless you're using software mixing. Not even pulseaudio resamples by default. If you want to see if a Linux setup is resampling audio play a file and execute this in the terminal:

Code: Select all

cat /proc/asound/card?/stream0 | grep Momentary
Also you want to be sure that your DAC/sound card will actually play at 0dB level wiithout distorting. You'd be surprised how many 'audiophile' DACs fail this basic test despite their price and great reviews at Flat Earther 'audiophile' magazines, which are almost all staffed by tech retards or thinly disguised PR hacks. For one example, when Stereophile reviews digital gear they never include the THD+N vs frequency results. Because many of the costly "Golden Ear" products on test would be embarrassed.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
organics1

Re: Steps towards a near-audiophile, bit-perfect Linux audio setup

Post by organics1 »

Your criticism is immediately suspect because you obviously don't understand the difference between basketball, idle chatter, and slobbering. Let me guess: You voted for Fat Donnie.
Granted, by describing APLinux as the absolute best is subjective...but everything dealing with audio IS! I stand by what I said. It worked for me. Just like a remedial English course might work for you.
Locked

Return to “Sound”