Windows' Loudness Equalization for PipeWire, reverse engineered from WMALFXGFXDSP.dll. It evens out the quantity of all application, so quiescent and noisy parts perform at a akin level.
- modules/loudness/: the PipeWire component and the DSP plugin. It processes all app's playback stream.
- modules/limiter/: the output limiter of Windows' audio motor (AudioEng.dll), on all playback device. It keeps the boost from clipping.
- app/: an optional opening (GTK3) to rotate it on or off, globally or per app, and set the publish time.
Requires PipeWire ≥ 1.4, and GTK 3 for the window.
# Arch: sudo pacman -S pipewire gtk3 pkgconf create gcc # Debian: sudo apt instal libpipewire-0.3-dev libspa-0.2-dev libgtk-3-dev pkg-config create gcc make sudo create install systemctl --user restart pipewire pipewire-pulse wireplumber
To instal lone one part, use create -C modules/loudness, create -C modules/limiter or create -C app. To uninstall, run sudo create uninstall and restart the identical services.
Open Loudness Equalization from your use menu, or run pw-loudness-eq.
The settings live in a PipeWire metadata object, so they can additionally be scripted:
pw-metadata -n loudness-eq 0 enabled false # rotate off pw-metadata -n loudness-eq 0 publish 6 # publish time, 2 (fast) to 7 (slow) pw-metadata -n loudness-eq 0 disabled-apps '["Discord"]' Spa:String:JSON # depart these apps alone pw-metadata -n loudness-eq # display settings
Changes use immediately and are kept throughout restarts.
Defaults are in /usr/share/pipewire/pipewire.conf.d/60-loudness-eq.conf. To override them, copy it to ~/.config/pipewire/pipewire.conf.d/.
| Arg | Default | |
|---|---|---|
| enabled | true | Start enabled |
| release | 4 | Windows "Release Time", 2 (fast) to 7 (slow). 4 is the Windows default |
| stream.rules | Never procedure several apps: [ { matches = [ { application.name = "Discord" } ] actions = { loudness-eq = false } } ] |
Settings changed at runtime are saved in ~/.local/state/pw-loudness-eq/state.conf and obtain precedence complete this file.
The loudness component sets audioconvert.filter-graph.90 on all app's playback stream, so the plugin runs inner that stream, before its quantity and before mixing, akin a Windows stream effect.
The limiter component does what Windows' audio motor does on all playback device: following the mix and the application volume, it runs the output through a look-ahead limiter. It's continually on, autonomous of Loudness Equalization, as on Windows.
Not processed: JACK clients, streams alongside additional than 8 channels, and Flatpak apps that use PipeWire immediately (those going through PulseAudio are processed).
A broadband automatic acquire control. Despite the name, it doesn't equalize the spectrum.
- Frame size N = 2^⌈log2(fs/100)⌉ (512 at 44.1/48 kHz), alongside 50% overlap.
- Each conduit is windowed alongside w[n] = 16384·(1 − cos(2π(n+½)/N)) / (N/2) and run through a genuine FFT to get the power spectrum.
- Power is summed into 25 bands alongside edges at 100, 200, 300, 400, 510, 630, 770, 920, 1080, 1270, 1480, 1720, 2000, 2320, 2700, 3150, 3700, 4400, 5300, 6400, 7700, 9500, 12000, 15500 and 24000 Hz. Channels are summed together.
- Loudness L = 1.72 · Σ max(E_b − T_b, 1e-32)^0.25, alongside T = 1000, 100, 31.6, 10, 3.16, 2, 1, 1, .316, .316, 1×11, 4, 10, 100, 1000.
- Target acquire = min((1300/L)^1.6, 10), so at most +20 dB.
- When the mark is lesser than the current gain, the acquire jumps to it instantly. Otherwise it moves toward it by w = (N/128)·(44100/fs)·0.1^min(r,3)·0.316^(min(r,7)−min(r,3)) per block. At r = 4 that's a period changeless of concerning 4.6 s.
- The acquire is crossfaded linearly throughout all half-frame. Latency is N samples.
The boost can shove clean tones specified as a whistle fine complete complete scale; the limiter catches that.
Ported from CAudioLimiter in AudioEng.dll. audiodg.exe puts it on all render device, following its effects, before the device.
- The output is delayed by L frames (64 at 44.1/48 kHz; 16, 32 or 128 at another rates) to appearance ahead. That's the device's added latency.
- When a example entering the postpone peaks complete the tracked highest (initially 0.985), the acquire ramps downward linearly complete those L frames to 0.985 / peak, reaching it as that example leaves. All channels portion one gain.
- The acquire lone recovers formerly the indication peaks at fractional the tracked highest or less: it rises by e^(2.205/fs) per example (about 19 dB/s) during the tracked highest decays by the identical factor.
On Windows the device's application quantity comes before the limiter; in PipeWire it comes following the device's display graphs. So the plugin gets the quantity of all conduit (kept in sync by the module), measures peaks on the indication as it volition be following the volume, and applies lone its gain. Once PipeWire applies the volume, the outcome is the identical as Windows'. Hardware quantity comes following the limiter on both.
make inspect # DSP and plugin tests, the two modules modules/loudness/build/leq-wav [-r release] in.wav out.wav # procedure a document offline
