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

Commit 435d7f42 authored by Bao Do's avatar Bao Do Committed by Gerrit Code Review
Browse files

Merge changes from topics "leaudio-multicodec", "leaudio-multicodec-base" into main

* changes:
  Default implementation of getLeAudioBroadcastConfiguration for LE Audio Offload provider
  Add VTS for LE multi-codec
  Default implementation of getLeAudioAseQosConfiguration for LE Audio Offload provider
  Default implementation of getLeAudioAseConfiguration for LE Audio Offload provider
  Add template functions and implement setCodecPriority for LE Audio offloading provider
  Parse LE Audio Set Configuration into LeAudioAseConfiguration
  Template and schemas for parsing LE Audio Set Configuration.
  Add LE Audio getProviderInfo information
  LeAudio: Add empty audio provider implementation
  bluetooth: LE Audio multi-codec extensibility - broadcast
  bluetooth: LE Audio multi-codec extensibility - unicast
parents 0d3349c7 5b2fdab6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -49,7 +49,15 @@ parcelable CodecInfo {
    int outputDataPath = 1;
    boolean useControllerCodec = true;
  }
  parcelable LeAudio {
    android.hardware.bluetooth.audio.ChannelMode[] channelMode;
    int[] samplingFrequencyHz;
    int[] frameDurationUs;
    int[] bitdepth;
    @nullable android.hardware.bluetooth.audio.ConfigurationFlags flags;
  }
  union Transport {
    android.hardware.bluetooth.audio.CodecInfo.LeAudio leAudio;
    android.hardware.bluetooth.audio.CodecInfo.A2dp a2dp;
    android.hardware.bluetooth.audio.CodecInfo.Hfp hfp;
  }
+83 −0
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.bluetooth.audio;
@VintfStability
union CodecSpecificCapabilitiesLtv {
  android.hardware.bluetooth.audio.CodecSpecificCapabilitiesLtv.SupportedSamplingFrequencies supportedSamplingFrequencies;
  android.hardware.bluetooth.audio.CodecSpecificCapabilitiesLtv.SupportedFrameDurations supportedFrameDurations;
  android.hardware.bluetooth.audio.CodecSpecificCapabilitiesLtv.SupportedAudioChannelCounts supportedAudioChannelCounts;
  android.hardware.bluetooth.audio.CodecSpecificCapabilitiesLtv.SupportedOctetsPerCodecFrame supportedOctetsPerCodecFrame;
  android.hardware.bluetooth.audio.CodecSpecificCapabilitiesLtv.SupportedMaxCodecFramesPerSDU supportedMaxCodecFramesPerSDU;
  parcelable SupportedSamplingFrequencies {
    int bitmask;
    const int HZ8000 = 0x0001;
    const int HZ11025 = 0x0002;
    const int HZ16000 = 0x0004;
    const int HZ22050 = 0x0008;
    const int HZ24000 = 0x0010;
    const int HZ32000 = 0x0020;
    const int HZ44100 = 0x0040;
    const int HZ48000 = 0x0080;
    const int HZ88200 = 0x0100;
    const int HZ96000 = 0x0200;
    const int HZ176400 = 0x0400;
    const int HZ192000 = 0x0800;
    const int HZ384000 = 0x1000;
  }
  parcelable SupportedFrameDurations {
    int bitmask;
    const int US7500 = 0x01;
    const int US10000 = 0x02;
    const int US7500PREFERRED = 0x10;
    const int US10000PREFERRED = 0x20;
  }
  parcelable SupportedAudioChannelCounts {
    int bitmask;
    const int ONE = 0x01;
    const int TWO = 0x02;
    const int THREE = 0x04;
    const int FOUR = 0x08;
    const int FIVE = 0x10;
    const int SIX = 0x20;
    const int SEVEN = 0x40;
    const int EIGHT = 0x80;
  }
  parcelable SupportedOctetsPerCodecFrame {
    int minimum;
    int maximum;
  }
  parcelable SupportedMaxCodecFramesPerSDU {
    int value;
  }
}
+101 −0
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.bluetooth.audio;
@VintfStability
union CodecSpecificConfigurationLtv {
  android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.CodecFrameBlocksPerSDU codecFrameBlocksPerSDU;
  android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.SamplingFrequency samplingFrequency;
  android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.FrameDuration frameDuration;
  android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation audioChannelAllocation;
  android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.OctetsPerCodecFrame octetsPerCodecFrame;
  @Backing(type="byte")
  enum SamplingFrequency {
    HZ8000 = 0x01,
    HZ11025 = 0x02,
    HZ16000 = 0x03,
    HZ22050 = 0x04,
    HZ24000 = 0x05,
    HZ32000 = 0x06,
    HZ44100 = 0x07,
    HZ48000 = 0x08,
    HZ88200 = 0x09,
    HZ96000 = 0x0A,
    HZ176400 = 0x0B,
    HZ192000 = 0x0C,
    HZ384000 = 0x0D,
  }
  @Backing(type="byte")
  enum FrameDuration {
    US7500 = 0x00,
    US10000 = 0x01,
  }
  parcelable AudioChannelAllocation {
    int bitmask;
    const int NOT_ALLOWED = 0x00000000;
    const int FRONT_LEFT = 0x00000001;
    const int FRONT_RIGHT = 0x00000002;
    const int FRONT_CENTER = 0x00000004;
    const int LOW_FREQUENCY_EFFECTS_1 = 0x00000008;
    const int BACK_LEFT = 0x00000010;
    const int BACK_RIGHT = 0x00000020;
    const int FRONT_LEFT_OF_CENTER = 0x00000040;
    const int FRONT_RIGHT_OF_CENTER = 0x00000080;
    const int BACK_CENTER = 0x00000100;
    const int LOW_FREQUENCY_EFFECTS_2 = 0x00000200;
    const int SIDE_LEFT = 0x00000400;
    const int SIDE_RIGHT = 0x00000800;
    const int TOP_FRONT_LEFT = 0x00001000;
    const int TOP_FRONT_RIGHT = 0x00002000;
    const int TOP_FRONT_CENTER = 0x00004000;
    const int TOP_CENTER = 0x00008000;
    const int TOP_BACK_LEFT = 0x00010000;
    const int TOP_BACK_RIGHT = 0x00020000;
    const int TOP_SIDE_LEFT = 0x00040000;
    const int TOP_SIDE_RIGHT = 0x00080000;
    const int TOP_BACK_CENTER = 0x00100000;
    const int BOTTOM_FRONT_CENTER = 0x00200000;
    const int BOTTOM_FRONT_LEFT = 0x00400000;
    const int BOTTOM_FRONT_RIGHT = 0x00800000;
    const int FRONT_LEFT_WIDE = 0x01000000;
    const int FRONT_RIGHT_WIDE = 0x02000000;
    const int LEFT_SURROUND = 0x04000000;
    const int RIGHT_SURROUND = 0x08000000;
  }
  parcelable OctetsPerCodecFrame {
    int value;
  }
  parcelable CodecFrameBlocksPerSDU {
    int value;
  }
}
+45 −0
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.bluetooth.audio;
@VintfStability
parcelable ConfigurationFlags {
  int bitmask;
  const int NONE = 0x0000;
  const int LOSSLESS = 0x0001;
  const int LOW_LATENCY = 0x0002;
  const int ALLOW_ASYMMETRIC_CONFIGURATIONS = 0x0003;
  const int SPATIAL_AUDIO = 0x0004;
  const int PROVIDE_ASE_METADATA = 0x0005;
  const int MONO_MIC_CONFIGURATION = 0x0006;
}
+148 −0
Original line number Diff line number Diff line
@@ -42,4 +42,152 @@ interface IBluetoothAudioProvider {
  void setLowLatencyModeAllowed(in boolean allowed);
  android.hardware.bluetooth.audio.A2dpStatus parseA2dpConfiguration(in android.hardware.bluetooth.audio.CodecId codecId, in byte[] configuration, out android.hardware.bluetooth.audio.CodecParameters codecParameters);
  @nullable android.hardware.bluetooth.audio.A2dpConfiguration getA2dpConfiguration(in List<android.hardware.bluetooth.audio.A2dpRemoteCapabilities> remoteA2dpCapabilities, in android.hardware.bluetooth.audio.A2dpConfigurationHint hint);
  void setCodecPriority(in android.hardware.bluetooth.audio.CodecId codecId, int priority);
  List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseConfigurationSetting> getLeAudioAseConfiguration(in @nullable List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDeviceCapabilities> remoteSinkAudioCapabilities, in @nullable List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDeviceCapabilities> remoteSourceAudioCapabilities, in List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioConfigurationRequirement> requirements);
  android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseQosConfigurationPair getLeAudioAseQosConfiguration(in android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseQosConfigurationRequirement qosRequirement);
  android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDataPathConfigurationPair getLeAudioAseDatapathConfiguration(in android.hardware.bluetooth.audio.AudioContext context, in android.hardware.bluetooth.audio.LeAudioConfiguration.StreamMap[] streamMap);
  void onSinkAseMetadataChanged(in android.hardware.bluetooth.audio.IBluetoothAudioProvider.AseState state, int cigId, int cisId, in @nullable android.hardware.bluetooth.audio.MetadataLtv[] metadata);
  void onSourceAseMetadataChanged(in android.hardware.bluetooth.audio.IBluetoothAudioProvider.AseState state, int cigId, int cisId, in @nullable android.hardware.bluetooth.audio.MetadataLtv[] metadata);
  android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioBroadcastConfigurationSetting getLeAudioBroadcastConfiguration(in @nullable List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDeviceCapabilities> remoteSinkAudioCapabilities, in android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioBroadcastConfigurationRequirement requirement);
  android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDataPathConfiguration getLeAudioBroadcastDatapathConfiguration(in android.hardware.bluetooth.audio.AudioContext context, in android.hardware.bluetooth.audio.LeAudioBroadcastConfiguration.BroadcastStreamMap[] streamMap);
  @VintfStability
  parcelable LeAudioDeviceCapabilities {
    android.hardware.bluetooth.audio.CodecId codecId;
    android.hardware.bluetooth.audio.CodecSpecificCapabilitiesLtv[] codecSpecificCapabilities;
    @nullable byte[] vendorCodecSpecificCapabilities;
    @nullable android.hardware.bluetooth.audio.MetadataLtv[] metadata;
  }
  @VintfStability
  parcelable LeAudioDataPathConfiguration {
    int dataPathId;
    android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDataPathConfiguration.DataPathConfiguration dataPathConfiguration;
    android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDataPathConfiguration.IsoDataPathConfiguration isoDataPathConfiguration;
    @VintfStability
    parcelable IsoDataPathConfiguration {
      android.hardware.bluetooth.audio.CodecId codecId;
      boolean isTransparent;
      int controllerDelayUs;
      @nullable byte[] configuration;
    }
    @VintfStability
    parcelable DataPathConfiguration {
      @nullable byte[] configuration;
    }
  }
  @VintfStability
  parcelable LeAudioAseQosConfiguration {
    int sduIntervalUs;
    android.hardware.bluetooth.audio.IBluetoothAudioProvider.Framing framing;
    android.hardware.bluetooth.audio.Phy[] phy;
    int maxTransportLatencyMs;
    int maxSdu;
    int retransmissionNum;
  }
  @Backing(type="byte") @VintfStability
  enum Packing {
    SEQUENTIAL = 0x00,
    INTERLEAVED = 0x01,
  }
  @Backing(type="byte") @VintfStability
  enum Framing {
    UNFRAMED = 0x00,
    FRAMED = 0x01,
  }
  @VintfStability
  parcelable LeAudioAseConfigurationSetting {
    android.hardware.bluetooth.audio.AudioContext audioContext;
    android.hardware.bluetooth.audio.IBluetoothAudioProvider.Packing packing;
    @nullable List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseConfigurationSetting.AseDirectionConfiguration> sinkAseConfiguration;
    @nullable List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseConfigurationSetting.AseDirectionConfiguration> sourceAseConfiguration;
    @nullable android.hardware.bluetooth.audio.ConfigurationFlags flags;
    @VintfStability
    parcelable AseDirectionConfiguration {
      android.hardware.bluetooth.audio.LeAudioAseConfiguration aseConfiguration;
      @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseQosConfiguration qosConfiguration;
      @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDataPathConfiguration dataPathConfiguration;
    }
  }
  @VintfStability
  parcelable LeAudioConfigurationRequirement {
    android.hardware.bluetooth.audio.AudioContext audioContext;
    @nullable List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioConfigurationRequirement.AseDirectionRequirement> sinkAseRequirement;
    @nullable List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioConfigurationRequirement.AseDirectionRequirement> sourceAseRequirement;
    @nullable android.hardware.bluetooth.audio.ConfigurationFlags flags;
    @VintfStability
    parcelable AseDirectionRequirement {
      android.hardware.bluetooth.audio.LeAudioAseConfiguration aseConfiguration;
    }
  }
  @VintfStability
  parcelable LeAudioAseQosConfigurationRequirement {
    android.hardware.bluetooth.audio.AudioContext contextType;
    @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseQosConfigurationRequirement.AseQosDirectionRequirement sinkAseQosRequirement;
    @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseQosConfigurationRequirement.AseQosDirectionRequirement sourceAseQosRequirement;
    @nullable android.hardware.bluetooth.audio.ConfigurationFlags flags;
    @VintfStability
    parcelable AseQosDirectionRequirement {
      android.hardware.bluetooth.audio.IBluetoothAudioProvider.Framing framing;
      android.hardware.bluetooth.audio.Phy[] preferredPhy;
      int preferredRetransmissionNum;
      int maxTransportLatencyMs;
      int presentationDelayMinUs;
      int presentationDelayMaxUs;
      int preferredPresentationDelayMinUs;
      int preferredPresentationDelayMaxUs;
      android.hardware.bluetooth.audio.LeAudioAseConfiguration aseConfiguration;
    }
  }
  @VintfStability
  parcelable LeAudioAseQosConfigurationPair {
    @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseQosConfiguration sinkQosConfiguration;
    @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioAseQosConfiguration sourceQosConfiguration;
  }
  parcelable LeAudioDataPathConfigurationPair {
    @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDataPathConfiguration inputConfig;
    @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDataPathConfiguration outputConfig;
  }
  @Backing(type="byte") @VintfStability
  enum AseState {
    ENABLING = 0x00,
    STREAMING = 0x01,
    DISABLING = 0x02,
  }
  @Backing(type="byte") @VintfStability
  enum BroadcastQuality {
    STANDARD,
    HIGH,
  }
  @VintfStability
  parcelable LeAudioBroadcastSubgroupConfigurationRequirement {
    android.hardware.bluetooth.audio.AudioContext context;
    android.hardware.bluetooth.audio.IBluetoothAudioProvider.BroadcastQuality quality;
    int bisNumPerSubgroup;
  }
  @VintfStability
  parcelable LeAudioBroadcastConfigurationRequirement {
    List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioBroadcastSubgroupConfigurationRequirement> subgroupConfigurationRequirements;
  }
  @VintfStability
  parcelable LeAudioSubgroupBisConfiguration {
    int numBis;
    android.hardware.bluetooth.audio.LeAudioBisConfiguration bisConfiguration;
  }
  @VintfStability
  parcelable LeAudioBroadcastSubgroupConfiguration {
    List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioSubgroupBisConfiguration> bisConfigurations;
    @nullable byte[] vendorCodecConfiguration;
  }
  @VintfStability
  parcelable LeAudioBroadcastConfigurationSetting {
    int sduIntervalUs;
    int numBis;
    int maxSduOctets;
    int maxTransportLatencyMs;
    int retransmitionNum;
    android.hardware.bluetooth.audio.Phy[] phy;
    android.hardware.bluetooth.audio.IBluetoothAudioProvider.Packing packing;
    android.hardware.bluetooth.audio.IBluetoothAudioProvider.Framing framing;
    @nullable android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioDataPathConfiguration dataPathConfiguration;
    List<android.hardware.bluetooth.audio.IBluetoothAudioProvider.LeAudioBroadcastSubgroupConfiguration> subgroupsConfigurations;
  }
}
Loading