自己记着当笔记,水平有限,仅供参考

#
# Audio policy configuration for generic device builds (goldfish audio HAL - emulator)
#这是模拟器的Audio policy配置
# # 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 #全局配置部分:列出了设备上总是存在的输入输出设备,它也是系统默认选择的输出设备
#这里的输入输出设备必须是audio.h中列出的枚举类型 global_configuration {
attached_output_devices AUDIO_DEVICE_OUT_SPEAKER
default_output_device AUDIO_DEVICE_OUT_SPEAKER
attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX
} # 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 hardware module部分:包含了对设备上的所有的audio hw modules的descriptors,每一个hw module节点
#的名字都与相应的so库名称相对应,例如:"primary"对应audio.primary.<device>.so。其中"primary"module是
#必须的,而且它必须包含一个含AUDIO_OUTPUT_FLAG_PRIMARY标志的output,每一个module的descriptor必须至少
#包含一个output配置descriptor和大于等于0个的input配置descriptor,每一个配置都描述了输入输出流类型支持
#的参数,其中的 "channel_masks"、"formats"、"devices"和"flags"必须为audio.h、audio_policy.h中定义的枚
#举值,它们可以通过|连接,但不能包含空格和"\n"。
audio_hw_modules {
primary {
outputs {
primary {
sampling_rates
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_SPEAKER
flags AUDIO_OUTPUT_FLAG_PRIMARY
}
}
inputs {
primary {
sampling_rates |
channel_masks AUDIO_CHANNEL_IN_MONO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_BUILTIN_MIC
}
}
}
r_submix {
outputs {
submix {
sampling_rates
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
}
}
inputs {
submix {
sampling_rates
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
}
}
}
}

另外,存储各个audio_hw_module的结构体如下:

        class HwModule {
public:
HwModule(const char *name);
~HwModule(); void dump(int fd); const char *const mName; // base name of the audio HW module (primary, a2dp ...)
audio_module_handle_t mHandle;
Vector <IOProfile *> mOutputProfiles; // output profiles exposed by this module
Vector <IOProfile *> mInputProfiles; // input profiles exposed by this module
}; // the IOProfile class describes the capabilities of an output or input stream.
// It is currently assumed that all combination of listed parameters are supported.
// It is used by the policy manager to determine if an output or input is suitable for
// a given use case, open/close it accordingly and connect/disconnect audio tracks
// to/from it.
class IOProfile
{
public:
IOProfile(HwModule *module);
~IOProfile(); bool isCompatibleProfile(audio_devices_t device,
uint32_t samplingRate,
uint32_t format,
uint32_t channelMask,
audio_output_flags_t flags) const; void dump(int fd); // by convention, "0' in the first entry in mSamplingRates, mChannelMasks or mFormats
// indicates the supported parameters should be read from the output stream
// after it is opened for the first time
Vector <uint32_t> mSamplingRates; // supported sampling rates
Vector <audio_channel_mask_t> mChannelMasks; // supported channel masks
Vector <audio_format_t> mFormats; // supported audio formats
audio_devices_t mSupportedDevices; // supported devices (devices this output can be
// routed to)
audio_output_flags_t mFlags; // attribute flags (e.g primary output,
// direct output...). For outputs only.
HwModule *mModule; // audio HW module exposing this I/O stream
};

在AudioPolicyManagerBase类对象的mHwModules中保存了这些读取的配置。

audio_policy.conf说明(翻译)的更多相关文章

  1. 〖Android〗/system/etc/audio_policy.conf

    原文件注释说明: # audio hardware module section: contains descriptors for all audio hw modules present on t ...

  2. Apache配置文件httpd.conf内容翻译

      本文已经废弃,现在apache2不依靠httpd.conf来配置. Ubuntu下默认的配置文件是/etc/apache2/sites-available/default 可以修改上面文件来修改a ...

  3. [Android][Audio] audio_policy.conf文件分析

    不同的Android产品在音频的设计上通常是存在差异的,而这些差异可以同过Audio的配置文件audio_policy.conf来获得.在Android系统中音频配置文件存放路径有两处,存放地址可以从 ...

  4. Apache httpd.conf的翻译

    本人初学,15年暑假翻译了一些,前几天翻译完,有机器翻译,也有自己翻译的内容,不准确之处请指出. --------------------------------------------------- ...

  5. React Conf 2017 干货总结 1: React + ES next = ♥

    React Conf 2017在加利福尼亚州的圣克拉拉万豪酒店圆满落幕,这已经是Facebook举办的第三届React官方大会了.虽然不能参会,但是作为前端开发者,我们当然不能错过这个绝佳的学习契机. ...

  6. Android PRODUCT_COPY_FILES 自动拷贝文件

    /********************************************************************** * Android PRODUCT_COPY_FILES ...

  7. Android AudioPolicyService服务启动过程

    AudioPolicyService是策略的制定者,比如什么时候打开音频接口设备.某种Stream类型的音频对应什么设备等等.而AudioFlinger则是策略的执行者,例如具体如何与音频设备通信,如 ...

  8. Android音频系统之AudioFlinger(二)

    1.1.1 音频设备的管理 虽然AudioFlinger实体已经成功创建并初始化,但到目前为止它还是一块静态的内存空间,没有涉及到具体的工作. 从职能分布上来讲,AudioPolicyService是 ...

  9. Android音频系统之AudioPolicyService

    地址:http://blog.csdn.net/edmond999/article/details/18599327 1.1 AudioPolicy Service 在AudioFlinger小节,我 ...

随机推荐

  1. oracle 中execute immediate

    简单来说 就是你一个存储过程当中 创建了一个表 table_a 然后要用insert into将其他的数据插入到这个table_a当中,但是因为你在创建过程的时候 table_a还不存在,过程就会显示 ...

  2. (笔记)Mysql命令mysql:连接Mysql数据库

    mysql命令用户连接数据库. mysql命令格式: mysql -h主机地址 -u用户名 -p用户密码 1) 连接到本机上的MYSQL首先打开DOS窗口,然后进入目录mysql\bin,再键入命令m ...

  3. zXing使用注意事项-转

    zXing使用注意事项   ------------------ zxing和zbar的比较: ZXing项目的示例程序对于摄像头的控制写的非常全面,ZBar的没有ZBar基于C语言编写,解码效率高于 ...

  4. Solr系列六:solr搜索详解优化查询结果(分面搜索、搜索结果高亮、查询建议、折叠展开结果、结果分组、其他搜索特性介绍)

    一.分面搜索 1. 什么是分面搜索? 分面搜索:在搜索结果的基础上进行按指定维度的统计,以展示搜索结果的另一面信息.类似于SQL语句的group by 分面搜索的示例: http://localhos ...

  5. MultipleActiveResultSets=true 数据库连接复用

    注:EF连接Mysql时,连接字符串是不能包含MARS的,Mysql不支持这个特性. ADO.NET 1.n 利用SqlDataReader读取数据,针对每个结果集需要一个独立的连接. 这些独立的链接 ...

  6. 分享一个MAC下绕开百度网盘限速下载的方法,三步操作永久生效

    相信大家都比较困惑,百度网盘客户端限速后一般只有几十K的下载速度,Windows有百度网盘破解版,但MAC的破解版似乎不存在,要提速的话,一般的做法是开超级会员(27元/月),身为程序员的我们,是不是 ...

  7. ASP.NET EntityFrameworkCore code first 多对多设计

    摘要:参考网址:https://docs.microsoft.com/zh-cn/ef/core/get-started/full-dotnet/new-db场景:使用ASP.NETEntityFra ...

  8. 微信小程序开发1_资料收集

    [前言] 小程序 [一.资料] 微信官网 开发文档.工具 等 https://mp.weixin.qq.com/cgi-bin/wx [二] 创建小程序和编辑代码,先安装 开发者工具 ,根据所使用的操 ...

  9. git解决冲突(rebase版)

    当使用git rebase碰到冲突时, git rebase <Remote Branch>/<Your Branch> 信息如下: error: Failed to merg ...

  10. Git 基础 - 远程仓库的使用

    远程仓库的使用 要参与任何一个 Git 项目的协作,必须要了解该如何管理远程仓库.远程仓库是指托管在网络上的项目仓库,可能会有好多个,其中有些你只能读,另外有些可以写.同他人协作开发某个项目时,需要管 ...