linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-devel] headsetd has problems serving two applications at a time
@ 2007-05-17  0:07 Robert Huitl
  2007-05-17  3:42 ` Brad Midgley
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Huitl @ 2007-05-17  0:07 UTC (permalink / raw)
  To: bluez-devel

Trying to get headsetd to work with the latest Skype version, I was able to 
find some pointers why Skype would freeze when I select the headset device 
both as an input and output device.

Try the following command:

$ arecord -D headset-sco -f s16_le -r 8000  | \
aplay -D headset-sco -f s16_le -r 8000

This should send all input captured right back to the headset, but it doesn't. 
The following is debug output from pcm_sco.c:

DEBUG(pid=7780): _snd_pcm_sco_open: Starting pcm_sco_headset plugin.
DEBUG(pid=7780): _snd_pcm_sco_open: Open mode is for Playback.
DEBUG(pid=7780): _snd_pcm_sco_open: do_cfg >>
DEBUG(pid=7780): do_cfg: send (PKT_TYPE_CFG_BDADDR) >>
DEBUG(pid=7780): do_cfg: <<send (PKT_TYPE_CFG_BDADDR)
DEBUG(pid=7780): do_cfg: recv (PKT_TYPE_CFG_BDADDR) >>
DEBUG(pid=7779): _snd_pcm_sco_open: Starting pcm_sco_headset plugin.
DEBUG(pid=7779): _snd_pcm_sco_open: Open mode is for Capture.
DEBUG(pid=7779): _snd_pcm_sco_open: do_cfg >>
DEBUG(pid=7779): do_cfg: send (PKT_TYPE_CFG_BDADDR) >>
DEBUG(pid=7779): do_cfg: <<send (PKT_TYPE_CFG_BDADDR)
DEBUG(pid=7779): do_cfg: recv (PKT_TYPE_CFG_BDADDR) >>
DEBUG(pid=7780): do_cfg: <<recv (PKT_TYPE_CFG_BDADDR)
DEBUG(pid=7780): do_cfg: send (PKT_TYPE_CFG_PAGINGTIMEOUT) >>
DEBUG(pid=7780): do_cfg: <<send (PKT_TYPE_CFG_PAGINGTIMEOUT)
DEBUG(pid=7780): do_cfg: recv (PKT_TYPE_CFG_PAGINGTIMEOUT) >>
DEBUG(pid=7780): do_cfg: <<recv (PKT_TYPE_CFG_PAGINGTIMEOUT)
DEBUG(pid=7780): _snd_pcm_sco_open: << do_cfg, get_sco_fd >>
DEBUG(pid=7780): _snd_pcm_sco_open: << get_sco_fd (OK)
DEBUG(pid=7780): _snd_pcm_sco_open: opened as ioplug=0x805ebd0, pcm=0x805ed08, 
ioplug->callback = 0xb7f48f40
Aborted by signal Interrupt...
DEBUG(pid=7780): sco_headset_close: closing ioplug=0x805ebd0
DEBUG(pid=7780): sco_headset_close: Closing Playback stream

(the << and >> messages are print before and after the corresponding function 
calls)

Suspicious here is:
1) "opened as ioplug=..." appears only once.
2) this is because do_cfg() only returns for process 7780, but not for 7779
3) which in turn is caused by the recv() call in do_cfg() which is blocking, 
waiting for an answer from headsetd about the PKT_TYPE_CFG_BDADDR it sends.

So why is headsetd not processing the config request of the 2nd process?
I'm not sure about the reason for this, but it doesn't get to dispatch the 
event that would send the answer pcm_sco.c is waiting for. It's somehow 
blocked by the first process. As soon as I kill the arecord/aplay combo, it 
gets to process the second CFG_BDADDR packet.


Another test:

$ arecord -D headset-sco -f s16_le -r 8000 > testfile
[testfile is recorded ok, keep arecord running]
$ aplay -D headset-sco -f s16_le -r 8000 < existing-testfile

In this scenario, aplay will be frozen until I kill arecord. Then it plays 
back the sound.

So why is headsetd blocking the second application while the first one is 
running?


I'd appreciate any hints,

Robert

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] headsetd has problems serving two applications at a time
  2007-05-17  0:07 [Bluez-devel] headsetd has problems serving two applications at a time Robert Huitl
@ 2007-05-17  3:42 ` Brad Midgley
  2007-05-17  7:51   ` Tim Chick
  2007-05-17 13:21   ` Robert Huitl
  0 siblings, 2 replies; 13+ messages in thread
From: Brad Midgley @ 2007-05-17  3:42 UTC (permalink / raw)
  To: BlueZ development


[-- Attachment #1.1: Type: text/plain, Size: 772 bytes --]

Robert

headsetd is written to allow a single application to use the headset at one
time. it doesn't multiplex the mic or mix to the speaker. one of the two
apps will fail to get exclusive access. it's basically a latency
optimization but there's room for something like dmix or a sound server like
pulse to make it more flexible.

if skype is written such that input and output are separate file descriptors
obtained through independent open() calls then it will also fail, even if
they're in the same thread. that may be how it's written, especially if they
let you choose one device for mic and another for speaker.

Brad

On 5/16/07, Robert Huitl <bluez-devel@huitl.de> wrote:
>
>
> So why is headsetd blocking the second application while the first one is
> running?

[-- Attachment #1.2: Type: text/html, Size: 1087 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] headsetd has problems serving two applications at a time
  2007-05-17  3:42 ` Brad Midgley
@ 2007-05-17  7:51   ` Tim Chick
  2007-05-17 13:21   ` Robert Huitl
  1 sibling, 0 replies; 13+ messages in thread
From: Tim Chick @ 2007-05-17  7:51 UTC (permalink / raw)
  To: bluez-devel

On Thursday 17 May 2007 04:42, you wrote:
> Robert
>
> headsetd is written to allow a single application to use the headset
> at one time. it doesn't multiplex the mic or mix to the speaker. one
> of the two apps will fail to get exclusive access. it's basically a
> latency optimization but there's room for something like dmix or a
> sound server like pulse to make it more flexible.
>
> if skype is written such that input and output are separate file
> descriptors obtained through independent open() calls then it will
> also fail, even if they're in the same thread. that may be how it's
> written, especially if they let you choose one device for mic and
> another for speaker.
>
Ah.. I think this is why I could not get the audio to work in both 
directions when I tried sparkle (voip client). I ran out of time to 
investigate it, but this matches up.

Can we not do something magic with the .asoundrc again to split it into 
2 devices essentially? I guess this is the dmix plugin, but I thought 
there was something simpler to just split recording and playback. Or is 
dsnoop needed?

Cheers,
Tim


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] headsetd has problems serving two applications at a time
  2007-05-17  3:42 ` Brad Midgley
  2007-05-17  7:51   ` Tim Chick
@ 2007-05-17 13:21   ` Robert Huitl
  2007-05-17 15:34     ` [Bluez-devel] Frequent headset disconnects John Feig
  2007-05-24 13:24     ` [Bluez-devel] headsetd has problems serving two applications at a time Brad Midgley
  1 sibling, 2 replies; 13+ messages in thread
From: Robert Huitl @ 2007-05-17 13:21 UTC (permalink / raw)
  To: BlueZ development

Hi Brad,

On Donnerstag, 17. Mai 2007, Brad Midgley wrote:
> headsetd is written to allow a single application to use the headset at one
> time. it doesn't multiplex the mic or mix to the speaker. one of the two
> apps will fail to get exclusive access. it's basically a latency
> optimization but there's room for something like dmix or a sound server
> like pulse to make it more flexible.

Thanks for pointing that out, not exactly what I wanted to hear, but it's an 
explanation ;-)

I played a bit with dmix, dsnoop, dshare etc., but I cannot get any of the d* 
plugins to work. The error message is always the same:

-----
$ arecord -D headset-test -f s16_le -r 8000  | aplay -D headset-test -f 
s16_le -r 8000
ALSA lib pcm_direct.c:1464:(_snd_pcm_direct_get_slave_ipc_offset) Invalid 
type 'sco' for slave PCM

aplay: main:545: audio open error: Invalid argument
ALSA lib pcm_direct.c:1464:(_snd_pcm_direct_get_slave_ipc_offset) Invalid 
type 'sco' for slave PCM

arecord: main:545: audio open error: Invalid argument
-----

this is with the following sections in .asoundrc (they might not be exactly 
what's needed here, but the same error messages appear as soon as I throw one 
of the dmix/dsnoop/... plugins into the chain):

pcm.dmixed {
       ipc_key 1025
       type dmix
       slave.pcm "headset-sco"
}

pcm.dsnooped {
       ipc_key 1027
       type dsnoop
       slave.pcm "headset-sco"
}

pcm.headset-test {
       type asym
       playback.pcm "dmixed"
       capture.pcm "dsnooped"
}


Could it be that some of the ALSA plugins only work with hardware devices?!

Robert

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bluez-devel]  Frequent headset disconnects
  2007-05-17 13:21   ` Robert Huitl
@ 2007-05-17 15:34     ` John Feig
  2007-05-18 13:13       ` Brad Midgley
  2007-05-24 13:24     ` [Bluez-devel] headsetd has problems serving two applications at a time Brad Midgley
  1 sibling, 1 reply; 13+ messages in thread
From: John Feig @ 2007-05-17 15:34 UTC (permalink / raw)
  To: BlueZ development

Hello,
I've been using the a2dpd app for a couple of weeks now, and really like 
it. I have a few issues though, with the main one being that after a 
couple of minutes of playback, my headphones (HT820) turn off, I turn 
them back on, and playback continues. I use these things long periods of 
time with my iPod and a Jabra a2dp adapter, I can listen for hours on an 
a2dp connection with those without interruption (aside from the 
occasional phone call). But within a couple of minutes using the a2dpd 
app (and amarok or mplayer), the connection gets really choppy, then 
drops out, and I have to turn _on_ my headphones. As you might guess, 
this is a show stopper for me, as I can't really enjoy listening to 
music wirelessly if I can't get through an entire song without turning 
my headphones back on.

Any ideas on why this is happening would be helpful, as right now, I 
don't even know where to start looking. Here's the output when it fails:

A2DPD[11:10:02.275]: a2dp_transfer_raw: Wrote -1 not 603 bytes (sbc.len=118)
A2DPD[11:10:02.275]: transfer_outgoing_packets: Error in transfer 
(transfer=-1)
A2DPD[11:10:02.275]: a2dp_state_disconnect: State 
AVDTP_STATEX_STREAM_CLOSING
A2DPD[11:10:02.275]: a2dp_state_machine: State 
AVDTP_STATEX_STREAM_CLOSING_WAIT
A2DPD[11:10:02.275]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[11:10:05.005]: a2dp_state_machine: Too many answer for AVDTP_CLOSE
A2DPD[11:10:05.005]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[11:10:05.005]: a2dp_disconnect:
A2DPD[11:10:05.005]: a2dp_stream_stop: Closing stream socket 12
A2DPD[11:10:05.005]: a2dp_stream_stop: Closed
A2DPD[11:10:05.005]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[11:10:05.005]: a2dp_disconnect: Closing ctl socket 10
A2DPD[11:10:05.005]: a2dp_disconnect: Closed
A2DPD[11:10:05.005]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[11:10:05.005]: a2dpd_signal_state: Disconnected
A2DPD[11:10:05.005]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[11:10:05.005]: a2dp_state_machine: Role is INITIATOR
A2DPD[11:10:05.005]: a2dp_state_machine: SDP connection on socket 10
A2DPD[11:10:05.005]: a2dp_state_machine: State 
AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[11:10:05.005]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[11:10:11.515]: a2dp_state_machine: SDP connection terminated
A2DPD[11:10:11.515]: a2dp_state_machine: (errno=110:Connection timed 
out)SDP connection failed
A2DPD[11:10:11.515]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[11:10:11.515]: a2dp_disconnect:
A2DPD[11:10:11.516]: a2dp_stream_stop: Closing stream socket -1
A2DPD[11:10:11.516]: a2dp_stream_stop: Closed
A2DPD[11:10:11.516]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[11:10:11.516]: a2dp_disconnect: Closing ctl socket -1
A2DPD[11:10:11.516]: a2dp_disconnect: Closed
A2DPD[11:10:11.516]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[11:10:11.516]: a2dpd_signal_state: Disconnected
A2DPD[11:10:11.523]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[11:10:11.524]: a2dp_state_machine: Role is INITIATOR
A2DPD[11:10:11.524]: a2dp_state_machine: SDP connection on socket 10
A2DPD[11:10:11.524]: a2dp_state_machine: State 
AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[11:10:11.524]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F

Thank you, I appreciate your help,
John

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] Frequent headset disconnects
  2007-05-17 15:34     ` [Bluez-devel] Frequent headset disconnects John Feig
@ 2007-05-18 13:13       ` Brad Midgley
  2007-05-18 15:56         ` John Feig
  0 siblings, 1 reply; 13+ messages in thread
From: Brad Midgley @ 2007-05-18 13:13 UTC (permalink / raw)
  To: feig, BlueZ development


[-- Attachment #1.1: Type: text/plain, Size: 701 bytes --]

John


> I've been using the a2dpd app for a couple of weeks now, and really like
> it. I have a few issues though, with the main one being that after a
> couple of minutes of playback, my headphones (HT820) turn off
>

it looks like alsa_transfer_raw returns -1 once and then a2dpd closes the
connection. Maybe we should be checking for an error state that indicates we
can retry or maybe we should retry a few times regardless.

it could be the set turns off because of the way we terminate the
connection. This is mostly Frederic's playground but I remember locking up
headsets with a2play by accidentally sending data on the stream fd after we
had signaled a stream close on the control fd.

brad

[-- Attachment #1.2: Type: text/html, Size: 959 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] Frequent headset disconnects
  2007-05-18 13:13       ` Brad Midgley
@ 2007-05-18 15:56         ` John Feig
  2007-05-18 19:17           ` [Bluez-devel] RE : " Frederic Dalleau
  0 siblings, 1 reply; 13+ messages in thread
From: John Feig @ 2007-05-18 15:56 UTC (permalink / raw)
  To: BlueZ development


[-- Attachment #1.1: Type: text/plain, Size: 2325 bytes --]

Brad Midgley wrote:
> *John
>
> *
>
>
>     I've been using the a2dpd app for a couple of weeks now, and
>     really like
>     it. I have a few issues though, with the main one being that after a
>     couple of minutes of playback, my headphones (HT820) turn off
>
>
> it looks like alsa_transfer_raw returns -1 once and then a2dpd closes 
> the connection. Maybe we should be checking for an error state that 
> indicates we can retry or maybe we should retry a few times regardless.
>
> it could be the set turns off because of the way we terminate the 
> connection. This is mostly Frederic's playground but I remember 
> locking up headsets with a2play by accidentally sending data on the 
> stream fd after we had signaled a stream close on the control fd.
>
> brad
Brad, thank you for the reply. To try to understand this, you're saying 
that when I get:

a2dp_transfer_raw: Wrote -1 not 603 bytes (sbc.len=118)
transfer_outgoing_packets: Error in transfer (transfer=-1)

The issue could be that the headset is expecting a value of a certain 
length, and since the value -1 is not that length, the headset doens't 
like that, and shuts down? If this is the case, where should I look to 
change that value, and what should it be changed to? I wouldn't mind 
sending some dummy data and have it drop out for a second once in a 
while, as long as I don't have to keep restarting the thing. At least it 
would be a temporary fix.

I found the IF block in a2dpd_output_a2dp.c:

if (a2dp->sk > 0) {
    // Pause?
    // The value 0 have finally been tested ;)
    // However, we may safely simulate a failed write
    if (!a2dp->pause_writing) {
        // Send our data
            if ((written = write(a2dp->sk, a2dp->buf, a2dp->len)) != 
a2dp->len) {
                // Error while sending data
                    DBG("Wrote %d not %d bytes (sbc.len=%d)", written, 
a2dp->len, a2dp->sbc.len);
                        // Return the error
                        result = written;
            }
...

That seems to be the only place that contains that string, that I could 
find. I can't find out where the function "write" is defined either.

I'll keep looking, and if you guys can give me some suggestions of 
things to try and what I should be looking at, I will and let you all 
know how it goes.

Thanks again,
John

[-- Attachment #1.2: Type: text/html, Size: 3606 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bluez-devel] RE :  Frequent headset disconnects
  2007-05-18 15:56         ` John Feig
@ 2007-05-18 19:17           ` Frederic Dalleau
  2007-05-22 14:31             ` John Feig
  0 siblings, 1 reply; 13+ messages in thread
From: Frederic Dalleau @ 2007-05-18 19:17 UTC (permalink / raw)
  To: feig, BlueZ development

[-- Attachment #1: Type: text/plain, Size: 3247 bytes --]

Hi,
I did some recent changes and there are things to solve.
I don't have access to a linux computer right now. 
In your case, enclosing the write call in a while loop may help.

do {
            if ((written = write(a2dp->sk, a2dp->buf, a2dp->len)) != 
a2dp->len) {
                        // Return the error
                        result = written;
            }
} while(written<0 && errno==EAGAIN);

Remove the DBG call.

However, it may burn cpu time if you don't wait a little before retrying.


The best solution would be to find why the packet must be resent.
Let us know if you get something.

Frederic.


-------- Message d'origine--------
De: bluez-devel-bounces@lists.sourceforge.net de la part de John Feig
Date: ven. 18/05/2007 17:56
À: BlueZ development
Objet : Re: [Bluez-devel] Frequent headset disconnects
 
Brad Midgley wrote:
> *John
>
> *
>
>
>     I've been using the a2dpd app for a couple of weeks now, and
>     really like
>     it. I have a few issues though, with the main one being that after a
>     couple of minutes of playback, my headphones (HT820) turn off
>
>
> it looks like alsa_transfer_raw returns -1 once and then a2dpd closes 
> the connection. Maybe we should be checking for an error state that 
> indicates we can retry or maybe we should retry a few times regardless.
>
> it could be the set turns off because of the way we terminate the 
> connection. This is mostly Frederic's playground but I remember 
> locking up headsets with a2play by accidentally sending data on the 
> stream fd after we had signaled a stream close on the control fd.
>
> brad
Brad, thank you for the reply. To try to understand this, you're saying 
that when I get:

a2dp_transfer_raw: Wrote -1 not 603 bytes (sbc.len=118)
transfer_outgoing_packets: Error in transfer (transfer=-1)

The issue could be that the headset is expecting a value of a certain 
length, and since the value -1 is not that length, the headset doens't 
like that, and shuts down? If this is the case, where should I look to 
change that value, and what should it be changed to? I wouldn't mind 
sending some dummy data and have it drop out for a second once in a 
while, as long as I don't have to keep restarting the thing. At least it 
would be a temporary fix.

I found the IF block in a2dpd_output_a2dp.c:

if (a2dp->sk > 0) {
    // Pause?
    // The value 0 have finally been tested ;)
    // However, we may safely simulate a failed write
    if (!a2dp->pause_writing) {
        // Send our data
            if ((written = write(a2dp->sk, a2dp->buf, a2dp->len)) != 
a2dp->len) {
                // Error while sending data
                    DBG("Wrote %d not %d bytes (sbc.len=%d)", written, 
a2dp->len, a2dp->sbc.len);
                        // Return the error
                        result = written;
            }
...

That seems to be the only place that contains that string, that I could 
find. I can't find out where the function "write" is defined either.

I'll keep looking, and if you guys can give me some suggestions of 
things to try and what I should be looking at, I will and let you all 
know how it goes.

Thanks again,
John


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4632 bytes --]

[-- Attachment #3: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] RE :  Frequent headset disconnects
  2007-05-18 19:17           ` [Bluez-devel] RE : " Frederic Dalleau
@ 2007-05-22 14:31             ` John Feig
  2007-05-22 17:51               ` John Feig
  0 siblings, 1 reply; 13+ messages in thread
From: John Feig @ 2007-05-22 14:31 UTC (permalink / raw)
  To: BlueZ development

[-- Attachment #1: Type: text/plain, Size: 2322 bytes --]

Frederic Dalleau wrote:
> Hi,
> I did some recent changes and there are things to solve.
> I don't have access to a linux computer right now. 
> In your case, enclosing the write call in a while loop may help.
>
> do {
>             if ((written = write(a2dp->sk, a2dp->buf, a2dp->len)) != 
> a2dp->len) {
>                         // Return the error
>                         result = written;
>             }
> } while(written<0 && errno==EAGAIN);
>
> Remove the DBG call.
>
> However, it may burn cpu time if you don't wait a little before retrying.
>
>
> The best solution would be to find why the packet must be resent.
> Let us know if you get something.
>
> Frederic.
>   
Ok, I plugged that loop into the code and it seemed to be better at 
first, but the disconnects continue. See attachment. (Attachment 
contains output during failure, loops many times, probably only the 
first couple are of importance).

As you can see from the  line (errno=112:Host is down), the headphones 
are disconnected at this point, and I actually have to turn my 
headphones back on.

I should mention that I also use my bluetooth connection, 
simultaneously, with my phone for internet access, and the a2dpd seems 
to get upset whenever I try to grab data from the net. I figured that my 
bluetooth chip should be able to handle this, as I thought that the 
point of bluetooth was to be able to connect up to 7 devices to a single 
chip, and the one I have (integrated into my laptop) says that it is 
v2.0+EDR, which I figured would be plenty of bandwidth. I gave the ppp 
connection a baud rate of 115200, and set the bitpool at 53 (had to 
hardcode, but that's another topic of discussion) which is i think a 
baud rate of 763200. Now, when I had the bitpool set at 33, or 475200 
baud, the behavior was the same, and the headphones would get kicked off 
frequently.

So, I wonder, based on Brad's comment, if the "transfer=-1" is what 
causes the shutoff of my headphones. And, if that's the case, where 
should I go to change the value being written, and what should that 
value be? If I change the "-1" to some junk data, will that collect on 
the client side, and cause issues there, or could the headphone crashes 
be because of collected junk data?

Let me know what you guys think. And thanks for the help so far.
-John

[-- Attachment #2: a2dpd.output.txt --]
[-- Type: text/plain, Size: 32993 bytes --]

A2DPD[09:42:00.165]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=55283 us.
A2DPD[09:42:01.169]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=67757 us.
A2DPD[09:42:02.169]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=76054 us.
A2DPD[09:42:03.169]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=55938 us.
A2DPD[09:42:04.181]: a2dp_transfer_raw: Bandwith: 42210 (329 kbps) 53, latency=52015 us.
A2DPD[09:42:04.491]: transfer_outgoing_packets: Error in transfer (transfer=-1)
A2DPD[09:42:04.491]: a2dp_state_disconnect: State AVDTP_STATEX_STREAM_CLOSING
A2DPD[09:42:04.491]: a2dp_state_machine: State AVDTP_STATEX_STREAM_CLOSING_WAIT
A2DPD[09:42:04.491]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:42:07.002]: a2dp_state_machine: Too many answer for AVDTP_CLOSE
A2DPD[09:42:07.002]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:42:07.006]: a2dp_disconnect:
A2DPD[09:42:07.006]: a2dp_stream_stop: Closing stream socket 12
A2DPD[09:42:07.006]: a2dp_stream_stop: Closed
A2DPD[09:42:07.006]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:42:07.006]: a2dp_disconnect: Closing ctl socket 10
A2DPD[09:42:07.006]: a2dp_disconnect: Closed
A2DPD[09:42:07.006]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:42:07.006]: a2dpd_signal_state: Disconnected
A2DPD[09:42:07.010]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:42:07.010]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:42:07.010]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:42:07.010]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:42:07.010]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:42:10.546]: a2dp_state_machine: SDP connection terminated
A2DPD[09:42:10.598]: get_avdtp_psm: Parsing results
A2DPD[09:42:10.598]: get_avdtp_psm: Record
A2DPD[09:42:10.598]: get_avdtp_psm: Service Search OK
A2DPD[09:42:10.628]: get_avdtp_psm: Checking non spec audio
A2DPD[09:42:10.628]: a2dp_state_machine: Found psm 25
A2DPD[09:42:10.628]: a2dp_state_machine: State AVDTP_STATEX_CTL_CONNECTING
A2DPD[09:42:10.628]: a2dp_state_machine: Socket is 10
A2DPD[09:42:10.628]: a2dp_state_machine: State AVDTP_STATEX_CTL_CONNECTING_WAIT
A2DPD[09:42:30.655]: a2dp_state_machine: (errno=110:Connection timed out)CTL connection failed
A2DPD[09:42:30.655]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:42:30.655]: a2dp_disconnect:
A2DPD[09:42:30.655]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:42:30.655]: a2dp_stream_stop: Closed
A2DPD[09:42:30.655]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:42:30.655]: a2dp_disconnect: Closing ctl socket 10
A2DPD[09:42:30.655]: a2dp_disconnect: Closed
A2DPD[09:42:30.655]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:42:30.655]: a2dpd_signal_state: Disconnected
A2DPD[09:42:30.659]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:42:30.659]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:42:30.659]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:42:30.659]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:42:30.659]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:42:40.932]: a2dp_state_machine: SDP connection terminated
A2DPD[09:42:40.932]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:42:40.932]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:42:40.936]: a2dp_disconnect:
A2DPD[09:42:40.936]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:42:40.936]: a2dp_stream_stop: Closed
A2DPD[09:42:40.936]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:42:40.936]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:42:40.936]: a2dp_disconnect: Closed
A2DPD[09:42:40.936]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:42:40.936]: a2dpd_signal_state: Disconnected
A2DPD[09:42:40.940]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:42:40.940]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:42:40.940]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:42:40.940]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:42:40.940]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:42:51.196]: a2dp_state_machine: SDP connection terminated
A2DPD[09:42:51.196]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:42:51.196]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:42:51.200]: a2dp_disconnect:
A2DPD[09:42:51.200]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:42:51.200]: a2dp_stream_stop: Closed
A2DPD[09:42:51.200]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:42:51.200]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:42:51.200]: a2dp_disconnect: Closed
A2DPD[09:42:51.200]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:42:51.200]: a2dpd_signal_state: Disconnected
A2DPD[09:42:51.205]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:42:51.205]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:42:51.205]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:42:51.205]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:42:51.205]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:43:01.461]: a2dp_state_machine: SDP connection terminated
A2DPD[09:43:01.461]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:43:01.461]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:43:01.465]: a2dp_disconnect:
A2DPD[09:43:01.465]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:43:01.465]: a2dp_stream_stop: Closed
A2DPD[09:43:01.465]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:43:01.465]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:43:01.465]: a2dp_disconnect: Closed
A2DPD[09:43:01.465]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:43:01.465]: a2dpd_signal_state: Disconnected
A2DPD[09:43:01.469]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:43:01.469]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:43:01.469]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:43:01.469]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:43:01.469]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:43:11.722]: a2dp_state_machine: SDP connection terminated
A2DPD[09:43:11.722]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:43:11.722]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:43:11.726]: a2dp_disconnect:
A2DPD[09:43:11.726]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:43:11.726]: a2dp_stream_stop: Closed
A2DPD[09:43:11.726]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:43:11.726]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:43:11.726]: a2dp_disconnect: Closed
A2DPD[09:43:11.726]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:43:11.726]: a2dpd_signal_state: Disconnected
A2DPD[09:43:11.730]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:43:11.730]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:43:11.730]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:43:11.730]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:43:11.730]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:43:21.987]: a2dp_state_machine: SDP connection terminated
A2DPD[09:43:21.987]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:43:21.987]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:43:21.988]: a2dp_disconnect:
A2DPD[09:43:21.988]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:43:21.988]: a2dp_stream_stop: Closed
A2DPD[09:43:21.988]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:43:21.988]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:43:21.988]: a2dp_disconnect: Closed
A2DPD[09:43:21.988]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:43:21.988]: a2dpd_signal_state: Disconnected
A2DPD[09:43:21.994]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:43:21.994]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:43:21.994]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:43:21.994]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:43:21.994]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:43:32.254]: a2dp_state_machine: SDP connection terminated
A2DPD[09:43:32.254]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:43:32.254]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:43:32.254]: a2dp_disconnect:
A2DPD[09:43:32.254]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:43:32.254]: a2dp_stream_stop: Closed
A2DPD[09:43:32.254]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:43:32.254]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:43:32.254]: a2dp_disconnect: Closed
A2DPD[09:43:32.254]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:43:32.254]: a2dpd_signal_state: Disconnected
A2DPD[09:43:32.255]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:43:32.255]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:43:32.255]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:43:32.255]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:43:32.255]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:43:42.516]: a2dp_state_machine: SDP connection terminated
A2DPD[09:43:42.516]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:43:42.516]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:43:42.516]: a2dp_disconnect:
A2DPD[09:43:42.516]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:43:42.516]: a2dp_stream_stop: Closed
A2DPD[09:43:42.516]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:43:42.516]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:43:42.516]: a2dp_disconnect: Closed
A2DPD[09:43:42.516]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:43:42.516]: a2dpd_signal_state: Disconnected
A2DPD[09:43:42.516]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:43:42.516]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:43:42.516]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:43:42.516]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:43:42.516]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:43:48.232]: pollfd_cb_sockfd: Client 11 got index 0
A2DPD[09:43:48.232]: stream_client_state_streamingsetup: PLAYBACK thread client_index=0, socket=11, id=0 started (44100 Hz, 2 channels, 16 bits)
A2DPD[09:43:51.940]: stream_client_state_streaming: Did not receive pkt_hdr
A2DPD[09:43:51.940]: pollfd_cb_clients: Client 1: Error detected (err=1, toc=1, err=0, hup=1)
A2DPD[09:43:52.772]: a2dp_state_machine: SDP connection terminated
A2DPD[09:43:52.772]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:43:52.772]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:43:52.776]: a2dp_disconnect:
A2DPD[09:43:52.776]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:43:52.776]: a2dp_stream_stop: Closed
A2DPD[09:43:52.776]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:43:52.776]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:43:52.776]: a2dp_disconnect: Closed
A2DPD[09:43:52.776]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:43:52.776]: a2dpd_signal_state: Disconnected
A2DPD[09:43:52.780]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:43:52.780]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:43:52.780]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:43:52.780]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:43:52.780]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:44:03.037]: a2dp_state_machine: SDP connection terminated
A2DPD[09:44:03.037]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:44:03.037]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:44:03.041]: a2dp_disconnect:
A2DPD[09:44:03.041]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:44:03.041]: a2dp_stream_stop: Closed
A2DPD[09:44:03.041]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:44:03.041]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:44:03.041]: a2dp_disconnect: Closed
A2DPD[09:44:03.041]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:44:03.041]: a2dpd_signal_state: Disconnected
A2DPD[09:44:03.045]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:44:03.045]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:44:03.045]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:44:03.045]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:44:03.045]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:44:13.301]: a2dp_state_machine: SDP connection terminated
A2DPD[09:44:13.301]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:44:13.302]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:44:13.306]: a2dp_disconnect:
A2DPD[09:44:13.306]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:44:13.306]: a2dp_stream_stop: Closed
A2DPD[09:44:13.306]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:44:13.306]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:44:13.306]: a2dp_disconnect: Closed
A2DPD[09:44:13.306]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:44:13.306]: a2dpd_signal_state: Disconnected
A2DPD[09:44:13.310]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:44:13.310]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:44:13.310]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:44:13.310]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:44:13.310]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:44:23.566]: a2dp_state_machine: SDP connection terminated
A2DPD[09:44:23.566]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:44:23.566]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:44:23.571]: a2dp_disconnect:
A2DPD[09:44:23.571]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:44:23.571]: a2dp_stream_stop: Closed
A2DPD[09:44:23.571]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:44:23.571]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:44:23.571]: a2dp_disconnect: Closed
A2DPD[09:44:23.571]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:44:23.571]: a2dpd_signal_state: Disconnected
A2DPD[09:44:23.574]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:44:23.574]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:44:23.574]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:44:23.574]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:44:23.574]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:44:33.827]: a2dp_state_machine: SDP connection terminated
A2DPD[09:44:33.827]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:44:33.827]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:44:33.834]: a2dp_disconnect:
A2DPD[09:44:33.834]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:44:33.834]: a2dp_stream_stop: Closed
A2DPD[09:44:33.834]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:44:33.834]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:44:33.834]: a2dp_disconnect: Closed
A2DPD[09:44:33.834]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:44:33.834]: a2dpd_signal_state: Disconnected
A2DPD[09:44:33.834]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:44:33.834]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:44:33.835]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:44:33.835]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:44:33.835]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:44:44.097]: a2dp_state_machine: SDP connection terminated
A2DPD[09:44:44.097]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:44:44.097]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:44:44.098]: a2dp_disconnect:
A2DPD[09:44:44.098]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:44:44.098]: a2dp_stream_stop: Closed
A2DPD[09:44:44.098]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:44:44.098]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:44:44.098]: a2dp_disconnect: Closed
A2DPD[09:44:44.098]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:44:44.098]: a2dpd_signal_state: Disconnected
A2DPD[09:44:44.098]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:44:44.098]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:44:44.098]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:44:44.098]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:44:44.098]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:44:54.360]: a2dp_state_machine: SDP connection terminated
A2DPD[09:44:54.360]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:44:54.360]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:44:54.360]: a2dp_disconnect:
A2DPD[09:44:54.360]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:44:54.360]: a2dp_stream_stop: Closed
A2DPD[09:44:54.360]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:44:54.360]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:44:54.360]: a2dp_disconnect: Closed
A2DPD[09:44:54.360]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:44:54.360]: a2dpd_signal_state: Disconnected
A2DPD[09:44:54.361]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:44:54.361]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:44:54.361]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:44:54.361]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:44:54.361]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:04.617]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:04.617]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:45:04.617]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:04.621]: a2dp_disconnect:
A2DPD[09:45:04.621]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:04.621]: a2dp_stream_stop: Closed
A2DPD[09:45:04.621]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:04.621]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:04.621]: a2dp_disconnect: Closed
A2DPD[09:45:04.621]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:04.621]: a2dpd_signal_state: Disconnected
A2DPD[09:45:04.624]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:04.624]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:04.624]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:04.625]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:04.625]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:14.889]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:14.889]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:45:14.889]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:14.889]: a2dp_disconnect:
A2DPD[09:45:14.889]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:14.889]: a2dp_stream_stop: Closed
A2DPD[09:45:14.889]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:14.889]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:14.889]: a2dp_disconnect: Closed
A2DPD[09:45:14.889]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:14.889]: a2dpd_signal_state: Disconnected
A2DPD[09:45:14.890]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:14.890]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:14.890]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:14.890]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:14.890]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:25.142]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:25.142]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:45:25.142]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:25.146]: a2dp_disconnect:
A2DPD[09:45:25.146]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:25.146]: a2dp_stream_stop: Closed
A2DPD[09:45:25.146]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:25.146]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:25.146]: a2dp_disconnect: Closed
A2DPD[09:45:25.146]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:25.146]: a2dpd_signal_state: Disconnected
A2DPD[09:45:25.150]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:25.150]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:25.150]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:25.150]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:25.150]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:35.407]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:35.407]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:45:35.407]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:35.407]: a2dp_disconnect:
A2DPD[09:45:35.407]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:35.407]: a2dp_stream_stop: Closed
A2DPD[09:45:35.407]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:35.407]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:35.407]: a2dp_disconnect: Closed
A2DPD[09:45:35.407]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:35.407]: a2dpd_signal_state: Disconnected
A2DPD[09:45:35.415]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:35.415]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:35.415]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:35.415]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:35.415]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:45.671]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:45.671]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:45:45.671]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:45.679]: a2dp_disconnect:
A2DPD[09:45:45.679]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:45.679]: a2dp_stream_stop: Closed
A2DPD[09:45:45.679]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:45.679]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:45.679]: a2dp_disconnect: Closed
A2DPD[09:45:45.679]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:45.679]: a2dpd_signal_state: Disconnected
A2DPD[09:45:45.679]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:45.680]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:45.680]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:45.680]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:45.680]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:55.936]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:55.936]: a2dp_state_machine: (errno=112:Host is down)SDP connection failed
A2DPD[09:45:55.936]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:55.940]: a2dp_disconnect:
A2DPD[09:45:55.940]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:55.940]: a2dp_stream_stop: Closed
A2DPD[09:45:55.940]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:55.940]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:55.940]: a2dp_disconnect: Closed
A2DPD[09:45:55.940]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:55.940]: a2dpd_signal_state: Disconnected
A2DPD[09:45:55.944]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:55.944]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:55.944]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:55.944]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:55.944]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:55.960]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:55.960]: a2dp_state_machine: (errno=16:Device or resource busy)SDP connection failed
A2DPD[09:45:55.960]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:55.960]: a2dp_disconnect:
A2DPD[09:45:55.960]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:55.960]: a2dp_stream_stop: Closed
A2DPD[09:45:55.960]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:55.960]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:55.960]: a2dp_disconnect: Closed
A2DPD[09:45:55.960]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:55.960]: a2dpd_signal_state: Disconnected
A2DPD[09:45:55.964]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:55.964]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:55.964]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:55.964]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:55.964]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:55.980]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:55.980]: a2dp_state_machine: (errno=16:Device or resource busy)SDP connection failed
A2DPD[09:45:55.980]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:55.984]: a2dp_disconnect:
A2DPD[09:45:55.984]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:55.984]: a2dp_stream_stop: Closed
A2DPD[09:45:55.984]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:55.984]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:55.984]: a2dp_disconnect: Closed
A2DPD[09:45:55.984]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:55.984]: a2dpd_signal_state: Disconnected
A2DPD[09:45:55.984]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:55.984]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:55.984]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:55.984]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:55.984]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:56.000]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:56.000]: a2dp_state_machine: (errno=16:Device or resource busy)SDP connection failed
A2DPD[09:45:56.000]: a2dp_state_machine: State AVDTP_STATEX_DISCONNECTING
A2DPD[09:45:56.004]: a2dp_disconnect:
A2DPD[09:45:56.004]: a2dp_stream_stop: Closing stream socket -1
A2DPD[09:45:56.004]: a2dp_stream_stop: Closed
A2DPD[09:45:56.004]: a2dp_stream_stop: State AVDTP_STATE_IDLE
A2DPD[09:45:56.004]: a2dp_disconnect: Closing ctl socket -1
A2DPD[09:45:56.004]: a2dp_disconnect: Closed
A2DPD[09:45:56.004]: a2dp_disconnect: State AVDTP_STATE_DISCONNECTED
A2DPD[09:45:56.004]: a2dpd_signal_state: Disconnected
A2DPD[09:45:56.008]: a2dp_state_connect: State AVDTP_STATEX_SDP_CONNECTING
A2DPD[09:45:56.008]: a2dp_state_machine: Role is INITIATOR
A2DPD[09:45:56.008]: a2dp_state_machine: SDP connection on socket 10
A2DPD[09:45:56.008]: a2dp_state_machine: State AVDTP_STATEX_SDP_CONNECTING_WAIT
A2DPD[09:45:56.008]: a2dpd_signal_state: Connecting 00:07:A4:B8:68:8F
A2DPD[09:45:56.480]: a2dp_state_machine: SDP connection terminated
A2DPD[09:45:56.557]: get_avdtp_psm: Parsing results
A2DPD[09:45:56.557]: get_avdtp_psm: Record
A2DPD[09:45:56.557]: get_avdtp_psm: Service Search OK
A2DPD[09:45:56.586]: get_avdtp_psm: Checking non spec audio
A2DPD[09:45:56.586]: a2dp_state_machine: Found psm 25
A2DPD[09:45:56.586]: a2dp_state_machine: State AVDTP_STATEX_CTL_CONNECTING
A2DPD[09:45:56.586]: a2dp_state_machine: Socket is 10
A2DPD[09:45:56.586]: a2dp_state_machine: State AVDTP_STATEX_CTL_CONNECTING_WAIT
A2DPD[09:45:56.632]: pollfd_cb_avdtpfd: AVDTP Accepted 8F:68:B8:A4:07:00 on socket 12
A2DPD[09:45:56.632]: a2dpd_signal_command: new up
A2DPD[09:45:56.632]: async_run_process: Command is dcop amarok player play
A2DPD[09:45:56.632]: async_run_process: argv[0] = dcop
A2DPD[09:45:56.632]: async_run_process: argv[1] = amarok
A2DPD[09:45:56.632]: async_run_process: argv[2] = player
A2DPD[09:45:56.632]: async_run_process: argv[3] = play
A2DPD[09:45:56.632]: async_run_process: argv[4] = NULL
A2DPD[09:45:56.633]: close_server_socket_on_fork: Closing server socket 5
A2DPD[09:45:56.636]: async_run_process: Forked dcop amarok player play
A2DPD[09:45:56.636]: a2dp_state_use_socket: Incoming socket 12 : refused
A2DPD[09:45:56.636]: pollfd_cb_avdtpfd: State machine is busy, closing socket 12
A2DPD[09:45:56.848]: pollfd_cb_sockfd: Client 12 got index 1
A2DPD[09:45:56.848]: stream_client_state_streamingsetup: PLAYBACK thread client_index=1, socket=12, id=0 started (44100 Hz, 2 channels, 16 bits)
A2DPD[09:45:56.920]: a2dp_state_machine: State AVDTP_STATE_IDLE
A2DPD[09:45:56.920]: a2dp_state_machine: State AVDTP_STATEX_DISCOVERING
A2DPD[09:45:56.920]: a2dp_state_machine: State AVDTP_STATEX_DISCOVERING_RESP
A2DPD[09:45:57.040]: a2dp_handle_avdtp_message: Read non command packet (msgtype=MESSAGE_TYPE_ACCEPT,signal=AVDTP_DISCOVER)
A2DPD[09:45:57.040]: a2dp_state_machine: AVDTP_DISCOVER success
A2DPD[09:45:57.040]: a2dp_state_machine: State AVDTP_STATEX_GETTING_CAPABILITIES
A2DPD[09:45:57.044]: a2dp_state_machine: Getting capabilities for SEID=1
A2DPD[09:45:57.044]: a2dp_state_machine: State AVDTP_STATEX_GETTING_CAPABILITIES_RESP
A2DPD[09:45:57.092]: a2dp_handle_avdtp_message: Read non command packet (msgtype=MESSAGE_TYPE_ACCEPT,signal=AVDTP_GET_CAPABILITIES)
A2DPD[09:45:57.092]: a2dp_state_machine: AVDTP_GET_CAPABILITIES success for seid 1
A2DPD[09:45:57.092]: a2dp_state_machine: servcap_cap=1, servcap_len=0,
A2DPD[09:45:57.092]: a2dp_state_machine: cap_type=7, length=6
A2DPD[09:45:57.092]: a2dp_state_machine: media_type=0, codec=0
A2DPD[09:45:57.092]: a2dp_state_machine: A2DPD  Prefered bitpool 53
A2DPD[09:45:57.092]: a2dp_state_machine: Device Prefered bitpool 2 -> 33
A2DPD[09:45:57.092]: a2dp_state_machine: Requested bitpool is greater than perfered device max bitpool, this could be dangerous.
A2DPD[09:45:57.092]: a2dp_state_machine: A2DPD  Selected bitpool 53
A2DPD[09:45:57.092]: a2dp_state_machine: State AVDTP_STATEX_SETTING_CONFIGURATION
A2DPD[09:45:57.096]: a2dp_state_machine: State AVDTP_STATEX_SETTING_CONFIGURATION_RESP
A2DPD[09:45:57.180]: a2dp_handle_avdtp_message: Read non command packet (msgtype=MESSAGE_TYPE_ACCEPT,signal=AVDTP_SET_CONFIGURATION)
A2DPD[09:45:57.180]: a2dp_state_machine: AVDTP_SET_CONFIGURATION success
A2DPD[09:45:57.180]: a2dp_state_machine: State AVDTP_STATEX_STREAM_OPENING
A2DPD[09:45:57.180]: a2dp_state_machine: State AVDTP_STATEX_STREAM_OPENING_RESP
A2DPD[09:45:57.244]: a2dp_handle_avdtp_message: Read non command packet (msgtype=MESSAGE_TYPE_ACCEPT,signal=AVDTP_OPEN)
A2DPD[09:45:57.244]: a2dp_state_machine: AVDTP_OPEN success
A2DPD[09:45:57.244]: a2dp_state_machine: State AVDTP_STATE_CONFIGURED
A2DPD[09:45:57.244]: a2dp_state_machine: State AVDTP_STATEX_STREAM_CONNECTING
A2DPD[09:45:57.248]: a2dp_state_machine: Socket is 13
A2DPD[09:45:57.248]: a2dp_state_machine: State AVDTP_STATEX_STREAM_CONNECTING_WAIT
A2DPD[09:45:57.396]: a2dp_state_machine: Stream connected
A2DPD[09:45:57.396]: get_socket_omtu: Socket 13 imtu=672, omtu=895, flush_to=65535
A2DPD[09:45:57.396]: a2dp_state_machine: State AVDTP_STATE_OPEN_START_STREAMING
A2DPD[09:45:57.396]: a2dp_state_machine: State AVDTP_STATEX_STREAM_STARTING
A2DPD[09:45:57.396]: a2dpd_signal_state: Connected 00:07:A4:B8:68:8F
A2DPD[09:45:57.396]: a2dp_state_machine: State AVDTP_STATEX_STREAM_STARTING_WAIT
A2DPD[09:45:57.512]: a2dp_handle_avdtp_message: Read non command packet (msgtype=MESSAGE_TYPE_ACCEPT,signal=AVDTP_START)
A2DPD[09:45:57.512]: a2dp_state_machine: AVDTP_START success
A2DPD[09:45:57.512]: a2dp_state_machine: State AVDTP_STATE_STREAMING
A2DPD[09:45:57.528]: a2dp_transfer_raw: Bandwith: 12060 (94 kbps) 53, latency=69663 us.
A2DPD[09:45:58.320]: get_socket_omtu: Socket 9 imtu=672, omtu=0, flush_to=65535
A2DPD[09:45:58.320]: pollfd_cb_avrcpfd: socket 14: Connection from 8F:68:B8:A4:07:00, mtu=610 accepted at index 0
A2DPD[09:45:58.540]: a2dp_transfer_raw: Bandwith: 42210 (329 kbps) 53, latency=87989 us.
A2DPD[09:45:59.540]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=68058 us.
A2DPD[09:46:00.544]: a2dp_transfer_raw: Bandwith: 41004 (320 kbps) 53, latency=79954 us.
A2DPD[09:46:00.548]: stream_client_state_streaming: Did not receive pkt_hdr
A2DPD[09:46:00.548]: pollfd_cb_clients: Client 0: Error detected (err=1, toc=1, err=0, hup=1)
A2DPD[09:46:01.544]: a2dp_transfer_raw: Bandwith: 42210 (329 kbps) 53, latency=87707 us.
A2DPD[09:46:02.544]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=67696 us.
A2DPD[09:46:03.552]: a2dp_transfer_raw: Bandwith: 42210 (329 kbps) 53, latency=59922 us.
A2DPD[09:46:04.556]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=67187 us.
A2DPD[09:46:05.557]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=75673 us.
A2DPD[09:46:06.557]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=59607 us.
A2DPD[09:46:07.561]: a2dp_transfer_raw: Bandwith: 41607 (325 kbps) 53, latency=67858 us.


[-- Attachment #3: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] RE :  Frequent headset disconnects
  2007-05-22 14:31             ` John Feig
@ 2007-05-22 17:51               ` John Feig
  0 siblings, 0 replies; 13+ messages in thread
From: John Feig @ 2007-05-22 17:51 UTC (permalink / raw)
  To: BlueZ development

John Feig wrote:
> Frederic Dalleau wrote:
>> Hi,
>> I did some recent changes and there are things to solve.
>> I don't have access to a linux computer right now. In your case, 
>> enclosing the write call in a while loop may help.
>>
>> do {
>>             if ((written = write(a2dp->sk, a2dp->buf, a2dp->len)) != 
>> a2dp->len) {
>>                         // Return the error
>>                         result = written;
>>             }
>> } while(written<0 && errno==EAGAIN);
>>
>> Remove the DBG call.
>>
>> However, it may burn cpu time if you don't wait a little before 
>> retrying.
>>
>>
>> The best solution would be to find why the packet must be resent.
>> Let us know if you get something.
>>
>> Frederic.
>>   
> Ok, I plugged that loop into the code and it seemed to be better at 
> first, but the disconnects continue. See attachment. (Attachment 
> contains output during failure, loops many times, probably only the 
> first couple are of importance).
>
> As you can see from the  line (errno=112:Host is down), the headphones 
> are disconnected at this point, and I actually have to turn my 
> headphones back on.
>
> I should mention that I also use my bluetooth connection, 
> simultaneously, with my phone for internet access, and the a2dpd seems 
> to get upset whenever I try to grab data from the net. I figured that 
> my bluetooth chip should be able to handle this, as I thought that the 
> point of bluetooth was to be able to connect up to 7 devices to a 
> single chip, and the one I have (integrated into my laptop) says that 
> it is v2.0+EDR, which I figured would be plenty of bandwidth. I gave 
> the ppp connection a baud rate of 115200, and set the bitpool at 53 
> (had to hardcode, but that's another topic of discussion) which is i 
> think a baud rate of 763200. Now, when I had the bitpool set at 33, or 
> 475200 baud, the behavior was the same, and the headphones would get 
> kicked off frequently.
>
> So, I wonder, based on Brad's comment, if the "transfer=-1" is what 
> causes the shutoff of my headphones. And, if that's the case, where 
> should I go to change the value being written, and what should that 
> value be? If I change the "-1" to some junk data, will that collect on 
> the client side, and cause issues there, or could the headphone 
> crashes be because of collected junk data?
>
> Let me know what you guys think. And thanks for the help so far.
> -John
Sorry for the repeat message, but I still get disconnects while the 
bluetooth internet connection is not active, and I'm touching anything 
else either. So, basically, it's just a2dpd and amarok that are doing 
anything at all.

-John

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] headsetd has problems serving two applications at a time
  2007-05-17 13:21   ` Robert Huitl
  2007-05-17 15:34     ` [Bluez-devel] Frequent headset disconnects John Feig
@ 2007-05-24 13:24     ` Brad Midgley
  2007-05-24 16:28       ` Marc-André Lureau
  2007-05-24 18:45       ` Robert Huitl
  1 sibling, 2 replies; 13+ messages in thread
From: Brad Midgley @ 2007-05-24 13:24 UTC (permalink / raw)
  To: BlueZ development


[-- Attachment #1.1: Type: text/plain, Size: 358 bytes --]

Robert

> Could it be that some of the ALSA plugins only work with hardware
> devices?!


that is a real possibility. libalsa plugins are definitely second-class.

i am searching around in headsetd to see if it restricts the mic and speaker
sockets to be sent to the same application. it should be easy enough to keep
track of these two independently.

Brad

[-- Attachment #1.2: Type: text/html, Size: 591 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] headsetd has problems serving two applications at a time
  2007-05-24 13:24     ` [Bluez-devel] headsetd has problems serving two applications at a time Brad Midgley
@ 2007-05-24 16:28       ` Marc-André Lureau
  2007-05-24 18:45       ` Robert Huitl
  1 sibling, 0 replies; 13+ messages in thread
From: Marc-André Lureau @ 2007-05-24 16:28 UTC (permalink / raw)
  To: BlueZ development


[-- Attachment #1.1: Type: text/plain, Size: 1454 bytes --]

Hi,

dmix and dsnoop requires hw interrupts. Thats why they are bundled inside
alsa-lib and not in alsa-plugins. If you want to do dmx or dsnoop stuff, you
should definetly have a look at PulseAudio as Brad suggested. Not however
that PulseAudio require NON_BLOCKING alsa pcm. I am unsure about the sco
alsa plugin support for NON_BLOCKING mode. Maybe Brad could comment.

my 2cents,

-- 
Marc-André Lureau, GSmartMix

On 5/24/07, Brad Midgley <bmidgley@gmail.com> wrote:
>
> Robert
>
> > Could it be that some of the ALSA plugins only work with hardware
> > devices?!
>
>
> that is a real possibility. libalsa plugins are definitely second-class.
>
> i am searching around in headsetd to see if it restricts the mic and
> speaker sockets to be sent to the same application. it should be easy enough
> to keep track of these two independently.
>
> Brad
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net<https://mail.google.com/mail?view=cm&tf=0&to=Bluez-devel@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
>

[-- Attachment #1.2: Type: text/html, Size: 2315 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bluez-devel] headsetd has problems serving two applications at a time
  2007-05-24 13:24     ` [Bluez-devel] headsetd has problems serving two applications at a time Brad Midgley
  2007-05-24 16:28       ` Marc-André Lureau
@ 2007-05-24 18:45       ` Robert Huitl
  1 sibling, 0 replies; 13+ messages in thread
From: Robert Huitl @ 2007-05-24 18:45 UTC (permalink / raw)
  To: BlueZ development

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

On Donnerstag, 24. Mai 2007, Brad Midgley wrote:
> Robert
>
> > Could it be that some of the ALSA plugins only work with hardware
> > devices?!
>
> that is a real possibility. libalsa plugins are definitely second-class.
>
> i am searching around in headsetd to see if it restricts the mic and
> speaker sockets to be sent to the same application. it should be easy
> enough to keep track of these two independently.

The code already has provisions for one application connecting several times. 
In the Skype case, the pcm_sco shared object is already loaded into the 
applications memory space and therefore it reuses the already established 
connection to headsetd (in theory):

  if(serverfd == -1) {
    /* First PCM to be opened, try to connect socket to headsetd */
    serverfd = socket(PF_LOCAL, SOCK_STREAM, 0);
    err = connect(serverfd, (struct sockaddr *)&socket_location,
        sizeof(socket_location));
    ...

Here it checks the static variable serverfd to see if a connection to headsetd 
is already established. If so, it should actually use that connection without 
trying to establish another one.

Only if serverfd == -1 (not Skype but the arecord|aplay case), it does the 
do_cfg() and this blocks for a second application.

I'm not sure if this code works as expected for Skype. Need more investigation 
here.

I patched headsetd to allow two applications to connect at the same time. Find 
the patch attached. It makes the arecord|aplay command work, but does not 
help with Skype. (Also, it does not check if both applications tried to open 
the device for playback, so both may end up sending out data to the headset, 
corrupting the stream. Likewise, both applications reading at the same time 
might corrupt the data as well.)

Robert

[-- Attachment #2: sockets.h.diff --]
[-- Type: text/x-diff, Size: 561 bytes --]

Index: sockets.h
===================================================================
RCS file: /cvsroot/bluetooth-alsa/plugz/alsa-plugins/headsetd/sockets.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sockets.h
--- sockets.h	20 Dec 2006 22:54:12 -0000	1.1.1.1
+++ sockets.h	24 May 2007 18:29:33 -0000
@@ -30,8 +30,9 @@
 #define IDX_SCO_SOCK          4
 #define IDX_PCM_APPL_SOCK     5
 #define IDX_SDP_SOCK          6
+#define IDX_PCM_APPL2_SOCK    7
 
-#define DAEMON_NUM_SOCKS 7
+#define DAEMON_NUM_SOCKS 8
 
 extern	int hspd_sockets[DAEMON_NUM_SOCKS];
 

[-- Attachment #3: states.c.diff --]
[-- Type: text/x-diff, Size: 4112 bytes --]

Index: states.c
===================================================================
RCS file: /cvsroot/bluetooth-alsa/plugz/alsa-plugins/headsetd/states.c,v
retrieving revision 1.4
diff -u -r1.4 states.c
--- states.c	25 Jan 2007 20:10:16 -0000	1.4
+++ states.c	24 May 2007 18:29:14 -0000
@@ -261,6 +261,10 @@
 		close(hspd_sockets[IDX_PCM_APPL_SOCK]);
 		hspd_sockets[IDX_PCM_APPL_SOCK] = 0;
 	}
+	if(hspd_sockets[IDX_PCM_APPL2_SOCK] != 0) {
+		close(hspd_sockets[IDX_PCM_APPL2_SOCK]);
+		hspd_sockets[IDX_PCM_APPL2_SOCK] = 0;
+	}
 	if(hspd_sockets[IDX_SCO_SOCK] != 0) {
 		close(hspd_sockets[IDX_SCO_SOCK]);
 		hspd_sockets[IDX_SCO_SOCK] = 0;
@@ -510,6 +514,10 @@
 		close(hspd_sockets[IDX_PCM_APPL_SOCK]);
 		hspd_sockets[IDX_PCM_APPL_SOCK] = 0;
 	}
+	if(hspd_sockets[IDX_PCM_APPL2_SOCK] != 0) {
+		close(hspd_sockets[IDX_PCM_APPL2_SOCK]);
+		hspd_sockets[IDX_PCM_APPL2_SOCK] = 0;
+	}
 	if(hspd_sockets[IDX_SCO_SOCK] != 0) {
 		close(hspd_sockets[IDX_SCO_SOCK]);
 		hspd_sockets[IDX_SCO_SOCK] = 0;
@@ -657,8 +665,7 @@
 	.getNextState  = genericGetNextState,
 };
 
-/* Streaming State */
-static void headsetStreamingEnter(struct State *this)
+static void sendStreamingIndication(struct State *this, int socket)
 {
 	/* Send sco socket to application using ancilliary data - see man 7 unix*/
         char cmsg_b[CMSG_SPACE(sizeof(int))];  /* ancillary data buffer */
@@ -688,10 +695,16 @@
         (*(int *)CMSG_DATA(cmsg)) = hspd_sockets[IDX_SCO_SOCK];
 
 	/* finally send it -we ignore PIPE signal & return code, as any errors will be caught later */
-	int ret = sendmsg(hspd_sockets[IDX_PCM_APPL_SOCK], &msgh, MSG_NOSIGNAL);
+	int ret = sendmsg(socket, &msgh, MSG_NOSIGNAL);
 	if(ret == -1) {
 		syslog(LOG_ERR, "Unable to send SCO socket to appl: %s", strerror(errno));
 	}
+}
+
+/* Streaming State */
+static void headsetStreamingEnter(struct State *this)
+{
+	sendStreamingIndication(this, hspd_sockets[IDX_PCM_APPL_SOCK]);
 	/* This is not a transitional state */
 	this->_next_state = this;	
 }
@@ -737,9 +750,46 @@
 	}
 }
 
+/* handle a second application trying to connect */
+static void headsetStreamingHandleApplConnReq(struct State *this)
+{
+syslog(LOG_INFO, "A second application connection is requested");                                
+	struct sockaddr_un client_addr;
+	unsigned int client_addr_len = sizeof(client_addr);
+	/* Per default stay in same state */
+	this->_next_state = this;
+	
+	/* Connect Appli to us */
+	int _appl_sock = accept(hspd_sockets[IDX_PCM_APPL_SRV_SOCK], (struct sockaddr *)&client_addr, &client_addr_len);
+	if(_appl_sock != -1) {
+		fcntl(_appl_sock, F_SETFL, O_NONBLOCK);
+		if(recv_cfg(_appl_sock, 0, 0) >= 0) {
+			if(hspd_sockets[IDX_PCM_APPL2_SOCK] == 0) {
+				/* secondary connection from application */
+				hspd_sockets[IDX_PCM_APPL2_SOCK] = _appl_sock;
+				sendStreamingIndication(this, _appl_sock);
+			}
+			else {
+				/* we already handle two connections with applications */
+				syslog(LOG_INFO, "Already handling two application connections, cannot accept another one");
+			        appl_send_error_pkt(EBUSY, _appl_sock);
+			        close(_appl_sock);
+			}
+		}
+		else {
+			/* else : stay where we are */
+			close(_appl_sock);
+		}
+	}
+	else {
+		syslog(LOG_ERR, "unable to accept 2nd local application connection, %s", strerror(errno));
+	}
+}
+
 struct State HeadsetStreamingState = {
 	.name = "Streaming",
 	.pollEvents = {
+                [IDX_PCM_APPL_SRV_SOCK] = POLLIN,
 		[IDX_CTL_APPL_SRV_SOCK] = POLLIN,
 		[IDX_PCM_APPL_SOCK]   = POLLIN,
 		[IDX_RFCOMM_SOCK] = POLLIN,
@@ -751,6 +801,7 @@
 	.readSco       = headsetStreamingReadSco,
 	.readCtlAppl   = connectedReadCtlAppl,
 	.getNextState  = genericGetNextState,
+        .handleApplConnReq = headsetStreamingHandleApplConnReq,
 };
 
 /* Zombie State */
@@ -761,6 +812,10 @@
 		close(hspd_sockets[IDX_PCM_APPL_SOCK]);
 		hspd_sockets[IDX_PCM_APPL_SOCK] = 0;
 	}
+	if(hspd_sockets[IDX_PCM_APPL2_SOCK] != 0) {
+		close(hspd_sockets[IDX_PCM_APPL2_SOCK]);
+		hspd_sockets[IDX_PCM_APPL2_SOCK] = 0;
+	}
 	/* This is not a transitional state */
 	this->_next_state = this;	
 }

[-- Attachment #4: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #5: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-05-24 18:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-17  0:07 [Bluez-devel] headsetd has problems serving two applications at a time Robert Huitl
2007-05-17  3:42 ` Brad Midgley
2007-05-17  7:51   ` Tim Chick
2007-05-17 13:21   ` Robert Huitl
2007-05-17 15:34     ` [Bluez-devel] Frequent headset disconnects John Feig
2007-05-18 13:13       ` Brad Midgley
2007-05-18 15:56         ` John Feig
2007-05-18 19:17           ` [Bluez-devel] RE : " Frederic Dalleau
2007-05-22 14:31             ` John Feig
2007-05-22 17:51               ` John Feig
2007-05-24 13:24     ` [Bluez-devel] headsetd has problems serving two applications at a time Brad Midgley
2007-05-24 16:28       ` Marc-André Lureau
2007-05-24 18:45       ` Robert Huitl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).