Chinaunix首页 | 论坛 | 博客
  • 博客访问: 651817
  • 博文数量: 160
  • 博客积分: 2384
  • 博客等级: 大尉
  • 技术积分: 1366
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-01 11:35
文章分类
文章存档

2015年(45)

2014年(36)

2012年(28)

2011年(37)

2010年(2)

2009年(10)

2008年(2)

分类: Android平台

2015-04-14 10:16:45

Audio

IN THIS DOCUMENT

  1. Audio Architecture

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


The following figure and list describe how audio functionality is implemented and the relevant source code that is involved in the implementation:

Audio architecture

Figure 1. Android audio architecture

Application framework
  At the application framework level is the app code, which utilizes the android.media APIs to interact with the audio hardware. Internally, this code calls corresponding JNI glue classes to access the native code that interacts with the audio hardware.

JNI
   The JNI code associated with android.media is located in the frameworks/base/core/jni/ andframeworks/base/media/jni directories. This code calls the lower level native code to obtain access to the audio hardware.

Native framework
    The native framework is defined in frameworks/av/media/libmedia and provides a native equivalent to theandroid.media package. The native framework calls the Binder IPC proxies to obtain access to audio-specific services of the media server.

Binder IPC
   The Binder IPC proxies facilitate communication over process boundaries. They are located in theframeworks/av/media/libmedia directory and begin with the letter "I".

Media Server
   The audio services in the media server, located in frameworks/av/services/audioflinger, is the actual code that interacts with your HAL implementations.

HAL
    The HAL defines the standard interface that audio services call into and that you must implement to have your audio hardware function correctly. The audio HAL interfaces are located inhardware/libhardware/include/hardware. See  for additional details.

Kernel Driver
      The audio driver interacts with the hardware and your implementation of the HAL. You can choose to use ALSA, OSS, or a custom driver of your own at this level. The HAL is driver-agnostic.

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

Not shown: Android native audio based on OpenSL ES. This API is exposed as part of Android NDK, and is at the same architecture level as android.media.


阅读(653) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~