Loading system/bta/le_audio/device_groups.h +8 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ class LeAudioDeviceGroup { /* Current audio stream configuration */ struct stream_configuration stream_conf; bool notify_streaming_when_cises_are_ready_; uint8_t audio_directions_; types::AudioLocations snk_audio_locations_; Loading @@ -90,6 +91,7 @@ class LeAudioDeviceGroup { : group_id_(group_id), cig(this), stream_conf({}), notify_streaming_when_cises_are_ready_(false), audio_directions_(0), dsa_mode_(DsaMode::DISABLED), is_enabled_(true), Loading Loading @@ -235,6 +237,12 @@ class LeAudioDeviceGroup { } inline types::AseState GetTargetState(void) const { return target_state_; } inline void SetNotifyStreamingWhenCisesAreReadyFlag(bool value) { notify_streaming_when_cises_are_ready_ = value; } inline bool GetNotifyStreamingWhenCisesAreReadyFlag(void) { return notify_streaming_when_cises_are_ready_; } void SetTargetState(types::AseState state) { LOG(INFO) << __func__ << " target state: " << target_state_ << " new target state: " << state; Loading system/bta/le_audio/state_machine.cc +19 −2 Original line number Diff line number Diff line Loading @@ -618,9 +618,22 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine { if (group->GetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING && !group->GetFirstActiveDeviceByCisAndDataPathState( CisState::CONNECTED, DataPathState::IDLE)) { /* No more transition for group */ /* No more transition for group. Here we are for the late join device * scenario */ cancel_watchdog_if_needed(group->group_id_); } if (group->GetNotifyStreamingWhenCisesAreReadyFlag() && group->IsGroupStreamReady()) { group->SetNotifyStreamingWhenCisesAreReadyFlag(false); LOG_INFO("Ready to notify Group Streaming."); cancel_watchdog_if_needed(group->group_id_); if (group->GetState() != AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) { group->SetState(AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING); } state_machine_callbacks_->StatusReportCb(group->group_id_, GroupStreamStatus::STREAMING); }; } void ProcessHciNotifRemoveIsoDataPath(LeAudioDeviceGroup* group, Loading Loading @@ -2682,7 +2695,11 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine { } /* Not all CISes establish events will came */ if (!group->IsGroupStreamReady()) return; if (!group->IsGroupStreamReady()) { LOG_INFO("CISes are not yet ready, wait for it."); group->SetNotifyStreamingWhenCisesAreReadyFlag(true); return; } if (group->GetTargetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) { Loading Loading
system/bta/le_audio/device_groups.h +8 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ class LeAudioDeviceGroup { /* Current audio stream configuration */ struct stream_configuration stream_conf; bool notify_streaming_when_cises_are_ready_; uint8_t audio_directions_; types::AudioLocations snk_audio_locations_; Loading @@ -90,6 +91,7 @@ class LeAudioDeviceGroup { : group_id_(group_id), cig(this), stream_conf({}), notify_streaming_when_cises_are_ready_(false), audio_directions_(0), dsa_mode_(DsaMode::DISABLED), is_enabled_(true), Loading Loading @@ -235,6 +237,12 @@ class LeAudioDeviceGroup { } inline types::AseState GetTargetState(void) const { return target_state_; } inline void SetNotifyStreamingWhenCisesAreReadyFlag(bool value) { notify_streaming_when_cises_are_ready_ = value; } inline bool GetNotifyStreamingWhenCisesAreReadyFlag(void) { return notify_streaming_when_cises_are_ready_; } void SetTargetState(types::AseState state) { LOG(INFO) << __func__ << " target state: " << target_state_ << " new target state: " << state; Loading
system/bta/le_audio/state_machine.cc +19 −2 Original line number Diff line number Diff line Loading @@ -618,9 +618,22 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine { if (group->GetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING && !group->GetFirstActiveDeviceByCisAndDataPathState( CisState::CONNECTED, DataPathState::IDLE)) { /* No more transition for group */ /* No more transition for group. Here we are for the late join device * scenario */ cancel_watchdog_if_needed(group->group_id_); } if (group->GetNotifyStreamingWhenCisesAreReadyFlag() && group->IsGroupStreamReady()) { group->SetNotifyStreamingWhenCisesAreReadyFlag(false); LOG_INFO("Ready to notify Group Streaming."); cancel_watchdog_if_needed(group->group_id_); if (group->GetState() != AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) { group->SetState(AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING); } state_machine_callbacks_->StatusReportCb(group->group_id_, GroupStreamStatus::STREAMING); }; } void ProcessHciNotifRemoveIsoDataPath(LeAudioDeviceGroup* group, Loading Loading @@ -2682,7 +2695,11 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine { } /* Not all CISes establish events will came */ if (!group->IsGroupStreamReady()) return; if (!group->IsGroupStreamReady()) { LOG_INFO("CISes are not yet ready, wait for it."); group->SetNotifyStreamingWhenCisesAreReadyFlag(true); return; } if (group->GetTargetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) { Loading