Skip to main content

Topic: Improve Linux audio playback quality? (Read 11972 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Cromulent
  • [*]
Improve Linux audio playback quality?
Please note that I am not talking about encoding here, just the audio output of the system.

I'm running Arch Linux and all is working well. I use ALSA for audio but was wondering if there were any known settings that can help in terms of audio playback quality?

I'm well aware of the fact that I need a dedicated sound card to get the best results but I'm looking for a short term solution to make sure that the on-board sound card is performing at its best. I'm pretty new to audio stuff on Linux so I would be grateful for any advice.

When I have enough cash to spare I'll be getting an Asus Xonar DGX 5.1 PCI-E sound card (unless someone can recommend a better one).

  • yourlord
  • [*][*][*][*]
Improve Linux audio playback quality?
Reply #1
The first question I would ask is what makes you feel there is a problem with your existing audio quality?

There are a lot of factors to consider in Linux when it comes to audio, but in general if you get audio from the output it's probably as good as it's gonna get. While ALSA has it's quirks, I don't think audio quality is one of them.

Also, what is your requirement that makes the onboard audio inadequate for you? There are situations where a discrete audio card makes sense, but generally the audio quality from most modern onboard audio outputs is usually good enough that you would be hard pressed to tell a difference from a dedicated card.

  • Cromulent
  • [*]
Improve Linux audio playback quality?
Reply #2
The first question I would ask is what makes you feel there is a problem with your existing audio quality?

There are a lot of factors to consider in Linux when it comes to audio, but in general if you get audio from the output it's probably as good as it's gonna get. While ALSA has it's quirks, I don't think audio quality is one of them.

Also, what is your requirement that makes the onboard audio inadequate for you? There are situations where a discrete audio card makes sense, but generally the audio quality from most modern onboard audio outputs is usually good enough that you would be hard pressed to tell a difference from a dedicated card.


Like most things in the audio world I'm just going off what is normally said. I have no way to verify the claims but everyone seems to rave about the difference between on board and a dedicated sound card.

  • Garf
  • [*][*][*][*][*]
  • Developer (Donating)
Improve Linux audio playback quality?
Reply #3
Quite a few (I'd even say: most) of the on-board soundcards are capable of meeting or getting very close to CD quality (96 db SNR, reasonably flat frequency response up to 20kHz with little distortion).

I'd check what you have first, and think about what you need, before plunking money down.

  • 2012
  • [*][*][*]
Improve Linux audio playback quality?
Reply #4
but everyone seems to rave about the difference between on board and a dedicated sound card.


In the subject of quality audio output perceptual by the human ear, I would say almost no one who knows what he/she is talking about said this. Not in the last decade anyway.

Back to your original question. Some of us believe that the resampling algorithm used by dmix (by default) produces a quality loss that is perceptual by the human ear. This information and a proposed solution is conveniently available in the ArchWiki:
https://wiki.archlinux.org/index.php/Advanc...lity_resampling
  • Last Edit: 12 December, 2012, 12:01:19 PM by 2012
saldl: A lightweight well-featured CLI downloader optimized for speed and early preview.
https://saldl.github.io

Improve Linux audio playback quality?
Reply #5
but everyone seems to rave about the difference between on board and a dedicated sound card.


In the subject of quality audio output perceptual by the human ear, I would say almost no one who knows what he/she is talking about said this. Not in the last decade anyway.

Back to your original question. Some of us believe that the resampling algorithm used by dmix (by default) produces a quality loss that is perceptual by the human ear. This information and a proposed solution is conveniently available in the ArchWiki:
https://wiki.archlinux.org/index.php/Advanc...lity_resampling
I hope that any developer that has the interest and spare time would make it possible to use SoX instead of libsamplerate/SSRC and Speex with Pulseaudio (and ALSA?) since to my knowledge SoX is lighter on the CPU and has better specification/sound which can be seen on the infinitewave web site.

  • skamp
  • [*][*][*][*][*]
  • Developer
Improve Linux audio playback quality?
Reply #6
On-board DACs are pretty good these days. Unless you hear electronic noise / interference, a standalone sound card or external DAC probably won't make much of a difference. The one problem with on-board audio is often very high output impedance (I measured my laptop at 70Ω, and some Xonar models were measured at 100Ω!). It could (not necessarily) adversely affect the frequency response
  • and dampening factor of your headphones; another possible problem is insufficient power (not loud enough). The fix for both issues is a headphone amplifier with a low output impedance, ideally near 0Ω.

  • The effect of an output impedance of just 22Ω on balanced armature IEMs whose impedance varies greatly with frequency (exagerated mids, no treble):



    Conversely, here's the effect of my laptop's output impedance of 70Ω on my 25Ω Denon AH-D2000:



    A slight 1 dB bump in the sub-bass region. Not much to write home about, so YMMV. My laptop doesn't get loud enough, though.
  • Last Edit: 12 December, 2012, 01:28:43 PM by skamp
See my profile for measurements, tools and recommendations.

  • Cromulent
  • [*]
Improve Linux audio playback quality?
Reply #7
but everyone seems to rave about the difference between on board and a dedicated sound card.


In the subject of quality audio output perceptual by the human ear, I would say almost no one who knows what he/she is talking about said this. Not in the last decade anyway.

Back to your original question. Some of us believe that the resampling algorithm used by dmix (by default) produces a quality loss that is perceptual by the human ear. This information and a proposed solution is conveniently available in the ArchWiki:
https://wiki.archlinux.org/index.php/Advanc...lity_resampling


Thank you everyone for the information. I just wanted to know if there were any settings that I had missed.

As for the sound card thing I'm glad to hear that it is not essential. Saves me some cash.

  • 2012
  • [*][*][*]
Improve Linux audio playback quality?
Reply #8
I hope that any developer that has the interest and spare time would make it possible to use SoX instead of libsamplerate/SSRC and Speex with Pulseaudio (and ALSA?) since to my knowledge SoX is lighter on the CPU and has better specification/sound which can be seen on the infinitewave web site.


I modified the libsamplerate code in alsa-plugins to use libsoxr-lsr (upstream wrapper mostly compatible with libsamplerate's API).

Everything seems to work except the VHQ quality profile (possibly due to high delay).

I profiled aplay with perf* and It looks like libsoxr uses ~10 times less cycles than samplerate_best (SRC_SINC_BEST_QUALITY).

Profiles/qualities tested and working:
LQ (with artifacts)
MQ
SOXR_16_BITQ
HQ
SOXR_24_BITQ (with artifacts).

I can share the [glue] code if there is interest.

* playing a 15sec wav file [s16le, 44100Hz, Stereo] > dmix 48000Hz
  • Last Edit: 18 December, 2012, 04:18:49 PM by 2012
saldl: A lightweight well-featured CLI downloader optimized for speed and early preview.
https://saldl.github.io

Improve Linux audio playback quality?
Reply #9
I hope that any developer that has the interest and spare time would make it possible to use SoX instead of libsamplerate/SSRC and Speex with Pulseaudio (and ALSA?) since to my knowledge SoX is lighter on the CPU and has better specification/sound which can be seen on the infinitewave web site.


I modified the libsamplerate code in alsa-plugins to use libsoxr-lsr (upstream wrapper mostly compatible with libsamplerate's API).

Everything seems to work except the VHQ quality profile (possibly due to high delay).

I profiled aplay with perf* and It looks like libsoxr uses ~10 times less cycles than samplerate_best (SRC_SINC_BEST_QUALITY).

Profiles/qualities tested and working:
LQ (with artifacts)
MQ
SOXR_16_BITQ
HQ
SOXR_24_BITQ (with artifacts).

I can share the [glue] code if there is interest.

* playing a 15sec wav file [s16le, 44100Hz, Stereo] > dmix 48000Hz

2012, that would be really interesting to try out but I can't compile though unless you have some guide lines for it. Regards.

  • 2012
  • [*][*][*]
Improve Linux audio playback quality?
Reply #10
2012, that would be really interesting to try out but I can't compile though unless you have some guide lines for it. Regards.


Could you be more specific. What compilation errors are you seeing?

Guideline:
Code: [Select]
# Assumptions:
# 1] You have some experience with building software from source
# 2] soxr already installed with headers

git clone git://git.alsa-project.org/alsa-plugins.git
cd alsa-plugins
wget http://ompldr.org/vaWQzNg/Initial-soxr-lsr-support.patch
patch -Np1 <Initial-soxr-lsr-support.patch
autoreconf -fis
./configure
make # If you have errors in avcodec_* functions, then your ffmpeg/libav version installed is not compatible. Go back to ./configure and pass --disable-avcodec
make install


If all goes well, then you can add to "/etc/asound.conf":
Code: [Select]
defaults.pcm.rate_converter "soxr_lsr"


You can alternatively use "soxr_lsr_HQ", "soxr_lsr_MQ" or "soxr_lsr_LQ".
saldl: A lightweight well-featured CLI downloader optimized for speed and early preview.
https://saldl.github.io

  • phofman
  • [*][*][*][*]
Improve Linux audio playback quality?
Reply #11
2012, did you check the actual output waveform? I detected some missing samples (audibly as well as visually in audacity). IMO there is a minor defficiency in handling the buffer borders.

I am in the process of writing native soxr resapling plugin, I will see. Just the contents of rate_soxr.c is still missing, still a long way to go
  • Last Edit: 10 May, 2013, 08:09:48 AM by phofman

Improve Linux audio playback quality?
Reply #12
2012, that would be really interesting to try out but I can't compile though unless you have some guide lines for it. Regards.


Could you be more specific. What compilation errors are you seeing?
What I meant was I am not very experienced when it comes to compiling programs except where I have ben given the commands to use. Regards.

  • AHD
  • [*]
Improve Linux audio playback quality?
Reply #13
...
When I have enough cash to spare I'll be getting an Asus Xonar DGX 5.1 PCI-E sound card (unless someone can recommend a better one).


I compared and Asus Xonar DS with SB Audigy2: The audio manipulation on Audigy2 cards  - tone:bass/treble or an equalizer, both hardware! sounds much better than any other card i tried, its cheap too (35 €), but needs a pci slot on your mb. The 190khz/32bit on the Xonar card doesnt make an audible difference. (tested with hi end teufel 5.1 set)

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Improve Linux audio playback quality?
Reply #14
Hi and welcome.

Would you mind substantiating these subjective claims with objective evidence per the rules of this forum which you agreed to follow when registering?
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • AHD
  • [*]
Improve Linux audio playback quality?
Reply #15
Hi and welcome.

Would you mind substantiating these subjective claims with objective evidence per the rules of this forum which you agreed to follow when registering?


Yer, Sorry.. but i only can bring subjective claim on this subject.

  • skamp
  • [*][*][*][*][*]
  • Developer
Improve Linux audio playback quality?
Reply #16
The audio manipulation on Audigy2 cards  - tone:bass/treble or an equalizer, both hardware! sounds much better than any other card i tried


Would you mind substantiating these subjective claims with objective evidence per the rules of this forum which you agreed to follow when registering?


If he's comparing one card with active EQing, to other cards without it, I don't think TOS8 applies. He's comparing two very different signals.
See my profile for measurements, tools and recommendations.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Improve Linux audio playback quality?
Reply #17
Hi and welcome.

Would you mind substantiating these subjective claims with objective evidence per the rules of this forum which you agreed to follow when registering?


Yer, Sorry.. but i only can bring subjective claim on this subject.

Then it shouldn't be brought.
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Improve Linux audio playback quality?
Reply #18
If [...(then)] I don't think TOS8 applies.

Based on the way he worded his post it does apply; even if he were comparing HW eq to SW eq it would still apply, but this really doesn't concern you.

If I thought this were a more egregious offense the post would have been binned.  Instead I took it as an opportunity to state that this forum expects more in the way of the presentation of preferences as they relate to sound quality, in the event that AHD did not read TOS8.  While it is wholly possible that this is an exception, most noobs don't bother reading the TOS and then act surprised when we actually enforce them.
  • Last Edit: 07 June, 2013, 02:16:26 PM by greynol
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • koplo
  • [*]
Improve Linux audio playback quality?
Reply #19
I think we should announce to the traditional audiophiles,
it is time now we all should migrate to computer audiophile systems.
To replace the spinning-CD transport with terrabyte SSD.
There's already ExactAudioCopy, RubyRipper, & else, (choose JACK, no ALSA, unisntall PulseAudio),
and no ErrorCorrectionCode, and using SSD inside laptops (no spinning HDD).
And in the future, many manufacturers will create more pure digital amplification like NAD M2 (bye-bye tube, bye-bye bipolar),
and interface like Berkeley Alpha USB,
so there are no analogs at all, even at the loudspeakers' terminals.
The sound ?
Even really challenge the 100,000 vinyl+tube systems, with the cost of under 15,000 !

  • phofman
  • [*][*][*][*]
Improve Linux audio playback quality?
Reply #20

  • skamp
  • [*][*][*][*][*]
  • Developer
Improve Linux audio playback quality?
Reply #21
Unsure. Jack is a low latency mixer. It works well, but so does the mixer built into ALSA (albeit not low latency).
See my profile for measurements, tools and recommendations.

  • cpchan
  • [*][*][*][*]
Improve Linux audio playback quality?
Reply #22
(choose JACK, no ALSA, unisntall PulseAudio),


Huh, JACK is only a low-latency audio server, it still output sound via the underlying audio system. On Linux it defaults to ALSA unless you set it up to use OSS4. If you are not doing any audio work that required extremely low latency, there is really no point in using it.