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

Commit 950e7623 authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Use transparent codec for DSA hardware path

Change-Id: I6382efecef21dd775baed21de032397b57f52331
Test: mmm packages/modules/Bluetooth
Flag: com.android.bluetooth.flags.dsa_hw_transparent_codec
Bug: 379990311
Bug: 382263607
parent a077cb3d
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -923,13 +923,21 @@ public:
    }

    uint8_t data_path_id = bluetooth::hci::iso_manager::kIsoDataPathHci;
    bluetooth::le_audio::types::LeAudioCodecId codec = {
            .coding_format = bluetooth::hci::kIsoCodingFormatTransparent,
            .vendor_company_id = 0x0000,
            .vendor_codec_id = 0x0000};
    log::info("DSA mode used: {}", static_cast<int>(group->dsa_.mode));
    switch (group->dsa_.mode) {
      case DsaMode::ISO_HW:
        data_path_id = bluetooth::hci::iso_manager::kIsoDataPathPlatformDefault;
        if (!com::android::bluetooth::flags::dsa_hw_transparent_codec()) {
          codec = bluetooth::le_audio::types::kLeAudioCodecHeadtracking;
        }
        break;
      case DsaMode::ISO_SW:
        data_path_id = bluetooth::hci::iso_manager::kIsoDataPathHci;
        codec = bluetooth::le_audio::types::kLeAudioCodecHeadtracking;
        break;
      default:
        log::warn("Unexpected DsaMode: {}", static_cast<int>(group->dsa_.mode));
@@ -951,11 +959,9 @@ public:
    bluetooth::hci::iso_manager::iso_data_path_params param = {
            .data_path_dir = bluetooth::hci::iso_manager::kIsoDataPathDirectionOut,
            .data_path_id = data_path_id,
            .codec_id_format = bluetooth::le_audio::types::kLeAudioCodecHeadtracking.coding_format,
            .codec_id_company =
                    bluetooth::le_audio::types::kLeAudioCodecHeadtracking.vendor_company_id,
            .codec_id_vendor =
                    bluetooth::le_audio::types::kLeAudioCodecHeadtracking.vendor_codec_id,
            .codec_id_format = codec.coding_format,
            .codec_id_company = codec.vendor_company_id,
            .codec_id_vendor = codec.vendor_codec_id,
            .controller_delay = 0x00000000,
            .codec_conf = std::vector<uint8_t>(),
    };