Replay Gain in Mopidy

Hi - I’m a new user of Mopidy, and it’s all fun so far. One thing that strikes me immediately: why no ReplayGain support? Playing back my local MP3 collection, I have to ride the volume control non-stop. I’m sure others have encountered this.

I’m wondering if there’s some design reason for the lack of replay gain. The documentation is quite explicit that it’s not supported. There seems no development discussion about it here or on Github.

I presume there are some backends that can’t support it… but then isn’t that equivalent to the basic case when an MP3 has no replaygain tags stored? And if it’s not a development priority then fine, but there’s also the chance that it’s deliberate. I’d like to know because one day I might go poking around to see if I can implement it…

I think it’s fair to say it’s just not a priority. But you could presumably just configure your output setting to include the rgvolume element.

how? some hint?
My audio output setting is just this: output = alsasink

I have zero experience with using it. But that Gstreamer documentation specifies the following example which I guess you can adapt to something like output = rgvolume ! audioconvert ! audioresample ! alsasink. That’s about the only hint I can offer.

gst-launch-1.0 filesrc location=filename.ext ! decodebin ! audioconvert
! rgvolume ! audioconvert ! audioresample ! alsasink

rvolume requires your media to include the specified ReplayGain meta data tags, no idea if many radio streams include them. You can add those tags to your local files.

If you are using Spotify, then it does it’s own normalisation (but only between Spotify tracks) when you enable Mopidy-Spotify’s volume_normalization setting (default is true).

I will try. This issue is really annoying… Radio streams plays loud, while mp3/CD/flac plays at low volume and you constantly need to raise/lower.

Having just tested this i can confirm that it does sound as though it works. looking at Gstreamer it seems to want tags like GstReplaygain but my files are tagged with with TXXX=replaygain style tags and it seems to accept them. Certainly everything sounds a similar volume

Seems to be working on my system.

To install replaygain:
sudo apt install replaygain

In /etc/Mopidy.conf:
output = rgvolume ! audioconvert ! audioresample ! alsasink

To add the Replaygain tag to all the MP3 files in the directory tree:
find . -iname *mp3 -exec /usr/bin/replaygain {} \;