open
nobody
None
2020-01-13
2020-01-06
Anonymous
No

It would be nice, if upmpdcli would in some kind support sending the "replay gain" attributes of tracks / albums to an UPnP control point or external program. The mpd internal replay gain handling is not very robust, and from my perspective useless.

As far as I've understood, it is possible to activate replay-gain handling on albums and tracks within mpd, but setting the "replay_gain_handler" to "none". In this case mpd doesn't adjust the volume itself but a MPD client is able to read the replay gain value of albums/tracks.

This information i.e. could be :

  • added as a element with in the musicTrack audioitem
  • used as parameters for an external script (just like the external volume control of upmpdcli)

Volume adjustment is then done by the control point / script itself.

What do you think?

Discussion

  • medoc
    medoc
    2020-01-06

    There was an interesting discussion about replaygain on the minimserver list:
    https://forum.minimserver.com/showthread.php?tid=1365

    Esp. it seems that there is no standard way to transport the ReplayGain values through UPnP:
    https://forum.minimserver.com/showthread.php?tid=1365&pid=21865#pid21865

     I don't think there is any UPnP standard property for passing this information.
    

    So I'm not sure how upmpdcli can help with this. As you know, it does not access the audio stream, but only the UPnP attributes.

    Also I don't see anything in the MPD API which would allow retrieving the replay gain attributes of a given track. Can you point me to information on the subject ?

    Maybe instead, use one of the mediaserver-side approaches suggested in the discussion ?

    If you have further ideas on the subject, I am interested.

     
  • SF666
    SF666
    2020-01-07

    I see. I came from this idea:

    https://www.musicpd.org/doc/html/user.html#client-hacks


    External Mixer
    The setting mixer_type "null" asks MPD to pretend that there is a mixer, but not actually do something. This allows you to implement a MPD client which listens for mixer events, queries the current (fake) volume, and uses it to program an external mixer. For example, your client can forward this setting to your amplifier.


    but just realized, that the volume control is still made by MPD and upmpdcli is already forwarding the correct volume percentage (after MPD applied replay gain) to the external script. This is actually the original scenario. It works (awfully).

    You're right. MPD reads the replay gain tags, but doesn't dump them on the "currentsong" command. Therefore, I will file a feature request at MPD forum. Without this information you can do nothing.

    UPnP: There is no standardized way of transferring those TAGS to a control point. You could just add the replay-gain attributes to the "res" element of the DIDL-Lite container (DIDL-Lite/item/res) next to the other musicItem attributes (nrAudioChannels, bitrate, ...).

     
  • medoc
    medoc
    2020-01-08

    I'm still not sure of how this would work ? Let's assume that mpd exports the replaygain values in the currentsong info. So upmpdcli has access to it. What happens next ?

    Also: what's wrong with the mpd replaygain support ? Would not it be better to have this fixed than to implement an external mechanism ?

     
  • SF666
    SF666
    2020-01-08

    Yes, MPD should fix this and I've found this entry:

    https://github.com/MusicPlayerDaemon/MPD/issues/434

    It's marked as feature request, so let's see what happens.

    Meanwhile :)

    Actually, I intended to implement something similar: An external script or UPnP control point can adjust the volume by a mapping between db levels and percent-values of my USB-DAC.

     
  • medoc
    medoc
    2020-01-11

    At this point I am a bit lost... Is there anything I can do in upmpdcli right now to help you with this ?

     
  • Anonymous
    Anonymous
    2020-01-13

    Not yet, thanks. I'm in a discussion with MPD support here:

    https://forum.musicpd.org/viewtopic.php?f=11&t=8024

    The discussion in the MPD thread helped me to clear what I actually intended to do. Once (if ever) the information will be made available to MPD clients, I'd come back here.

     

Cancel   Add attachment