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

Commit 3ef98486 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

LeAudio/CodecExtensibility: Use proper data path

When converting the data path from AIDL for the offloader
(transparent data path mode), we should properly align
the stacl format for coding to `transparent`.

Bug: 308428644
Bug: 313054645
Test: atest bluetooth-test-audio-hal-le-audio-software bluetooth-test-audio-hal-aidl-leaudio-utils bluetooth_le_audio_test bluetooth_le_audio_client_test bluetooth_test_broadcaster bluetooth_test_broadcaster_state_machine bluetooth_le_audio_codec_manager_test
Change-Id: I6224e64904e6267afd26beaee414f4e8ec2ae25f
parent f4772369
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -523,6 +523,15 @@ GetStackDataPathFromAidlFormat(
    config.dataPathConfig = *dp.dataPathConfiguration.configuration;
  }

  // Due to AIDL not having the Transparent codec type, it uses the boolean and
  // we should manually align the codecId.
  if (config.isoDataPathConfig.isTransparent) {
    config.isoDataPathConfig.codecId.coding_format =
        bluetooth::hci::kIsoCodingFormatTransparent;
    config.isoDataPathConfig.codecId.vendor_codec_id = 0x00;
    config.isoDataPathConfig.codecId.vendor_company_id = 0x00;
  }

  if (dp.isoDataPathConfiguration.configuration) {
    config.isoDataPathConfig.configuration =
        *dp.isoDataPathConfiguration.configuration;
+14 −2
Original line number Diff line number Diff line
@@ -73,6 +73,14 @@ static const ::bluetooth::le_audio::types::LeAudioCodecId kStackCodecVendor1 = {
aidl::android::hardware::bluetooth::audio::CodecId::Vendor kAidlCodecVendor1{
    .id = 0xC0DE, .codecId = 0xF00D};

static const ::bluetooth::le_audio::types::LeAudioCodecId
    kStackCodecTransparent = {
        .coding_format = ::bluetooth::hci::kIsoCodingFormatTransparent,
        .vendor_company_id =
            ::bluetooth::le_audio::types::kLeAudioVendorCompanyIdUndefined,
        .vendor_codec_id =
            ::bluetooth::le_audio::types::kLeAudioVendorCodecIdUndefined};

namespace test_utils {

static auto PrepareStackMetadataLtv() {
@@ -208,7 +216,9 @@ PrepareReferenceLeAudioDataPathConfigurationVendor() {
  ::bluetooth::le_audio::types::DataPathConfiguration stack_config;
  stack_config.dataPathId = config.dataPathId;
  stack_config.dataPathConfig = *config.dataPathConfiguration.configuration;
  stack_config.isoDataPathConfig.codecId = kStackCodecVendor1;
  stack_config.isoDataPathConfig.codecId =
      config.isoDataPathConfiguration.isTransparent ? kStackCodecTransparent
                                                    : kStackCodecVendor1;
  stack_config.isoDataPathConfig.isTransparent =
      config.isoDataPathConfiguration.isTransparent;
  stack_config.isoDataPathConfig.controllerDelayUs =
@@ -243,7 +253,9 @@ PrepareReferenceLeAudioDataPathConfigurationLc3() {
  ::bluetooth::le_audio::types::DataPathConfiguration stack_config;
  stack_config.dataPathId = config.dataPathId;
  stack_config.dataPathConfig = *config.dataPathConfiguration.configuration;
  stack_config.isoDataPathConfig.codecId = kStackCodecLc3;
  stack_config.isoDataPathConfig.codecId =
      config.isoDataPathConfiguration.isTransparent ? kStackCodecTransparent
                                                    : kStackCodecLc3;
  stack_config.isoDataPathConfig.isTransparent =
      config.isoDataPathConfiguration.isTransparent;
  stack_config.isoDataPathConfig.controllerDelayUs =