Does EBU R128 Loudness Normalization have clip protection?
-
I have a collection of around 60K flac files with music ranging from classical to jazz to techno and have, with the help of AI, looked at enabling EBU R128 and what the potential issues may be.
Looking through the EBU R128 loudness normalization code (
ebur128analysis.cpp,enginebase.cpp,gstenginepipeline.cpp) to understand how it applies gain, and I can't find any peak/clip protection in that path — but I'd like to check whether I'm missing something before assuming that's the case.What I've found so far
The gain applied is computed simply as
target_lufs - measured_lufs(EngineBase::Load), converted to a linear multiplier (10^(gain_dB/20)), and applied via a dedicatedvolumeelement (volume_ebur128_) created inGstEnginePipeline::InitAudioBin. I don't see any peak check, clamping, or limiter anywhere in that path.By contrast, the ReplayGain path creates a
rgvolume → rglimiter → rgconverterchain, andrglimiter'senabledproperty is tied to the "Apply compression to prevent clipping" setting in Backend settings. I don't see an equivalent for EBU R128 anywhere — no limiter element, no max-peak setting, nothing referencing clipping in the EBU R128 code path.Why I'm asking
I ran an external loudness scan (
rsgain custom -t -l -23, true peak, -23 LUFS target to match Strawberry's default) against my own library and computed what the post-normalization peak would be (measured true peak + computed gain). On a large, classical/opera/jazz-heavy portion of my library, a meaningful number of tracks come back with a post-normalization peak above 0 dBFS — some by quite a lot (one Vivaldi slow movement comes out over +10 dB above 0 dBFS after normalization). These are mostly quiet, sustained passages (adagios, largos, recitative, solo guitar) that are naturally low LUFS but still carry the recording's full dynamic peak elsewhere.My question
If EBU R128 normalization doesn't have clip protection built in, is that intentional (e.g. relying on the user to pick a conservative target LUFS, or on downstream limiting elsewhere in the audio pipeline/output device), or is this a gap that just hasn't been addressed yet? And if it's the latter, would something like ReplayGain's optional limiter (or a max-peak setting, similar to what tools like
rsgain's Custom Mode offer via-c/-m) be a reasonable feature request?Happy to share my test data/scripts if useful.