Asus WL-BTD202 needs force_scofix
Hello,
I'm currently testing bluetooth audio with latest cvs.
I use this dongle and a mono headset (PROF PBH-6W) :
$ /usr/sbin/lsusb | grep ASUS Bus 001 Device 002: ID 0b05:1715 ASUSTek Computer, Inc.
Apparently, it only works with this option set hci_usb :
options hci_usb force_scofix=1
Recording and playback work, mostly.
Sometimes noise is produced, retrying once or twice make it work...
Could this option be set as a default in hci_usb.c, or could it have some drawback I'm not aware of ?
Best regards,
Guillaume B.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
PATCH 1/1 Support for CLIP
Hi Johan/Fredric,
Here is the patch for IdentifyCall() method as discussed.
Let me know if anything needs to be changed.
Thanks,
Alok.
Index: audio/headset.c
===================================================================
RCS file: /cvsroot/bluez/utils/audio/headset.c,v
retrieving revision 1.158
headset.c +91 -1
@@ -113,10 +113,13 @@ struct headset {int data_start;int data_length;gboolean hfp_active;gboolean search_hfp; +gboolean cli_active; +char *ph_number; +int type;headset_state_t state;GSList *pending;int sp_gain;
@@ -230,10 +233,15 @@ static int answer_call(struct device *de }if (!hs->hfp_active)return headset_send (hs,"\r\nOK\r\n" ); +if (hs->ph_number) { +g_free (hs->ph_number); + hs->ph_number =NULL ; + } + err =headset_send (hs,"\r\nOK\r\n" );if (err <0 )return err;/*+CIEV: (call = 1)*/
@@ -256,10 +264,15 @@ static int terminate_call(struct device err =headset_send (hs,"\r\nOK\r\n" );if (err <0 )return err; +if (hs->ph_number) { +g_free (hs->ph_number); + hs->ph_number =NULL ; + } +if (hs->ring_timer) {g_source_remove (hs->ring_timer); hs->ring_timer =0 ;/*+CIEV: (callsetup = 0)*/ return headset_send (hs,"\r\n+CIEV:3, 0\r\n" );
@@ -267,10 +280,22 @@ static int terminate_call(struct device/*+CIEV: (call = 0)*/ return headset_send (hs,"\r\n+CIEV:2, 0\r\n" ); } +static int cli_notification (struct device *device,const char *buf) +{ +struct headset *hs = device->headset; + +if (buf[8 ] =='1' ) + hs->cli_active = TRUE; +else + hs->cli_active = FALSE; + +return headset_send (hs,"\r\nOK\r\n" ); +} +static int signal_gain_setting (struct device *device,const char *buf) {struct headset *hs = device->headset;const char *name;dbus_uint16_t gain;
@@ -321,10 +346,11 @@ static struct event event_callbacks[] = {"AT+CIND", report_indicators}, {"AT+CMER", event_reporting}, {"AT+CHLD", call_hold}, {"AT+CHUP", terminate_call}, {"AT+CKPD", answer_call}, + {"AT+CLIP", cli_notification}, {0} };static GIOError handle_event (struct device *device,const char *buf) {
@@ -1178,11 +1204,19 @@ static gboolean ring_timer_cb(gpointer dint err; err =headset_send (hs,"\r\nRING\r\n" );if (err <0 ) -error ("Sending RING failed" ); +error ("Error while sending RING: %s (%d)" ,strerror (-err), -err); + +if (hs->cli_active && hs->ph_number) { + err =headset_send (hs,"\r\n+CLIP:\"%s\", %d\r\n" , + hs->ph_number, hs->type); + +if (err <0 ) +error ("Error while sending CLIP: %s (%d)" ,strerror (-err), -err); + }return TRUE; } static DBusHandlerResult hs_ring(DBusConnection *conn, DBusMessage *msg,
@@ -1209,10 +1243,19 @@ static DBusHandlerResult hs_ring(DBusConif (err <0 ) {dbus_message_unref (reply);return error_failed (conn, msg,"Failed" ); } +if (hs->cli_active && hs->ph_number) { + err =headset_send (hs,"\r\n+CLIP:\"%s\", %d\r\n" , + hs->ph_number, hs->type); +if (err <0 ) { +dbus_message_unref (reply); +return error_failed (conn, msg,"Failed" ); + } + } + hs->ring_timer =g_timeout_add (RING_INTERVAL , ring_timer_cb, device); done:send_message_and_unref (conn, reply);
@@ -1454,10 +1497,54 @@ static DBusHandlerResult hf_setup_call(Dsend_message_and_unref (conn, reply);return DBUS_HANDLER_RESULT_HANDLED ; } +static DBusHandlerResult hf_identify_call (DBusConnection *conn, +DBusMessage *msg, +void *data) +{ +struct device *device = data; +struct headset *hs = device->headset; +DBusMessage *reply; +DBusError derr; +const char *number; +dbus_int32_t type; + +if (!hs->hfp_active && !hs->cli_active) +return error_not_supported (device->conn, msg); + +if (hs->state <HEADSET_STATE_CONNECTED ) +return error_not_connected (conn, msg); + +dbus_error_init (&derr); +dbus_message_get_args (msg, &derr,DBUS_TYPE_STRING , &number, +DBUS_TYPE_INT32 , &type,DBUS_TYPE_INVALID ); + +if (dbus_error_is_set (&derr)) { +error_invalid_arguments (conn, msg, derr.message); +dbus_error_free (&derr); +return DBUS_HANDLER_RESULT_HANDLED ; + } + + reply =dbus_message_new_method_return (msg); +if (!reply) +return DBUS_HANDLER_RESULT_NEED_MEMORY ; + +if (hs->ph_number) { +g_free (hs->ph_number); + hs->ph_number =NULL ; + } + + hs->ph_number =g_strdup (number); + hs->type = type; + +send_message_and_unref (conn, reply); + +return DBUS_HANDLER_RESULT_HANDLED ; +} +static DBusMethodVTable headset_methods[] = { {"Connect" , hs_connect,"" ,"" }, {"Disconnect" , hs_disconnect,"" ,"" }, {"IsConnected" , hs_is_connected,"" ,"b" }, {"IndicateCall" , hs_ring,"" ,"" },
@@ -1468,10 +1555,11 @@ static DBusMethodVTable headset_methods[ { "GetSpeakerGain", hs_get_speaker_gain, "", "q" }, { "GetMicrophoneGain", hs_get_mic_gain, "", "q" }, { "SetSpeakerGain", hs_set_speaker_gain, "q", "" }, { "SetMicrophoneGain", hs_set_mic_gain, "q", "" }, { "SetupCall", hf_setup_call, "s", "" }, + { "IdentifyCall", hf_identify_call, "si", "" }, { NULL, NULL, NULL, NULL } };static DBusSignalVTable headset_signals[] = { { "Connected", "" },
@@ -1554,10 +1642,12 @@ struct headset *headset_init(struct devi hs->rfcomm_ch =-1 ; hs->sp_gain =-1 ; hs->mic_gain =-1 ; hs->search_hfp =server_is_enabled (HANDSFREE_SVCLASS_ID ); hs->hfp_active = FALSE; + hs->cli_active = FALSE; + hs->ph_number =NULL ;if (!record) goto register_iface;switch (svc) {
Index: audio/audio-api.txt
===================================================================
RCS file: /cvsroot/bluez/utils/audio/audio-api.txt,v retrieving revision 1.27
audio-api.txt +8 -1
@@ -181,17 +181,24 @@ Methods void Connect() void SetMicrophoneGain(uint16 gain) Changes the current speaker gain if possible. - void SetupCall(string value) + void SetupCall(string value) [experimental] Sets up an call with the connected HFP. The value can be "incoming", "outgoing" or "remote" to indicate incoming call, outgoing call and remote party alerted respectively. + void IdentifyCall(string phone_number, int32 type) [experimental] + + Enables a called subscriber to get the calling + line identity (CLI) of the calling party when + receiving a call. The value of type shud be + the same as provided by the GSM stack. + Signals void AnswerRequested() Sent when the answer button is pressed on the headset void Connected()
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Guillaume,
Quoted 6 lines
I'm currently testing bluetooth audio with latest cvs.
I use this dongle and a mono headset (PROF PBH-6W) :
$ /usr/sbin/lsusb | grep ASUS Bus 001 Device 002: ID 0b05:1715 ASUSTek Computer, Inc.
Quoted 8 lines
Apparently, it only works with this option set
hci_usb:
optionshci_usbforce_scofix=1Recording and playback work, mostly.
Sometimes noise is produced, retrying once or twice make it work...Could this option be set as a default in
hci_usb.c, or could it have some drawback I'm not aware of ?
include the content of /proc/bus/usb/devices for this dongle and create a kernel patch for hci_usb to always enable the SCO fix.
Regards
Marcel
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Quoted 11 lines · Marcel Holtmann
Hi Guillaume,
Quoted 9 lines
I'm currently testing bluetooth audio with latest cvs.
I use this dongle and a mono headset (PROF PBH-6W) :
$ /usr/sbin/lsusb | grep ASUS Bus 001 Device 002: ID 0b05:1715 ASUSTek Computer, Inc.Apparently, it only works with this option set
hci_usb:
optionshci_usbforce_scofix=1
Quoted 7 lines
Quoted 5 lines
Recording and playback work, mostly.
Sometimes noise is produced, retrying once or twice make it work...Could this option be set as a default in
hci_usb.c, or could it have some drawback I'm not aware of ?include the content of
/proc/bus/usb/devicesfor this dongle
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0b05 ProdID=1715 Rev= 1.00 S: Manufacturer=Broadcom Corp S: Product=WL-BTD202 C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I:* If#= 1 Alt= 2 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=84(I) Atr=02(Bulk) MxPS= 32 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 32 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)
Quoted 2 lines
and create
a kernel patch forhci_usbto always enable the SCO fix.
It is the joined file (it remains to test though).
What's the use of usb_device_id blacklist_ids[] ?
Best regards,
Guillaume B.
bluetooth/hci_usb.c renamed from bluetooth/hci_usb.c.orig +3 -0
@@ -98,6 +98,9 @@/* Canyon CN-BTU1 with HID interfaces */ { USB_DEVICE(0x0c10, 0x0000), .driver_info = HCI_RESET }, + /* ASUS WL-BTD202 */ + { USB_DEVICE(0x0b05, 0x1715), .driver_info = HCI_WRONG_SCO_MTU }, + { }/* Terminating entry */ };
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Hello,
Hopefully, this time a working patch :-)
Regards,
Guillaume B.
bluetooth/hci_usb.c renamed from bluetooth/hci_usb.c.orig +3 -0
@@ -104,6 +104,9 @@MODULE_DEVICE_TABLE (usb, bluetooth_ids);static struct usb_device_id blacklist_ids[] = { +/* ASUS WL-BTD202 */ + {USB_DEVICE (0x0b05 ,0x1715 ), .driver_info =HCI_WRONG_SCO_MTU }, +/* CSR BlueCore devices */ {USB_DEVICE (0x0a12 ,0x0001 ), .driver_info =HCI_CSR },
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel