2006-03-03 00:14:33

by Henryk Plötz

[permalink] [raw]
Subject: [Bluez-devel] SCO stuck on a Netgear WGT634U (mips)

Moin,

I'm currently trying to get btsco working on a my Netgear WGT634U
running OpenWgt (with a lot of custom packages) on kernel 2.6.12-rc3
and current btsco cvs. I can't seem to get it working: Each program
that wants to play audio simply stalls (when using aplay it stops in a
poll(), when using oss the write blocks).

The syslog says:
snd-bt-sco: playback_open
snd-bt-sco: prepare ok bps: 16000 size: 16002 count: 4000
snd-bt-sco: playback_trigger 1
snd-bt-sco: setting playback to bspcm

hcidump says:
< HCI Command: Add SCO Connection (0x01|0x0007) plen 4
0000: 2a 00 e0 00 *...
> HCI Event: Command Status (0x0f) plen 4
0000: 00 01 07 04 ....
> HCI Event: Max Slots Change (0x1b) plen 3
0000: 2a 00 01 *..
> HCI Event: Connect Complete (0x03) plen 11
0000: 00 2d 00 ed 03 30 f4 08 00 00 00 .-...0.....
> HCI Event: Max Slots Change (0x1b) plen 3
0000: 2a 00 03 *..

When looking through kernel/btsco.c this caught my attention:
/* This will block until we receive data or a signal */
len = sock_recvmsg(sock, &msg, BUF_SIZE,0);

I added a dprintk("foo\n"); and a dprintk("bar\n"); after that line and
get foo, bar, foo in the logs, so yes, it is blocking at this line.

At this point I'm stuck. Any hints as to in what direction I should
investigate further would be highly appreciated.

--
Henryk Pl?tz
Gr??e aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~


Attachments:
(No filename) (1.62 kB)
(No filename) (191.00 B)
Download all attachments

2006-03-06 19:10:16

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO stuck on a Netgear WGT634U (mips)

Henryk

>>I'm using a Energic BT-001 headset (bluetooth 1.1, Motorale chipset)
>>and had a terrible distortion as well. After having disabled
>>automatic endianness fixup in the snd_bt_sco kernel module (line 32
>>btsco.c:
>>#undef AUTO_FIXUP_BYTESHIFT) it works flawlessly :).
>
> Yeah, I found that part of the code suspicious too.

I was hoping to take it out when we fixed the underlying problem, but I
can do it sooner if it causes new problems.

For some reason, it appears that damaged sco frames are not tossed out.
They are still accepted and processed. A missing byte in the middle
mixes up byte order and turns the stream into static.

Brad


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-06 08:01:40

by Henryk Plötz

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO stuck on a Netgear WGT634U (mips)

Moin,

Am Mon, 06 Mar 2006 08:43:24 +0100 schrieb Pieter Poorthuis:

> I'm using a Energic BT-001 headset (bluetooth 1.1, Motorale chipset)
> and had a terrible distortion as well. After having disabled
> automatic endianness fixup in the snd_bt_sco kernel module (line 32
> btsco.c:
> #undef AUTO_FIXUP_BYTESHIFT) it works flawlessly :).

Yeah, I found that part of the code suspicious too.

My current problem is that sending sound from the Netgear to the
headset works, but only some of the time (about 10% of it) and
non-reproducible too. When playing back a sound file sometimes I hear
something and most of the time I don't. Sound seems to come and go at
will. (Note: It's not a speaker problem. When there is no sound I still
hear the background static noise.)

I looked at the outgoing SCO stream with hcidump and that seems to be
fine. (E.g. I grabbed the raw data from the stream and played it back
on my Laptop's sound card and there the sound is continuously OK.)

I tried two different dongles (both work fine with the headset when
attached to my Laptop) but have yet to find a different headset to try.

The byteshift doesn't seem to have anything to do with it, despite
there being a minor correlation between sound switching on and off and
"Shift problem detected! Fixing to 1."/"Shift problem detected! Fixing
to 0." in the log (they _always_ come in pairs on the Netgear). I
experimentally changed the code to switch between byteshift on and off
every 15s and that didn't have any effect whatsoever.

(Note: Recording sound from the microphone seems to work always. But I
didn't test that very extensively.)

Next step would be for me to read more on the Headset profile to better
understand the hcidump output (and look for errors) and get a headset
emulator running on my laptop to check the SCO stream that is actually
received by the headset. When I have more time ...

--
Henryk Pl?tz
Gr??e aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~


Attachments:
(No filename) (2.02 kB)
(No filename) (191.00 B)
Download all attachments

2006-03-06 07:43:24

by Pieter Poorthuis

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO stuck on a Netgear WGT634U (mips)


>
> Not completely solved yet, since the sound I hear in my headset is
> anything from inaudible to heavily distorted, but at least the SCO
> packets happily go in and out, so that should be solvable for me.
>
>
I'm using a Energic BT-001 headset (bluetooth 1.1, Motorale chipset) and
had a terrible distortion as well. After having disabled automatic
endianness fixup in the snd_bt_sco kernel module (line 32 btsco.c:
#undef AUTO_FIXUP_BYTESHIFT) it works flawlessly :).

Btw, this headset costed me Euro 12.50, so is this the cheapest headset
that works with btsco...?

Pieter


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-04 07:47:32

by Henryk Plötz

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO stuck on a Netgear WGT634U (mips)

Moin,

Am Sat, 4 Mar 2006 02:41:14 +0100 schrieb Henryk Pl?tz:

> I just remembered the scotest program and tried it: Sending from the
> Netgear and receiving on my Laptop works, but not the other way round.

Hmm, suddenly started working and I'm not completely sure why. I was
debugging and broke everything (apparantly enabling BT_HCI_CORE_DEBUG
lead to a deadlock) and then hastily disabled all debugging. After that
scotest receive somehow began to work on the Netgear although I didn't
do anything which could possibly have caused it to. That's funny.


Not completely solved yet, since the sound I hear in my headset is
anything from inaudible to heavily distorted, but at least the SCO
packets happily go in and out, so that should be solvable for me.

Also: recording from the headset's microphone works just fine.

--
Henryk Pl?tz
Gr??e aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~


Attachments:
(No filename) (0.98 kB)
(No filename) (191.00 B)
Download all attachments

2006-03-04 01:41:14

by Henryk Plötz

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO stuck on a Netgear WGT634U (mips)

Moin,

Am Thu, 02 Mar 2006 21:27:59 -0700 schrieb Brad Midgley:

> very impressive. Did you have to put a hub in place since it only has
> one usb port? The hub has often been a problem on x86. If you have to
> use a hub, try both 1.1 and 2.0.

Ah, you're right. I completely forgot about the hub. Yes, I had been
using a hub since I will need a lot of USB ports when this device is
finally doing all that it is supposed to do. However, in the meantime
I'm booting off the net (makes experimenting with kernels, etc. much
easier) and don't need it.

Unfortunately that's not it. The bevahiour is exactly the same,
regardless of whether I'm using a hub or not.

I just remembered the scotest program and tried it: Sending from the
Netgear and receiving on my Laptop works, but not the other way round.

There is also some peculiarity that I found while looking at the
problem in hcidump: hcidump -t reports the same timestamp
(16358398.715819904) for every event. Could this have something to do
with it?

I don't think the device has a rtc and I developed some sort of theory
that maybe some timer is set that won't fire or something, but I don't
know how to check that or even where to look.

--
Henryk Pl?tz
Gr??e aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~


Attachments:
(No filename) (1.34 kB)
(No filename) (191.00 B)
Download all attachments

2006-03-03 04:27:59

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO stuck on a Netgear WGT634U (mips)

Henryk

> I'm currently trying to get btsco working on a my Netgear WGT634U
> running OpenWgt (with a lot of custom packages) on kernel 2.6.12-rc3
> and current btsco cvs. I can't seem to get it working: Each program
> that wants to play audio simply stalls (when using aplay it stops in a
> poll(), when using oss the write blocks).

very impressive. Did you have to put a hub in place since it only has
one usb port? The hub has often been a problem on x86. If you have to
use a hub, try both 1.1 and 2.0.

I'm not certain at all on the mips side of things. I've occasionally
seen complaints about bluez problems on mips but it's almost invariably
someone using kernel 2.4.

Brad


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel