skills/L2-multimedia-audio-expert/SKILL.md
--- name: multimedia-audio-expert layer: L2 path_scope: frameworks/av/, frameworks/native/services/surfaceflinger/, hardware/interfaces/audio/, hardware/interfaces/camera/, hardware/interfaces/graphics/ version: 1.1.0 android_version_tested: Android 16 parent_skill: aosp-root-router --- ## Path Scope | Path | Responsibility | |------|---------------| | `frameworks/av/` | Audio, Video, Camera, MediaCodec stack (AV framework) | | `frameworks/av/services/audioflinger/` | AudioFlinger — central au
npx skillsauth add jonaschen/Android-Software multimedia-audio-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Path | Responsibility |
|------|---------------|
| frameworks/av/ | Audio, Video, Camera, MediaCodec stack (AV framework) |
| frameworks/av/services/audioflinger/ | AudioFlinger — central audio mixing daemon |
| frameworks/av/services/audiopolicy/ | AudioPolicyService — routing decisions |
| frameworks/av/services/mediacodec/ | MediaCodec service — hardware video codec |
| frameworks/av/services/camera/ | CameraService |
| frameworks/av/media/ | MediaExtractor, MediaPlayer, NuPlayer |
| frameworks/native/services/surfaceflinger/ | SurfaceFlinger — display compositor |
| hardware/interfaces/audio/ | Audio HAL AIDL interfaces |
| hardware/interfaces/camera/ | Camera HAL AIDL interfaces |
| hardware/interfaces/graphics/ | Graphics / HWC HAL interfaces |
| hardware/interfaces/media/ | MediaCodec HAL interfaces |
Load this skill when the task involves:
BUFFER TIMEOUT, write blocked, underrunsIComposer, IHwcComposerClient (HWC2/HWC3) interface questionsApp
│ AudioTrack / MediaPlayer API
▼
AudioFlinger (frameworks/av/services/audioflinger/)
│ Mixing engine — combines all audio tracks
│ Applies effects, handles focus
▼
AudioPolicy (frameworks/av/services/audiopolicy/)
│ Decides which output device / stream to use
▼
Audio HAL (hardware/interfaces/audio/)
│ AIDL interface: IModule, IStreamIn, IStreamOut
▼
Kernel ALSA (/dev/snd/*)
▼
DSP / Codec Hardware
AudioTrack (app) → shared memory (AudioTrackShared)
│
AudioFlinger MixerThread
│
HAL write() call
│ ← BUFFER TIMEOUT occurs here if HAL blocks
Audio HAL implementation
│
Kernel driver (ALSA)
BUFFER TIMEOUT diagnosis:
write() is blocking → DSP not consuming data.AudioFlinger thread period vs HAL buffer size mismatch.SCHED_FIFO.App renders → BufferQueue → SurfaceFlinger
│
Composition decision:
GPU (GLES) composition ← fallback
HWC (hardware) composition ← preferred
│
Display HAL (IComposer)
│
Panel / HDMI output
Dropped frame diagnosis:
adb shell dumpsys SurfaceFlinger — check missed deadlines, jank.acquireFence signal = stall.systrace with gfx and view categories for frame timeline.CameraService (frameworks/av/services/camera/)
│ ICameraDevice AIDL
▼
Camera HAL3 (hardware/interfaces/camera/)
│ IDevice, ICaptureSession, ICaptureRequest
▼
ISP driver / Kernel
▼
Sensor
Request pipeline:
configureStreams() → repeatingRequest() → processCaptureResult()
Stall indicators: result metadata delay, buffer queue full
App uses MediaCodec API
│
MediaCodec service (frameworks/av/services/mediacodec/)
│
OmxStore / Codec2 component store
│
Hardware decoder/encoder (via Media HAL)
│
Video codec hardware
Key failure modes:
- ERROR_INSUFFICIENT_OUTPUT_PROTECTION: DRM policy block
- INFO_OUTPUT_FORMAT_CHANGED: codec renegotiated format mid-stream
- BUFFER TIMEOUT in dequeueOutputBuffer: downstream consumer stalled
| Change | Impact | |--------|--------| | Low Light Boost | New camera auto exposure mode for low-light preview brightness adjustment | | Camera feature combination query API | Platform API to query supported camera feature combinations | | Head tracking over LE Audio | Latency mode adjustments based on head tracking transport | | Region of Interest (RoI) video encoding | Standardized RoI integration for video encoding pipelines | | Audio AIDL HAL: CAP not ported | Configurable Audio Policy not available in AIDL HAL for A14/A15; blocks OEM migration |
| Change | Impact |
|--------|--------|
| CAP AIDL fixed | Configurable Audio Policy AIDL gap from A14/A15 is now resolved; AudioHalCapConfiguration.aidl added; Cuttlefish Auto converted to CAP AIDL. Automotive audio policy can now use the AIDL backend. This closes the long-standing blocker documented above. |
| APV codec support | Advanced Professional Video codec for high-bitrate intra-frame video; targets professional video workflows. New MediaCodec component type. |
| AV1 transition | Platform transitioning toward AV1 from VP8/VP9/H.264 as preferred codec; affects MediaCodec defaults and codec selection heuristics |
| HDR enhancements | SDR fallback via Media3 ExoPlayer, enhanced HDR screenshot support, HLG and DolbyVision capture |
| Media Quality Framework | Standardized API for Android TV picture/audio quality — per-stream, per-user, per-input-type settings |
| EEVDF scheduler (kernel) | New EEVDF scheduler in GKI 6.12 may change AudioFlinger thread scheduling latency; audit SCHED_FIFO thread behavior. See HS-033. |
Note: The CAP AIDL fix in A16 is a critical milestone. Skills and build configurations that previously worked around the missing AIDL definitions for CAP can now remove those workarounds and use the standard AIDL backend.
hardware/interfaces/audio/effect/), not AudioFlinger core.NUM_BUFFER_SLOTS increases latency; always measure jank before and after.CameraManager arbitration — CameraService enforces exclusive access.L2-kernel-gki-expert.hardware/interfaces/audio/ AIDL without bumping the interface version — all HAL interface changes must follow the versioning procedure in L2-hal-vendor-interface-expert.# Dump AudioFlinger state
adb shell dumpsys media.audio_flinger
# Dump AudioPolicy routing
adb shell dumpsys media.audio_policy
# Check SurfaceFlinger composition stats
adb shell dumpsys SurfaceFlinger | grep -A5 "VSYNC\|jank\|dropped"
# Capture systrace for graphics pipeline
python3 systrace.py gfx view -o trace.html
# List camera devices and their status
adb shell dumpsys media.camera
# Check MediaCodec codec list
adb shell media list-codecs
# Monitor audio underruns in real time
adb logcat -s AudioFlinger:V AudioPolicyManager:V
| Condition | Hand off to |
|-----------|------------|
| Audio/Camera HAL AIDL interface version bump | L2-hal-vendor-interface-expert |
| SELinux denial for media daemon | L2-security-selinux-expert |
| Build failure in frameworks/av/ | L2-build-system-expert |
| Kernel ALSA driver or V4L2 driver issue | L2-kernel-gki-expert |
| MediaCodec service .rc or startup issue | L2-init-boot-sequence-expert |
Emit [L2 MEDIA → HANDOFF] before transferring.
references/audioflinger_architecture.md — AudioFlinger threading model, mixing pipeline, and HAL interface.frameworks/av/services/audioflinger/README.md — upstream docs.frameworks/native/services/surfaceflinger/docs/ — SurfaceFlinger internals.ANDROID_SW_OWNER_DEV_PLAN.md §5 — L2 skill design spec.development
--- name: qualcomm-kernel-expert layer: L3 path_scope: vendor/qcom/opensource/, device/qcom/, kernel/msm-*/ version: 1.0.0 android_version_tested: Android 16 (GKI 6.12) parent_skill: kernel-gki-expert --- ## Path Scope | Path | Responsibility | |------|---------------| | `vendor/qcom/opensource/` | Qualcomm open-source kernel modules (camera, audio, wlan, data, video) | | `vendor/qcom/opensource/camera-kernel/` | Camera kernel drivers (IFE, IPE, IOMMU, CCI) | | `vendor/qcom/opensource/audio-ke
development
--- name: mediatek-kernel-expert layer: L3 path_scope: vendor/mediatek/kernel_modules/, vendor/mediatek/proprietary/, device/mediatek/, kernel/mediatek/ version: 1.0.0 android_version_tested: Android 16 (GKI 6.12) parent_skill: kernel-gki-expert --- ## Path Scope | Path | Responsibility | |------|---------------| | `vendor/mediatek/kernel_modules/` | MediaTek out-of-tree kernel modules (connectivity, GPU, display, camera, audio) | | `vendor/mediatek/kernel_modules/connectivity/` | CONNSYS / WM
development
--- name: <oem-or-soc>-<subsystem>-expert layer: L3 path_scope: vendor/<oem>/, device/<oem>/ version: 1.0.0 android_version_tested: Android 16 parent_skill: <L2-parent-skill-name> --- ## Path Scope | Path | Responsibility | |------|---------------| | `vendor/<oem>/` | OEM-proprietary code, BSP blobs, vendor HALs | | `device/<oem>/<device>/` | Device-specific configuration, BoardConfig, overlays | | <!-- Add OEM-specific paths below --> | | ### Inherited Paths (from parent L2 skill) This L3 s
development
--- name: L2-virtualization-pkvm-expert layer: L2 path_scope: packages/modules/Virtualization/, external/crosvm/, frameworks/libs/vmbase/ version: 1.1.0 android_version_tested: Android 16 parent_skill: aosp-root-router --- # L2 Expert: pKVM / Android Virtualization Framework ## Path Scope | Path | Description | |------|-------------| | `packages/modules/Virtualization/` | AVF mainline module — VirtualizationService, Microdroid, VmPayloadService, vmbase | | `packages/modules/Virtualization/mic