[pulseaudio-discuss] [PATCH] bluetooth: set gain correctly

David Henningsson david.henningsson at canonical.com
Fri Nov 21 03:02:55 PST 2014


I pushed this one now since I (finally!) got it working here too. Thanks!

I needed some support from vudentz (thanks!) to have it up and working, 
but here's the relevant start order I used:

  * Start bluetoothd
  * Start bluetoothctl and input these commands "power on", "agent on" 
and "default-agent"
  * Start pulseaudio
  * If not paired, then pair the device using bluetoothctl (using "scan 
on", then "pair")
  * Connect the device, e g by turning it on. Bluetoothctl might now ask 
you to authorize the device (and do so twice), answer "yes".

Hopefully this will be easier with GUI tools, but that's how to do it 
manually for now.

On 2014-11-14 15:01, Wim Taymans wrote:
> Send the right command to set the speaker and microphone gain.
>
> Note that setting the volume on the Headset should use the unsolicited
> result code. Receiving the volume from the Headset uses the AT
> command.
> ---
>   src/modules/bluetooth/backend-native.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c
> index 86af422..8407672 100644
> --- a/src/modules/bluetooth/backend-native.c
> +++ b/src/modules/bluetooth/backend-native.c
> @@ -285,8 +285,8 @@ static void set_speaker_gain(pa_bluetooth_transport *t, uint16_t gain) {
>
>       t->speaker_gain = gain;
>
> -    len = sprintf(buf, "AT+VGS=%d\r", gain);
> -    pa_log_debug("RFCOMM >> AT+VGS=%d", gain);
> +    len = sprintf(buf, "\r\n+VGS=%d\r\n", gain);
> +    pa_log_debug("RFCOMM >> +VGS=%d", gain);
>
>       written = write(trfc->rfcomm_fd, buf, len);
>
> @@ -304,8 +304,8 @@ static void set_microphone_gain(pa_bluetooth_transport *t, uint16_t gain) {
>
>       t->microphone_gain = gain;
>
> -    len = sprintf(buf, "AT+VGM=%d\r", gain);
> -    pa_log_debug("RFCOMM >> AT+VGM=%d", gain);
> +    len = sprintf(buf, "\r\n+VGM=%d\r\n", gain);
> +    pa_log_debug("RFCOMM >> +VGM=%d", gain);
>
>       written = write (trfc->rfcomm_fd, buf, len);
>
>

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


More information about the pulseaudio-discuss mailing list