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

2014-11-14 Thread Wim Taymans
Send the right command to set the speaker and microphone gain.
---
 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..cea2db2 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, "+VGS=%d\r", 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, "+VGM=%d\r", gain);
+pa_log_debug("RFCOMM >> +VGM=%d", gain);
 
 written = write (trfc->rfcomm_fd, buf, len);
 
-- 
1.9.3

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


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

2014-11-14 Thread Wim Taymans
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);
 
-- 
1.9.3

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


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

2014-11-21 Thread David Henningsson

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
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


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

2014-11-21 Thread Luiz Augusto von Dentz
Hi David,

On Fri, Nov 21, 2014 at 1:02 PM, David Henningsson
 wrote:
> 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.

So you were testing this, I was about to ack this patch since we
actually had this right in the beginning but it seems we got confused
with unsolicited commands, anyway good that this has been fixed and
you were able to test it.

>
> 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
>
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss



-- 
Luiz Augusto von Dentz
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss