Improve Linux audio playback quality? |
![]() ![]() |
Improve Linux audio playback quality? |
Dec 12 2012, 14:28
Post
#1
|
|
|
Group: Members Posts: 12 Joined: 31-August 08 Member No.: 57750 |
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). |
|
|
|
Dec 12 2012, 16:37
Post
#2
|
|
|
Group: Members Posts: 144 Joined: 1-March 11 Member No.: 88621 |
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. |
|
|
|
Dec 12 2012, 16:59
Post
#3
|
|
|
Group: Members Posts: 12 Joined: 31-August 08 Member No.: 57750 |
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. |
|
|
|
Dec 12 2012, 17:44
Post
#4
|
|
![]() Server Admin Group: Admin Posts: 4808 Joined: 24-September 01 Member No.: 13 |
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. |
|
|
|
Dec 12 2012, 17:59
Post
#5
|
|
|
Group: Members Posts: 46 Joined: 7-February 12 Member No.: 96993 |
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 This post has been edited by 2012: Dec 12 2012, 18:01 |
|
|
|
Dec 12 2012, 18:28
Post
#6
|
|
|
Group: Members Posts: 230 Joined: 21-February 05 Member No.: 20022 |
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 |
|
|
|
Dec 12 2012, 19:23
Post
#7
|
|
![]() Group: Members Posts: 1066 Joined: 4-May 04 From: France Member No.: 13875 |
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. This post has been edited by skamp: Dec 12 2012, 19:28 -------------------- Save my friend from going homeless: http://outpost.fr/url/308w
|
|
|
|
Dec 13 2012, 09:18
Post
#8
|
|
|
Group: Members Posts: 12 Joined: 31-August 08 Member No.: 57750 |
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. |
|
|
|
Dec 18 2012, 22:16
Post
#9
|
|
|
Group: Members Posts: 46 Joined: 7-February 12 Member No.: 96993 |
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 This post has been edited by 2012: Dec 18 2012, 22:18 |
|
|
|
May 9 2013, 20:25
Post
#10
|
|
|
Group: Members Posts: 230 Joined: 21-February 05 Member No.: 20022 |
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. |
|
|
|
May 10 2013, 12:53
Post
#11
|
|
|
Group: Members Posts: 46 Joined: 7-February 12 Member No.: 96993 |
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 # 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 defaults.pcm.rate_converter "soxr_lsr" You can alternatively use "soxr_lsr_HQ", "soxr_lsr_MQ" or "soxr_lsr_LQ". |
|
|
|
May 10 2013, 13:09
Post
#12
|
|
|
Group: Members Posts: 144 Joined: 14-February 12 Member No.: 97162 |
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 This post has been edited by phofman: May 10 2013, 13:09 |
|
|
|
May 10 2013, 22:29
Post
#13
|
|
|
Group: Members Posts: 230 Joined: 21-February 05 Member No.: 20022 |
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? |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 25th May 2013 - 23:21 |