Skip to contentSkip to conversation

audio: Fix missing reply to Acquire in AVDTP

PATCH In review Frédéric Dalleau 2 participants 2 messages Jul 2, 2012 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 audio: Fix missing reply to Acquire in AVDTP

Calling org.bluez.MediaEndpoint.Acquire ends in avdtp_start(). If bluez is acceptor of AVDTP_OPEN, then avdtp_start is delayed in a timer in order to wait for the initiator to send AVDTP_START. If the timer expires, avdtp_start() is called a second time and find that Bluez is acceptor. This time, since a timer already exists, Bluez does nothing and the answer to Acquire is never sent.
The idea of this patch is that if we get in the timeout, we will no longer care whether we accepted open or not.

---
 audio/avdtp.c |    2 ++
 1 file changed, 2 insertions(+)
audio/avdtp.c +2 -0
index 56a0905..e431ce8 100644
@@ -3627,6 +3627,8 @@ static gboolean start_timeout(gpointer user_data)
 	struct avdtp_stream *stream = user_data;
 	struct avdtp *session = stream->session;
 
+	stream->open_acp = 0;
+
 	if (avdtp_start(session, stream) < 0)
 		error("wait_timeout: avdtp_start failed");
 
Signature · 1 line
1.7.9.5
#1 lore raw

Hi Frédéric,

Quoted 26 lines · Frédéric Dalleau

Calling org.bluez.MediaEndpoint.Acquire ends in avdtp_start(). If bluez is acceptor of AVDTP_OPEN, then avdtp_start is delayed in a timer in order to wait for the initiator to send AVDTP_START. If the timer expires, avdtp_start() is called a second time and find that Bluez is acceptor. This time, since a timer already exists, Bluez does nothing and the answer to Acquire is never sent.
The idea of this patch is that if we get in the timeout, we will no longer care whether we accepted open or not.

---
 audio/avdtp.c |    2 ++
 1 file changed, 2 insertions(+)
audio/avdtp.c +2 -1
index 56a0905..e431ce8 100644
@@ -3627,6 +3627,8 @@ static gboolean start_timeout(gpointer user_data)
        struct avdtp_stream *stream = user_data;
        struct avdtp *session = stream->session;
 
+       stream->open_acp = 0;
+
        if (avdtp_start(session, stream) < 0)
                error("wait_timeout: avdtp_start failed");
 
--
Quoted 2 lines

1.7.9.5

Pushed, thanks.

Signature · 1 line
Luiz Augusto von Dentz