Starting with Android 14, the Audio HAL interface is defined using Stable AIDL. Partners and SoC vendors are encouraged to reimplement their Audio HAL to provide an AIDL interface.
Extending the libaudiohal
library adds framework support for AIDL HAL.
With the AIDL implementation, the audio policy configuration specification is
moved to AIDL HAL. With this change, the Audio Policy Manager (APM) gets the
configuration from the HAL instead of consuming it from the vendor-provided XML
file.
Audio AIDL HAL API
This section describes the Core, Effects, and Common HAL APIs for AIDL.
Use default implementation of the AIDL API at
/hardware/interfaces/audio/aidl/default/
as a reference when implementing new versions of Audio HALs that
interact with kernel drivers.
See the Audio HAL README file for the Audio HAL directory structure for AIDL.
Core HAL
Some of the key interfaces of Core HAL, using AIDL, are as follows:
IModule.aidl
is the entry point into the API.- Streams are unidirectional and are used by AudioFlinger to send or receive
audio to and from the HAL through
IStreamOut.aidl
andIStreamIn.aidl
. ITelephony.aidl
provides controls specific to telephony functions.IBluetooth.aidl
provides BT SCO and HFP controls that were onIPrimaryModule
in the HIDL API.IConfig.aidl
provides system-wide configuration parameters.ISoundDose.aidl
provides sound dose support. See Sound dose for more information.- The latest version of the Core HAL API in development is in
/hardware/interfaces/audio/aidl/android/hardware/audio/core/
. - The latest released version of the Core HAL API is in
/hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.core/
.
Effects HAL
Some of the key interfaces of Effects HAL, using AIDL, are as follows:
IFactory.aidl
is the entry point into the API.Descriptor.aidl
contains all information such as capabilities and attributes for an effect implementation.Capability.aidl
defines effect capabilities that don't change at runtime.Parameter.aidl
defines all parameters supported by the effect instance.IEffect.aidl
is used to configure and control particular effect instances.Effect-specific parcelables named after the effect.
The latest version of the Effects HAL API in development is in
/hardware/interfaces/audio/aidl/android/hardware/audio/effect/
.The latest released version of the Effects HAL API is in
/hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.effect
.
See the Audio Effects for more information.
Common HAL
Data structures and interfaces shared between various HALs such as BT HAL, core and effects Audio HALs are in the Common HAL.
The latest version of the Common AIDL HAL in development is in
/hardware/interfaces/audio/aidl/android/hardware/audio/common/
.The latest released version of the Common HAL API is in
/hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/
.
Common stable data types
Stable data structure definitions are used both by HALs and the framework.
The latest version of the stable data types in development is in
/system/hardware/interfaces/media/aidl/android/media/audio/common/
.The latest released version of the stable data types is in
/system/hardware/interfaces/media/aidl_api/android.media.audio.common.types/
.
Testing the Audio AIDL HAL API
New VTS tests are provided for the AIDL interface.
There are no changes in the new HAL version that can affect security.