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

Commit 4993c9b9 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

LeAudio: QoS configurations improvements

Since the 'target_latency` is a QoS type of parameter, it should be
moved into the QoS section. This makes the codec configurations
ortogonal to QoS, allowing us to reuse the same codec configuration
with different 'target_latency', without the need to copy the whole
configuration just to change this one parameter.

It will also prevent invalid configurations where HighReliability
'target_latency' is paired with QoS settings for low latency stream.

Lastly the naming now explicitly states if the server preference that
we ask the remote device for is low latency, balanced realiability or
high reliability mode.

Bug: 269394021
Tag: #feature
Test: atest --host bluetooth_le_audio_client_test bluetooth_le_audio_test --no-bazel-mode
Change-Id: I4774591252e1479dc0712afbf9f7f7ba0aa8ca35
parent 4fac27a6
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -584,7 +584,6 @@ std::vector<AudioSetConfiguration> get_offload_capabilities() {
      audio_set_config.confs.push_back(SetConfiguration(
          ::le_audio::types::kLeAudioDirectionSink, hal_encode_cap.deviceCount,
          hal_encode_cap.deviceCount * hal_encode_cap.channelCountPerDevice,
          ::le_audio::types::kTargetLatencyBalancedLatencyReliability,
          encode_cap));
      str_capability_log = " Encode Capability: " + hal_encode_cap.toString();
    }
@@ -594,16 +593,14 @@ std::vector<AudioSetConfiguration> get_offload_capabilities() {
          ::le_audio::types::kLeAudioDirectionSource,
          hal_decode_cap.deviceCount,
          hal_decode_cap.deviceCount * hal_decode_cap.channelCountPerDevice,
          ::le_audio::types::kTargetLatencyBalancedLatencyReliability,
          decode_cap));
      str_capability_log += " Decode Capability: " + hal_decode_cap.toString();
    }

    if (hal_bcast_capability_to_stack_format(hal_bcast_cap, bcast_cap)) {
      // Set device_cnt, ase_cnt, target_latency to zero to ignore these fields
      // for broadcast
      // Set device_cnt, ase_cnt to zero to ignore these fields for broadcast
      audio_set_config.confs.push_back(SetConfiguration(
          ::le_audio::types::kLeAudioDirectionSink, 0, 0, 0, bcast_cap));
          ::le_audio::types::kLeAudioDirectionSink, 0, 0, bcast_cap));
      str_capability_log +=
          " Broadcast Capability: " + hal_bcast_cap.toString();
    }
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ enum AudioSetConfigurationTargetLatency : byte {
    HIGH_RELIABILITY = 0x03,
}
table AudioSetSubConfiguration {
    target_latency: AudioSetConfigurationTargetLatency = BALANCED_RELIABILITY;
    device_cnt: ubyte;
    ase_cnt: ubyte;
    direction: AudioSetConfigurationDirection = SINK;
@@ -70,6 +69,7 @@ table CodecConfiguration {
}
table QosConfiguration {
    name: string (key, required);
    target_latency: AudioSetConfigurationTargetLatency = BALANCED_RELIABILITY;
    retransmission_number: ubyte;
    max_transport_latency : ushort;
}
+245 −299

File changed.

Preview size limit exceeded, changes collapsed.

+154 −154

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -1549,7 +1549,7 @@ bool LeAudioDevice::ConfigureAses(
      if (ase->state == AseState::BTA_LE_AUDIO_ASE_STATE_CODEC_CONFIGURED)
        ase->reconfigure = true;

      ase->target_latency = ent.target_latency;
      ase->target_latency = ent.qos.target_latency;
      ase->codec_id = ent.codec.id;
      /* TODO: find better way to not use LC3 explicitly */
      ase->codec_config = std::get<LeAudioLc3Config>(ent.codec.config);
@@ -1592,7 +1592,7 @@ bool LeAudioDevice::ConfigureAses(
        "cis_id=%d, target_latency=%d",
        ADDRESS_TO_LOGGABLE_CSTR(address_), ase->id,
        (ent.direction == 1 ? "snk" : "src"), ase->max_sdu_size, ase->cis_id,
        ent.target_latency);
        ent.qos.target_latency);

    /* Try to use the already active ASE */
    ase = GetNextActiveAseWithSameDirection(ase);
Loading