À partir du 27 mars 2025, nous vous recommandons d'utiliser android-latest-release
au lieu de aosp-main
pour créer et contribuer à AOSP. Pour en savoir plus, consultez la section Modifications apportées à AOSP.
HAL audio AIDL
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
À partir d'Android 14, l'interface HAL audio est définie à l'aide d'AIDL stable. Les partenaires et les fournisseurs de SoC sont encouragés à réimplémenter leur HAL audio pour fournir une interface AIDL.
L'extension de la bibliothèque libaudiohal
permet d'ajouter la prise en charge du framework pour l'HAL AIDL.
Avec l'implémentation AIDL, la spécification de configuration des règles audio est déplacée vers le HAL AIDL. Avec ce changement, le gestionnaire de règles audio (APM) obtient la configuration à partir du HAL au lieu de la consommer à partir du fichier XML fourni par le fournisseur.
API HAL Audio AIDL
Cette section décrit les API Core, Effects et HAL communes pour AIDL.
Utilisez l'implémentation par défaut de l'API AIDL à l'adresse /hardware/interfaces/audio/aidl/default/
comme référence lorsque vous implémentez de nouvelles versions d'HAL audio qui interagissent avec les pilotes du noyau.
Consultez le fichier README de l'HAL audio pour connaître la structure de répertoire de l'HAL audio pour AIDL.
HAL principal
Voici quelques-unes des principales interfaces du Core HAL, qui utilisent AIDL:
HAL des effets
Voici quelques-unes des principales interfaces de l'HAL Effects, à l'aide d'AIDL:
Pour en savoir plus, consultez la section Effets audio.
HAL commun
Les structures de données et les interfaces partagées entre différents HAL, tels que le HAL BT, le HAL audio de base et les effets, se trouvent dans le HAL commun.
Types de données stables courants
Les définitions de structure de données stables sont utilisées à la fois par les HAL et le framework.
Tester l'API Audio AIDL HAL
De nouveaux tests VTS sont fournis pour l'interface AIDL.
Aucune modification apportée à la nouvelle version de HAL ne peut affecter la sécurité.
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/27 (UTC)."],[],[],null,["# AIDL Audio HAL\n\nStarting with Android 14, the Audio HAL interface is\ndefined using [Stable AIDL](/docs/core/architecture/aidl/stable-aidl). Partners\nand SoC vendors are encouraged to reimplement their Audio HAL to provide an\nAIDL interface.\n\nExtending the `libaudiohal` library adds framework support for AIDL HAL.\nWith the AIDL implementation, the audio policy configuration specification is\nmoved to AIDL HAL. With this change, the Audio Policy Manager (APM) gets the\nconfiguration from the HAL instead of consuming it from the vendor-provided XML\nfile.\n\nAudio AIDL HAL API\n------------------\n\nThis section describes the Core, Effects, and Common HAL APIs for AIDL.\n\nUse default implementation of the AIDL API at\n[`/hardware/interfaces/audio/aidl/default/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/default/)\nas a reference when implementing new versions of Audio HALs that\ninteract with kernel drivers.\n\nSee the\n[Audio HAL README file](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/README.md)\nfor the Audio HAL directory structure for AIDL.\n\n### Core HAL\n\nSome of the [key interfaces of Core HAL](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/),\nusing AIDL, are as follows:\n\n- [`IModule.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/IModule.aidl) is the entry point into the API.\n- Streams are unidirectional and are used by AudioFlinger to send or receive audio to and from the HAL through [`IStreamOut.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/IStreamOut.aidl) and [`IStreamIn.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/IStreamIn.aidl).\n- [`ITelephony.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/ITelephony.aidl) provides controls specific to telephony functions.\n- [`IBluetooth.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/IBluetooth.aidl) provides BT SCO and HFP controls that were on `IPrimaryModule` in the HIDL API.\n- [`IConfig.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/IConfig.aidl) provides system-wide configuration parameters.\n- [`ISoundDose.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.aidl) provides sound dose support. See [Sound dose](/docs/core/audio/sound-dose) for more information.\n- The latest version of the Core HAL API *in development* is in [`/hardware/interfaces/audio/aidl/android/hardware/audio/core/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/core/).\n- The latest *released* version of the Core HAL API is in [`/hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.core/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.core/).\n\n### Effects HAL\n\nSome of the key interfaces of Effects HAL, using AIDL, are as follows:\n\n- [`IFactory.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/effect/IFactory.aidl) is the entry point into the API.\n- [`Descriptor.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/effect/Descriptor.aidl) contains all information such as capabilities and attributes for an effect implementation.\n- [`Capability.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/effect/Capability.aidl) defines effect capabilities that don't change at runtime.\n- [`Parameter.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/effect/Parameter.aidl) defines all parameters supported by the effect instance.\n- [`IEffect.aidl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/effect/IEffect.aidl) is used to configure and control particular effect instances.\n- Effect-specific parcelables named after the effect.\n\n- The latest version of the Effects HAL API *in development* is in [`/hardware/interfaces/audio/aidl/android/hardware/audio/effect/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/effect/).\n\n- The latest *released* version of the Effects HAL API is in\n [`/hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.effect`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.effect/).\n\nSee the [Audio Effects](/docs/core/audio/audio-effects) for more\ninformation.\n\n### Common HAL\n\nData structures and interfaces shared between various HALs such as BT HAL, core\nand effects Audio HALs are in the Common HAL.\n\n- The latest version of the Common AIDL HAL *in development* is in\n [`/hardware/interfaces/audio/aidl/android/hardware/audio/common/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/android/hardware/audio/common/).\n\n- The latest *released* version of the Common HAL API is in\n [`/hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.common/).\n\n#### Common stable data types\n\nStable data structure definitions are used both by HALs and the framework.\n\n- The latest version of the stable data types *in development* is in\n [`/system/hardware/interfaces/media/aidl/android/media/audio/common/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:system/hardware/interfaces/media/aidl/android/media/audio/common/).\n\n- The latest *released* version of the stable data types is in\n [`/system/hardware/interfaces/media/aidl_api/android.media.audio.common.types/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:system/hardware/interfaces/media/aidl_api/android.media.audio.common.types/).\n\nTesting the Audio AIDL HAL API\n------------------------------\n\nNew [VTS](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/audio/aidl/vts/)\ntests are provided for the AIDL interface.\n\nThere are no changes in the new HAL version that can affect security."]]