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

Commit b43465af authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

LeAudio: Ase configuration data refactor - part 2

Continue the configuration alignment to match the requirements of the
new approach to audio set configrations, supporting the new multi-codec
AIDL configuration provider interface.

In Part 2, the previously isolated TopologyInfo is now removed as there
is no equivalent information from the AIDL config provider, additionally:

 - device_count from the cached configurations were removed from the
   audio set reconfiguration code path and the CSIS group size is being used
   for  ASE activation and channel allocation selection
 - since the dependency to device_cnt in json configurations were
   removed, SingleDev and DualDev configurations flavors became the same
   configurations. This unbloated the *json file as almost one third of the
   configuration entries became duplicates,
 - a more meaningful configuration naming scheme is introduced, due to the
   previous one being dependent on the device count which is now
   removed,
 - the `strategy` based configuration selector is left for the legacy static
  .json file configuration provider (the non-AIDL path), but the `strategy`
  is now derived from parameters like ASE count and channel count per ASE

Bug: 308428860
Bug: 295972694
Test: atest --host bluetooth_le_audio_test bluetooth_le_audio_client_test bluetooth_test_broadcaster bluetooth_test_broadcaster_state_machine bluetooth_le_audio_codec_manager_test
Flag: Exempt; Non-flagable change in .json. Confirmed with unit tests and manual testing
Change-Id: Ie9bdbee14f8c3d5e5ddd10c627a654213ce00b40
parent 16c0ec14
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <bluetooth/log.h>

#include <atomic>
#include <bitset>
#include <unordered_map>
#include <vector>

@@ -767,14 +768,17 @@ bluetooth::audio::le_audio::OffloadCapabilities get_offload_capabilities() {
      str_capability_log += " Decode Capability: " + hal_decode_cap.toString();
    }

    audio_set_config.topology_info = {
        {{static_cast<uint8_t>(hal_decode_cap.deviceCount),
          static_cast<uint8_t>(hal_encode_cap.deviceCount)}}};

    if (hal_bcast_capability_to_stack_format(hal_bcast_cap, bcast_cap)) {
      // Set device_cnt, ase_cnt to zero to ignore these fields for broadcast
      audio_set_config.topology_info = {{{0, 0}}};
      AudioSetConfiguration audio_set_config = {
          .name = "broadcast offload capability"};
      // Note: The offloader config supports multiple channels per stream
      //       (subgroup), corresponding to the number of BISes, where each BIS
      //       has a single channel.
      bcast_cap.channel_count_per_iso_stream = 1;
      auto bis_cnt = hal_bcast_cap.channelCountPerStream;
      while (bis_cnt--) {
        audio_set_config.confs.sink.push_back(AseConfiguration(bcast_cap));
      }
      broadcast_offload_capabilities.push_back(audio_set_config);
      str_capability_log +=
          " Broadcast Capability: " + hal_bcast_cap.toString();
+1 −2
Original line number Diff line number Diff line
@@ -56,10 +56,9 @@ enum AudioSetConfigurationTargetLatency : byte {
    HIGH_RELIABILITY = 0x03,
}
table AudioSetSubConfiguration {
    device_cnt: ubyte;
    ase_channel_cnt: ubyte;
    ase_cnt: ubyte;
    direction: AudioSetConfigurationDirection = SINK;
    configuration_strategy: AudioSetConfigurationStrategy;
    codec_id : CodecId (required);
    codec_configuration: [CodecSpecificConfiguration] (required);
}
+1554 −4216

File changed.

Preview size limit exceeded, changes collapsed.

+213 −250

File changed.

Preview size limit exceeded, changes collapsed.

+22 −27
Original line number Diff line number Diff line
@@ -3134,10 +3134,6 @@ class LeAudioClientImpl : public LeAudioClient {
      return;
    }

    auto num_of_devices =
        get_num_of_devices_in_configuration(stream_conf->conf.get());

    if (num_of_devices < group->NumOfConnected()) {
    for (auto direction :
         {bluetooth::le_audio::types::kLeAudioDirectionSink,
          bluetooth::le_audio::types::kLeAudioDirectionSource}) {
@@ -3150,8 +3146,8 @@ class LeAudioClientImpl : public LeAudioClient {
      for (const auto& ent : stream_conf->conf->confs.get(direction)) {
        if (!bluetooth::le_audio::utils::GetConfigurationSupportedPac(
                pacs, ent.codec)) {
            log::info("Configuration is not supported by device %s",
                      ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_));
          log::info("Configuration is not supported by device {}",
                    leAudioDevice->address_);

          /* Reconfigure if newly connected member device cannot support
           * current codec configuration */
@@ -3163,7 +3159,6 @@ class LeAudioClientImpl : public LeAudioClient {
        }
      }
    }
    }

    /* Do not put the TBS CCID when not using Telecom for the VoIP calls. */
    auto ccid_contexts = group->GetMetadataContexts();
Loading