1<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2<!-- Copyright (C) 2020 The Android Open Source Project
3     Licensed under the Apache License, Version 2.0 (the "License");
4     you may not use this file except in compliance with the License.
5     You may obtain a copy of the License at
6          http://www.apache.org/licenses/LICENSE-2.0
7     Unless required by applicable law or agreed to in writing, software
8     distributed under the License is distributed on an "AS IS" BASIS,
9     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10     See the License for the specific language governing permissions and
11     limitations under the License.
12-->
13<audioPolicyConfiguration version="7.0" xmlns:xi="http://www.w3.org/2001/XInclude">
14    <globalConfiguration speaker_drc_enabled="false" call_screen_mode_supported="true" />
15    <modules>
16        <!-- Primary Audio HAL -->
17        <module name="primary" halVersion="2.0">
18            <attachedDevices>
19                <item>Speaker</item>
20                <item>Speaker Safe</item>
21                <item>Earpiece</item>
22                <item>Built-In Mic</item>
23                <item>Built-In Back Mic</item>
24                <item>Telephony Tx</item>
25                <item>Voice Call And Telephony Rx</item>
26                <item>Echo Ref In</item>
27            </attachedDevices>
28            <defaultOutputDevice>Speaker</defaultOutputDevice>
29            <mixPorts>
30                <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY AUDIO_OUTPUT_FLAG_FAST"
31                         recommendedMuteDurationMs="40">
32                    <profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
33                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
34                </mixPort>
35                <mixPort name="deep buffer" role="source" flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER">
36                    <profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
37                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
38                </mixPort>
39                <mixPort name="compressed_offload" role="source"
40                         flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD AUDIO_OUTPUT_FLAG_NON_BLOCKING AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD">
41                    <profile name="" format="AUDIO_FORMAT_MP3"
42                             samplingRates="8000 16000 24000 32000 44100 48000"
43                             channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
44                    <profile name="" format="AUDIO_FORMAT_AAC_LC"
45                             samplingRates="8000 16000 24000 32000 44100 48000"
46                             channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
47                    <profile name="" format="AUDIO_FORMAT_AAC_HE_V1"
48                             samplingRates="8000 16000 24000 32000 44100 48000"
49                             channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
50                    <profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
51                             samplingRates="8000 16000 24000 32000 44100 48000"
52                             channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
53                </mixPort>
54                <mixPort name="haptic" role="source">
55                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
56                             samplingRates="48000"
57                             channelMasks="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A" />
58                </mixPort>
59                <mixPort name="raw" role="source" flags="AUDIO_OUTPUT_FLAG_RAW AUDIO_OUTPUT_FLAG_FAST">
60                    <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
61                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
62                </mixPort>
63                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
64                    <profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
65                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
66                </mixPort>
67                <mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
68                    <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
69                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
70                </mixPort>
71                <mixPort name="incall playback" role="source"
72                         flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
73                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
74                             samplingRates="48000"
75                             channelMasks="AUDIO_CHANNEL_OUT_STEREO" />
76                </mixPort>
77                <mixPort name="voice call tx" role="source">
78                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
79                             samplingRates="48000"
80                             channelMasks="AUDIO_CHANNEL_OUT_STEREO" />
81                </mixPort>
82                <mixPort name="voip_rx" role="source"
83                         flags="AUDIO_OUTPUT_FLAG_VOIP_RX">
84                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
85                           samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
86                </mixPort>
87                <mixPort name="primary input" role="sink">
88                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
89                             samplingRates="48000"
90                             channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_INDEX_MASK_3"/>
91                </mixPort>
92                <mixPort name="hotword input" role="sink" flags="AUDIO_INPUT_FLAG_HW_HOTWORD" maxActiveCount="0" >
93                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
94                             samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
95                             channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
96                </mixPort>
97                <mixPort name="incall capture" role="sink" maxActiveCount="2" maxOpenCount="2">
98                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
99                             samplingRates="48000"
100                             channelMasks="AUDIO_CHANNEL_IN_MONO"/>
101                </mixPort>
102                <mixPort name="voice call rx" role="sink">
103                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
104                             samplingRates="48000"
105                             channelMasks="AUDIO_CHANNEL_IN_MONO"/>
106                </mixPort>
107                <mixPort name="voip_tx" role="sink"
108                         flags="AUDIO_INPUT_FLAG_VOIP_TX">
109                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
110                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
111                </mixPort>
112                <mixPort name="fast input" role="sink" flags="AUDIO_INPUT_FLAG_RAW AUDIO_INPUT_FLAG_FAST">
113                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
114                             samplingRates="48000"
115                             channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
116                </mixPort>
117                <mixPort name="mmap_no_irq_in" role="sink" flags="AUDIO_INPUT_FLAG_MMAP_NOIRQ">
118                    <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
119                             samplingRates="48000"
120                             channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
121                </mixPort>
122                <mixPort name="hifi_playback" role="source" />
123                <mixPort name="hifi_input" role="sink" />
124                <mixPort name="echo_ref_input" role="sink">
125                    <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
126                             samplingRates="48000"
127                             channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
128                </mixPort>
129            </mixPorts>
130            <devicePorts>
131                <!-- Output devices declaration, i.e. Sink DEVICE PORT -->
132                <devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
133                </devicePort>
134                <devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink">
135                </devicePort>
136                <devicePort tagName="Speaker Safe" type="AUDIO_DEVICE_OUT_SPEAKER_SAFE" role="sink">
137                </devicePort>
138                <devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink">
139                </devicePort>
140                <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink">
141                </devicePort>
142                <devicePort tagName="BT SCO Car Kit" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT" role="sink">
143                </devicePort>
144                <devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink">
145                </devicePort>
146                <devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink">
147                </devicePort>
148                <devicePort tagName="Telephony Tx" type="AUDIO_DEVICE_OUT_TELEPHONY_TX" role="sink">
149                </devicePort>
150                <!-- Input devices declaration, i.e. Source DEVICE PORT -->
151                <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
152                </devicePort>
153                <devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source">
154                </devicePort>
155                <devicePort tagName="BT SCO Headset Mic" type="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET" role="source">
156                </devicePort>
157                <devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink"
158                            encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
159                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
160                             samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
161                </devicePort>
162                <devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink"
163                            encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
164                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
165                             samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
166                </devicePort>
167                <devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink"
168                            encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
169                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
170                             samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
171                </devicePort>
172                <devicePort tagName="BT BLE Headset" type="AUDIO_DEVICE_OUT_BLE_HEADSET" role="sink"
173                            encodedFormats="AUDIO_FORMAT_LC3">
174                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
175                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
176                </devicePort>
177                <devicePort tagName="BT BLE Speaker" type="AUDIO_DEVICE_OUT_BLE_SPEAKER" role="sink"
178                            encodedFormats="AUDIO_FORMAT_LC3">
179                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
180                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
181                </devicePort>
182                <devicePort tagName="USB Device In" type="AUDIO_DEVICE_IN_USB_DEVICE" role="source">
183                </devicePort>
184                <devicePort tagName="USB Headset In" type="AUDIO_DEVICE_IN_USB_HEADSET" role="source">
185                </devicePort>
186                <!-- AUDIO_DEVICE_IN_VOICE_CALL and AUDIO_DEVICE_IN_TELEPHONY_RX are in the same value -->
187                <devicePort tagName="Voice Call And Telephony Rx" type="AUDIO_DEVICE_IN_VOICE_CALL" role="source">
188                </devicePort>
189                <devicePort tagName="Echo Ref In" type="AUDIO_DEVICE_IN_ECHO_REFERENCE" role="source">
190                </devicePort>
191            </devicePorts>
192            <!-- route declaration, i.e. list all available sources for a given sink -->
193            <routes>
194                <route type="mix" sink="Speaker"
195                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out,voip_rx"/>
196                <route type="mix" sink="Speaker Safe"
197                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out,voip_rx"/>
198                <route type="mix" sink="Earpiece"
199                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out,voip_rx"/>
200                <route type="mix" sink="BT A2DP Out"
201                       sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,immersive_out,raw,mmap_no_irq_out"/>
202                <route type="mix" sink="BT A2DP Headphones"
203                       sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,immersive_out,raw,mmap_no_irq_out"/>
204                <route type="mix" sink="BT A2DP Speaker"
205                       sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,immersive_out,raw,mmap_no_irq_out"/>
206                <route type="mix" sink="BT BLE Headset"
207                       sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,immersive_out,raw,mmap_no_irq_out"/>
208                <route type="mix" sink="BT BLE Speaker"
209                       sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,immersive_out,raw,mmap_no_irq_out"/>
210                <route type="mix" sink="USB Device Out"
211                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out,voip_rx,hifi_playback,immersive_out"/>
212                <route type="mix" sink="USB Headset Out"
213                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out,voip_rx,hifi_playback,immersive_out"/>
214                <route type="mix" sink="BT SCO"
215                       sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out"/>
216                <route type="mix" sink="BT SCO Headset"
217                       sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out"/>
218                <route type="mix" sink="BT SCO Car Kit"
219                       sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out"/>
220                <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
221                <route type="mix" sink="primary input"
222                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
223                <route type="mix" sink="hotword input"
224                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
225                <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
226                <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
227                <route type="mix" sink="voip_tx"
228                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
229                <route type="mix" sink="fast input"
230                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
231                <route type="mix" sink="mmap_no_irq_in"
232                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
233                <route type="mix" sink="hifi_input" sources="USB Device In,USB Headset In" />
234                <route type="mix" sink="echo_ref_input" sources="Echo Ref In"/>
235            </routes>
236        </module>
237        <!-- Bluetooth Audio HAL -->
238        <xi:include href="bluetooth_audio_policy_configuration_7_0.xml"/>
239        <!-- Usb Audio HAL -->
240        <module name="usbv2" halVersion="2.0">
241            <mixPorts>
242                <mixPort name="usb_accessory output" role="source">
243                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
244                             samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
245                </mixPort>
246            </mixPorts>
247            <devicePorts>
248                <devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink">
249                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
250                             samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
251                </devicePort>
252            </devicePorts>
253            <routes>
254                <route type="mix" sink="USB Host Out"
255                       sources="usb_accessory output"/>
256            </routes>
257        </module>
258        <!-- Remote Submix Audio HAL -->
259        <xi:include href="r_submix_audio_policy_configuration.xml"/>
260    </modules>
261    <!-- End of Modules section -->
262    <!-- Volume section -->
263    <xi:include href="audio_policy_volumes.xml"/>
264    <xi:include href="default_volume_tables.xml"/>
265    <!-- End of Volume section -->
266</audioPolicyConfiguration>
267