Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 91a8cc85 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix possible race when confirming stream start

It could happen that ConfirmStreamingRequest is called in the main
thread before, StartRequest() ends and sets pending flag.

That could lead to incorrect Bluetooth Audio Hal state - stay in
STARTING state.

08-30 11:14:06.921114  8896 11089 I bt_stack: [INFO:le_audio_software_aidl.cc(69)] StartRequest
08-30 11:14:06.921221  8896  8965 I bt_stack: [INFO:client.cc(2967)] OnAudioSinkResume
08-30 11:14:06.921272  8896  8965 I bt_stack:  audio_receiver_state: IDLE
08-30 11:14:06.921272  8896  8965 I bt_stack:  audio_sender_state: READY_TO_RELEASE
08-30 11:14:06.921272  8896  8965 I bt_stack:  configuration_context_type_: 4
08-30 11:14:06.921299  8896  8965 I bt_stack: [INFO:client_audio.cc(428)] ConfirmStreamingRequest
08-30 11:14:06.921314  8896  8965 I bt_stack: [INFO:le_audio_software.cc(197)] ConfirmStreamingRequest
08-30 11:14:06.921327  8896  8965 W bt_stack: [WARNING:le_audio_software.cc(212)] , no pending start stream request

<snip>

08-30 11:14:11.421940   817 12545 E BTAudioHalDeviceProxyAIDL: Start: session_type=LE_AUDIO_SOFTWARE_ENCODING_DATAPATH, cookie=0x400, state=STARTING failure
08-30 11:14:11.422137   817 12545 E BTAudioHalStream: out_write: state=STARTING failed to resume
08-30 11:14:11.438755   817 12545 I BTAudioHalStream: out_write: state=STARTING first time bytes=1920
08-30 11:14:11.438829   817 12545 W BTAudioHalStream: out_resume: state=STARTING NOT ready to resume?!
08-30 11:14:11.438852   817 12545 E BTAudioHalStream: out_write: state=STARTING failed to resume

This patch makes sure that when ConfirmStreamingRequest
Bug: 244299911
Test: atest BluetoothInstrumentationTests
Tag: #feature

Change-Id: I1ffb35e48212e9a75bc7b3b9d0c15716d419d62b
parent eee558b5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment