2007-10-18 01:36:28

by 

[permalink] [raw]
Subject: [Bluez-devel] SCO connection timed out issue

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


Attachments:
(No filename) (314.00 B)
(No filename) (164.00 B)
Download all attachments

2007-10-20 08:05:08

by 

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO connection timed out issue


Hi Fabien:
I got a clue after printf lots of information from the kernel about
my "aplay: main:550: audio open error: Input/output error" after using "apl=
ay -D bluetooth /1.wav".
In bluez-utils-3.20/audio/pcm_bluetooth.c
It has a function named:
static int bluetooth_cfg(struct bluetooth_data *data,
snd_pcm_stream_t stream,
snd_config_t *conf)

and the Input/Output error comes from bluetooth_cfg():
***************************************************************************=
************************
ret =3D send(data->server.fd, pkt, sizeof(*pkt) + pkt->length, 0);
if (ret < 0)
return -errno;
else if (ret =3D=3D 0)
return -EIO;

DBG("OK - %d bytes sent. Waiting for response...", ret);

memset(buf, 0, sizeof(buf));

ret =3D recv(data->server.fd, buf, sizeof(*pkt) + sizeof(*cfg), 0);
if (ret < 0)
return -errno;
else if (ret =3D=3D 0)
return -EIO;//This is where Input/Output error come from.
***************************************************************************=
************************
That means after recv(data->server.fd, buf, sizeof(*pkt) + sizeof(*cfg),
0);, it returns a wrong value.

Here's the debug message related to this error:
DEBUG: _snd_pcm_bluetooth_open: Bluetooth PCM plugin (Playback)
DEBUG: bluetooth_init: Connecting to address: /org/bluez/audio
DEBUG: bluetooth_cfg: Sending PKT_TYPE_CFG_REQ...
DEBUG: bluetooth_cfg: OK - 34 bytes sent. Waiting for response...

After Sending PKT_TYPE_CFG_REQ, it seems it didn't
recieve(recv(data->server.fd, buf, sizeof(*pkt) + sizeof(*cfg), 0);) the
proper information.

Can you give me any hints? Is this about PKT_TYPE_CFG_REQ or my .asoundrc
configuration?
***************************************************************************=
***********************************

PS:This is my .asoundrc:
#pcm.a2dpd {
# type a2dpd
# }

pcm.bluetooth {
type bluetooth
device 00:0D:3C:EB:53:F0
}

#pcm.!default {
# type hw
# card 0
# device 0
#}

pcm.card0 {
type hw
card 0
}
ctl.card0 {
type hw
card 0
}
***************************************************************************=
************************************



thanks


semiyd




> From: [email protected]
> To: [email protected]
> Date: Fri, 19 Oct 2007 05:55:35 +0000
> Subject: Re: [Bluez-devel] SCO connection timed out issue
>
>
> Hi Fabien:
> Just got comfirm from ST. No support for sco over hci ;-(
> They said uncless i buy a mother board with hw-codec and connect it to th=
e STLC2500 adapter .
>
> About the command "aplay -D bluetooth /1.wav", i have question here:
> Is this command aimed to connect the headset over A2DP? Or will it automa=
tically adjust the link type between A2DP and SCO accoring to the actual si=
tuation?
> And , is there any command that is aimed to do A2DP with the headset that=
i can use ?
>
>
>
> Thanks!
>
>
>
> semiyd
>
>
>
>> From: [email protected]
>> To: [email protected]
>> Date: Fri, 19 Oct 2007 03:16:00 +0000
>> Subject: Re: [Bluez-devel] SCO connection timed out issue
>>
>>
>> Hi Fabien:
>> *Firstly, i could only find the 'data brief' datasheet of
>> STLC2500C,which has very little information.No more detailed datasheet
>> could be found...
>>
>> (http://www.st.com/stonline/products/literature/bd/12019/stlc2500c.pdf)
>> I also found something.Maybe related to SCO.In the datasheet,it says:
>> "
>> Communication interfaces
>> -PCM interface for voice
>> "
>> I don't know if this is indicating that the chip only supports sco
>> over pcm,not hci,or something else...Anyway , no further info about SCO =
can
>> be found in this datasheet.I also wrote an email to the ST technical
>> support team to comfirm the stuff.
>>
>> *I looked into the source code in the driver of pl2303 in my
>> linux.It's true that the max baudrate the driver supports is 460800.
>> I'm now using the command 'hciattach ttyUSB0 stlc2500 460800 '.
>>
>> *About the error:
>> aplay: main:550: audio open error: Input/output error
>> hcid[318]: Service owner exited: :1.2
>> hcid[318]: Audio service (audio) was killed by signal 7
>> It's like this:I'm developing on an embeded system(S3c2410 EVB).So
>> i have to mount the root file system(mounted root) through NFS.I tried g=
db
>> before and seems there's something wrong when gdb goes into the content =
of
>> NFS(my 'aplay'and some other programmes are in the file system from NFS)=
.I
>> got the following error from gdb when mounting on NFS:
>>
>> Program received signal SIGTRAP, Trace/breakpoint trap
>>
>> This error will force the gdb into a single step mode .That mode begins
>> when the system just started to mount the root FS from NFS.
>> But the GDB is okey with ramdisk-based file systems.
>> So maybe i should create a ramdisk with all the necessary components of
>> ALSA and bluez and try the GDB again.
>>
>>
>> thanks
>>
>>
>> yandong
>>> Date: Thu, 18 Oct 2007 15:08:29 +0200
>>> From: [email protected]
>>> To: [email protected]
>>> Subject: Re: [Bluez-devel] SCO connection timed out issue
>>>
>>> Please find some comments below
>>>>
>>>> * Im confused about what you said about the sco function on STLC2500C.=
According to the IC datasheet of STLC2500C downloaded from 'http://www.st.com', it=
says that this chip supports SCO link. So are you saying that this chip si=
mply can't support SCO under linux?(i have a couple of evaluation software =
of STLC2500C evaluation board under windowXP.It seems that under windows , =
its SCO link works.But im not very sure about this.)
>>>
>>> It's basically not in the datasheet, but it is how things are. The chip
>>> supports SCO but not over hci, only over PCM.
>>> It won't work with windows either :-(
>>>
>>>>
>>>> * i followed your hint and used the command "hciattach ttyUSB0 stlc250=
0" and then got the following information:
>>>> Loading file /lib/firmware/STLC2500_R4_02_04.ptc
>>>> Loading file /lib/firmware/STLC2500_R4_02_02_WLAN.ssf
>>>> STLC2500 R4.2 12102005 12:40:14
>>>> ZAV100012 05HW Id=3D V440BAA
>>>>
>>>> i copied 2 files:
>>>> STLC2500_R4_02_02_WLAN.ssf
>>>> STLC2500_R4_02_04.ptc
>>>> from the bluez-firmware-1.2/st to the /lib/firmware folder.
>>>>
>>>> i didn't use the "hciattach ttyUSB0 stlc2500 921600" cause this will g=
ive the following error:
>>>> pl2303 ttyUSB0: pl2303 driver does not support the baudrate requested =
(fix it)
>>>> It seems the pl2303(the serial-USB converter IC on STLC2500C evaluatio=
n board) driver does not support the baudrate of 921600.
>>>
>>> Yes that's true, you need a 2.6.23 kernel for this high speed. With
>>> 2.6.18 you should be able to go to 460800 bps though, please retry with
>>> hciattach ttyUSB0 stlc2500 460800
>>>
>>>
>>>>
>>>> So up to now , some good improvements have been made thanks to your su=
ggestion. Anyway , i got the same err when i tried to connect using the com=
mand :aplay -D bluetooth /1.wav
>>>> aplay: main:550: audio open error: Input/output error
>>>> hcid[318]: Service owner exited: :1.2
>>>> hcid[318]: Audio service (audio) was killed by signal 7
>>>> hcid[318]: link_key_request (sba=3D00:80:E1:00:00:00, dba=3D00:0D:3C:E=
B:53:F0)
>>>
>>> I have no idea of what's going wrong either. If you attach gdb to the
>>> bluetoothd-service-audio and show me where the program breaks i could
>>> tell more.
>>>
>>> Cheers,
>>>
>>> Fabien
>>>
>>> -----------------------------------------------------------------------=
--
>>> This SF.net email is sponsored by: Splunk Inc.
>>> Still grepping through log files to find problems? Stop.
>>> Now Search log events and configuration files using AJAX and a browser.
>>> Download your FREE copy of Splunk now>> http://get.splunk.com/
>>> _______________________________________________
>>> Bluez-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>>
>> _________________________________________________________________
>> Explore the seven wonders of the world
>> http://search.msn.com/results.aspx?q=3D7+wonders+world&mkt=3Den-US&form=
=3DQBRE
>>
>
> _________________________________________________________________
> Invite your mail contacts to join your friends list with Windows Live Spa=
ces. It's easy!
> http://spaces.live.com/spacesapi.aspx?wx_action=3Dcreate&wx_url=3D/friend=
s.aspx&mkt=3Den-us
>

_________________________________________________________________
Connect to the next generation of MSN Messenger=A0
http://imagine-msn.com/messenger/launch80/default.aspx?locale=3Den-us&sourc=
e=3Dwlmailtagline
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2007-10-19 02:24:58

by dong yan

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO connection timed out issue

Hi Brad:
You are right.I launched passkey-agent with the command
"passkey-agent --default 8888 &". After that ,i deleted the headset
related linkcode in the /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/pincodes.
Now hcid looks for the linkcode from passkey-agent.
Here:
hcid[306]: link_key_request (sba=00:80:E1:00:AB:BA,
dba=00:0D:3C:EB:53:F0) hcid[306]: pin_code_request
(sba=00:80:E1:00:AB:BA, dba=00:0D:3C:EB:53:F0) hcid[306]: Calling
PasskeyAgent.Request: name=:1.3, path=/org/bluez/passkey_agent_328
Passkey request for device 00:0D:3C:EB:53:F0
hcid[306]: link_key_notify (sba=00:80:E1:00:AB:BA, dba=00:0D:3C:EB:53:F0)
hcid[306]: link_key_request (sba=00:80:E1:00:AB:BA,
dba=00:0D:3C:EB:53:F0) The pairing procedure to the headset is now
handled by passkey-agent. Seems like hcid will search the linkcode
firstly in that 'pincodes' file. If he didn't find one ,he will turn
to the passkey-agent and ask for the code.

thanks

semiyd

2007/10/19, Brad Midgley <[email protected]>:
> semiyd,
>
> fyi you get unpredictable behavior if you change stuff in
> /var/lib/bluetooth manually.
>
> brad
>
> On 10/18/07, [email protected] <[email protected]> wrote:
> >
> > Hi Brad:
> > No , i didn't start up the passkey agent:)
> > In /etc/bluetooth/hcid.conf ,my configuration is "security auto;"
> > I manually created a file named 'pincodes' in /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/ and put the linkcode
> > in it . So that hcid will find the linkcode when requested by the headset.
> >
> > thanks
> >
> > semiyd
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Bluez-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2007-10-18 17:26:02

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO connection timed out issue

semiyd,

fyi you get unpredictable behavior if you change stuff in
/var/lib/bluetooth manually.

brad

On 10/18/07, [email protected] <[email protected]> wrote:
>
> Hi Brad:
> No , i didn't start up the passkey agent:)
> In /etc/bluetooth/hcid.conf ,my configuration is "security auto;"
> I manually created a file named 'pincodes' in /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/ and put the linkcode
> in it . So that hcid will find the linkcode when requested by the headset.
>
> thanks
>
> semiyd

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2007-10-18 13:24:58

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO connection timed out issue

semiyd

> hcid[318]: link_key_request (sba=00:80:E1:00:00:00, dba=00:0D:3C:EB:53:F0)
> hcid[318]: link_key_request (sba=00:80:E1:00:00:00, dba=00:0D:3C:EB:53:F0)

did you start up a passkey agent? under some setups I have to do this manually:

passkey-agent --default 0000 &

brad

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2007-10-18 13:08:29

by Fabien Chevalier

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO connection timed out issue

Please find some comments below
>
> * Im confused about what you said about the sco function on STLC2500C.According to the IC datasheet of STLC2500C downloaded from 'http://www.st.com', it says that this chip supports SCO link. So are you saying that this chip simply can't support SCO under linux?(i have a couple of evaluation software of STLC2500C evaluation board under windowXP.It seems that under windows , its SCO link works.But im not very sure about this.)

It's basically not in the datasheet, but it is how things are. The chip
supports SCO but not over hci, only over PCM.
It won't work with windows either :-(

>
> * i followed your hint and used the command "hciattach ttyUSB0 stlc2500" and then got the following information:
> Loading file /lib/firmware/STLC2500_R4_02_04.ptc
> Loading file /lib/firmware/STLC2500_R4_02_02_WLAN.ssf
> STLC2500 R4.2 12102005 12:40:14
> ZAV100012 05HW Id= V440BAA
>
> i copied 2 files:
> STLC2500_R4_02_02_WLAN.ssf
> STLC2500_R4_02_04.ptc
> from the bluez-firmware-1.2/st to the /lib/firmware folder.
>
> i didn't use the "hciattach ttyUSB0 stlc2500 921600" cause this will give the following error:
> pl2303 ttyUSB0: pl2303 driver does not support the baudrate requested (fix it)
> It seems the pl2303(the serial-USB converter IC on STLC2500C evaluation board) driver does not support the baudrate of 921600.

Yes that's true, you need a 2.6.23 kernel for this high speed. With
2.6.18 you should be able to go to 460800 bps though, please retry with
hciattach ttyUSB0 stlc2500 460800


>
> So up to now , some good improvements have been made thanks to your suggestion. Anyway , i got the same err when i tried to connect using the command :aplay -D bluetooth /1.wav
> aplay: main:550: audio open error: Input/output error
> hcid[318]: Service owner exited: :1.2
> hcid[318]: Audio service (audio) was killed by signal 7
> hcid[318]: link_key_request (sba=00:80:E1:00:00:00, dba=00:0D:3C:EB:53:F0)

I have no idea of what's going wrong either. If you attach gdb to the
bluetoothd-service-audio and show me where the program breaks i could
tell more.

Cheers,

Fabien

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2007-10-18 10:31:40

by Fabien Chevalier

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO connection timed out issue

Hi,

Sorry i have to say you this, but you're basically trying to make sth
work that will never make it ;-)

* STLC2500C does not support sco over hci, so unless your development
has an audio codec hardwired to the BT chip, you're screwed :-(
* You need latest bluez-utils CVS to have any chance for your chip
to run at decent speed, which is required for a2dp streaming. You should
then use the follwing syntax to start the chip at max speed: hciattach
/dev/ttyUSB0 stlc2500 921600

Apart from that this is know to work.

Regards,

Fabien

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2007-10-18 01:49:57

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] SCO connection timed out issue

semiyd

> Later i found something.I checked out the website "
> http://wiki.bluez.org/wiki/Audio" and found that the
> /bluez-utils-3.20/audio/gateway.c implements the
> org.bluez.audio.gateway interface.But when i looked into the
> gateway.c, there's nothing in there.And /bluez-
> utils-3.20/audio-api.txt also says that the audio gateway service is
> not yet implemented in the current bluez. Is that true? If it is so
> ,does this means that there's no way we can enable the SCO/A2DP audio
> connection to the headset right now?

for now the files there are named backward. gateway.c would contain
code for talking to a gateway device, not for being a gateway. You can
experiment now with sco/a2dp to a headset just fine.

> I'm really confused cause i read about an
> article:http://bluetooth-alsa.sourceforge.net/build.html ,which
> teaches the reader how to enable bluez audio without mentioning
> anything about the org.bluez.audio.gateway implementation.

the bluetooth-alsa stuff is all old. that's why there's a banner
across the top of the page directing people to the new stuff.

brad

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel