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小节,我 ...
随机推荐
- 域名映射ip
windows: 修改文件hosts文件 地址是C:\WINDOWS\system32\drivers\etc\hosts 加进你自己的如: Linux: hosts 文件目录: sudo vi /e ...
- e783. 监听对JList中项双击和三击
// Create a list String[] items = {"A", "B", "C", "D"}; JLis ...
- Swing AWT一套新的图形界面系统
Swing 是在AWT的基础上构建的一套新的图形界面系统,它提供了AWT 所能够提供的所有功能,并且用纯粹的Java代码对AWT 的功能进行了大幅度的扩充. 例如说并不是所有的操作系统都提供了对树形控 ...
- CI框架 -- 文件结构
这个本来是很基础的东西,基本上用过CI的人都知道这些,原本是不消说的~但是因为毕业论文是关于CodeIgniter的,所以我必须把大大小小的东西都写出来做成记录~ CodeInigter,一个轻量,功 ...
- 一款标注颜色,距离的小软件 markman
长度标记 坐标和矩形标记 色值标记 文字标记 长度自动测量 标记拖拽删除 支持多种图片格式 支持PSD(需用最大兼容保存).PNG.BMP.JPG格式 设计稿自动刷新 在标注的 ...
- C# 把string字符导出到txt文档方法
public static string writtxt(string html, string file) { FileStream fileStream = new FileStream(Envi ...
- iOS :UIPickerView reloadAllComponets not work
编辑信息页面用了很多选择栏,大部分都用 UIPickerView 来实现.在切换数据显示的时候, UIPickerView 不更新数据,不得其解.Google 无解,原因在于无法描述自己的问题,想想应 ...
- js pjax 和window.history.pushState,replaceState
原文:http://blog.linjunhalida.com/blog/pjax/ github:https://github.com/defunkt/jquery-pjax 什么是pjax? 现在 ...
- java新手的session初体验
众所周知,session作为保存我们用户对话所需要的信息的对象,在我们的项目中必不可少.作为菜鸟学习java的第一课就是了解它的思想和用法,在以后的学习中,逐渐学习和总结,从基础到高级,慢慢学会应用. ...
- 在Android中,px,dp,dip,sp的不同之处
最近在学习Android开发,一直没有弄清楚px,dp,dip,sp的区别.今天正好有时间,就花时间研究了一下. 众所周知,Android厂商非常多,各种尺寸的Android手机 ...