bluetooth: Update source software volume on AVRCP SetAbsoluteVolume
authorMarijn Suijten <marijns95@gmail.com>
Sat, 27 Mar 2021 09:53:07 +0000 (10:53 +0100)
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>
Mon, 17 May 2021 14:50:03 +0000 (14:50 +0000)
commit710a35cdc3581afc52ea167d42681bfecae5dd4f
tree77c44b4bcfa59d4558754e91674cb84d1e0970dc
parentc098a75d107c5fcfc6a6b1558f183f1b1d57b1f8
bluetooth: Update source software volume on AVRCP SetAbsoluteVolume

The A2DP spec mandates that the audio rendering device - the device
receiving audio, in our case a `pa_source` - is responsible for
performing attenuation:

AVRCP v1.6.2, ยง5.8:
    The SetAbsoluteVolume command is used to set an absolute volume to be used by the rendering device.

BlueZ models this call as a change of the `Volume` property on the
`org.bluez.MediaTransport1` interface.  Supporting Absolute Volume is
optional but BlueZ unconditionally reports feature category 2 in its
profile, mandating support.  Hence remote devices (ie. a phone) playing
back audio to a machine running PulseAudio assume volume is to be
changed through SetAbsoluteVolume, without performing any local
attenuation.

Future changes will implement this feature the other way around: setting
an initial value for the `Volume` property as well as propagating
`pa_source` volume changes back to the peer.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/239>
src/modules/bluetooth/bluez5-util.c
src/modules/bluetooth/bluez5-util.h