博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
〖Android〗/system/etc/audio_policy.conf
阅读量:5732 次
发布时间:2019-06-18

本文共 3678 字,大约阅读时间需要 12 分钟。

原文件注释说明:

# 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..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.
.so。其中,"primary"是必须要有的,而且必须包含至少一个输出 AUDIO_OUTPUT_FLAG_PRIMARY 标志。每个模块描述元包含一个或多个输出配置描述元和一或多个输入配置描述元。每个配置通过给定的输出或输入流种类,列出所有支持的参数。其中"channel_masks"、"formats"、"devices"和"flags"是由audio.h和audio_policy.h中相应的字符串指定的。它们通过没有空格的"|"或"\n"联系起来。

其他博客的讲解:[Form: ]

不同的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.hglobal_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..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      }    }  }}

 

转载于:https://www.cnblogs.com/scue/p/3141327.html

你可能感兴趣的文章
告警系统主脚本、告警系统配置文件、告警系统监控项目
查看>>
Python 和 PyCharm 在 windows10 环境的安装和设置
查看>>
B-树,B+树与B*树的优缺点比较
查看>>
C语言入门基础之数组——数学和编程的完美结合(图)
查看>>
《远见》的读后感作文1000字范文
查看>>
重置密码、单用户模式、救援模式
查看>>
LAMP环境搭建1-mysql5.5
查看>>
第三课 Linux目录及文件管理、用户组管理及bash重定向
查看>>
shell 脚本攻略--小试牛刀
查看>>
spring boot view override
查看>>
bzoj 2282: [Sdoi2011]消防
查看>>
我的友情链接
查看>>
centos5.9使用RPM包搭建lamp平台
查看>>
关于C#面向对象2
查看>>
Javascript String类的属性及方法
查看>>
vim编辑器如何添加或删除多行注释
查看>>
[LeetCode] Merge Intervals
查看>>
iOS开发-按钮的基本使用
查看>>
在QT和SDL搭建的框架中使用OPENGL在SDL窗口上进行绘图
查看>>
REST技术第三步 @BeanParam的使用
查看>>