it-artikel:linux:how-to-enable-audio-normalization-a.k.a.-audio-compression-a.k.a.-audio-dynamic-range-compression-under-linux

How to enable audio normalization a.k.a. audio compression a.k.a. audio dynamic range compression under Linux?

Under Windows its been around for many years already, installed by default and included pretty much with every sound driver. The user would just need to click a checkbox to enable it. With Linux it isnt that easy yet and most people are not even aware of it. But Linux offers a vast variety of messing with the audio path and signals in real time. Way more and better than you can with windows. However, as always with Linux, it requires some research and reading/learning first.

With Linux we make use the pulseaudio audio server, which is default with pretty much every Linux distro these days, and the Steve Harris' LADSPA Plugins, available from your distro's online repository. Then we just tell the pulseaudio daemon (our local audio server) to add in an audio compressor plugin into our audio path and make it the “default audio sink” or “default audio output device”. And voila! From now on you'll have proper clean leveled audio on your Linux installation. No more games, videos or music suddenly “screaming” or shouting at you.

Well, that might not be a thing for audiophiles and lovers of classic music, who prefer to have a large dynamic audio range. But for anyone else who prefer so “set audio level and forget”, THIS is a very nice, easy and fast solution, that is been tested on Ubuntu 22.04 LTS.

Additional notes and bits:

  • :!: This has been tested/used on Installations with just ONE audio interface! If you have more than one audio interface (like hot pluggable bluetooth or usb headsets or speakers), more steps and adjustments might be necessary to make it work and “stable” — Axel Werner 2023-09-14 06:32.
  • :!: For UBUNTU 20.04 and older : Seems with older UBUNTU LTS Versions there is no “modular approach” (no /etc/pulse/default.pa.d/ directory) like with UBUNTU 22.04. This means you'll need to add the code to the end of your main /etc/pulse/default.pa File instead. Don't forget to make a backup copy of this file, beforehand!

Installation and Setup:

  1. Since “pulseaudio” is already preinstalled for us, all we need are the ladspa plugins and the pulseaudio mixer (optional but good for debugging and testing):
    sudo apt install -y swh-plugins pavucontrol
  2. Next, we just out a small (modular) configuration file for our pulseaudio daemon in the /etc/pulse/default.pa.d/ directory and add the ladspa compressor that we like:
    cat > /etc/pulse/default.pa.d/ladspa-compressor.pa <<'EOF'
    
    .ifexists module-ladspa-sink.so
    .nofail
    
    # mono compressor
    #load-module module-ladspa-sink sink_name=compressor plugin=sc4m_1916 label=sc4m control=1,1.5,401,-30,20,5,12
    
    # stereo compressor
    load-module module-ladspa-sink sink_name=compressor plugin=sc4_1882 label=sc4 control=1,1.5,401,-30,20,5,12
    
    set-default-sink compressor
    
    .fail
    .endif
    
    EOF
  3. Now either reboot or just restart your pulseaudio daemon within your session, to make it reload the new configuration to activate it.
    pulseaudio -k
    
  4. Restart your Audio Apps (like firefox or whatever) so they can reconnect the the audio server . THATS IT! Enjoy!

Btw: BIG THANKS to +Gotbletu on YouTube and Twitter (@gotbletu) for finding and showing me a solution this is based on!! THANKS MATE!

Axel Werner 2018-06-25 06:26

it-artikel/linux/how-to-enable-audio-normalization-a.k.a.-audio-compression-a.k.a.-audio-dynamic-range-compression-under-linux.txt · Last modified: 2023-09-15 14:29 by axel.werner.1973@gmail.com