(2014-05-24, 16:21)MGA1500 Wrote: PS. An alternative (learnt it from muffinman) is to add an ALSA sink that uses ALSA softvol. An out-of-XBMC volume channel can be configured through a custom .asoundrc file and a piece of code that presents itself as a volume control to alsa and can implement anything.
This is not entirely correct.
The way I would propose to have some more control over volume in XBMC is to allow volume control in the ALSA sink to be done via a mixer device in ALSA instead of the internal volume control of XBMC. This requires a similar setup as is already there in the PULSE sink. So, this in no way requires an extra sink. It does require an expert user option in which the user can set the mixer device, mixer, and index to diverge from the default internal volume control. I think this is a clean and in some cases useful extension of the existing ALSA implementation.
For unidirectional volume control all it requires is the function SetVolume() to be set. To be bi-directional I think it requires an extra thread to keep track of changes happening at the ALSA end (unless there is someway to trigger such a synchronization at some time interval?).
This benefits those who have a soundcard with hardware volume control (increased sound quality) and allows one to have other applications to handle volume control*. This setup is also present in applications such as MPD and Shairport. However, whatever happens at this end is not of any relevance to XBMC, it shouldn't and doesn't care. All it does is sync volume with an ALSA device/mixer.
Kind regards, Maarten
*) I've created an app that syncs volume changes back and forth between in ALSA and RS232 (quite configurable so suitable for a broad range of amplifiers that carry a serial interface). All it requires is that the ALSA dummy soundcard is loaded (modprobe snd_dummy) and that applications such as XBMC allows setting the mixer device, mixer, and index. So, this is not as complicated as suggested above.