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

Commit 8bf404e9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "leaudio: Fix issue with not moving to Streaming state" into main

parents 77cf38a3 3579d56a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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_;
@@ -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),
@@ -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;
+19 −2
Original line number Diff line number Diff line
@@ -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,
@@ -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) {