[RFC] [PATCH] Do no process a stream as connected if AVDTP set configuration failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Right now, if set configuration fails then the
sink.c:stream_setup_complete seems to consider the stream connected.
So the DBus AudioSink.Connect() call returns without error. But the
stream is not actually ready.

I have a feeling we may want to do some more cleanup, but this patch
does the trick for us.

It is easy to reproduce the problem with the HTC BH S100. If you
quickly disconnect and then reconnect it will return AVDTP set
configuration failed (presumably because it hasn't closed the SEP on
its end yet), but Dbus does not return an error for Connect.

The verbose hcid logs for this problem look like:

  102        /system/bin/hcid   I  hcid[103]: avdtp_ref(0x145e8): ref=2
  102        /system/bin/hcid   I  hcid[103]: Discovery complete
  102        /system/bin/hcid   I  hcid[103]: a2dp_source_config:
selected SEP 0x12100
  102        /system/bin/hcid   I  hcid[103]: avdtp_ref(0x145e8): ref=3
  102        /system/bin/hcid   I  hcid[103]: setup_ref(0x11930): ref=1
  102        /system/bin/hcid   I  hcid[103]:
avdtp_set_configuration(0x145e8): int_seid=1, acp_seid=1
  102        /system/bin/hcid   I  hcid[103]: stream creation in progress
  102        /system/bin/hcid   I  hcid[103]: session_cb
  102        /system/bin/hcid   I  hcid[103]: SET_CONFIGURATION
request rejected: Stream End Point in Use (19)
  102        /system/bin/hcid   I  hcid[103]: Source 0x12100:
Set_Configuration_Cfm
  102        /system/bin/hcid   I  hcid[103]: setup_ref(0x11930): ref=2
  102        /system/bin/hcid   I  hcid[103]: npelly 174
stream_setup_complete session=0x145e8 sep=0x120d8 stream=0x14ec0
err=0xbeea8aa4 user_data=0x13de8
  102        /system/bin/hcid   I  hcid[103]: Stream successfully created



>From 47866d9e0e9596b8682293f601d195ef390bfd87 Mon Sep 17 00:00:00 2001
From: Nick Pelly <npelly@xxxxxxxxxx>
Date: Fri, 6 Mar 2009 16:53:04 -0800
Subject: [PATCH] Do not process stream as connected if AVDTP set
configuration failed.

---
 audio/sink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/sink.c b/audio/sink.c
index 44faacf..f204cb1 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -191,7 +191,7 @@ static void stream_setup_complete(struct avdtp
*session, struct a2dp_sep *sep,

        pending = sink->connect;

-       if (stream) {
+       if (stream & !err) {
                debug("Stream successfully created");

                if (pending->msg) {
-- 
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux