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

#
# 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. [转]java加密算法简要介绍

    本篇内容简要介绍BASE64.MD5.SHA.HMAC几种加密算法.     BASE64编码算法不算是真正的加密算法.     MD5.SHA.HMAC这三种加密算法,可谓是非可逆加密,就是不可解密 ...

  2. windows sever2003安装Wamp 2.5不成功——VC 11不支持Windows Server 2003和win XP?

    Windows Server 2003 安装Wamp 2.5不成功Wampserver 2.5 will not run on Windows XP 报错信息:C:\wamp\bin\apache\a ...

  3. SpringMVC系列(十五)Spring MVC与Spring整合时实例被创建两次的解决方案以及Spring 的 IOC 容器和 SpringMVC 的 IOC 容器的关系

    一.Spring MVC与Spring整合时实例被创建两次的解决方案 1.问题产生的原因 Spring MVC的配置文件和Spring的配置文件里面都使用了扫描注解<context:compon ...

  4. e805. 监听JProgressBar的数值变化

    Whenever the value of a progress bar is changed, a change event is fired. In fact, the event is also ...

  5. e807. 设置进程监听对话框的延迟弹出

    By default, the progress monitor delays for a short period before it is displayed. There are two pro ...

  6. Unity---------Particle Effect详情

    Effects:效果/特效. Particle System:粒子系统.可用于创建烟雾.气流.火焰.涟漪等效果. 在Unity3D 3.5版本之后退出了新的shuriken粒子系统:   添加组件之后 ...

  7. Ubuntu Server对OpenStack的支持

    关于Ubuntu上OpenStack版本选择的问题, 就看这里. 从12.04 LTS起, Ubuntu云存档允许用户在下一个LTS版的Ubuntu发布前安装更新的OpenStack. 就拿Ubunt ...

  8. iOS:自定义字体

    转自: <iOS tips: Custom Fonts> Post by Steve Vlaminck My good friend google told me that using a ...

  9. Excel破解密码代码

    Option ExplicitPublic Sub AllInternalPasswords()' Breaks worksheet and workbook structure passwords. ...

  10. recovery中英对照表 recovery大全图解

    一:Recovery主界面 ---reboot system now                         重启手机(刷机完毕选择此项就能重新启动系统) ---apply SDcard:up ...