Comment 10 for bug 1509557

Revision history for this message
Daniel Schürmann (daschuer) wrote : Re: remember gain adjustments in ReplayGain values

What is your target Loudness?

I have just tested the track as mp3 and I cannot reproduce the clipping with the recommended default loudness of -16 LUFS and replay gain applied. The track plays also in almost the same loudness then my other tracks.

But I have noticed that the original track is already clipping without applying any gain.

This is possible due to the lossy nature of mp3. If you level a track to digital full scale and pass it to a lossy codec, the
output samples can reach values on top of the digital full scale.
This happens, because of two reasons.
1: the codec adds a amount of "noise" the track original sample at 1 + noise = clipping.
2: a track leveled at digital full scale can be considered as already clipping, since a digital track is already a "compressed" appearance of the original analog sound. The DAC circuit in you soundcard reintroduces the voltage level between the samples, and can reach likely values above full scale in between two samples at full scale.
Something similar happens inside the mp3 codec when transforming to the frequency domain.

Conclusion: Tracks leveled at digital full scale are broken (of bad quality)

However the MAD codec used in Mixxx is able to output fixed point samples above digital full scale.
Unfortunately they are clamped by the following code in Mixxx 1.12. This means you will experience an undesired distorsion / noise when playing such an effected track. This is independent from the following gain settings.

Mixxx "master" has a full floating point engine, which does not clamp such a track anymore.
Here you can reduce the gain of the track, in a way that all track samples are below the clipping threshold.
Of cause this reduces the loudness of Mixxx (but you can increase it at the amp :-P )