Od 27 marca 2025 r. zalecamy używanie android-latest-release
zamiast aosp-main
do kompilowania i wspołtworzenia AOSP. Więcej informacji znajdziesz w artykule o zmianach w AOSP.
AIDL Audio HAL
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Od wersji 14 Androida interfejs Audio HAL jest definiowany za pomocą stabilnego AIDL. Zachęcamy partnerów i producentów układów SoC do ponownego zaimplementowania interfejsu Audio HAL, aby udostępnić interfejs AIDL.
Rozszerzenie biblioteki libaudiohal
umożliwia obsługę interfejsu AIDL HAL.
W ramach implementacji AIDL specyfikacja konfiguracji zasad dotyczących dźwięku została przeniesiona do interfejsu HAL AIDL. Dzięki tej zmianie menedżer zasad dotyczących dźwięku (APM) pobiera konfigurację z HAL, zamiast korzystać z pliku XML dostarczonego przez dostawcę.
Interfejs API HAL dla Audio AIDL
Ta sekcja opisuje interfejsy API Core, Effects i Common HAL dla AIDL.
Podczas implementowania nowych wersji interfejsu Audio HAL, które współpracują z sterownikami jądra, użyj domyślnej implementacji interfejsu AIDL API w pliku /hardware/interfaces/audio/aidl/default/
.
Zapoznaj się z plikiem README dotyczącym Audio HAL, aby poznać strukturę katalogu Audio HAL w przypadku AIDL.
Core HAL
Oto niektóre z głównych interfejsów Core HAL, które korzystają z AIDL:
Warstwa HAL efektów
Oto niektóre z głównych interfejsów HAL efektów, które korzystają z AIDL:
Więcej informacji znajdziesz w sekcji Efekty dźwiękowe.
Wspólny HAL
Struktury danych i interfejsy wspólne dla różnych HAL-i, takie jak BT HAL, core HAL i effects Audio HAL, znajdują się w Common HAL.
Typy stabilnych danych
Stabilne definicje struktury danych są używane zarówno przez HAL, jak i przez framework.
Testowanie interfejsu Audio AIDL HAL API
Dostępne są nowe testy VTS dotyczące interfejsu AIDL.
Nowa wersja HAL nie zawiera żadnych zmian, które mogłyby wpłynąć na bezpieczeństwo.
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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."]]