[pulseaudio-discuss] [RFC v0 15/15] bluetooth: Update to volume control in BlueZ 5
Mikel Astiz
mikel.astiz.oss at gmail.com
Mon Jan 7 08:49:04 PST 2013
Hi Tanu,
On Wed, Jan 2, 2013 at 2:18 PM, Tanu Kaskinen <tanuk at iki.fi> wrote:
> On Wed, 2012-12-19 at 13:58 +0100, Mikel Astiz wrote:
>> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
>>
>> In BlueZ 5, the microphone and speaker gains are exposed as properties
>> of the MediaTransport1 interface.
>> ---
>> src/modules/bluetooth/bluetooth-util.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
>> index 16aee20..8c96cc1 100644
>> --- a/src/modules/bluetooth/bluetooth-util.c
>> +++ b/src/modules/bluetooth/bluetooth-util.c
>> @@ -1578,6 +1578,12 @@ void pa_bluetooth_transport_set_microphone_gain(pa_bluetooth_transport *t, uint1
>> pa_assert(t);
>> pa_assert(t->profile == PROFILE_HSP);
>>
>> + if (t->device->discovery->version >= BLUEZ_VERSION_5) {
>> + set_property(t->device->discovery, t->owner, t->path, "org.bluez.MediaTransport1",
>> + "MicrophoneGain", DBUS_TYPE_UINT16, &gain);
>> + return;
>> + }
>> +
>> set_property(t->device->discovery, "org.bluez", t->device->path, "org.bluez.Headset",
>> "MicrophoneGain", DBUS_TYPE_UINT16, &gain);
>> }
>> @@ -1588,6 +1594,12 @@ void pa_bluetooth_transport_set_speaker_gain(pa_bluetooth_transport *t, uint16_t
>> pa_assert(t);
>> pa_assert(t->profile == PROFILE_HSP);
>>
>> + if (t->device->discovery->version >= BLUEZ_VERSION_5) {
>> + set_property(t->device->discovery, t->owner, t->path, "org.bluez.MediaTransport1",
>> + "SpeakerGain", DBUS_TYPE_UINT16, &gain);
>> + return;
>> + }
>> +
>> set_property(t->device->discovery, "org.bluez", t->device->path, "org.bluez.Headset",
>> "SpeakerGain", DBUS_TYPE_UINT16, &gain);
>> }
>
> The MicrophoneGain and SpeakerGain properties aren't parsed in
> transport_parse_property(). You probably knew that already, but I'm
> reminding anyway just to be sure.
I actually didn't realize this, so I have to complete the patch.
The only problem is BlueZ 5 doesn't currently define an API for this.
I believe it's just about the documentation, which needs to be
updated, since BlueZ itself is not implementing HFP transports (it's
instead oFono's job), but I have to confirm this with Luiz.
Cheers,
Mikel
More information about the pulseaudio-discuss
mailing list