• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required as is 20 years of participation in forums (not all true). There are daily reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

DAC different sound in Linux

Torus

Member
Joined
Oct 21, 2021
Messages
6
Likes
3
Hi everyone,

I discovered ASR a while ago now, which led me to buy the TempoTec Sonata HD Pro(still in v.3.0 since I don't know how to upgrade it to 3.3.1), which I've coupled with my HD6XXs. This has been my entry setup for a year now, and I'm pretty happy with it so far. I've been using it on an old HP laptop with Beats Audio(turned off) in Windows 10, and it sounds really good overall. I haven't done too much tweaking like using ASIO/WASAPI and all that, but it seems to sound good nonetheless.

Booting up into Linux though, is a different story. I'm using elementary OS 6 Odin(Ubuntu 20.04). It sounds fine, but kinda grainy, everything is more forward and not as open. I just prefer the sound quality on Windows. I've done most the steps to modify the audio settings, with the exception of keeping the resampling method to speex-float-10, and I think it may have sounded richer and fuller, but not sure. It still didn't sound as open as Windows, like the soundstage wasn't really there at all.

I did a little more reading and saw that the CS43131 chip that my Sonata HD Pro was listed in the new support for the CS43130 driver in Linux Kernel 5.15rc6. I installed that version, and I think it did sound a bit better, but wasn't quite there. I then installed PipeWire, the replacement for Pulseaudio, and it did get even closer to Windows in quality, but still not exactly the same. I figured I would try PipeWire because we're all gonna be switching to that eventually.

Is it true that there are differences in sound quality in USB DACs in different OS's? I thought USB was universal, and it meant plug and play. Anyone here have a similar experience, and is there a high quality USB DAC that works as well in Linux like it does in Windows?
 

alpha_logic

Member
Forum Donor
Joined
Aug 16, 2021
Messages
83
Likes
119
My Linux setup sounds better than my windows audio setup, but that's subjective. Try the soxr-vhq for the resampling method, which measures best last time I looked. Here's my pulse daemon conf for your reference:

Code:
# always upsample to 2 or 4 x integer!
default-sample-format = float32le
#default-sample-format = s24le

# no upsampling
default-sample-rate = 44100
alternate-sample-rate = 48000

# 2x upsampling
#default-sample-rate = 88200
#alternate-sample-rate = 96000

# 4x upsampling
#default-sample-rate = 176400
#alternate-sample-rate = 192000

# hybrid upsampling - 2x for 44.1khz, 4x for 48khz
#default-sample-rate = 88200
#alternate-sample-rate = 192000

default-sample-channels = 2
avoid-resampling = yes
default-channel-map = front-left,front-right
default-fragments = 2
default-fragment-size-msec = 125
#resample-method = speex-float-10
resample-method = soxr-vhq
remixing-produce-lfe = no
remixing-consume-lfe = no
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 9
rlimit-rtprio = 9
daemonize = no
flat-volumes = no

Ideally though, you don't want to resample at all, but play back your input without resampling it. On windows this is called bit-matched playback. Even though some older pulseaudio documentation recommends using resampling, I haven't seen an issue with setting 'avoid-resampling = yes' since Ubuntu Focal (Pulseaudio Version 13).
 
Last edited:
OP
Torus

Torus

Member
Joined
Oct 21, 2021
Messages
6
Likes
3
Okay, I edited /etc/pulse/daemon.conf with a fresh install of eOS 6, but didn't install the 5.15 kernel or PipeWire. I changed a few things like set the resampling method to soxr-vhq. I kept avoid-resample the same. I realized I forgot to edit a few things like flat-volume = no, and setting the default-sample-channel and default-channel-map. Here is what my daemon.conf looks like now:
Code:
daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

 high-priority = yes
 nice-level = -15

 realtime-scheduling = yes
 realtime-priority = 9

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

 resample-method = soxr-vhq
 avoid-resampling = yes
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
 remixing-produce-lfe = no
 remixing-consume-lfe = no
; lfe-crossover-freq = 0

 flat-volumes = no

; rescue-streams = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
 rlimit-rtprio = 9
; rlimit-rttime = 200000

 default-sample-format = float32le
 default-sample-rate = 44100
 alternate-sample-rate = 96000
 default-sample-channels = 2
 default-channel-map = front-left,front-right

 default-fragments = 2
 default-fragment-size-msec = 125

; enable-deferred-volume = yes
deferred-volume-safety-margin-usec = 1
; deferred-volume-extra-delay-usec = 0

I think I do notice a difference. I think there is starting to be a better separation, but not as open as Windows yet. The bass is still kinda muddy compared to Windows. I played a track where the bass would normally be clear and fill the area, and it was present, but not as clear in Linux. It doesn't sound bad by any means, but it sounds better in Windows.

I know that when it comes to my laptop speakers, they sound terrible in Linux vs Windows. This old HP laptop has Beats Audio, and uses the Realtek ALC3241 chip, and it sounded like it was coming from a tin can. It seems like it's having a similar effect on my headphones despite using a USB DAC. Is there any other reason this could be happening, and does anyone else with the TempoTec Sonata HD Pro experience this with Linux vs Windows?
 
Last edited:

reverbel

Member
Forum Donor
Joined
May 5, 2021
Messages
26
Likes
19
Don't know about the TempoTec DAC dongle, but I use Linux with another DAC and was able to avoid resampling by switching to the Strawberry Music Player (https://www.strawberrymusicplayer.org).

I am running Ubuntu 20.04 and have not yet upgraded from Pulseaudio to PipeWire. Strawberry allows me to completely bypass Pulseaudio and send audio to the sound card (or to an USB DAC) via ALSA. This way the sound is much better. Audio is played at the original resolution and sampling rate, up to 24 bits and 192 kHz.

In my case the audio goes to a Loxjie D30 DAC connected via USB. You should be able to do the same with the TempoTec DAC. Look at the Backend Settings in Strawberry.
 

Attachments

  • Screenshot from 2021-10-22 01-49-12.png
    Screenshot from 2021-10-22 01-49-12.png
    83 KB · Views: 147
  • Screenshot from 2021-10-22 01-57-34.png
    Screenshot from 2021-10-22 01-57-34.png
    1.4 MB · Views: 161
Last edited:
OP
Torus

Torus

Member
Joined
Oct 21, 2021
Messages
6
Likes
3
I just tried Strawberry Music Player today. I was already on Windows so I decided to try that out first, and played through WASAPI. It sounds better than MS Groove. Now I've booted into eOS 6(Ubuntu 20.04), and tried it. Wow, it sounds a lot better! I think on one track I did notice the bass wasn't as clear as it was on Windows, but I don't know if I'm just hearing things or not. I feel like the sound on Linux might be a bit louder, but on Windows a bit clearer and maybe a bit more open, but both sound great on Strawberry.

I do also listen to music on YouTube Music on High(256kbps AAC). I know it's not lossless, but should be "good enough", and on Spotify(free). I wish there was a way to get ALSA working everywhere in Linux, but I know that's not possible to do so in every app. I don't know what the potential of PipeWire is. It's supposed to be a replacement for Pulseaudio and JACK(low latency and supposedly higher quality, kind of like ALSA). If it does replace JACK, then it should bring higher quality audio everywhere, but didn't seem to make it quite as good as Windows on just YouTube videos and all that. It should have made it on par with Linux, right?

I just don't understand. A DAC, which is connected by USB, should sound the same everywhere. When searching up for best DACs for Linux, you get things like AudioQuest Dragonfly, which is a bit old and FiiO E10K. These DACs don't measure nearly as well as the TempoTec Sonata HD Pro, which is supposedly one of the best USB DAC out there right now.
 

reverbel

Member
Forum Donor
Joined
May 5, 2021
Messages
26
Likes
19
I wish there was a way to get ALSA working everywhere in Linux, but I know that's not possible to do so in every app. I don't know what the potential of PipeWire is. It's supposed to be a replacement for Pulseaudio and JACK(low latency and supposedly higher quality, kind of like ALSA). If it does replace JACK, then it should bring higher quality audio everywhere, but didn't seem to make it quite as good as Windows on just YouTube videos and all that. It should have made it on par with Linux, right?

What is kind of confusing is that ALSA has two parts: (1) a set of kernel-level drivers for sound cards, USB DACs, etc, and (2) userspace libraries that interface with these kernel-level ALSA drivers. Most sound cards don't support hardware mixing, so they cannot be used for more than one application program at the same time. The userspace ALSA libraries address issues such as the mixing of audio streams. A sound card is typically used by just one program: a "sound server", which receives audio streams from various application progams and mixes theses streams (possibly with the help of the userspace ALSA libraries) into a single audio stream, which is sent out to the sound card via a kernel-level ALSA driver. This scheme lets various application programs play audio at the same time, but none of these progams accesses the sound card directly. The "sound server" has monopolistic access to the sound card.

Pulseaudio, JACK and Pipewire are all sound servers in the sense described above. All of them use kernel-level ALSA to reach the sound cards. There is no other way to reach a sound card in Linux. So kernel-level ALSA is in action whenever you play audio in Linux. The userspace ALSA libraries, on the other hand, may or may not be used. Pulseaudio uses these libraries, but Pipewire can be configured to bypass them entirely and rely solely on the kernel-level ALSA code.

Since audio mixing involves resampling, the digital audio stream that reaches a sound card through a sound server (Pulseaudio, or Jack, or Pipewire) is typically different from the original one, i.e., it is hardly ever identical to the audio stream that the sound server received from the music player. There may be some audio quality degradation, which depends on the sound server. This is what you avoid by configuring Strawberry to bypass the Pulseaudio server and send audio directly to a sound card via a kernel-level ALSA driver. Of course, by configuring Strawberry this way you are also granting it monopolistic access to the sound card.

See https://wiki.debian.org/ALSA.

See also the discussion in this Reddit thread: https://www.reddit.com/r/archlinux/comments/ae67oa .
 
Last edited:

reverbel

Member
Forum Donor
Joined
May 5, 2021
Messages
26
Likes
19
A DAC, which is connected by USB, should sound the same everywhere.

No, because the digital audio stream may be modified some software component (such as a sound server) before it reaches the DAC.
 

Lambda

Major Contributor
Joined
Mar 22, 2020
Messages
1,419
Likes
1,155
Maybe try raw ALSA without pulse audio or pipewire before trying to debug puls or pipewie?
 

reverbel

Member
Forum Donor
Joined
May 5, 2021
Messages
26
Likes
19

Another option would be to leave Pulseaudio enabled, tell it to output audio to the built-in sound card and speakers, and configure your music player to bypass Pulseaudio and send the audio stream to a USB DAC, via ALSA. Strawberry lets you do this.

With this arrangement, Strawberry does not perform any resampling. I didn't check if the audio stream is bit perfect, but see no reason why it wouldn't be. The music played by Strawberry goes to the USB DAC. System sounds and all other audio go to the built-in speakers via Pulse.
 

dc655321

Major Contributor
Joined
Mar 4, 2018
Messages
1,447
Likes
1,866
If resampling is causing audible degradation, then it is broken and yes, should be bypassed.

I've understood more recent versions of pulseaudio use libsoxr for resampling, so should be largely without such issues. Is that not the case? Demonstrably?
 

moosso

Member
Joined
Aug 5, 2021
Messages
15
Likes
8
I uninstalled pulseaudio and pipewire on my fedora linux, because pulseaudio will do resampling anyway (it can avoid resampling for 2 sampling rate by setting default-sample-rate and alternate-sample-rate, but third one still resampling). In addition, fedora will redirect alsa to pipewire if pipewire-alsa is installed, that application use alsa client library will still output audio stream to pipewire before going to the sound card.
If you leave pulseaudio or pipewire on, you may need to check /etc/alsa/conf.d and alsamixer to confirm the distribution did not redirect you alsa.
 
OP
Torus

Torus

Member
Joined
Oct 21, 2021
Messages
6
Likes
3
I uninstalled pulseaudio and pipewire on my fedora linux, because pulseaudio will do resampling anyway (it can avoid resampling for 2 sampling rate by setting default-sample-rate and alternate-sample-rate, but third one still resampling). In addition, fedora will redirect alsa to pipewire if pipewire-alsa is installed, that application use alsa client library will still output audio stream to pipewire before going to the sound card.
If you leave pulseaudio or pipewire on, you may need to check /etc/alsa/conf.d and alsamixer to confirm the distribution did not redirect you alsa.
The thing is, I've been testing on Strawberry Music Player, which just uses ALSA through the sound card, and I still hear a difference between Linux and Windows. It must be something other than Pulseaudio.
have you checked if there is any enhancement going on in the windows driver? cause the APO wont work via Alsa
I don't know how to check out the Windows driver. I'm guessing it's proprietary, or there's no documentation I can find.

Has anyone else tested both Windows and Linux sound quality with this DAC?
 

reverbel

Member
Forum Donor
Joined
May 5, 2021
Messages
26
Likes
19
Has anyone else tested both Windows and Linux sound quality with this DAC?
I haven't been dealing with audio on Windows for a long time.

The thing is, I've been testing on Strawberry Music Player, which just uses ALSA through the sound card, and I still hear a difference between Linux and Windows. It must be something other than Pulseaudio.
Could the difference be caused by some APO that Windows uses by default and is quite hard to turn off?

This thread mentions a "hidden non defeatable APO":
 

reverbel

Member
Forum Donor
Joined
May 5, 2021
Messages
26
Likes
19
``... if your music system is Windows based, to guarantee no funny business from Windows audio, install EAPO even if you don't use filtering, and shut off "original APOs".``

Quoted from this post, which contains more tips for Windows users:
 

moosso

Member
Joined
Aug 5, 2021
Messages
15
Likes
8

Oh I didn't notice that, thanks for the information.

The thing is, I've been testing on Strawberry Music Player, which just uses ALSA through the sound card, and I still hear a difference between Linux and Windows. It must be something other than Pulseaudio.

If you have RME ADI-2 you can use it to test whether your configuration is bit perfect, I have tested these combination can pass the bit test:
- Linux alsa + audacious (32bit will cut down to 24bit, otherwise fine)
- Linux alsa + mplayer (without -volume flag, all passed)
- Windows foobar + asio (all passed)
Or maybe you could use aplay (command that directly play wav file with alsa) to check whether the sound is different from windows, if both environment is bit perfect then it shouldn't have any difference.
 

starsail0r

New Member
Joined
May 9, 2022
Messages
1
Likes
0
Don't know about the TempoTec DAC dongle, but I use Linux with another DAC and was able to avoid resampling by switching to the Strawberry Music Player (https://www.strawberrymusicplayer.org).

I am running Ubuntu 20.04 and have not yet upgraded from Pulseaudio to PipeWire. Strawberry allows me to completely bypass Pulseaudio and send audio to the sound card (or to an USB DAC) via ALSA. This way the sound is much better. Audio is played at the original resolution and sampling rate, up to 24 bits and 192 kHz.

In my case the audio goes to a Loxjie D30 DAC connected via USB. You should be able to do the same with the TempoTec DAC. Look at the Backend Settings in Strawberry.
Thanks so much for the suggestion. Are there further practices that you follow with your dac on linux?
 
Last edited:
Top Bottom