Re: [RFC 19/20] audio/sink: Fix not notifying service about connection state

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

 



Hi Mikel,

On Thu, Jul 4, 2013 at 10:05 AM, Mikel Astiz <mikel.astiz.oss@xxxxxxxxx> wrote:
> Hi Luiz,
>
> On Wed, Jul 3, 2013 at 5:15 PM, Luiz Augusto von Dentz
> <luiz.dentz@xxxxxxxxx> wrote:
>> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
>>
>> btd_service_connecting_complete should be called whenever the service
>> is connected otherwise the service state will not be consistent.
>> ---
>>  profiles/audio/sink.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
>> index bb9ab21..5206920 100644
>> --- a/profiles/audio/sink.c
>> +++ b/profiles/audio/sink.c
>> @@ -164,6 +164,7 @@ static void stream_state_changed(struct avdtp_stream *stream,
>>                 sink->cb_id = 0;
>>                 break;
>>         case AVDTP_STATE_OPEN:
>> +               btd_service_connecting_complete(sink->service, 0);
>>                 sink_set_state(sink, SINK_STATE_CONNECTED);
>>                 break;
>>         case AVDTP_STATE_STREAMING:
>> @@ -212,11 +213,8 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep,
>>
>>         sink->connect_id = 0;
>>
>> -       if (stream) {
>> -               DBG("Stream successfully created");
>> -               btd_service_connecting_complete(sink->service, 0);
>> +       if (stream)
>>                 return;
>> -       }
>>
>>         avdtp_unref(sink->session);
>>         sink->session = NULL;
>> --
>
> If this is a fix, it'd be good to document the steps to reproduce and
> point out the commit that broke this.
>
> In particular, I'm interested in knowing whether this was introduced
> during the transition to btd_service. If you look at
> 10620c1c0fbb211455fde597a1d2e5e47806f25d, you'll see that the previous
> approach also missed the state notification in stream_state_changed().
>
> If this is indeed an issue introduced by btd_service, other profiles
> might need to be double-checked.

It is quite easy to reproduce, revert these patches and make a
incoming connection, stream_setup_complete is never called for
incoming connection thus causing the policy plugin to not be notified
and AVRCP does not connect for example with WP8 which doesn't connect
AVRCP automatically.


--
Luiz Augusto von Dentz
--
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