snd-bt-sco
Hi bluez developers,
I'm not sure if this is the right forum. I'm probably in-between alsa-user, bluez-user, kernel-user? But here goes anyway:-)
I just tried getting the Logitech HS01 bluetooth headset working on kernel 2.6.6 (debian unstable), using the ALSA driver from http://www.dcs.gla.ac.uk/~jp/snd-bt-sco/
Anyone had success with getting a headset working?
I know this driver is a hack, but it would be cool to have skype working using a headset under linux.
BR
Peter
--- cut: long and windy story about my adventures ---
I think I managed to patch my kernel-source-2.6.6 successfully. After modprobing the modules dmesg says:
Bluetooth: L2CAP ver 2.1
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM ver 1.2
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: SCO (Voice Link) ver 0.3
Bluetooth: SCO socket layer initialized
Bluetooth: HCI USB driver ver 2.5
usbcore: registered new driver hci_usb
snd-bt-sco revision ??$
snd-bt-sco: snd-bt-scod thread starting
so far so good.
After a while I got this additional message:
hci_acldata_packet: hci0 ACL packet for unknown connection handle 1
here is a summary of what I did:
modprobe hci_usb
modprobe sco
invoke-rc.d bluez-utils restart
Here I turned on the headset in this special "reset/pairing mode" (don't know the right name for it - but you hold down the button for 10 seconds).
hcitool scan
Scanning ...
00:0D:44:00:76:07 Logitech HS01
hcitool cc 00:0D:44:00:76:07 (I think I had to enter pin here)
hciconfig hci0 voice 0x0040
modprobe snd-bt-sco
sdptool search --bdaddr 00:0D:44:00:76:07 0x1108 snd-bt-sco-2004-03-14/btsco-0.2/btsco 00:0D:44:00:76:07 1
Error: control open (hw:0): No such file or directory
Error: Can't find device. Bail
So that was end of the game.
At this time hcitool con says:
Connections:
> ACL 00:0D:44:00:76:07 handle 1 state 1 lm SLAVE
But I've also had it say:
< ACL 00:0D:44:00:76:07 handle 1 state 1 lm MASTER
Using strace I get this:
strace btsco-0.2/btsco 00:0D:44:00:76:07 1
futex(0x400fbffc, FUTEX_WAKE, 2147483647) = 0
access("/etc/asound.conf", R_OK) = -1 ENOENT (No such file or directory)
access("/root/.asoundrc", R_OK) = -1 ENOENT (No such file or directory)
open("/dev/snd/controlC0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/aloadC0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/snd/controlC0", O_RDWR) = -1 ENOENT (No such file or directory)
open("/dev/snd/controlC0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/aloadC0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/snd/controlC0", O_RDWR) = -1 ENOENT (No such file or directory)write(2, "Error: ", 7Error: ) = 7write(2, "control open (hw:0): No such fil"..., 46control open (hw:0): No such file or directory) = 46 write(2, "\n", 1
) = 1write(2, "Error: ", 7Error: ) = 7
write(2, "Can\'t find device. Bail", 23Can't find device. Bail) = 23
write(2, "\n", 1
) = 1exit_group(1) = ?
This could be caused by missing device files in /dev/ maybe?
I have ALSA compiled statically into the kernel, here is what dmesg says:
Advanced Linux Sound Architecture Driver Version 1.0.4rc2 (Tue Mar 30 08:19:30 2004 UTC). ALSA device list:
#0: C-Media PCI CMI8738 (model 37) at 0xc400, irq 10
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Hi again,
Well, I figured out I didn't have the /dev/snd/* device files
So now it almost works. The headset seems connected. I can use alsamixer (and the volume buttons on the headset changes the volume in the mixer window). hciconfig shows data is flowing at a steady rate from the microphone:
hci0: Type: USB
BD Address: 00:0B:0D:20:79:21 ACL MTU: 339:4 SCO MTU: 64:0
UP RUNNING PSCAN ISCAN
RX bytes:8895374 acl:72 sco:329395 events:232 errors:0
TX bytes:3768 acl:151 sco:0 commands:47 errors:0But no sound
I'll try some more.
BR
Peter
Quoted 8 lines · Peter Favrholdt
Hi bluez developers,
I'm not sure if this is the right forum. I'm probably in-between alsa-user, bluez-user, kernel-user? But here goes anyway:-)
I just tried getting the Logitech HS01 bluetooth headset working on kernel 2.6.6 (debian unstable), using the ALSA driver from http://www.dcs.gla.ac.uk/~jp/snd-bt-sco/
Anyone had success with getting a headset working?
Quoted 7 lines
I know this driver is a hack, but it would be cool to have skype working using a headset under linux.
BR
Peter
--- cut: long and windy story about my adventures ---
<snip>
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Peter,
Quoted 6 lines
Well, I figured out I didn't have the
/dev/snd/*device filesSo now it almost works. The headset seems connected. I can use alsamixer (and the volume buttons on the headset changes the volume in the mixer window). hciconfig shows data is flowing at a steady rate from the microphone:
Quoted 7 lines
hci0: Type: USB
BD Address: 00:0B:0D:20:79:21 ACL MTU: 339:4 SCO MTU: 64:0 UP RUNNING PSCAN ISCAN RX bytes:8895374 acl:72 sco:329395 events:232 errors:0 TX bytes:3768 acl:151 sco:0 commands:47 errors:0But no sound
and I am not sure that your USB dongle supports SCO over HCI. Show us the output of "hciconfig -a" and "cat /proc/bus/usb/devices".
Regards
Marcel
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Hi Marcel,
Thank you very much for the reply. I have included the information you requested at the bottom. First a little more information that might help you help me :-)
When I start the user space "btsco" program the headset goes "off the hook" - I hear a beep, the led starts blinking three blinks at a time, and I can hear some "static" noise (mostly silent but occasionally some lsb "clicks"). I take this as a good sign since it was mentioned in the readme for the snd-bt-sco package:
"There seems to be some unexplained noise that's noticeable when a program has
the device open but is not sending audio data. Instead of seeing all silence,
the driver is receiving the occasional non-zero byte. I've added a temporary
filter to eliminate this, but I'd really like to know what's causing it."
As I said earlier, the buttons on the headset works - I can disconnect and change the volume (can be seen in alsamixer :-)
dmesg has lots of these messages. Sometimes the number following handle is not zero but a "random" integer.hci_scodata_packet: hci0 SCO packet for unknown connection handle 0hci_scodata_packet: hci0 SCO packet for unknown connection handle 0hci_scodata_packet: hci0 SCO packet for unknown connection handle 0hci_scodata_packet: hci0 SCO packet for unknown connection handle 0hci_scodata_packet: hci0 SCO packet for unknown connection handle 0
Besides adding the snd-bt-sco alsa driver to the kernel tree, I have patched the hci_usb.c of the 2.6.6 kernel with this patch (which was meant for 2.6.4):
<patch>
drivers/bluetooth/hci_usb.c 2004-03-13 23:52:27 renamed from drivers/bluetooth/hci_usb.c 2004-03-11 02:55:44 +0 -0
@@ -851,7 +851,12 @@
#ifdef CONFIG_BT_HCIUSB_SCO
case USB_ENDPOINT_XFER_ISOC:
- if (ep->desc.wMaxPacketSize < size || a > 2)
+ /* Use only the 9 byte
+ "One voice channel with 8 bit encoding"
+ endpoint until there is support for changing
+ the endpoint dynamically. See
+ Bluetooth 1.1 Part H:2, section 2.1 */
+ if (ep->desc.wMaxPacketSize != 9)
break;
size = ep->desc.wMaxPacketSize;</patch>
One further note: I had to increment the magic numbers in sndmagic.h because the ones in the patch was already used in kernel 2.6.6. I assume this isn't a problem as I have compiled both kernel and the btsco program with these numbers... but something else might need to be changed also?
After having "used" the headset and turned it off I have trouble getting it online again (without rebooting Linux). After putting the headset in "pairing mode" I can do "hcitool scan" Scanning ...
00:0D:44:00:76:07 Logitech HS01
But it fails with one of two error messages when I try to setup a connection:
hcitool cc 00:0D:44:00:76:07
Can't create connection: Input/output error
or:
Can't create connection: Connection timed out
But still "hcitool con" shows no connections.
Any ideas/suggestions welcome,
BR Peter
Quoted 2 lines · Marcel Holtmann
and I am not sure that your USB dongle supports SCO over HCI. Show us the output of "hciconfig -a" and "cat
/proc/bus/usb/devices".
At the moment the headset is not turned on (don't know if that makes a difference). Also I noted that sometimes the headset will be master and sometimes slave. Not sure what that means though:-)
how4:~# hciconfig -a
hci0: Type: USB
BD Address: 00:0B:0D:20:79:21 ACL MTU: 339:4 SCO MTU: 64:0
UP RUNNING PSCAN ISCAN
RX bytes:665056950 acl:108 sco:216472402 events:222 errors:0
TX bytes:2507 acl:87 sco:0 commands:66 errors:0
Features: 0xff 0xff 0x3d 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'how4-0.'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x93 LMP Ver: 1.1 (0x1) LMP Subver: 0x93
Manufacturer: Transilica, Inc. (24)how4:~# cat /proc/bus/usb/devices
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc=143/900 us (16%), #Int= 2, #Iso= 2 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.06 S: Manufacturer=Linux 2.6.6 uhci_hcd S: Product=Intel Corp. 82801AA USB S: SerialNumber=0000:00:1f.2 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=16 #Cfgs= 1 P: Vendor=0f4d ProdID=1000 Rev= 4.01 C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr= 26mA I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=hci_usb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 32 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 32 Ivl=0ms I: If#= 1 Alt= 0 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=hci_usb E: Ad=84(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=05(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=hci_usb E: Ad=84(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=05(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=hci_usb E: Ad=84(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=05(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=hci_usb E: Ad=84(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=05(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=hci_usb E: Ad=84(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=05(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=hci_usb E: Ad=84(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=05(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 3 Spd=1.5 MxCh= 0 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=046d ProdID=c408 Rev=14.00 S: Manufacturer=Logitech S: Product=USB Trackball C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 50mA I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=hid E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=10ms