[connect] Inconsistent volume normalisation in "album" mode
Description
Using the options "--enable-volume-normalisation --normalisation-gain-type album" should play albums at a consistent volume level, i.e. prevent volume jumps between tracks. This does not seem to work, however. An example where this can clearly be noticed are the first two tracks of the album "Opeth - Sorceress": Without volume normalisation, there is clean transition between "Persephone" and "... Sorceress" at a similar volume level. With volume normalisation turned on (album gain), the second track starts with a substantially lower volume.
Version
At least since version 0.6.0 up to the current version 0.8.0
How to reproduce
Steps to reproduce the behavior in librespot e.g.
- Launch
librespotwith '--enable-volume-normalisation --normalisation-gain-type album' - Connect via Spotify connect.
- Play an album (e.g. the above mentioned "Opeth - Sorceress") where consecutive tracks have significantly different average volume levels.
- Notice the volume jump at the transition between the tracks, which disappears when normalisation is turned off (and is also not present when the tracks are played directly via the Spotify app (i.e. without using 'librespot') regardless of normalisation being activated in the app)
Host (what you are running librespot on):
- OS: Linux
- Platform: RPi 3B
To diagnose, what happens if you set it to track mode or leave it at auto?
Also please provide a verbose log so we can see what it’s doing.
I have tried track and auto as well. All settings lead to the same volume jump between the tracks. I have also seen no obvious difference in the logs between theses settings. The interesting parts are probably:
Track 1 (Persephone):
[2025-11-17T22:14:43Z INFO librespot_playback::player] <Persephone> (112866 ms) loaded [2025-11-17T22:14:43Z WARN librespot_playback::player] This track may exceed dBFS by 2.42 dB and be subject to 4.42 dB of dynamic limiting at its peak. [2025-11-17T22:14:43Z DEBUG librespot_playback::player] Normalisation Data: NormalisationData { track_gain_db: 2.4226226806640625, track_peak: 0.68017578125, album_gain_db: 2.4226226806640625, album_peak: 0.68017578125 } [2025-11-17T22:14:43Z DEBUG librespot_playback::player] Calculated Normalisation Factor for Album: 132.17%
Track 2 (Sorceress):
[2025-11-17T22:16:08Z INFO librespot_playback::player] <Sorceress> (349093 ms) loaded [2025-11-17T22:16:12Z TRACE librespot_core::dealer] Sent ping [2025-11-17T22:16:12Z TRACE librespot_core::dealer] Received pong [2025-11-17T22:16:37Z DEBUG librespot_connect::state::tracks] finished filling up next_tracks (14) [2025-11-17T22:16:37Z DEBUG librespot_playback::player] command=Load(SpotifyUri("spotify:track:5mY8mY7DSfuqVbY2psq3Cg"), true, 0) [2025-11-17T22:16:37Z DEBUG librespot_playback::player] Normalisation Data: NormalisationData { track_gain_db: -8.277918815612793, track_peak: 1.036327600479126, album_gain_db: -8.277918815612793, album_peak: 1.036327600479126 } [2025-11-17T22:16:37Z DEBUG librespot_playback::player] Calculated Normalisation Factor for Album: 38.56%
So the album normalisation values are equal to the track values (and both differ between the tracks). Which is consistent to the audible volume jump. I would have expected different track values but the same album values for both tracks.
Yes that also stands out for me. I’m traveling now so can’t check myself, but is it any different for you on other albums?
Now that I know what to look for: It's actually different between albums, e.g.:
Pink Floyd - The Division Bell => same album gain for all tracks => no volume jumps Pink Floyd - The Dark Side Of The Moon => different album gain for each track => volume jumping between tracks
What's interesting, however: The Spotify app can play all these albums without volume jumps when normalisation is activated there (i.e. direct output, not using librespot),