Better handling of ReplayGain for song RG in random playback

Issue description:

I’m using Navidrome and have switched to Symfonium specifically because it has ReplayGain support. I’ve been testing this using the ReplayGain Test Vectors, and while ReplayGain does work in Symfonium, there is a noticeable delay of about 1-2 seconds before ReplayGain changes are applied to the audio. This results in a jarring shift in volume in a lot of instances where a large amount of gain needs to be applied.

Repro steps are pretty much to use any files with ReplayGain tags (the ones I’ve linked above are what I used in the logs, but this behaviour can be seen in other ‘normal’ music files as well), enable ReplayGain (I’ve tried each of the modes, but have used Track in the logs), then play and you’ll notice the volume change isn’t instant.


debug.log (157.9 KB)


Can’t think of any that would help here, but happy to add some if needed.

Additional information:

ReplayGain works fine when playing these same files via Navidrome in a desktop client, or through a browser, so I think this isn’t a configuration issue, but as I’ve just started using Symfonium it might be a setting within the app causing this?

Well yes this is the limits of current ExoPlayer solution :frowning:

Due to Gapless implementation the preload on mid quality mp3 can be large before the replay gain is applied.

For the most common use cases of flac or playing albums with album RG (or auto) this is not an issue but when playing random songs without empty time on start / end and large RG changes this can be problematic.

I’m not sure I can disable gapless on Exoplayer for that use case (I’ve asked there) but the other solution would be to apply RG on the source file via ffmpeg as I intend to do to apply RG to Chomecast.

Next release will have an option for that mode.