* Volume control for headset
@ 2009-09-25 3:34 Nick Davies
2009-09-25 7:38 ` Iain Hibbert
0 siblings, 1 reply; 6+ messages in thread
From: Nick Davies @ 2009-09-25 3:34 UTC (permalink / raw)
To: linux-bluetooth
Dear all,
I've tried to control the headset's volume via the volume control on my platform. I am curious about how the headset's volume is controlled? Just send some special bluetooth packets to the headset, and then change some registers related with volume control of the headset?
Any explanations are welcome!
Best regards,
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Volume control for headset
2009-09-25 3:34 Volume control for headset Nick Davies
@ 2009-09-25 7:38 ` Iain Hibbert
2009-09-25 9:34 ` Nick Davies
0 siblings, 1 reply; 6+ messages in thread
From: Iain Hibbert @ 2009-09-25 7:38 UTC (permalink / raw)
To: Nick Davies; +Cc: linux-bluetooth
On Thu, 24 Sep 2009, Nick Davies wrote:
> I've tried to control the headset's volume via the volume control on
> my platform. I am curious about how the headset's volume is controlled?
> Just send some special bluetooth packets to the headset, and then change
> some registers related with volume control of the headset?
Yes, it uses a straight serial (over RFCOMM) link with commands/responses
being sent each way in plaintext. eg from Audio Gateway (computer) to
Headset:
+VGS=n
set headset speaker volume (0-15)
+VGM=n
set headset microphone gain (0-15)
> Any explanations are welcome!
You can find more information in the "Headset Profile" specification at
www.bluetooth.com
regards,
iain
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Volume control for headset
2009-09-25 7:38 ` Iain Hibbert
@ 2009-09-25 9:34 ` Nick Davies
2009-09-25 10:54 ` Johan Hedberg
0 siblings, 1 reply; 6+ messages in thread
From: Nick Davies @ 2009-09-25 9:34 UTC (permalink / raw)
To: Iain Hibbert; +Cc: linux-bluetooth
Hi Iain,
Thanks for your quick response! :)
> Yes, it uses a straight serial (over RFCOMM) link with commands/responses
> being sent each way in plaintext. eg from Audio Gateway (computer) to
> Headset:
>
> +VGS=n
>
> set headset speaker volume (0-15)
>
> +VGM=n
>
> set headset microphone gain (0-15)
OK, but I don't know where the RFCOMM socket is created, how can I connect to existing socket?
Best regards,
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Volume control for headset
2009-09-25 9:34 ` Nick Davies
@ 2009-09-25 10:54 ` Johan Hedberg
2009-09-25 12:09 ` Nick Davies
0 siblings, 1 reply; 6+ messages in thread
From: Johan Hedberg @ 2009-09-25 10:54 UTC (permalink / raw)
To: Nick Davies; +Cc: Iain Hibbert, linux-bluetooth
Hi,
On Fri, Sep 25, 2009, Nick Davies wrote:
> OK, but I don't know where the RFCOMM socket is created,
audio/headset.c
> how can I connect to existing socket?
You can't really but you also shouldn't need to. You can request
bluetoothd to change the volume using the SetProperty("SpeakerGain", 0-15)
method on the org.bluez.Headset interface on the D-Bus object that
represents your headset. There's a python script in the bluez source that
lets you do it too, e.g:
test/test-telephony <remote address> speakergain 10
test/test-telephony <remote address> microphonegain 5
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Volume control for headset
2009-09-25 10:54 ` Johan Hedberg
@ 2009-09-25 12:09 ` Nick Davies
2009-09-25 13:14 ` Marcel Holtmann
0 siblings, 1 reply; 6+ messages in thread
From: Nick Davies @ 2009-09-25 12:09 UTC (permalink / raw)
To: Johan Hedberg, Iain Hibbert; +Cc: linux-bluetooth
Hi all,
I'd like to provide you more details about my current situation:
I download the btsco-5.0 , use the old bt-sco module and daemon to connect the headset with my PC, then I can hear the sound from my headset, but it's not available to control the volume from my PC. So I start to debug this issue.
With Iain's help, I add some codes to send the volume value to the RFCOMM socket after the socket is created by the daemon:
+ char vol[20];
+ int value = 1;
+ int ret;
+ if((value >= 0) && (value <= 15)) {
+ sprintf(vol, "\r\n+VGS=%d\r\n", value);
+ ret = send(socket_name, vol, strlen(vol), MSG_NOSIGNAL);
+ }
I checked the ret value, it's OK, but the headset value isn't changed to 1. Is there something wrong with my approach? Or the signal I've sent is not correct?
Best regards,
Nick
> audio/headset.c
>
> > how can I connect to existing socket?
>
> You can't really but you also shouldn't need to. You can request
> bluetoothd to change the volume using the SetProperty("SpeakerGain", 0-15)
> method on the org.bluez.Headset interface on the D-Bus object that
> represents your headset. There's a python script in the bluez source that
> lets you do it too, e.g:
>
> test/test-telephony speakergain 10
> test/test-telephony microphonegain 5
>
> Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Volume control for headset
2009-09-25 12:09 ` Nick Davies
@ 2009-09-25 13:14 ` Marcel Holtmann
0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2009-09-25 13:14 UTC (permalink / raw)
To: Nick Davies; +Cc: Johan Hedberg, Iain Hibbert, linux-bluetooth
Hi Nick,
so first of all this mailing list does NOT allow top posting. So don't
do it.
> I'd like to provide you more details about my current situation:
> I download the btsco-5.0 , use the old bt-sco module and daemon to connect the headset with my PC, then I can hear the sound from my headset, but it's not available to control the volume from my PC. So I start to debug this issue.
And this is where you are using old and deprecated software. btsco and
its kernel module is and actually never was supported. Use the method
Johan described.
Regards
Marcel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-09-25 13:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25 3:34 Volume control for headset Nick Davies
2009-09-25 7:38 ` Iain Hibbert
2009-09-25 9:34 ` Nick Davies
2009-09-25 10:54 ` Johan Hedberg
2009-09-25 12:09 ` Nick Davies
2009-09-25 13:14 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).