DEV Community

LeoJulieta
LeoJulieta

Posted on

PipeWire’s Loudness Equalizer: Consistent Volume on Linux

PipeWire’s New Loudness Equalization: Windows‑Style Volume Consistency for Linux

Introduction

Ever been jolted by a sudden volume spike when you switch from a quiet tutorial to a booming music stream? You’re not alone—Linux users have been battling unpredictable loudness for years, often resorting to clunky equalizers or manual gain tweaks.

Now PipeWire, the fast‑growing multimedia server that’s replacing PulseAudio and JACK, ships a Windows‑style Loudness Equalization module. It automatically smooths out those abrupt jumps, giving you a consistent listening experience across every app—no extra software, no manual fiddling. In this article we’ll show why the feature matters, walk through the exact commands to enable and tune it, and demonstrate real‑world results on a typical Linux desktop.


How Loudness Equalization Works (In a Nutshell)

  • What it does: Continuously measures perceived loudness (using the EBU R128 standard) and applies gentle gain‑control so the output stays within a target LUFS range.
  • What it isn’t: A graphic equalizer. It doesn’t boost or cut specific frequencies; it only adjusts overall level in real time.
  • Why it matters: Eliminates the “loud‑quiet‑loud” roller‑coaster that makes you constantly reach for the volume knob.

Enabling the Module on Your System

PipeWire ships the module as libpipewire-module-loudness. Most distributions keep it disabled by default.

1. Verify PipeWire version

pipewire --version
# Expected output: 0.4.12 or newer (released March 2024)
Enter fullscreen mode Exit fullscreen mode

If you’re on an older release, update via your package manager (sudo dnf upgrade pipewire, sudo apt install pipewire, etc.).

2. Load the module manually (temporary)

pw-cli create-node \
  factory.name=adapter \
  node.name=loudness-eq \
  media.class=Audio/Source \
  module.loudness.target-lufs=-23 \
  module.loudness.compression-ratio=1.5
Enter fullscreen mode Exit fullscreen mode

You should now hear a smoother transition when switching apps. This configuration disappears after a reboot.

3. Enable it permanently (system‑wide)

Create or edit /etc/pipewire/pipewire.conf.d/99-loudness.conf:

context.modules = [
  { name = libpipewire-module-loudness
    args = {
      target.lufs = -23          # Target loudness (LUFS)
      compression.ratio = 1.5   # Gentle compression
      attack = 5ms               # Fast response
      release = 100ms
    }
    flags = [ ifexists ]
  }
]
Enter fullscreen mode Exit fullscreen mode

Then restart PipeWire:

systemctl --user restart pipewire
Enter fullscreen mode Exit fullscreen mode

4. Toggle from a GUI (if available)

  • GNOME Settings → Sound → Advanced → Loudness Equalization – switch it on.
  • KDE System Settings → Audio → PipeWire → Loudness – enable the toggle.

Fine‑Tuning the Parameters

Parameter Typical Value Effect
target.lufs -23 (broadcast level) Sets the loudness you want all streams to converge to.
compression.ratio 1.5 – 2.0 Higher values compress more aggressively.
attack 5 ms – 20 ms Faster attack reduces sudden spikes quicker.
release 80 ms – 200 ms Longer release smooths the decay, preventing “pumping”.

Adjust them on the fly with pw-metadata:

pw-metadata -n pipewire.loudness set target.lufs -22
pw-metadata -n pipewire.loudness set compression.ratio 1.8
Enter fullscreen mode Exit fullscreen mode

Changes take effect instantly, no restart required.


Real‑World Example: YouTube → Spotify → Terminal Alerts

# Start a YouTube video (low volume)
xdg-open "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# After a minute, launch Spotify (normally louder)
spotify &

# Finally, trigger a terminal bell
printf '\a'
Enter fullscreen mode Exit fullscreen mode

Before loudness equalization: The Spotify track blasts at +10 dB relative to the video, and the terminal bell is almost inaudible.

After enabling the module: All three sources sit within a 2‑dB window, and the bell is clearly audible without raising the master volume.


FAQ

1. Does PipeWire copy Microsoft’s code?

No. The module is a clean‑room implementation that reproduces the perceptual behavior of Windows’ Loudness Equalization using open‑source standards (EBU R128, dynamic range compression).

2. Is it safe for critical listening (e.g., music production)?

The default settings are deliberately mild (ratio ≈ 1.5:1). Professionals can either lower the compression ratio to ≤ 1.2 or disable the module entirely for DAW sessions.

3. Will it increase CPU usage?

Negligible. On a typical modern laptop the module consumes < 1 % of a single core, well within the headroom of any desktop environment.

4. Can I apply it per‑application?

PipeWire’s node‑based architecture lets you create separate loudness adapters per stream, but the simplest approach is a system‑wide module. Advanced users can script per‑app nodes with pw-cli.

5. What if I run both PulseAudio and PipeWire?

Most distros now ship PipeWire as a PulseAudio replacement (pipewire-pulse). If you still have the legacy daemon running, stop it (systemctl --user stop pulseaudio) and enable the PipeWire socket (systemctl --user enable --now pipewire.socket).


Bottom Line

PipeWire’s Loudness Equalization gives Linux the same “set‑and‑forget” volume consistency that Windows users have enjoyed for years—without proprietary code or third‑party hacks. With a few terminal commands or a single GUI toggle, you can tame abrupt volume swings, improve daily listening comfort, and keep your workflow distraction‑free.

Give it a try on your distro today, fine‑tune the parameters to match your listening habits, and enjoy a smoother audio experience across every application.


Herramienta mencionada: Railway

Top comments (0)