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

Commit 8fb68002 authored by Yuyang Huang's avatar Yuyang Huang Committed by Gerrit Code Review
Browse files

Merge "LeAudio/CodecExtensibility: Use proper allocated channel counts" into main

parents faf3b0ae f4772369
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

#include "le_audio_utils.h"

#include <com_android_bluetooth_flags.h>

#include <optional>

#include "hardware/bt_le_audio.h"
@@ -490,6 +492,11 @@ GetCodecConfigSettingFromAidl(
    if (!ase_config->codecConfiguration.empty()) {
      stack_config.params =
          GetStackLeAudioLtvMapFromAidlFormat(ase_config->codecConfiguration);
      auto cfg = stack_config.params.GetAsCoreCodecConfig();
      if (cfg.audio_channel_allocation.has_value()) {
        stack_config.channel_count_per_iso_stream =
            std::bitset<32>(cfg.audio_channel_allocation.value()).count();
      }
    }
  }

+4 −2
Original line number Diff line number Diff line
@@ -394,8 +394,10 @@ PrepareReferenceAseDirectionConfigLc3(bool is_left, bool is_right,
  auto [aidl_metadata, _] = PrepareReferenceMetadata();
  aidl_ase_config.aseConfiguration.metadata = aidl_metadata;

  // FIXME: Seems redundant if audio allocations in .codec.params is mandatory
  // stack_ase_config.codec.channel_count_per_iso_stream = ?
  auto stack_codec_params = stack_params.GetAsCoreCodecConfig();
  stack_ase_config.codec.channel_count_per_iso_stream =
      std::bitset<32>(stack_codec_params.audio_channel_allocation.value_or(1))
          .count();

  /* QoS configuration */
  if (has_qos) {