Android's Audio hardware abstraction layer (HAL) connects the higher-level,
audio-specific framework APIs into
the underlying audio drivers and hardware. The Audio HAL defines the standard
interface that audio services call in to. The Audio HAL must be implemented for
the audio hardware to function correctly.
This page gives an overview of the Audio HAL and provides details of its API and implementation requirements.
Audio HAL interface
Starting with Android 14, the Audio HAL interface is defined using AIDL. For past versions, the Audio HAL interface is defined using HIDL. Partners and SoC vendors are encouraged to reimplement their Audio HAL to provide an AIDL interface.
New HAL APIs for features added in Android 14 and higher are supported only with the implementation of the AIDL interface. Starting with Android 14, no new API is added to the HIDL implementation.
Switching to AIDL and deprecating and removing support for previous major Audio HAL versions frees up disk space and RAM on devices. This leads to a smoother UX and allows for newer user-visible features for end users.
See AIDL and HIDL Audio HAL comparison for more information about the differences between the AIDL and HIDL Audio HAL.
Audio HAL API
The Audio HAL contains the following APIs:
- The Core HAL is the main API used by AudioFlinger to play audio and control the audio routing.
The Effects HAL API is used by the effects framework to control audio effects. You can also configure preprocessing effects such as automatic gain control and noise suppression through the Effects HAL API.
The Common HAL API is a library of common data types used by the Core and Effects HAL APIs. The Common HAL has no interfaces and no associated VTS tests as it defines only data structures.
In addition to implementing the Audio HAL and creating the audio policy configuration file, you must adhere to the following HAL requirements:
If capture for Sound Trigger (capture from hotword DSP buffer) is supported by one input profile, the implementation must support the number of active streams on this profile corresponding to the number of concurrent sessions supported by Sound Trigger HAL.
Concurrency of voice call TX and capture from the app processor as detailed on the Concurrent capture page.