This section explains how to implement the audio Hardware Abstraction Layer
(HAL), provides details about configuring an audio policy (file formats, code
organization, pre-processing effects), and describes how to configure the shared
library (creating the
Audio HAL capabilities
The Android 10 release includes the following new capabilities for audio HAL:
HE V1, and
Those HAL capabilities should be declared in the device
for the framework to use them.
Audio HAL and subsytem requirements
The Android 10 release includes the following requirements for audio HAL and subsystem implementation:
- If separate input stream profiles are declared in
audio_policy_configuration.xml, it must be possible to activate them all simultaneously for any device selection.
- If capture for sound trigger (capture from hotword DSP buffer) is supported by one input profile, the implementation must support a number of active streams on this profile corresponding to the number of concurrent sessions supported by sound trigger HAL.
- Concurrency of DSP hotword detection and capture from the AP.
- Concurrency of voice call TX and capture from the AP.
Implementing audio HAL
The audio HAL is composed of the following interfaces:
hardware/libhardware/include/hardware/audio.h. Represents the main functions of an audio device.
hardware/libhardware/include/hardware/audio_effect.h. Represents effects that can be applied to audio such as downmixing, echo, or noise suppression.
You must implement all interfaces.
Audio header files
For a reference of the properties you can define, refer to the audio header files:
- In Android 6.0 and higher, see
- In Android 5.1 and lower, see
For an example, refer to the implementation for the Galaxy Nexus at
In addition to implementing the audio HAL, you must also create an audio policy configuration file that describes your audio topology and package the HAL implementation into a shared library. You can also configure pre-processing effects such as automatic gain control and noise suppression.