比如這個:frameworks/av/services/audiopolicy/config/audio_policy_configuration.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
<globalConfiguration speaker_drc_enabled="true"/>
<modules>
<module name="primary" halVersion="3.0">
<attachedDevices>
<item>Speaker</item>
<item>Earpiece</item>
<item>Built-In Mic</item>
</attachedDevices>
<defaultOutputDevice>Speaker</defaultOutputDevice>
<mixPorts>
<mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="primary input" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO"/>
</mixPort>
</mixPorts>
<devicePorts>
<devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
</devicePort>
<devicePort tagName="Speaker" role="sink" type="AUDIO_DEVICE_OUT_SPEAKER" address="">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>
<devicePort tagName="Wired Headset" type="AUDIO_DEVICE_OUT_WIRED_HEADSET" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>
<devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO"/>
</devicePort>
<devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO"/>
</devicePort>
</devicePorts>
<routes>
<route type="mix" sink="Earpiece" sources="primary output"/>
<route type="mix" sink="Speaker" sources="primary output"/>
<route type="mix" sink="Wired Headset" sources="primary output"/>
<route type="mix" sink="primary input" sources="Built-In Mic,Wired Headset Mic"/>
</routes>
</module>
<xi:include href="https://bbs.csdn.net/topics/a2dp_audio_policy_configuration.xml"/>
</modules>
<xi:include href="https://bbs.csdn.net/topics/audio_policy_volumes.xml"/>
<xi:include href="https://bbs.csdn.net/topics/default_volume_tables.xml"/>
</audioPolicyConfiguration>
這個怎么看呢?是有專門的格式嗎?還是不同廠商有不同的寫法?
比如在linux里面我們要設定音頻配置,可以使用tinymix 設定不同屬性的值,那這里是怎么對上這個xml檔案的呢?
還有一個問題,xml檔案我看有好多啊,除了這個audio_policy_configuration.xml檔案,是不是還有其他xml檔案在起作用?
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/197429.html
標籤:內核源代碼研究區
上一篇:請大神來幫幫我!!!
