当前位置: 首页 > news >正文

国外idc网站c2c网站建设系统

国外idc网站,c2c网站建设系统,东莞网络营销新模式,扶风网站建设一,简介 usb_audio_policy_configuration.xml文件用于配置 USB 音频策略 的 XML 文件,属于 USB Audio HAL(Hardware Abstraction Layer) 的一部分。它的作用是定义 USB 音频设备的输入输出行为、支持的格式、采样率、通道数&#…

一,简介

usb_audio_policy_configuration.xml文件用于配置 USB 音频策略 的 XML 文件,属于 USB Audio HAL(Hardware Abstraction Layer) 的一部分。它的作用是定义 USB 音频设备的输入输出行为、支持的格式、采样率、通道数,以及音频路由规则。

源码位置:frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml
系统位置(adb 下可直接修改文件验证):/vendor/etc/audio/usb_audio_policy_configuration.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2015 The Android Open Source ProjectLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
-->
<!-- USB Audio HAL Audio Policy Configuration file --><module name="usb" halVersion="2.0"><mixPorts><mixPort name="usb_accessory output" role="source"><profile name="" format="AUDIO_FORMAT_PCM_16_BIT"samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/></mixPort><mixPort name="usb_device output" role="source"/><mixPort name="usb_device input" role="sink"/></mixPorts><devicePorts><devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink"><profile name="" format="AUDIO_FORMAT_PCM_16_BIT"samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/></devicePort><devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink"/><devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink"/><devicePort tagName="USB Device In" type="AUDIO_DEVICE_IN_USB_DEVICE" role="source"/><devicePort tagName="USB Headset In" type="AUDIO_DEVICE_IN_USB_HEADSET" role="source"/></devicePorts><routes><route type="mix" sink="USB Host Out"sources="usb_accessory output"/><route type="mix" sink="USB Device Out"sources="usb_device output"/><route type="mix" sink="USB Headset Out"sources="usb_device output"/><route type="mix" sink="usb_device input"sources="USB Device In,USB Headset In"/></routes>
</module>

二,文件结构解析

1. module 标签

<module name="usb" halVersion="2.0">

表示这是一个 USB 音频模块的配置。halVersion="2.0" 表示使用的是 USB Audio HAL 2.0 版本。

2. mixPorts 标签

定义系统内部用于播放或录制的逻辑音频流(虚拟端口)。

<mixPort name="usb_accessory output" role="source"><profile name="" format="AUDIO_FORMAT_PCM_16_BIT"samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>

role="source":表示这是一个输出源(播放),profile 定义了支持的音频格式:16-bit PCM、44.1kHz、立体声。

<mixPort name="usb_device output" role="source"/>
<mixPort name="usb_device input" role="sink"/>

usb_device output:用于 USB 设备输出(播放);
usb_device input:用于 USB 设备输入(录制),role="sink" 表示接收音频数据。

3. devicePorts 标签

定义系统中可识别的物理 USB 音频设备类型及其能力。

<devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink"><profile name="" format="AUDIO_FORMAT_PCM_16_BIT"samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>

type="AUDIO_DEVICE_OUT_USB_ACCESSORY":表示这是一个 USB 主机模式下的输出设备。
role="sink":表示这是一个接收音频的设备(如扬声器),同样支持 16-bit PCM、44.1kHz、立体声。

4. routes 标签

定义音频数据如何在 mixPort devicePort 之间流动。

<route type="mix" sink="USB Host Out" sources="usb_accessory output"/>

表示将逻辑输出流 usb_accessory output 路由到物理设备 USB Host Out

<route type="mix" sink="USB Device Out" sources="usb_device output"/>
<route type="mix" sink="USB Headset Out" sources="usb_device output"/>

usb_device output 输出流分别路由到 USB Device Out 和 USB Headset Out

<route type="mix" sink="usb_device input" sources="USB Device In,USB Headset In"/>

将两个物理输入设备(USB Device In 和 USB Headset In)的音频数据路由到逻辑输入流 usb_device input


三,实例修改

  1. 问题现象:
    主板接入客户USB接口阵列麦克风,可以录音的同时但是也会识别到耳机(右上角有耳机图标),会导致喇叭无声音输出。
  2. 问题原因:
    USB麦克风通常是一个复合设备(Composite Device),它可能同时包含音频输入(麦克风) 和音频输出(耳机) 两个接口(Interface)。
  3. 解决方法:
    修改音频策略配置文件: usb_audio_policy_configuration.xml
注释掉了两条路由规则:
sink="USB Device Out"
sink="USB Headset Out"<!--<route type="mix" sink="USB Device Out"sources="usb_device output"/><route type="mix" sink="USB Headset Out"sources="usb_device output"/>-->

这两条规则原本将系统内部的 usb_device output 音频流路由到物理的USB输出设备。注释后,系统无法将播放音频发送到USB设备的输出接口。所有输入相关的配置(usb_device input, USB Device In, USB Headset In)和路由均保持原样,确保USB麦克风的录音功能正常。

http://www.dtcms.com/a/456016.html

相关文章:

  • 三明市建设局网站软件定制研发
  • 网络建站流程营销型网站开发方案
  • 长春seo公司网站十大网络公司
  • 网站建设制作教程大连做网站的公司有哪些
  • 网站首页浮动窗口代码鹿城网络公司
  • 网站建设公司宣传标语网站制作软件工程师
  • 用返利网站做爆款wordpress 干什么
  • 宁波网站建设的公司私人网页制作
  • 如何建设网站安全wordpress打开高级设置
  • 青岛网站推广优化公司深圳市房产管理局官方网站
  • 网站建设 概念购物网站模版html
  • 怎样做视频上网站赚钱最新裁员公司名单
  • 专业建站模板安卓手机网页视频怎么下载
  • 四川seo整站优化费用即时通讯app开发
  • 企业网站图片渐变效果怎么做微信怎样引流被加精准粉
  • 常州网站建设 最易制作视频教程
  • 网站建设不开单免费的网站管理系统
  • 营销网站开发找哪家怎么免费建立自己的网站
  • 网站排名推广专业做电脑系统下载网站好
  • 做网站公司未来的发展方向网站推广方案200字
  • 金昌大型网站建设费用网页设计如何把照片作为背景
  • 郑州 制造 网站官方网站下载qq音速
  • 南通城乡住房建设厅网站网站主机一个g
  • 家具营销型网站模板优质的企业网站
  • 大石桥网站制作90设计手机站
  • 网站建设与管理教学视频在哪里可以买到客户数据
  • wordpress多站点无法访问wordpress qq微信登陆地址修改
  • 凡科网做的网站怎么样宿州网站建设工作室
  • 如何购买一个网站的域名制作一个网站需要多少小时
  • 做网站实现登陆功能阅读网站源码