原文件注释说明:

# 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. mysql 3.2.49 源代码安装-redhat 5 x64

    [mysql@localhost ~]$ uname -r2.6.32 [root@localhost ~]#cp /usr/include/pthread.h /usr/include/pthrea ...

  2. [MySql]windows下设置mysql默认编码

    摘要 在安装好mysql的时候,如果新建数据库或者表默认的编码为latin1,如果这时候插入中文时,出出现类似下面的乱码的问题. SQLException: Incorrect string valu ...

  3. spring mvc实现restful

    restful它的核心是将所有的 Api 都理解为一个网络资源.把api映射成资源 restful它的核心是将所有的 Api 都理解为一个网络资源.把api映射成资源 把api映射成资源,把api映射 ...

  4. linux普通用户获取管理员权限

    原文:http://www.cnblogs.com/likwo/p/3435404.html 测试环境:CentOS 5.5 1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #ad ...

  5. SQLAlchemy 操作方法汇总

    参考 1.查询: #简单查询 print(session.query(User).all()) print(session.query(User.name, User.fullname).all()) ...

  6. JavaScript的js文件压缩和格式化工具

    JavaScriptcompressor.com这个网站可是大名鼎鼎啊.以前在找到过压缩 Javascript 代码的程序,一直在用,感觉效果不错.域名是: http://javascriptcomp ...

  7. iphone手机微信端html5 Geolocation定位失效的问题

    使用Geolocation方法存在错误信息error.POSITION_UNAVAILABLE 其实问题不局限于微信端而是iphone升级到ios10后,对获取地理位置信息作出了限制,只有https的 ...

  8. PL/SQL 下 Command window 与 SQL window 的区别

    1.Command window实现了SQL*Plus的所有功能,允许运行sql*plus命令,sql命令,sql脚本. 2.SQL window用于执行sql语句,显示sql输出,执行统计信息.(测 ...

  9. 如何在Linux上安装服务器管理软件Cockpit

    Cockpit 是一个自由开源的服务器管理软件,使得我们可以通过它好看的 Web 前端界面轻松地管理我们的 GNU/Linux 服务器,非常轻量级,Web 界面也非常简单易用. Cockpit 使得 ...

  10. SqlServer 在查询结果中如何过滤掉重复数据

    问题背景 在一个多表查询的sql中正常情况下产生的数据都是唯一的,但因为数据库中存在错误(某张表中存在相同的外键ID)导致我这边查询出来的数据就会有重复的问题 下面结果集中UserID:15834存在 ...