1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 2 <!-- Copyright (C) 2018 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 --> 16 17 <audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude"> 18 <!-- version section contains a version tag in the form major.minor e.g version=1.0 --> 19 20 <!-- Global configuration Decalaration --> 21 <globalConfiguration speaker_drc_enabled="true"/> 22 23 <!-- Modules section: 24 There is one section per audio HW module present on the platform. 25 Each module section will contains two mandatory tags for audio HAL halVersion and name. 26 The module names are the same as in current .conf file: 27 primary, A2DP, remote_submix, USB 28 Each module will contain the following sections: 29 devicePorts: a list of device descriptors for all input and output devices accessible via this 30 module. 31 This contains both permanently attached devices and removable devices. 32 "gain": constraints applied to the millibel values: 33 - maxValueMB >= minValueMB 34 - defaultValueMB >= minValueMB && defaultValueMB <= maxValueMB 35 - (maxValueMB - minValueMB) % stepValueMB == 0 36 - (defaultValueMB - minValueMB) % stepValueMB == 0 37 mixPorts: listing all output and input streams exposed by the audio HAL 38 routes: list of possible connections between input and output devices or between stream and 39 devices. 40 "route": is defined by an attribute: 41 -"type": <mux|mix> means all sources are mutual exclusive (mux) or can be mixed (mix) 42 -"sink": the sink involved in this route 43 -"sources": all the sources than can be connected to the sink via vis route 44 attachedDevices: permanently attached devices. 45 The attachedDevices section is a list of devices names. The names correspond to device names 46 defined in <devicePorts> section. 47 defaultOutputDevice: device to be used by default when no policy rule applies 48 --> 49 <modules> 50 <!-- Primary Audio HAL --> 51 <module name="primary" halVersion="3.0"> 52 <attachedDevices> 53 <!-- One bus per context --> 54 <item>bus0_media_out</item> 55 <item>bus1_navigation_out</item> 56 <item>bus2_voice_command_out</item> 57 <item>bus3_call_ring_out</item> 58 <item>bus4_call_out</item> 59 <item>bus5_alarm_out</item> 60 <item>bus6_notification_out</item> 61 <item>bus7_system_sound_out</item> 62 <item>Built-In Mic</item> 63 <item>Built-In Back Mic</item> 64 <item>bus0_mic1_in</item> 65 <!-- Test input device port for audio patch --> 66 <item>bus1_audio_patch_test_in</item> 67 </attachedDevices> 68 <defaultOutputDevice>bus0_media_out</defaultOutputDevice> 69 <mixPorts> 70 <mixPort name="mixport_bus0_media_out" role="source" 71 flags="AUDIO_OUTPUT_FLAG_PRIMARY"> 72 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 73 samplingRates="48000" 74 channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 75 </mixPort> 76 <mixPort name="mixport_bus1_navigation_out" role="source" 77 flags="AUDIO_OUTPUT_FLAG_PRIMARY"> 78 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 79 samplingRates="48000" 80 channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 81 </mixPort> 82 <mixPort name="mixport_bus2_voice_command_out" role="source" 83 flags="AUDIO_OUTPUT_FLAG_PRIMARY"> 84 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 85 samplingRates="48000" 86 channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 87 </mixPort> 88 <mixPort name="mixport_bus3_call_ring_out" role="source" 89 flags="AUDIO_OUTPUT_FLAG_PRIMARY"> 90 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 91 samplingRates="48000" 92 channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 93 </mixPort> 94 <mixPort name="mixport_bus4_call_out" role="source" 95 flags="AUDIO_OUTPUT_FLAG_PRIMARY"> 96 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 97 samplingRates="48000" 98 channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 99 </mixPort> 100 <mixPort name="mixport_bus5_alarm_out" role="source" 101 flags="AUDIO_OUTPUT_FLAG_PRIMARY"> 102 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 103 samplingRates="48000" 104 channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 105 </mixPort> 106 <mixPort name="mixport_bus6_notification_out" role="source" 107 flags="AUDIO_OUTPUT_FLAG_PRIMARY"> 108 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 109 samplingRates="48000" 110 channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 111 </mixPort> 112 <mixPort name="mixport_bus7_system_sound_out" role="source" 113 flags="AUDIO_OUTPUT_FLAG_PRIMARY"> 114 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 115 samplingRates="48000" 116 channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 117 </mixPort> 118 <mixPort name="primary input" role="sink"> 119 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 120 samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000" 121 channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/> 122 </mixPort> 123 <mixPort name="mixport_bus0_mic1_in" role="sink"> 124 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 125 samplingRates="48000" 126 channelMasks="AUDIO_CHANNEL_IN_STEREO"/> 127 </mixPort> 128 <!-- 129 Test mixport for audio patch, 130 this needs to be present to work around the framework limitation 131 --> 132 <mixPort name="mixport_audio_patch_in" role="sink"> 133 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 134 samplingRates="48000" 135 channelMasks="AUDIO_CHANNEL_IN_STEREO"/> 136 </mixPort> 137 </mixPorts> 138 <devicePorts> 139 <devicePort tagName="bus0_media_out" role="sink" type="AUDIO_DEVICE_OUT_BUS" 140 address="bus0_media_out"> 141 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 142 samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 143 <gains> 144 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 145 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 146 </gains> 147 </devicePort> 148 <devicePort tagName="bus1_navigation_out" role="sink" type="AUDIO_DEVICE_OUT_BUS" 149 address="bus1_navigation_out"> 150 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 151 samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 152 <gains> 153 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 154 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 155 </gains> 156 </devicePort> 157 <devicePort tagName="bus2_voice_command_out" role="sink" type="AUDIO_DEVICE_OUT_BUS" 158 address="bus2_voice_command_out"> 159 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 160 samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 161 <gains> 162 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 163 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 164 </gains> 165 </devicePort> 166 <devicePort tagName="bus3_call_ring_out" role="sink" type="AUDIO_DEVICE_OUT_BUS" 167 address="bus3_call_ring_out"> 168 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 169 samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 170 <gains> 171 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 172 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 173 </gains> 174 </devicePort> 175 <devicePort tagName="bus4_call_out" role="sink" type="AUDIO_DEVICE_OUT_BUS" 176 address="bus4_call_out"> 177 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 178 samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 179 <gains> 180 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 181 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 182 </gains> 183 </devicePort> 184 <devicePort tagName="bus5_alarm_out" role="sink" type="AUDIO_DEVICE_OUT_BUS" 185 address="bus5_alarm_out"> 186 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 187 samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 188 <gains> 189 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 190 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 191 </gains> 192 </devicePort> 193 <devicePort tagName="bus6_notification_out" role="sink" type="AUDIO_DEVICE_OUT_BUS" 194 address="bus6_notification_out"> 195 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 196 samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 197 <gains> 198 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 199 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 200 </gains> 201 </devicePort> 202 <devicePort tagName="bus7_system_sound_out" role="sink" type="AUDIO_DEVICE_OUT_BUS" 203 address="bus7_system_sound_out"> 204 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 205 samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> 206 <gains> 207 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 208 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 209 </gains> 210 </devicePort> 211 <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source"> 212 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 213 samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000" 214 channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/> 215 </devicePort> 216 <devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source"> 217 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 218 samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000" 219 channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/> 220 </devicePort> 221 <devicePort tagName="bus0_mic1_in" type="AUDIO_DEVICE_IN_BUS" role="source" 222 address="bus0_mic1_in"> 223 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 224 samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/> 225 <gains> 226 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 227 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 228 </gains> 229 </devicePort> 230 <!-- Test input device ports for audio patch --> 231 <devicePort tagName="bus1_audio_patch_test_in" type="AUDIO_DEVICE_IN_BUS" role="source" 232 address="bus1_audio_patch_test_in"> 233 <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" 234 samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/> 235 <gains> 236 <gain name="" mode="AUDIO_GAIN_MODE_JOINT" 237 minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/> 238 </gains> 239 </devicePort> 240 </devicePorts> 241 <!-- route declaration, i.e. list all available sources for a given sink --> 242 <routes> 243 <route type="mix" sink="bus0_media_out" sources="mixport_bus0_media_out"/> 244 <route type="mix" sink="bus1_navigation_out" sources="mixport_bus1_navigation_out"/> 245 <route type="mix" sink="bus2_voice_command_out" sources="mixport_bus2_voice_command_out"/> 246 <route type="mix" sink="bus3_call_ring_out" sources="mixport_bus3_call_ring_out"/> 247 <route type="mix" sink="bus4_call_out" sources="mixport_bus4_call_out"/> 248 <route type="mix" sink="bus5_alarm_out" sources="mixport_bus5_alarm_out"/> 249 <route type="mix" sink="bus6_notification_out" sources="mixport_bus6_notification_out"/> 250 <route type="mix" sink="bus7_system_sound_out" sources="mixport_bus7_system_sound_out"/> 251 <route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic"/> 252 <route type="mix" sink="mixport_bus0_mic1_in" sources="bus0_mic1_in"/> 253 <!-- 254 Listed source device ports will be routed to desired sinks via audio patch, 255 this route needs to be present to work around framework limitation for now 256 --> 257 <route type="mix" sink="mixport_audio_patch_in" sources="bus1_audio_patch_test_in"/> 258 </routes> 259 260 </module> 261 262 <!-- A2dp Audio HAL --> 263 <xi:include href="a2dp_audio_policy_configuration.xml"/> 264 265 <!-- Usb Audio HAL --> 266 <xi:include href="usb_audio_policy_configuration.xml"/> 267 268 <!-- Remote Submix Audio HAL --> 269 <xi:include href="r_submix_audio_policy_configuration.xml"/> 270 271 </modules> 272 <!-- End of Modules section --> 273 274 <!-- Volume section --> 275 276 <xi:include href="audio_policy_volumes.xml"/> 277 <xi:include href="default_volume_tables.xml"/> 278 279 <!-- End of Volume section --> 280 <!-- End of Modules section --> 281 282 </audioPolicyConfiguration> 283