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.minore.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
30        this 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
39        and 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                <!-- names with _audio_zone_# are used for defined an emulator rear seat audio zone
63                     where each number # is the zone id number -->
64                <item>Built-In Mic</item>
65                <item>Built-In Back Mic</item>
66                <item>Echo-Reference Mic</item>
67                <item>FM Tuner</item>
68                <item>Tone Generator 0</item>
69                <item>Tone Generator 1</item>
70            </attachedDevices>
71            <defaultOutputDevice>bus0_media_out</defaultOutputDevice>
72            <mixPorts>
73                <mixPort name="mixport_bus0_media_out" role="source"
74                         flags="AUDIO_OUTPUT_FLAG_PRIMARY">
75                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
76                             samplingRates="48000"
77                             channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
78                </mixPort>
79                <mixPort name="mixport_bus1_navigation_out" role="source">
80                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
81                             samplingRates="48000"
82                             channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
83                </mixPort>
84                <mixPort name="mixport_bus2_voice_command_out" role="source">
85                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
86                             samplingRates="48000"
87                             channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
88                </mixPort>
89                <mixPort name="mixport_bus3_call_ring_out" role="source">
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                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
96                             samplingRates="48000"
97                             channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
98                </mixPort>
99                <mixPort name="mixport_bus5_alarm_out" role="source">
100                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
101                             samplingRates="48000"
102                             channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
103                </mixPort>
104                <mixPort name="mixport_bus6_notification_out" role="source">
105                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
106                             samplingRates="48000"
107                             channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
108                </mixPort>
109                <mixPort name="mixport_bus7_system_sound_out" role="source">
110                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
111                             samplingRates="48000"
112                             channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
113                </mixPort>
114                <mixPort name="primary input" role="sink">
115                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
116                             samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
117                             channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
118                </mixPort>
119                <mixPort name="mixport_tuner0" role="sink">
120                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
121                             samplingRates="48000"
122                             channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
123                </mixPort>
124                <mixPort name="mixport_input_bus_tone_zone_0" role="sink">
125                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
126                             samplingRates="48000"
127                             channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
128                </mixPort>
129                <mixPort name="mixport_input_bus_tone_zone_1" role="sink">
130                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
131                             samplingRates="48000"
132                             channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
133                </mixPort>
134            </mixPorts>
135            <devicePorts>
136                <devicePort tagName="bus0_media_out" role="sink" type="AUDIO_DEVICE_OUT_BUS"
137                            address="bus0_media_out">
138                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
139                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
140                    <gains>
141                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
142                              minValueMB="-3200" maxValueMB="600"
143                              defaultValueMB="0" stepValueMB="100"/>
144                    </gains>
145                </devicePort>
146                <devicePort tagName="bus1_navigation_out" role="sink" type="AUDIO_DEVICE_OUT_BUS"
147                        address="bus1_navigation_out">
148                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
149                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
150                    <gains>
151                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
152                              minValueMB="-3200" maxValueMB="600"
153                              defaultValueMB="0" stepValueMB="100"/>
154                    </gains>
155                </devicePort>
156                <devicePort tagName="bus2_voice_command_out" role="sink" type="AUDIO_DEVICE_OUT_BUS"
157                            address="bus2_voice_command_out">
158                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
159                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
160                    <gains>
161                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
162                              minValueMB="-3200" maxValueMB="600"
163                              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"
173                              defaultValueMB="0" stepValueMB="100"/>
174                    </gains>
175                </devicePort>
176                <devicePort tagName="bus4_call_out" role="sink" type="AUDIO_DEVICE_OUT_BUS"
177                            address="bus4_call_out">
178                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
179                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
180                    <gains>
181                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
182                              minValueMB="-3200" maxValueMB="600"
183                              defaultValueMB="0" stepValueMB="100"/>
184                    </gains>
185                </devicePort>
186                <devicePort tagName="bus5_alarm_out" role="sink" type="AUDIO_DEVICE_OUT_BUS"
187                            address="bus5_alarm_out">
188                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
189                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
190                    <gains>
191                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
192                              minValueMB="-3200" maxValueMB="600"
193                              defaultValueMB="0" stepValueMB="100"/>
194                    </gains>
195                </devicePort>
196                <devicePort tagName="bus6_notification_out" role="sink" type="AUDIO_DEVICE_OUT_BUS"
197                            address="bus6_notification_out">
198                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
199                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
200                    <gains>
201                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
202                              minValueMB="-3200" maxValueMB="600"
203                              defaultValueMB="0" stepValueMB="100"/>
204                    </gains>
205                </devicePort>
206                <devicePort tagName="bus7_system_sound_out" role="sink" type="AUDIO_DEVICE_OUT_BUS"
207                            address="bus7_system_sound_out">
208                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
209                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
210                    <gains>
211                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
212                              minValueMB="-3200" maxValueMB="600"
213                              defaultValueMB="0" stepValueMB="100"/>
214                    </gains>
215                </devicePort>
216                <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source"
217                    address="Built-In Mic" >
218                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
219                             samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
220                             channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
221                </devicePort>
222                <devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC"
223                            role="source" address="Built-In Back Mic">
224                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
225                             samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
226                             channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
227                </devicePort>
228                <devicePort tagName="Echo-Reference Mic" type="AUDIO_DEVICE_IN_ECHO_REFERENCE" role="source"
229                            address="Echo-Reference Mic">
230                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
231                             samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
232                             channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
233                </devicePort>
234                <devicePort tagName="FM Tuner" type="AUDIO_DEVICE_IN_FM_TUNER" role="source"
235                            address="tuner0">
236                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
237                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
238                    <gains>
239                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
240                              minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
241                    </gains>
242                </devicePort>
243                <devicePort tagName="Tone Generator 0" type="AUDIO_DEVICE_IN_BUS" role="source"
244                            address="input_bus_tone_zone_0">
245                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
246                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
247                    <gains>
248                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
249                              minValueMB="-3200" maxValueMB="600"
250                              defaultValueMB="0" stepValueMB="100"/>
251                    </gains>
252                </devicePort>
253                <devicePort tagName="Tone Generator 1" type="AUDIO_DEVICE_IN_BUS" role="source"
254                            address="input_bus_tone_zone_1">
255                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
256                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
257                    <gains>
258                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
259                              minValueMB="-3200" maxValueMB="600"
260                              defaultValueMB="0" stepValueMB="100"/>
261                    </gains>
262                </devicePort>
263            </devicePorts>
264            <!-- route declaration, i.e. list all available sources for a given sink -->
265            <routes>
266                <route type="mix" sink="bus0_media_out" sources="mixport_bus0_media_out"/>
267                <route type="mix" sink="bus1_navigation_out" sources="mixport_bus1_navigation_out"/>
268                <route type="mix" sink="bus2_voice_command_out"
269                       sources="mixport_bus2_voice_command_out"/>
270                <route type="mix" sink="bus3_call_ring_out" sources="mixport_bus3_call_ring_out"/>
271                <route type="mix" sink="bus4_call_out" sources="mixport_bus4_call_out"/>
272                <route type="mix" sink="bus5_alarm_out" sources="mixport_bus5_alarm_out"/>
273                <route type="mix" sink="bus6_notification_out"
274                       sources="mixport_bus6_notification_out"/>
275                <route type="mix" sink="bus7_system_sound_out"
276                       sources="mixport_bus7_system_sound_out"/>
277                <route type="mix" sink="primary input"
278                       sources="Built-In Mic,Built-In Back Mic,Echo-Reference Mic"/>
279                <route type="mix" sink="mixport_tuner0" sources="FM Tuner"/>
280                <route type="mix" sink="mixport_input_bus_tone_zone_0" sources="Tone Generator 0"/>
281                <route type="mix" sink="mixport_input_bus_tone_zone_1" sources="Tone Generator 1"/>
282            </routes>
283
284        </module>
285
286        <!-- A2dp Audio HAL -->
287        <xi:include href="a2dp_audio_policy_configuration.xml"/>
288
289        <!-- Usb Audio HAL -->
290        <xi:include href="usb_audio_policy_configuration.xml"/>
291
292        <!-- Remote Submix Audio HAL -->
293        <xi:include href="r_submix_audio_policy_configuration.xml"/>
294
295    </modules>
296    <!-- End of Modules section -->
297
298    <!-- Volume section -->
299
300    <xi:include href="audio_policy_volumes.xml"/>
301    <xi:include href="default_volume_tables.xml"/>
302
303    <!-- End of Volume section -->
304    <!-- End of Modules section -->
305
306</audioPolicyConfiguration>
307