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

Commit 0fe1d07a authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix choosing available configuration

When devices of the group are known, configuration are chosen for all
the available context types based on the capabilities of the remote
devices.
Later during configuration, code is choosing best CIG parameters
looking into remote capabilities and also by determining topology
(strategy).
This patch, adds strategy check when configuration is chosen for the
available context, so we are sure that the same configuration is
chosen later when CIG is created.

Bug: 248430016
Test: atest BluetoothInstrumentationTests
Test: atest bluetooth_le_audio_test
Test: manual stream to LeAudio device
Tag: #feature

Merged-In: Ifcb35b4554436a2061f03d95e757d5495bbb38c5
Change-Id: Ifcb35b4554436a2061f03d95e757d5495bbb38c5
(cherry picked from commit 758d0d3c)
parent 5a59bddc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1235,6 +1235,8 @@ bool LeAudioDeviceGroup::IsConfigurationSupported(
    return false;
  }

  auto required_snk_strategy = GetGroupStrategy();

  /* TODO For now: set ase if matching with first pac.
   * 1) We assume as well that devices will match requirements in order
   *    e.g. 1 Device - 1 Requirement, 2 Device - 2 Requirement etc.
@@ -1259,6 +1261,14 @@ bool LeAudioDeviceGroup::IsConfigurationSupported(
        +required_device_cnt, +ent.ase_cnt, +max_required_ase_per_dev,
        static_cast<int>(strategy));

    if (ent.direction == types::kLeAudioDirectionSink &&
        strategy != required_snk_strategy) {
      LOG_INFO(" Sink strategy mismatch (%d!=%d)",
               static_cast<int>(required_snk_strategy),
               static_cast<int>(strategy));
      return false;
    }

    for (auto* device = GetFirstDeviceWithActiveContext(context_type);
         device != nullptr && required_device_cnt > 0;
         device = GetNextDeviceWithActiveContext(device, context_type)) {
+234 −52

File changed.

Preview size limit exceeded, changes collapsed.

+143 −24

File changed.

Preview size limit exceeded, changes collapsed.