Android Audio HAL on Hikey


I wanted to ask if there is any reference implementation for Audio HAL layer on Hikey 960. Also which audio driver is recommended to be used on Hikey 960 ? The AOSP reference page lists ALSA and OSS as options.



You can find the hikey960 audio hal in AOSP tree (device/linaro/hikey/audio).
This HAL relies on ALSA (via tinyalsa library).


@Loic I also want to ask if this same HAL code is used when a USB sound card is used for audio. When I read the AOSP documentation ( ), they mention a usbaudio HAL implementation located at: hardware/libhardware/modules/usbaudio/.


The USB audio HAL is located at the path you specify. Both will be built and installed to the device. Android will select the appropriate one for the scenario. Generally, the USB will have priority, but this could vary based on how they are defined.

If you wish to build a more specialized USB audio HAL, you will need to duplicate it into the device tree, rename it to device specific, and include it in your build scripts.