קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
שכבת ההפשטה של חומרת האודיו (HAL) ב-Android מחברת את ממשקי ה-API ברמה גבוהה יותר של המסגרת הספציפית לאודיו אל android.media הנהגים והחומרה הבסיסיים של האודיו. Audio HAL מגדיר את הממשק הסטנדרטי שאליו שירותי האודיו קוראים. כדי שחומרת האודיו תפעל כראוי, צריך להטמיע את Audio HAL.
בדף הזה מוצגת סקירה כללית על Audio HAL, ומפורטים בו פרטים על ה-API ועל דרישות ההטמעה שלו.
ממשק HAL של אודיו
החל מ-Android 14, ממשק ה-HAL של האודיו מוגדר באמצעות AIDL. בגרסאות קודמות, ממשק ה-HAL של האודיו מוגדר באמצעות HIDL.
שותפים וספקי SoC מומלצים להטמיע מחדש את Audio HAL שלהם כדי לספק ממשק AIDL.
ממשקי HAL API חדשים לתכונות שנוספו ב-Android 14 ואילך נתמכים רק באמצעות הטמעת ממשק AIDL.
החל מ-Android 14, לא מתווסף API חדש להטמעת HIDL.
המעבר ל-AIDL והוצאה משימוש והסרה של התמיכה בגרסאות הקודמות של Audio HAL מאפשרים לפנות מקום בדיסק ובזיכרון RAM במכשירים. כך אפשר ליהנות מחוויית משתמש חלקה יותר, ומאפשר למשתמשים קצה לראות תכונות חדשות יותר.
Core HAL הוא ה-API הראשי שבו AudioFlinger משתמש כדי להפעיל אודיו ולשלוט בניתוב האודיו.
מסגרת האפקטים משתמשת ב-Effects HAL API כדי לשלוט באפקטי האודיו.
אפשר גם להגדיר אפקטים של עיבוד מקדים, כמו בקרת רווח אוטומטית ודחיית רעשי רקע, באמצעות Effects HAL API.
Common HAL API היא ספרייה של סוגי נתונים נפוצים שמשמשים את ממשקי ה-HAL API של Core ו-Effects. ל-HAL המשותף אין ממשקים ואין לו בדיקות VTS משויכות, כי הוא מגדיר רק מבני נתונים.
בנוסף להטמעת Audio HAL ויצירת קובץ התצורה של מדיניות האודיו, עליכם לעמוד בדרישות ה-HAL הבאות:
אם פרופיל קלט אחד תומך בתיעוד של Sound Trigger (תיעוד ממאגר ה-DSP של מילות מפתח חמות), ההטמעה חייבת לתמוך במספר הסטרימינגים הפעילים בפרופיל הזה בהתאם למספר הסשנים בו-זמנית שנתמכים על ידי Sound Trigger HAL.
בו-זמניות של העברת שיחות קוליות והקלטה מהמעבד של האפליקציה, כפי שמתואר בדף הקלטה בו-זמנית.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-26 (שעון UTC)."],[],[],null,["# Audio HAL\n\nAndroid's Audio hardware abstraction layer (HAL) connects the higher-level,\naudio-specific framework APIs into\n[`android.media`](http://developer.android.com/reference/android/media/package-summary.html)\nthe underlying audio drivers and hardware. The Audio HAL defines the standard\ninterface that audio services call in to. The Audio HAL must be implemented for\nthe audio hardware to function correctly.\n\nThis page gives an overview of the Audio HAL and provides details of its API and\nimplementation requirements.\n\nAudio HAL interface\n-------------------\n\nStarting with Android 14, the Audio HAL interface is\ndefined using [AIDL](/docs/core/audio/aidl-implement). For past versions, the\nAudio HAL interface is defined using [HIDL](/docs/core/audio/hidl-implement).\nPartners and SoC vendors are encouraged to reimplement their\nAudio HAL to provide an AIDL interface.\n\nNew HAL APIs for features added in Android 14 and\nhigher are supported **only** with the implementation of the AIDL interface.\nStarting with Android 14, no new API is added to the\nHIDL implementation.\n\nSwitching to AIDL and deprecating and removing support for previous\nmajor Audio HAL versions frees up disk space and RAM on devices. This\nleads to a smoother UX and allows for newer user-visible features for end users.\n\nSee [AIDL and HIDL Audio HAL comparison](/docs/core/audio/aidl-hidl-comp)\nfor more information about the differences between the AIDL and HIDL Audio HAL.\n\n### Audio HAL API\n\nThe Audio HAL contains the following APIs:\n\n- The Core HAL is the main API used by AudioFlinger to play audio and control the audio routing.\n- The Effects HAL API is used by the effects framework to control audio effects.\n You can also configure [preprocessing effects](/devices/audio/implement-pre-processing)\n such as automatic gain control and noise suppression through the Effects HAL\n API.\n\n | **Note:** The Audio Effects HAL API is similar to the [framework effects APIs](https://developer.android.com/reference/android/media/audiofx/AudioEffect).\n- The Common HAL API is a library of common data types used by the Core and\n Effects HAL APIs. The Common HAL has no interfaces and no associated VTS\n tests as it defines only data structures.\n\nSee [AIDL Audio HAL](/docs/core/audio/aidl-implement) and\n[HIDL Audio HAL](/docs/core/audio/hidl-implement) for specific details\nrelated to AIDL and HIDL respectively.\n| **Note:** Starting with Android 13, Audio HAL is updated to version 7.1.\n\nRequirements\n------------\n\nIn addition to implementing the Audio HAL and creating the audio policy\nconfiguration file, you must adhere to the following HAL requirements:\n\n- If capture for Sound Trigger (capture from hotword DSP buffer) is supported\n by one input profile, the implementation must support the number of active\n streams on this profile corresponding to the number of concurrent sessions\n supported by Sound Trigger HAL.\n\n | **Note:** The implementation of the [Sound trigger HAL](/docs/core/audio/sound-trigger) is located at `/hardware/interfaces/soundtrigger` and is coupled with the Audio HAL.\n- Concurrency of voice call TX and capture from the app processor as\n detailed on the [Concurrent capture](/docs/core/audio/concurrent) page."]]