linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Race between SCO disconnection and AVDTP Start
@ 2010-05-28  9:58 Daniel Örstadius
  2010-05-30 10:44 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Örstadius @ 2010-05-28  9:58 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

If the audio client closes the SCO connection (by disconnecting the
unix socket to bluetoothd) and then immediately tries to open an A2DP
connection, the kernel might not send the SCO disconnect and AVDTP
Start to the remote in the sequence they were requested by bluetoothd.

Is there a way to preserve the order, so that SCO disc is consistently
sent before AVDTP Start? (some headsets behave better in this case)

Have tried with the sockopt SO_LINGER on the SCO socket, but it didn't
seem to make any difference [1].

/Daniel

[1] Not sure what LINGER really does here. Looking at the code in
sco_sock_shutdown(), it waits for the BT_CLOSED state:

__sco_sock_close(sk);

if (sock_flag(sk, SOCK_LINGER) && sk->sk_lingertime)
        err = bt_sock_wait_state(sk, BT_CLOSED, sk->sk_lingertime);


However the socket state is set to BT_CLOSED in sco_chan_del() which
is called from __sco_sock_close(), so it looks like it's waiting for a
state that's already set (or maybe I'm just missing something here?).

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

end of thread, other threads:[~2010-05-31  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28  9:58 Race between SCO disconnection and AVDTP Start Daniel Örstadius
2010-05-30 10:44 ` Marcel Holtmann
2010-05-31  8:33   ` Daniel Örstadius

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).