Improve quality of sound in PULSEAUDIO for GNU/Linux distros

Discussion in 'Soundcards, Speakers HiFI & File formats' started by anticupidon, Nov 26, 2017.

  1. anticupidon

    anticupidon Ancient Guru

    Messages:
    4,166
    Likes Received:
    873
    GPU:
    Vega/Navi
    Hello gurus!
    Sound quality in modern distros is and was a pet peeve of mine, I can't stand muddy, mushy sound when I know that the same hardware in Windows just rocks...
    So, I wanted to share a nice tweak with notable improvement in sound quality for the modern distros.

    Before anything, make a back-up of the /etc/pulse/daemon.conf, to revert to it, in the case of any issue.

    Alright, follow me.
    Open the terminal with root privileges and type:

    Code:
    sudo nano /etc/pulse/daemon.conf
    I use nano for editing etc/ configuration files, you can use whatever you want (vim, gedit, leafpad, kate...)

    After you opened the configuration file look for this lines:

    Code:
        ; resample-method = speex-float-1
        ; default-sample-format = s16le
        ; default-sample-rate = 44100
    

    The last 2 lines are together, the first is found a bit closer to the beginning of the configuration file.
    Change the 3 lines to the following :

    Code:
        ; resample-method = src-sinc-best-quality
        ; default-sample-format = s24le
        ; default-sample-rate = 96000
    
    Press Ctrl+O to save the changes, press Enter, and Ctrl+X to exit.
    You need to uncomment the lines, as in deleting the "; " sign and deleting the blank space between the line and the left part of the configuration file (just to make sure that the code is clean).

    After, that you need to restart PulseAudio with the following commands:

    Code:
    pulseaudio -k
    
    pulseaudio –start
    Or you can log out, then log in your account.The sound quality will improve, and for me, it was a night and day difference.In the case that sound quality has not improved, or should you experience some bugs or some issues, revert to the default values.
    Cheers!
     
    RzrTrek likes this.
  2. RealNC

    RealNC Ancient Guru

    Messages:
    3,114
    Likes Received:
    1,339
    GPU:
    EVGA GTX 980 Ti FTW
    The src resampler is deprecated. It eats too much CPU for no benefit. The speex float resampler is recommended. speex-float-5 is enough even for hardcore audiophiles.

    Also, unless you remove the leading ";" from these lines, they have no effect.

    Furthermore, if you don't use 96kHz material, you should stick to 48kHz. PulseAudio will switch between 44 and 48 depending on what you play, meaning no resampling is done when not needed.
     
  3. Alexander The Sexy

    Alexander The Sexy New Member

    Messages:
    7
    Likes Received:
    0
    GPU:
    NVIDIA GTX 660
    Hi there,

    If I may make a suggestion?
    Have you considered testing the Open Sound System (OSS)?
    I have used it successfully on my Linux system, and the difference between it and the included ALSA driver is night and day; much higher resolution.
    Apparently, the OSS driver feeds a higher voltage to the sound hardware (in summary) and probably does some other "voodoo" (forgive the pun).
    But I must say, the audio improvement was drastic.

    There is one catch.... no audio in Mozilla FireFox, and the latest version of Google Chrome. The audio did work in version 52.xxx of Chrome, but stopped after updating to the latest version. Both browsers are compiled to use ALSA.
    But every other major software audio player works flawlessly.
    Just remember to completely disable ALSA and reboot the system before installing OSS. The process is reversible.

    My two cents... Cheers.
     
  4. anticupidon

    anticupidon Ancient Guru

    Messages:
    4,166
    Likes Received:
    873
    GPU:
    Vega/Navi
    After months of tweaking, I think I finally found the best settings and from a very reliable source. Anyone here knows Wendel from Level1?
    Here it goes:
    https://forum.level1techs.com/t/improving-linux-audio-updated/134511


    TL-DR;

    Code:
    default-sample-format = float32le
    default-sample-rate = 19200
    alternate-sample-rate = 96000
    default-sample-channels = 5.1
    default-channel-map = front-left, front-right, rear-left, rear-right, center, LFE
    default-fragments = 2
    default-fragment-size-msec = 125
    resample-method = speex-float-10
    enable-lfe-remixing = yes
    high-priority = yes
    nice-level = -11
    realtime-scheduling = yes
    realtime-priority = 9
    rlimit-rtprio = 9
    daemonize = no
     

  5. sverek

    sverek Ancient Guru

    Messages:
    5,438
    Likes Received:
    2,301
    GPU:
    NOVIDIA -0.5GB
    I am not familiar with this program, but 19200 for default sample rate is weird. Why not just use 44100 or 48000 which is half of 96000.

    Most sources will be 44100 / 48000.
     
    INSTG8R likes this.
  6. RzrTrek

    RzrTrek Ancient Guru

    Messages:
    2,352
    Likes Received:
    632
    GPU:
    RX 580 ❤ MESA 19.2
    Your solution didn't improve my audio, but I found that my levels were a bit low in alsamixer and I had to bump my 4/8/16kHz with +3dB in pulseeffects.

    However I've not found an easy fix for youtube always normalizing my videos, though I remember having this issue back on Windows 10 as well.

    I know there was a switch back in Windows, where I could change the power from performance, standard and extreme (very loud), but I've not found the setting anywhere.

    Also having bought a new pair of 250 ohm headphones (will get them next week), it will be interesting to see what kind of soundcards has proper driver support,

    but I know there's a dedicated thread for that topic: https://forums.guru3d.com/threads/onboard-sound-vs-add-in-sound-card.174494/
     
    Last edited: Nov 11, 2019
  7. tdog87

    tdog87 New Member

    Messages:
    1
    Likes Received:
    0
    GPU:
    amd R9 380+
    ... some correction i had to figure out the hard way ... also remove ( ; ) for setting to work "over-ride defaults
    1. (default-sample-format = float32le) --- this is set different for almost every CPU/MB . and should be set to your system , as in my default is (s16le) , and was changed to (s32le) for 32bit sound... when i used float32le my CPU use went into 5-10% and lagged every game... and did not sound as good as s32le ... you need to figure out what your default is then change (16 to "24, or 32"
    ) so if you have float16le , change to float32le or s16be to s32be

    2. (default-sample-rate) .. to run at 96k is strait up - a wast of CPU and on "good/premium hard-ware" sounds Poopy ... 48k sounds best , and minimal impact to CPU, .. use 96k for your (alternate-sample-rate)
    ---------------------
    the biggest impact to sound while up scaling is (resample-method) and to my ears (soxr-vhq) sounded best and i have no performance penalty ..

    resample-method = soxr-vhq
    default-sample-format = s32le
    default-sample-rate = 48000
    alternate-sample-rate = 96000
    ; default-sample-channels = 2
    ; default-channel-map = front-left,front-right

    (my setup is )
    Q9505
    sound blaster x-fi (PCI)
    Crusher Wireless, bass you can feal (S6CRW) "using audio cord wired in"
     
  8. anticupidon

    anticupidon Ancient Guru

    Messages:
    4,166
    Likes Received:
    873
    GPU:
    Vega/Navi
    Well, I have to finish my build and install from 0 .
    Will test your settings, and give some feed back. Your contribution matters.
    And welcome to the forums, enjoy!
     

Share This Page