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

Commit 43811684 authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Gerrit Code Review
Browse files

Merge changes Id5a0f3fe,I0041ff8d

* changes:
  leaudio: Fix dumpsys direction printing
  leaudio: Improve logs for group
parents f25a88fc bb70911e
Loading
Loading
Loading
Loading
+30 −18
Original line number Diff line number Diff line
@@ -1002,7 +1002,7 @@ class LeAudioClientImpl : public LeAudioClient {
  }

  void GroupSetActive(const int group_id) override {
    DLOG(INFO) << __func__ << " group_id: " << group_id;
    LOG_INFO(" group_id: %d", group_id);

    if (group_id == bluetooth::groups::kGroupUnknown) {
      if (active_group_id_ == bluetooth::groups::kGroupUnknown) {
@@ -1010,6 +1010,7 @@ class LeAudioClientImpl : public LeAudioClient {
        return;
      }

      LOG_INFO("Active group_id changed %d -> %d", active_group_id_, group_id);
      auto group_id_to_close = active_group_id_;
      active_group_id_ = bluetooth::groups::kGroupUnknown;

@@ -1093,6 +1094,7 @@ class LeAudioClientImpl : public LeAudioClient {
      callbacks_->OnGroupStatus(active_group_id_, GroupStatus::INACTIVE);
    }

    LOG_INFO("Active group_id changed %d -> %d", active_group_id_, group_id);
    active_group_id_ = group_id;
    callbacks_->OnGroupStatus(active_group_id_, GroupStatus::ACTIVE);
  }
@@ -3290,8 +3292,10 @@ class LeAudioClientImpl : public LeAudioClient {
  }

  void OnLocalAudioSourceSuspend() {
    LOG_INFO("IN: audio_receiver_state_: %s,  audio_sender_state_: %s",
             ToString(audio_receiver_state_).c_str(),
    LOG_INFO(
        "active group_id: %d, IN: audio_receiver_state_: %s, "
        "audio_sender_state_: %s",
        active_group_id_, ToString(audio_receiver_state_).c_str(),
        ToString(audio_sender_state_).c_str());

    /* Note: This callback is from audio hal driver.
@@ -3327,8 +3331,10 @@ class LeAudioClientImpl : public LeAudioClient {
  }

  void OnLocalAudioSourceResume() {
    LOG_INFO("IN: audio_receiver_state_: %s,  audio_sender_state_: %s",
             ToString(audio_receiver_state_).c_str(),
    LOG_INFO(
        "active group_id: %d, IN: audio_receiver_state_: %s, "
        "audio_sender_state_: %s",
        active_group_id_, ToString(audio_receiver_state_).c_str(),
        ToString(audio_sender_state_).c_str());
    /* Note: This callback is from audio hal driver.
     * Bluetooth peer is a Sink for Audio Framework.
@@ -3436,8 +3442,10 @@ class LeAudioClientImpl : public LeAudioClient {
  }

  void OnLocalAudioSinkSuspend() {
    LOG_INFO("IN: audio_receiver_state_: %s,  audio_sender_state_: %s",
             ToString(audio_receiver_state_).c_str(),
    LOG_INFO(
        "active group_id: %d, IN: audio_receiver_state_: %s, "
        "audio_sender_state_: %s",
        active_group_id_, ToString(audio_receiver_state_).c_str(),
        ToString(audio_sender_state_).c_str());

    StartVbcCloseTimeout();
@@ -3481,8 +3489,10 @@ class LeAudioClientImpl : public LeAudioClient {
  }

  void OnLocalAudioSinkResume() {
    LOG_INFO("IN: audio_receiver_state_: %s,  audio_sender_state_: %s",
             ToString(audio_receiver_state_).c_str(),
    LOG_INFO(
        "active group_id: %d IN: audio_receiver_state_: %s, "
        "audio_sender_state_: %s",
        active_group_id_, ToString(audio_receiver_state_).c_str(),
        ToString(audio_sender_state_).c_str());
    /* Stop the VBC close watchdog if needed */
    StopVbcCloseTimeout();
@@ -3989,7 +3999,7 @@ class LeAudioClientImpl : public LeAudioClient {

    /* Make sure we have CONVERSATIONAL when in a call */
    if (in_call_) {
      LOG_DEBUG(" In Call preference used.");
      LOG_INFO(" In Call preference used.");
      metadata_context_types_.sink |=
          AudioContexts(LeAudioContextType::CONVERSATIONAL);
      metadata_context_types_.source |=
@@ -4443,8 +4453,10 @@ class LeAudioClientImpl : public LeAudioClient {
  }

  void OnStateMachineStatusReportCb(int group_id, GroupStreamStatus status) {
    LOG_INFO("status: %d , audio_sender_state %s, audio_receiver_state %s",
             static_cast<int>(status),
    LOG_INFO(
        "status: %d ,  group_id: %d, audio_sender_state %s, "
        "audio_receiver_state %s",
        static_cast<int>(status), group_id,
        bluetooth::common::ToString(audio_sender_state_).c_str(),
        bluetooth::common::ToString(audio_receiver_state_).c_str());
    LeAudioDeviceGroup* group = aseGroups_.FindById(group_id);
+9 −2
Original line number Diff line number Diff line
@@ -2061,9 +2061,10 @@ void LeAudioDeviceGroup::Dump(int fd, int active_group_id) {
         << "      state: " << GetState()
         << ",\ttarget state: " << GetTargetState()
         << ",\tcig state: " << cig_state_ << "\n"
         << "      group available contexts: " << GetAvailableContexts()
         << "      group available contexts: " << GetAvailableContexts() << "\n"
         << "      configuration context type: "
         << bluetooth::common::ToString(GetConfigurationContextType()).c_str()
         << "\n"
         << "      active configuration name: "
         << (active_conf ? active_conf->name : " not set") << "\n"
         << "      stream configuration: "
@@ -2580,6 +2581,12 @@ void LeAudioDevice::Dump(int fd) {
  std::string location = "unknown location";

  if (snk_audio_locations_.to_ulong() &
          codec_spec_conf::kLeAudioLocationAnyLeft &&
      snk_audio_locations_.to_ulong() &
          codec_spec_conf::kLeAudioLocationAnyRight) {
    std::string location_left_right = "left/right";
    location.swap(location_left_right);
  } else if (snk_audio_locations_.to_ulong() &
             codec_spec_conf::kLeAudioLocationAnyLeft) {
    std::string location_left = "left";
    location.swap(location_left);
+12 −0
Original line number Diff line number Diff line
@@ -2019,6 +2019,8 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
      confs.push_back(conf);
    } while ((ase = leAudioDevice->GetNextActiveAse(ase)));

    LOG_INFO("group_id: %d, %s", leAudioDevice->group_id_,
             ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_));
    le_audio::client_parser::ascs::PrepareAseCtpEnable(confs, value);

    BtaGattQueue::WriteCharacteristic(leAudioDevice->conn_id_,
@@ -2038,6 +2040,8 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
      ids.push_back(ase->id);
    } while ((ase = leAudioDevice->GetNextActiveAse(ase)));

    LOG_INFO("group_id: %d, %s", leAudioDevice->group_id_,
             ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_));
    std::vector<uint8_t> value;
    le_audio::client_parser::ascs::PrepareAseCtpDisable(ids, value);

@@ -2058,6 +2062,8 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
      ids.push_back(ase->id);
    } while ((ase = leAudioDevice->GetNextActiveAse(ase)));

    LOG_INFO("group_id: %d, %s", leAudioDevice->group_id_,
             ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_));
    std::vector<uint8_t> value;
    le_audio::client_parser::ascs::PrepareAseCtpRelease(ids, value);

@@ -2128,6 +2134,8 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
      return;
    }

    LOG_INFO("group_id: %d, %s", leAudioDevice->group_id_,
             ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_));
    std::vector<uint8_t> value;
    le_audio::client_parser::ascs::PrepareAseCtpConfigQos(confs, value);
    BtaGattQueue::WriteCharacteristic(leAudioDevice->conn_id_,
@@ -2183,6 +2191,8 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
    }

    if (confs.size() != 0) {
      LOG_INFO("group_id: %d, %s", leAudioDevice->group_id_,
               ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_));
      std::vector<uint8_t> value;
      le_audio::client_parser::ascs::PrepareAseCtpUpdateMetadata(confs, value);

@@ -2203,6 +2213,8 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
    } while ((ase = leAudioDevice->GetNextActiveAse(ase)));

    if (ids.size() > 0) {
      LOG_INFO("group_id: %d, %s", leAudioDevice->group_id_,
               ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_));
      le_audio::client_parser::ascs::PrepareAseCtpAudioReceiverStartReady(
          ids, value);