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

Commit 623bdeba authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix channel count provided to Java layer.

This channel count is a codec configuration parameter and not a number
of channels which will be sent to remote devices.

Bug: 331775328
Test: atest bluetooth_le_audio_client_test
Flags: Exempt, trivial fix, value not yet used
Change-Id: I5e283bffaf456c71d509dde7288b8351a83d9627
parent 1e629602
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4775,7 +4775,7 @@ TEST_F_WITH_FLAGS(UnicastTest, GroupSetActive_CurrentCodecSentOfActive,
      .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3,
      .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_48000HZ,
      .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16,
      .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_2,
      .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1,
      .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US,
      .octets_per_frame = 120};

@@ -6288,7 +6288,7 @@ TEST_F(UnicastTest, TwoEarbudsStreaming) {
      .codec_type = LE_AUDIO_CODEC_INDEX_SOURCE_LC3,
      .sample_rate = LE_AUDIO_SAMPLE_RATE_INDEX_16000HZ,
      .bits_per_sample = LE_AUDIO_BITS_PER_SAMPLE_INDEX_16,
      .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_2,
      .channel_count = LE_AUDIO_CHANNEL_COUNT_INDEX_1,
      .frame_duration = LE_AUDIO_FRAME_DURATION_INDEX_10000US,
      .octets_per_frame = 40};

+2 −8
Original line number Diff line number Diff line
@@ -342,14 +342,8 @@ void fillStreamParamsToBtLeAudioCodecConfig(
  out_config.frame_duration =
      translateToBtLeAudioCodecConfigFrameDuration(config.GetDataIntervalUs());
  out_config.octets_per_frame = config.GetOctectsPerFrame();

  int num_of_channels = 0;
  for (auto const& c : confs) {
    num_of_channels += c.codec.GetChannelCountPerIsoStream();
  }

  out_config.channel_count =
      translateToBtLeAudioCodecConfigChannelCount(num_of_channels);
  out_config.channel_count = translateToBtLeAudioCodecConfigChannelCount(
      config.GetChannelCountPerIsoStream());
}

static bool is_known_codec(const types::LeAudioCodecId& codec_id) {