MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.16k stars 348 forks source link

per-output volume control #434

Open tremby opened 5 years ago

tremby commented 5 years ago

I see that a patch for this was posted to the mailing list a few years ago:

http://mailman.blarg.de/pipermail/mpd-devel/2015-October/000445.html

It doesn't look like that was ever finished or merged.

It's a feature I'd very much like to see; it'd be very useful for multi-room audio setups.

It looks like one hangup was how to treat the master volume. If that's still an issue, what about this approach?

This would give backward compatibility without introducing any complicated proportional adjustment logic.

miccoli commented 5 years ago

I would suggest a different approach:

At least for the ALSA mixer plugin this would be fairly simple: you just have to redefine the volume mapping so that MPD volume 100 does not correspond to full scale but to full scale minus attenuation.

The attenuation could be set in the config file, plus a new command in the MPD protocol to change the attenuation of the individual outputs.

See also #219.

tremby commented 5 years ago

I don't want the outputs to always have the same volume ratios.

Your suggested behaviour might be useful in some situations, but wouldn't fulfill my usage pattern.

I don't see the relevance of the issue you linked.

tremby commented 5 years ago

Oh, I missed the part where you suggested a command to alter the different outputs' attenuations. That would work. That makes it more like the patch I linked to in my original post, I think.

miccoli commented 5 years ago

@tremby The relevance of the other issue is linked to the need to have an API in MPD that allows direct control of the mixer settings in terms of dB gain. If I got it right, in MPD volume control is 0...100 (arbitrary units) that are mapped to the audio card internal settings by the individual output plugins. How this mapping is done is unspecified. It would be very useful to have an API in which I can

This would allow a lot of interesting applications and also a more accurate implementation of ReplayGain

In a multi-room audio system I would like to have

And finally, yes, my approach is very similar to the original patch, but defined in terms of dB, and not as the product of arbitrary loudness scales.