Original author: mritter Merged from: //branches/cupcake/... Automated import of CL 146204
57 lines
2.1 KiB
Plaintext
Executable File
57 lines
2.1 KiB
Plaintext
Executable File
page.title=Audio
|
|
pdk.version=1.0
|
|
@jd:body
|
|
|
|
<a name="toc"/>
|
|
<div style="padding:10px">
|
|
<a href="#androidAudioSubSystemIntroduction">Introduction</a><br/>
|
|
<a href="#androidAudioBuildingDriver">Building an Audio Library</a><br/>
|
|
<a href="#androidAudioInterface">Interface</a><br/></div></font></div>
|
|
|
|
<a name="androidAudioSubSystemIntroduction"></a><h2>Introduction</h2>
|
|
|
|
<p>AudioHardwareInterface serves as the glue between proprietary audio drivers and the Android AudioFlinger service, the core audio service that handles all audio-related requests from applications.</p>
|
|
<p><img src="android_audio_architecture.gif"></p>
|
|
|
|
Solid elements represent Android blocks and dashed elements represent partner-specific blocks.
|
|
|
|
|
|
|
|
<a name="androidAudioBuildingDriver"></a><h2>Building an Audio Library</h2>
|
|
|
|
<p>To implement an audio driver, create a shared library that implements the interface defined in <code>AudioHardwareInterface.h</code>. You must name your shared library <code>libaudio.so</code> so that it will get loaded from <code>/system/lib</code> at runtime. Place libaudio sources and <code>Android.mk</code> in <code>partner/acme/chipset_or_board/libaudio/</code>.</p>
|
|
<p>The following stub <code>Android.mk</code> file ensures that <code>libaudio</code> compiles and links to the appropriate libraries:</p>
|
|
|
|
<pre class="prettify">
|
|
LOCAL_PATH := $(call my-dir)
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := libaudio
|
|
|
|
LOCAL_SHARED_LIBRARIES := \
|
|
libcutils \
|
|
libutils \
|
|
libmedia \
|
|
libhardware
|
|
|
|
LOCAL_SRC_FILES += MyAudioHardware.cpp
|
|
|
|
LOCAL_CFLAGS +=
|
|
|
|
LOCAL_C_INCLUDES +=
|
|
|
|
LOCAL_STATIC_LIBRARIES += libaudiointerface
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
</pre>
|
|
|
|
|
|
<a name="androidAudioInterface"></a><h2>Interface</h2>
|
|
|
|
|
|
|
|
<p class="note"><strong>Note</strong>: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, <a href="audio_sub_system.html">click here</a>.</p>
|
|
|
|
|
|
<iframe onLoad="resizeDoxFrameHeight();" src="_audio_hardware_interface_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>
|