summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Łukasz Rymanowski <rlukasz@google.com> 2025-03-19 17:43:44 +0000
committer Łukasz Rymanowski <rlukasz@google.com> 2025-03-19 17:52:14 +0000
commitb484726f4e110660e0ad68f7b27303a207ccd77f (patch)
treed103ae8695aa524ece18af353de1b6a363f451d8
parentbf8f3074b995de3c8f9664f8732facfc67490079 (diff)
leaudio: Clear data path state when it is failed to be created
Make sure that stack has valid data path state when it is failed to be set (usually due to controller issue). If the state is incorrect, stack will try to remove data path when CIS is disconnected which will lead to assert in btm_iso layer. Bug: 404423428 Flag: Exempt, day to day fix Test: atest bluetooth_le_audio_test Change-Id: I311a86cfe54ccba39ae697bdc85a53ff254e44af
-rw-r--r--system/bta/le_audio/state_machine.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/system/bta/le_audio/state_machine.cc b/system/bta/le_audio/state_machine.cc
index e5ce67cf9d..b3f20fba39 100644
--- a/system/bta/le_audio/state_machine.cc
+++ b/system/bta/le_audio/state_machine.cc
@@ -681,8 +681,16 @@ public:
kLogHciEvent, group->group_id_, leAudioDevice->address_,
kLogSetDataPathOp + "cis_h:" + loghex(conn_handle) + " STATUS=" + loghex(status));
+ /* Find ASE and later update state for the given cis.*/
+ auto ase = leAudioDevice->GetFirstActiveAseByCisAndDataPathState(CisState::CONNECTED,
+ DataPathState::CONFIGURING);
+
if (status) {
- log::error("failed to setup data path");
+ log::error("Failed to setup data path for {}, cis handle: {:#x}, error: {:#x}",
+ leAudioDevice->address_, conn_handle, status);
+ if (ase && ase->cis_conn_hdl == conn_handle) {
+ ase->data_path_state = DataPathState::IDLE;
+ }
StopStream(group);
return;
@@ -696,10 +704,6 @@ public:
return;
}
- /* Update state for the given cis.*/
- auto ase = leAudioDevice->GetFirstActiveAseByCisAndDataPathState(CisState::CONNECTED,
- DataPathState::CONFIGURING);
-
if (!ase || ase->cis_conn_hdl != conn_handle) {
log::error("Cannot find ase by handle {}", conn_handle);
return;