Android Audio架构

下面是来自Android官方的Audio架构图,比较清楚地说明了android中audio的组成。


出处:https://source.android.com/devices/audio/index.html


Audio

Android Audio HAL icon

Android's audio Hardware Abstraction Layer (HAL) connects the higher-level, audio-specific framework APIs in android.media to the underlying audio driver and hardware. This section includes implementation instructions and tips for improving performance.

Audio Architecture


Android audio architecture defines how audio functionality is implemented and points to the relevant source code involved in the implementation.

Audio architecture

Figure 1. Android audio architecture

Application framework
The application framework includes the app code, which uses the  android.media APIs to interact with audio hardware. Internally, this code calls corresponding JNI glue classes to access the native code that interacts with audio hardware.
JNI
The JNI code associated with  android.media calls lower level native code to access audio hardware. JNI is located in  frameworks/base/core/jni/ and  frameworks/base/media/jni.
Native framework
The native framework provides a native equivalent to the  android.media package, calling Binder IPC proxies to access the audio-specific services of the media server. Native framework code is located in frameworks/av/media/libmedia.
Binder IPC
Binder IPC proxies facilitate communication over process boundaries. Proxies are located in frameworks/av/media/libmedia and begin with the letter "I".
Media server
The media server contains audio services, which are the actual code that interacts with your HAL implementations. The media server is located in  frameworks/av/services/audioflinger.
HAL
The HAL defines the standard interface that audio services call into and that you must implement for your audio hardware to function correctly. The audio HAL interfaces are located in hardware/libhardware/include/hardware. For details, see  hardware/audio.h.
Kernel driver
The audio driver interacts with your hardware and HAL implementation. You can use Advanced Linux Sound Architecture (ALSA), Open Sound System (OSS), or a custom driver (HAL is driver-agnostic).

Note: If you use ALSA, we recommend external/tinyalsa for the user portion of the driver because of its compatible licensing (the standard user-mode library is GPL-licensed).

Android native audio based on Open SL ES  (not shown)
This API is exposed as part of  Android NDK and is at the same architecture level as  android.media.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值