Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Replay gain
#1
Like many I have a mixed Library of sources, years,  and differing file types.
Recorded levels are thus quite variable and, having tired of manually adjusting, I spent some time adding replay gain tags.

Used rsgain as it handles a very wide range of formats including .wav.
Only to find that MPD has a limited range of file support and .wav is not one. No bother, will just convert the few .wav to flac.

However, I am unsure as to how MPD handles the volume adjustment...perhaps someone can illuminate ?

From the MPD documentation


Quote:ReplayGain is usually implemented with a software volume filter (which prevents Bit-perfect playback).
To use a hardware mixer, set replay_gain_handler to mixer in the audio_output section (see Configuring audio outputs for details)
Quote:To configure an audio output manually, add one or more audio_output blocks to mpd.conf:

audio_output {
    type "alsa"
    name "my ALSA device"
    device "hw:0"
}

ProtoDac has no mixer and I have volume Disabled so 0db output.

mpd.conf contains

Code:
replaygain "auto"
replaygain_preamp "0"
volume_normalization "no"
and audio output section there

Code:
audio_output {
type "alsa"
name "ALSA Default"
device "_audioout"
mixer_type "none"
dop "no"
stop_dsd_silence "no"
thesycon_dsd_workaround "no"
}

Listening confirms replay gain is operating but what is MPD using to make the adjustment ? Software Volume ? if so where is that configured ?
----------
bob
Reply
#2
The MPD replaygain files are in the source tree.
https://github.com/MusicPlayerDaemon/MPD

Try "Go to file" replaygain and have a look at Analyzer.cxx. I think this file implements the algorithm.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Thanks Tim.
It appears that MPD uses the software volume libraries, if I read the docs correctly.
This tallies with what I am hearing.
Ok for background random play but I will have to remember to turn RG off for any serious listening.

Next to try is another MoOde player that does have a Hardware Mixer and see if setting replay_gain_handler to mixer in the audio_output section works. One player for random and another for serious ? Might have to have a reminder as to how to make changes to mpd.conf stick through reboots :-)

Later today I will change volume type from disabled to software on the ProtoDac player and see if the replay gain corrections show dynamically in the MoOde volume control ?
----------
bob
Reply
#4
AFAIK replaygain adjustments are done before main volume control and so should not affect its value?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
The main volume control being the MPD volume shown on the player page ?
If RG uses software volume ahead of main volume and main volume is set to software then two processings.

It would be very interesting to have the main volume visually reflect the dynamic RG adjustments. :-)
I'll play a little more and perhaps enter a feature request to the mpd maintainer. (wish me luck)
----------
bob
Reply
#6
The knob volume is same as internal MPD volume level reported by for example "mpc volume".

Theres a dev tweaks feature for maintaining custom mpd.conf settings (compliments of @bitlab)
https://moodeaudio.org/forum/showthread....3#pid47753

For sure the difference in loudness of music, movies, TV shows etc is one of the most annoying things. For music replaygain and volume normalization help somewhat but the result is YMMV.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
@Tim Curtis
'The knob volume is same as internal MPD volume level reported by for example "mpc volume"'

Ah..yes so only downstream from RG..
I will ask at mpd-site if the mpd volume could report mpd-replay_gain
----------
bob
Reply
#8
That doesn't seem right since replaygain normalizes the output volume and MPD volume is acting as the master volume in the pipeline. MPD volume is not just a display value, it actually changes the output volume and so you definitely don't want its value jumping around. That would defeat the purpose of replaygain.

If you want to see the replaygain tags for a given track it could prolly be added to Audio info but I don't have any test tracks with replaygain tags so...
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#9
(04-03-2024, 11:44 AM)Tim Curtis Wrote: That doesn't seem right since replaygain normalizes the output volume and MPD volume is acting as the master volume in the pipeline. MPD volume is not just a display value, it actually changes the output volume and so you definitely don't want its value jumping around. That would defeat the purpose of replaygain.

If you want to see the replaygain tags for a given track it could prolly be added to Audio info but I don't have any test tracks with replaygain tags so...

I can't figure out how I would want to use this information and how I would want to see it presented. As I understand the MPD docs, one or the other of the album or track replaygain values may be operative while a track is being played and there's the pesky MPD replaygain_preamp parameter as well. All these are expressed in dB, while the volume value returned by MPD is expressed as a percentage.

Apart from that, since MPD doesn't include any replaygain_* tag in its set of supported tags, the info isn't present in the MPD database or returned either by mpc or via the MPD protocol. You'd have to parse them yourself. Can mediainfo or one of its ilk do the job?

I try to keep up-to-date a test directory of well-tagged files representing all the major encodings/containers (MP3, FLAC, yada, yada, yada) but like Tim I have nothing with replaygain_* tags so ....

Regards,
Kent
Reply
#10
Ok, if there are no replaygain tags exported by MPD then its a no-go.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: