原文件注释说明:

# audio hardware module section: contains descriptors for all audio hw modules present on the
# device. Each hw module node is named after the corresponding hw module library base name.
# for instance, "primary" corresponds to audio.primary.<device>.so.
# the "primary" module is mandatory and must include at least one output with
# AUDIO_OUTPUT_FLAG_PRIMARY flag.
# Each module descriptor contains one or more output profile descriptors and zero or more
# input profile descriptors. Each profile lists all the parameters supported by a given output
# or input stream category.
# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".

其中文翻译大致如下(不太精确,勿见怪~~):

音频设备模块部分:描述设备中包含所有音频设备模块。
每个音频设备节点有着相应的设备模块库基本名称;
例如:primary 对应着audio.primary.<devices>.so。
其中,"primary"是必须要有的,而且必须包含至少一个输出 AUDIO_OUTPUT_FLAG_PRIMARY 标志。
每个模块描述元包含一个或多个输出配置描述元和一或多个输入配置描述元。
每个配置通过给定的输出或输入流种类,列出所有支持的参数。
其中"channel_masks"、"formats"、"devices"和"flags"是由audio.h和audio_policy.h中相应的字符串指定的。
它们通过没有空格的"|"或"\n"联系起来。

其他博客的讲解:[Form: http://www.tuicool.com/articles/7J73ae]

不同的Android产品在音频的设计上通常是有差异的,利用配置文件的形式(audio_policy.conf)可以使厂商方便地描述其产品中所包含的音频设备,这个文件的存放路径有两处:

#define AUDIO_POLICY_VENDOR_CONFIG_FILE  "/vendor/etc/audio_policy.conf"

#define AUDIO_POLICY_CONFIG_FILE"/system/etc/audio_policy.conf"

联想K860手机例子:

# Global configuration section: lists input and output devices always present on the device
# as well as the output device selected by default.
# Devices are designated by a string that corresponds to the enum in audio.h global_configuration {
attached_output_devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER
default_output_device AUDIO_DEVICE_OUT_SPEAKER
attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC
} # audio hardware module section: contains descriptors for all audio hw modules present on the
# device. Each hw module node is named after the corresponding hw module library base name.
# for instance, "primary" corresponds to audio.primary.<device>.so.
# the "primary" module is mandatory and must include at least one output with
# AUDIO_OUTPUT_FLAG_PRIMARY flag.
# Each module descriptor contains one or more output profile descriptors and zero or more
# input profile descriptors. Each profile lists all the parameters supported by a given output
# or input stream category.
# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n". audio_hw_modules {
primary {
outputs {
primary {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_LINEOUT1|AUDIO_DEVICE_OUT_LINEOUT2|AUDIO_DEVICE_OUT_FM
flags AUDIO_OUTPUT_FLAG_PRIMARY
}
}
inputs {
primary {
sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_LINEIN1|AUDIO_DEVICE_IN_LINEIN2
}
}
}
a2dp {
outputs {
a2dp {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_ALL_A2DP
}
}
}
}

〖Android〗/system/etc/audio_policy.conf的更多相关文章

  1. 〖Android〗/system/etc/event-log-tags

    一博客中,一段的注释的解释:[From: http://blog.csdn.net/hustpzb/article/details/8525324] /** * Access to the syste ...

  2. 〖Android〗/system/etc/media_codecs.xml

    其中的原文件中包含的注释如下: <?xml version="1.0" encoding="utf-8" ?> <!-- Copyright ...

  3. 〖Android〗/system/etc/recovery-resource.dat

    源代码中的解释:[platform_build/tools/releasetools/ota_from_target_files] # Recovery is generated as a patch ...

  4. 〖Android〗/system/etc/fallback_fonts.xml

    <?xml version="1.0" encoding="utf-8"?> <!-- Fallback Fonts This file sp ...

  5. 〖Android〗Android源代码所有目录生成的Target(编译生成文件反查)

    => build/tools/zipalign: out/host/linux-x86/bin/zipalign (host) => build/tools/atree: out/host ...

  6. 〖Android〗快速部署SSHD和Bash Shell(程序:DroidSSHD和BetterTerminalEmulatorPro)

    --此文仅做个人配置记录-- 因为我经常需要sshd来连接设备,它抓取logcat日志太方便了,方便排查问题,及多人共享: 及有USB孔限制的人来说,这个更具有意义: 把超级终端增强包部署到内网,也是 ...

  7. 〖Android〗巧用/system/etc/mkshrc文件,把busybox常用命令映射(链接)出来;

    在/system/etc/mkshrc文中尾部添加以下代码即可: # for busybox for n in $(busybox --list) do eval alias $n=\'busybox ...

  8. 〖Android〗查找Android中的/system/lib中增加的lib文件是否在apk文件中

    #!/bin/bash - #=============================================================================== # # F ...

  9. 〖Android〗arm-linux-androideabi-gdb报 libpython2.6.so.1.0: cannot open shared object file错误的解决方法

    执行: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gdb out/target/p ...

随机推荐

  1. as 汇编器

    [root@localhost ~]# cat .s .file "write.s" .section .rodata hello: .string "hello, wo ...

  2. ASP.NET浏览器跨域

    转载:http://www.cnblogs.com/alvinwei1024/p/4626054.html 什么是跨域? 访问同源的资源是被浏览器允许的,但是如果访问不同源的资源,浏览器默认是不允许的 ...

  3. 在Powerdesigner中创建概念数据模型

    点击菜单“File”---->“New Model” 点击[OK]按钮后,将进入如下的画面 系统将出现一个工具栏如下,用于在设计面板中设计模型

  4. Java Web开发基础(2)-JSP

    上一篇博我粗略的介绍了一下Servlet.粗略是由于博主也刚刚学习这部分的内容,还不是非常懂所以无法讲的非常精细.可是本着二八原则,我还是先继续学习.所以,这篇博客接着JSP的内容.由于.这两个内容关 ...

  5. VC6 下 libpng 库的编译与初步使用

      VC6 下 libpng 库的编译与初步使用 目录 libong 库的介绍 VC6 下 libpng 的编译 下载 libpng 与 zlib 进行编译 得到 .lib 文件 初步使用 对 VC6 ...

  6. Android.mk中引用第3方动态库

    Android.mk 文件内容: LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOC ...

  7. tornado基础入门(一)——简单了解tornado

    参考:http://demo.pythoner.com/itt2zh/ch1.html tornado是一个轻量级的web框架,是一个用python写的web服务器,它有三个最大的特点(优势)速度.简 ...

  8. Excel 批量快速合并相同的单元格:数据透视表、宏代码、分类汇总

    Excel 批量快速合并相同的单元格   在制作Excel表格的时候,为了使得自己制作的报表更加简洁明了,方便查阅,经常需要合并很多相同的单元格,如果有几千几万条记录需要合并的话,真的会让人发疯.怎样 ...

  9. 【SPOJ】【1825】Free Tour 2

    点分治 点分治的例题2(本题代码结果为TLE……) 强烈谴责卡时限QAQ,T了无数次啊无数次…… 不过在N次的静态查错中倒是加深了对点分治的理解……也算因祸得福吧(自我安慰一下) TLE后的改进:每棵 ...

  10. 第一章 Java代码执行流程

    说明:本文主要参考自<分布式Java应用:基础与实践> 1.Java代码执行流程 第一步:*.java-->*.class(编译期) 第二步:从*.class文件将其中的内容加载到内 ...