audio_policy.conf说明(翻译)
自己记着当笔记,水平有限,仅供参考
#
# 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说明(翻译)的更多相关文章
- 〖Android〗/system/etc/audio_policy.conf
原文件注释说明: # audio hardware module section: contains descriptors for all audio hw modules present on t ...
- Apache配置文件httpd.conf内容翻译
本文已经废弃,现在apache2不依靠httpd.conf来配置. Ubuntu下默认的配置文件是/etc/apache2/sites-available/default 可以修改上面文件来修改a ...
- [Android][Audio] audio_policy.conf文件分析
不同的Android产品在音频的设计上通常是存在差异的,而这些差异可以同过Audio的配置文件audio_policy.conf来获得.在Android系统中音频配置文件存放路径有两处,存放地址可以从 ...
- Apache httpd.conf的翻译
本人初学,15年暑假翻译了一些,前几天翻译完,有机器翻译,也有自己翻译的内容,不准确之处请指出. --------------------------------------------------- ...
- React Conf 2017 干货总结 1: React + ES next = ♥
React Conf 2017在加利福尼亚州的圣克拉拉万豪酒店圆满落幕,这已经是Facebook举办的第三届React官方大会了.虽然不能参会,但是作为前端开发者,我们当然不能错过这个绝佳的学习契机. ...
- Android PRODUCT_COPY_FILES 自动拷贝文件
/********************************************************************** * Android PRODUCT_COPY_FILES ...
- Android AudioPolicyService服务启动过程
AudioPolicyService是策略的制定者,比如什么时候打开音频接口设备.某种Stream类型的音频对应什么设备等等.而AudioFlinger则是策略的执行者,例如具体如何与音频设备通信,如 ...
- Android音频系统之AudioFlinger(二)
1.1.1 音频设备的管理 虽然AudioFlinger实体已经成功创建并初始化,但到目前为止它还是一块静态的内存空间,没有涉及到具体的工作. 从职能分布上来讲,AudioPolicyService是 ...
- Android音频系统之AudioPolicyService
地址:http://blog.csdn.net/edmond999/article/details/18599327 1.1 AudioPolicy Service 在AudioFlinger小节,我 ...
随机推荐
- Android 耳机插入过程分析 (AudioManager部分)
接上一篇,记录audioManager对耳机插入的操作 https://www.cnblogs.com/helloworldtoyou/p/9868890.html 主要是发送广播,另外更新音频通路 ...
- android设置主mic/副mic录音
//添加MIC设置参数 /hal/audio_extn/audio_extn.c @@ -75,6 +75,7 @@ struct audio_extn_module { bool ras_enabl ...
- Python中的高级turtle(海龟)作图
在Python里,海龟不仅可以画简单的黑线,还可以用它画更复杂的几何图形,用不同的颜色,甚至还可以给形状填色. 一.从基本的正方形开始 引入turtle模块并创建Pen对象: >>> ...
- (原)U盘可见容量不能被识别的处理方法
之前我手里有1个8G的U盘,因为前段时间借给了其他人使用,然后今天拿起来用的时候,发现8G的U盘只有200M未被识别,我用管理器下的磁盘管理查看了下,有7G的空间未被识别. 怎么办? 进入win7: ...
- Git -- 基本操作 之 版本回退
现在,你已经学会了修改文件,然后把修改提交到Git版本库,现在,再练习一次,修改readme.txt文件如下: Git is a distributed version control system. ...
- CI框架 -- 核心文件 之 Lang.php(加载语言包)
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class CI_Lang { var $l ...
- Erlang编程语言的一些痛点
Erlang编程语言的一些痛点 http://www.zhihu.com/question/34500981
- CentOS7环境RabbitMQ集群配置管理
CentOS7系统内核版本:3.10.0-514.26.2.el7.x86_64 一.对应主机host地址(三台主机host文件要保持一致) 10.100.2.10 v01-app-rabbitmq0 ...
- C# 抓取网页的img src带参数的图片链接,并下载
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- 在Centos7下发布.NET CORE项目[转]
1.安装安装前准备开发环境 编译类库:yum -y install gcc make gcc-c++ openssl-devel 系统信息: CentOS Linux release 7.2.1511 ...