2003-07-03 11:05:47

by Cozza

[permalink] [raw]
Subject: Re: [Bluez-devel] Bluetooth headset problems.

Hi,

I believe that there is a problem with the hci-usb driver. I performed some
brief investigations which I posted earlier to this mailing list.

Are you using a USB device? I've used the same code and Bluetooth headset
with a PC card Bluetooth adaptor and everything worked fine.

Both Bluetooth devices use the CSR chipset, but the UART one using the BCSP
protocol works whereas the USB one misses half the data packets, as you
suggest.

My earlier message was posted on 20th June, entitled "SCO problem with USB
devices" - I'd be interested to see if your problem looks the same. I think
it possibly is, from what you've posted.

I haven't yet got around to investigating the problem with the USB stack -
but I have the same problem, if it helps! If you are in a rush, then PC card
devices seem to work at the moment...

Regards,

Colin




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2003-07-21 22:30:32

by Max Krasnyansky

[permalink] [raw]
Subject: Re: [Bluez-devel] Bluetooth headset problems.

At 11:59 AM 7/6/2003, James Courtier-Dutton wrote:


>>I have made some progress. I can now record audio from the headset without it loosing any samples. I.e. I can record 8 bit PCM at 8000hz and it sounds fine. Before it was loosing samples and recording at more like 4000hz.
>>Once I get playback to work, I will post a patch to this list.
>>Cheers
>>James
>If anyone is interested, the fix for recording required 2 urbs for each isoc connection. The current cvs only uses 1 urb for isoc connections, so the usbcore fills one urb in real time, and then when it is full, sends it to hci_usb.c via a callback. Once hci_usb.c has finished with the urb it sends it back to the usbcore to get refilled. The problem is that while hci_usb.c is processing the urb, usbcore has no urb to put real time audio samples in, so it just drops them. If 2 urbs are used, if hci_usb.c is processing one, usbcore always has another to place samples in. As long as hci_usb.c does not hold on to it's urb for too long, all is ok. This fix was discovered by comparing the alsa snd-usb-audio driver with the hci_usb.c driver.
Make sense.
So basically you're saying that you're just calling hci_usb_isoc_rx_submit() twice
during open, right ? ie just like hci_usb_bulk_rx_submit() is called multiple times.

Max




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2003-07-06 22:16:16

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] Bluetooth headset problems.

Hi James,

> I would prefer it if you would take care of the things you are
> suggesting. I am still quite far from providing a patch, because I
> cannot get playback to work(only recording works). I would prefer to
> stay focused on getting the playback working, rather than get diverted
> to changing compile options and the like.

no problem. If you get it working, I will do the rest.

> Question: Has anyone got a bluetooth headset working with the hstest
> bluez tool and playing sound out of the headset speakers ?
> I just want to double check that this is just a usb problem still.

A long time ago I got playback with the Xircom Credit Card and the 3Com
Bluetooth Card 2.0.

Regards

Marcel




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2003-07-06 22:11:07

by James Courtier-Dutton

[permalink] [raw]
Subject: Re: [Bluez-devel] Bluetooth headset problems.

Marcel Holtmann wrote:
> Hi James,
>
>
>>If anyone is interested, the fix for recording required 2 urbs for each
>>isoc connection. The current cvs only uses 1 urb for isoc connections,
>>so the usbcore fills one urb in real time, and then when it is full,
>>sends it to hci_usb.c via a callback. Once hci_usb.c has finished with
>>the urb it sends it back to the usbcore to get refilled. The problem is
>>that while hci_usb.c is processing the urb, usbcore has no urb to put
>>real time audio samples in, so it just drops them. If 2 urbs are used,
>>if hci_usb.c is processing one, usbcore always has another to place
>>samples in. As long as hci_usb.c does not hold on to it's urb for too
>>long, all is ok. This fix was discovered by comparing the alsa
>>snd-usb-audio driver with the hci_usb.c driver.
>
>
> this sounds reasonable to me. Currently I have replaced the ZERO_PACKET
> compile option with a module parameter, which allows you to change this
> easily at runtime. I will push this together with a new driver for a non
> H2 compatible USB device.
>
> It is also a good idea to remove the SCO compile option, because it is
> not really needed and we can safely enable SCO for all H2 devies with
> ISOC endpoints. If you are working on a patch for full SCO support,
> please take care of this.
>
> Regards
>
> Marcel
>
>
I would prefer it if you would take care of the things you are
suggesting. I am still quite far from providing a patch, because I
cannot get playback to work(only recording works). I would prefer to
stay focused on getting the playback working, rather than get diverted
to changing compile options and the like.

Question: Has anyone got a bluetooth headset working with the hstest
bluez tool and playing sound out of the headset speakers ?
I just want to double check that this is just a usb problem still.

Cheers
James

2003-07-06 20:44:02

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] Bluetooth headset problems.

Hi James,

> If anyone is interested, the fix for recording required 2 urbs for each
> isoc connection. The current cvs only uses 1 urb for isoc connections,
> so the usbcore fills one urb in real time, and then when it is full,
> sends it to hci_usb.c via a callback. Once hci_usb.c has finished with
> the urb it sends it back to the usbcore to get refilled. The problem is
> that while hci_usb.c is processing the urb, usbcore has no urb to put
> real time audio samples in, so it just drops them. If 2 urbs are used,
> if hci_usb.c is processing one, usbcore always has another to place
> samples in. As long as hci_usb.c does not hold on to it's urb for too
> long, all is ok. This fix was discovered by comparing the alsa
> snd-usb-audio driver with the hci_usb.c driver.

this sounds reasonable to me. Currently I have replaced the ZERO_PACKET
compile option with a module parameter, which allows you to change this
easily at runtime. I will push this together with a new driver for a non
H2 compatible USB device.

It is also a good idea to remove the SCO compile option, because it is
not really needed and we can safely enable SCO for all H2 devies with
ISOC endpoints. If you are working on a patch for full SCO support,
please take care of this.

Regards

Marcel




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2003-07-06 18:59:43

by James Courtier-Dutton

[permalink] [raw]
Subject: Re: [Bluez-devel] Bluetooth headset problems.

James Courtier-Dutton wrote:
> Cozza wrote:
>
>> Hi,
>>
>> I believe that there is a problem with the hci-usb driver. I performed
>> some
>> brief investigations which I posted earlier to this mailing list.
>>
>> Are you using a USB device? I've used the same code and Bluetooth headset
>> with a PC card Bluetooth adaptor and everything worked fine.
>>
>> Both Bluetooth devices use the CSR chipset, but the UART one using the
>> BCSP
>> protocol works whereas the USB one misses half the data packets, as you
>> suggest.
>>
>> My earlier message was posted on 20th June, entitled "SCO problem with
>> USB
>> devices" - I'd be interested to see if your problem looks the same. I
>> think
>> it possibly is, from what you've posted.
>>
>> I haven't yet got around to investigating the problem with the USB
>> stack -
>> but I have the same problem, if it helps! If you are in a rush, then
>> PC card
>> devices seem to work at the moment...
>>
>> Regards,
>>
>> Colin
>>
>>
>>
>>
> I have made some progress. I can now record audio from the headset
> without it loosing any samples. I.e. I can record 8 bit PCM at 8000hz
> and it sounds fine. Before it was loosing samples and recording at more
> like 4000hz.
> Once I get playback to work, I will post a patch to this list.
> Cheers
> James
>
>
If anyone is interested, the fix for recording required 2 urbs for each
isoc connection. The current cvs only uses 1 urb for isoc connections,
so the usbcore fills one urb in real time, and then when it is full,
sends it to hci_usb.c via a callback. Once hci_usb.c has finished with
the urb it sends it back to the usbcore to get refilled. The problem is
that while hci_usb.c is processing the urb, usbcore has no urb to put
real time audio samples in, so it just drops them. If 2 urbs are used,
if hci_usb.c is processing one, usbcore always has another to place
samples in. As long as hci_usb.c does not hold on to it's urb for too
long, all is ok. This fix was discovered by comparing the alsa
snd-usb-audio driver with the hci_usb.c driver.
I hope to get playback working soon.

Cheers
James



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2003-07-05 01:55:01

by James Courtier-Dutton

[permalink] [raw]
Subject: Re: [Bluez-devel] Bluetooth headset problems.

Cozza wrote:
> Hi,
>
> I believe that there is a problem with the hci-usb driver. I performed some
> brief investigations which I posted earlier to this mailing list.
>
> Are you using a USB device? I've used the same code and Bluetooth headset
> with a PC card Bluetooth adaptor and everything worked fine.
>
> Both Bluetooth devices use the CSR chipset, but the UART one using the BCSP
> protocol works whereas the USB one misses half the data packets, as you
> suggest.
>
> My earlier message was posted on 20th June, entitled "SCO problem with USB
> devices" - I'd be interested to see if your problem looks the same. I think
> it possibly is, from what you've posted.
>
> I haven't yet got around to investigating the problem with the USB stack -
> but I have the same problem, if it helps! If you are in a rush, then PC card
> devices seem to work at the moment...
>
> Regards,
>
> Colin
>
>
>
>
I have made some progress. I can now record audio from the headset
without it loosing any samples. I.e. I can record 8 bit PCM at 8000hz
and it sounds fine. Before it was loosing samples and recording at more
like 4000hz.
Once I get playback to work, I will post a patch to this list.
Cheers
James




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2003-07-03 12:36:13

by James Courtier-Dutton

[permalink] [raw]
Subject: Re: [Bluez-devel] Bluetooth headset problems.

Cozza wrote:
> Hi,
>
> I believe that there is a problem with the hci-usb driver. I performed some
> brief investigations which I posted earlier to this mailing list.
>
> Are you using a USB device? I've used the same code and Bluetooth headset
> with a PC card Bluetooth adaptor and everything worked fine.
>
> Both Bluetooth devices use the CSR chipset, but the UART one using the BCSP
> protocol works whereas the USB one misses half the data packets, as you
> suggest.
>
> My earlier message was posted on 20th June, entitled "SCO problem with USB
> devices" - I'd be interested to see if your problem looks the same. I think
> it possibly is, from what you've posted.
>
> I haven't yet got around to investigating the problem with the USB stack -
> but I have the same problem, if it helps! If you are in a rush, then PC card
> devices seem to work at the moment...
>
> Regards,
>
> Colin
>
>
>
>
I looked at your previous email, and it seems that we both have exactly
the same problem. I will have to look into this further, because I think
it is better to get usb dongles working, than just use different
hardware. As you have already tried it in windows and it works, I will
proceed with that assumption, as I don't have windows to test with.
The "hstest" program in it's current state would never handle full
duplex, but at least I can maybe get the recording working.

I am using a USB dongle. Mitsumi WML-C52APR, contains FCC ID: POOWML-C06
Relevent info from usb.
T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 7 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=03ee ProdID=6440 Rev= 3.09
C:* #Ifs= 3 Cfg#= 1 Atr=c0 MxPwr=200mA
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=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=82(I) 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=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
I: If#= 2 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)


hciconfig -a hci0
hci0: Type: USB
BD Address: 00:A0:96:1F:42:BF ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:99 acl:0 sco:0 events:13 errors:0
TX bytes:296 acl:0 sco:0 commands:12 errors:0
Features: 0xff 0xff 0x0f 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'BlueZ (0)'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x135 LMP Ver: 1.1 (0x1) LMP
Subver: 0x135
Manufacturer: Cambridge Silicon Radio (10)

hcitool info 00:0A:D9:48:00:6E
Requesting information ...
BD Address: 00:0A:D9:48:00:6E
Device Name: HBH-30
LMP Version: 1.1 (0x1) LMP Subversion: 0x8b40
Manufacturer: Ericsson Mobile Comunications (0)
Features: 0x1c 0x28 0x01 0x00
<encryption> <slot offset> <timing accuracy> <SCO link>
<HV3 packets> <CVSD>




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel