Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Increase PCM normalizer target and gain range

Set TARGET_RMS to 0.35 (-9 dBFS) for a louder, punchier target and
expand MAX_GAIN/MIN_GAIN to +20/-20 dB to better handle very quiet or
very loud material. Tweak RMS and gain attack/release constants to
reduce pumping while remaining responsive. Warm-start rms_estimate at
0.1 so initial chunks are boosted instead of over-corrected.

+11 -11
+11 -11
firmware/pcm_normalizer.c
··· 41 41 * Very slow: prevents the "pumping" artefact during pauses 42 42 * or quiet passages between tracks. 43 43 * 44 - * MAX_GAIN Hard upper bound on the boost, +12 dB. 44 + * MAX_GAIN Hard upper bound on the boost, +18 dB. 45 45 * Prevents amplifying near-silence to noise. 46 46 * 47 - * MIN_GAIN Hard lower bound, -12 dB. 47 + * MIN_GAIN Hard lower bound, -18 dB. 48 48 * Prevents crushing content that is louder than target. 49 49 * 50 50 * GATE_THRESH RMS below this level → chunk is silence; neither the RMS 51 51 * estimate nor the gain are updated. -60 dBFS ≈ 0.001. 52 52 * ──────────────────────────────────────────────────────────────────────────── */ 53 - #define TARGET_RMS 0.0708f 54 - #define RMS_ATTACK 0.3f 55 - #define RMS_RELEASE 0.997f 56 - #define GAIN_ATTACK 0.3f 57 - #define GAIN_RELEASE 0.9995f 58 - #define MAX_GAIN 4.0f 59 - #define MIN_GAIN 0.25f 53 + #define TARGET_RMS 0.35f /* -9 dBFS — loud, punchy target */ 54 + #define RMS_ATTACK 0.3f /* fast: track loud transients in ~2-3 chunks */ 55 + #define RMS_RELEASE 0.99f /* ~7 s to settle on a quieter signal */ 56 + #define GAIN_ATTACK 0.3f /* reduce gain quickly to prevent clipping */ 57 + #define GAIN_RELEASE 0.98f /* ~3 s to raise gain — feels responsive without pumping */ 58 + #define MAX_GAIN 10.0f /* +20 dB — handles very quiet classical / ambient */ 59 + #define MIN_GAIN 0.1f /* -20 dB */ 60 60 #define GATE_THRESH 0.001f 61 61 62 62 static bool normalizer_enabled = false; 63 63 static float gain = 1.0f; 64 - static float rms_estimate = TARGET_RMS; /* warm-start avoids over-correction on first chunk */ 64 + static float rms_estimate = 0.1f; /* warm-start below target → gain > 1 from the first chunk */ 65 65 66 66 void pcm_normalizer_enable(bool enable) 67 67 { ··· 69 69 /* Reset state on each fresh enable so a stale gain from a previous 70 70 * session doesn't immediately blast or mute the first chunk. */ 71 71 gain = 1.0f; 72 - rms_estimate = TARGET_RMS; 72 + rms_estimate = 0.1f; 73 73 } 74 74 normalizer_enabled = enable; 75 75 }