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                    <profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
32                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
33                </mixPort>
34                <mixPort name="deep buffer" role="source" flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER">
35                    <profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
36                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
37                </mixPort>
38                <mixPort name="compressed_offload" role="source"
39                         flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD AUDIO_OUTPUT_FLAG_NON_BLOCKING">
40                    <profile name="" format="AUDIO_FORMAT_MP3"
41                             samplingRates="8000 16000 24000 32000 44100 48000"
42                             channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
43                    <profile name="" format="AUDIO_FORMAT_AAC_LC"
44                             samplingRates="8000 16000 24000 32000 44100 48000"
45                             channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
46                    <profile name="" format="AUDIO_FORMAT_AAC_HE_V1"
47                             samplingRates="8000 16000 24000 32000 44100 48000"
48                             channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
49                    <profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
50                             samplingRates="8000 16000 24000 32000 44100 48000"
51                             channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
52                </mixPort>
53                <!--mixPort name="haptic" role="source">
54                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
55                             samplingRates="48000"
56                             channelMasks="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A" />
57                </mixPort-->
58                <mixPort name="raw" role="source" flags="AUDIO_OUTPUT_FLAG_RAW AUDIO_OUTPUT_FLAG_FAST">
59                    <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
60                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
61                </mixPort>
62                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
63                    <profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
64                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
65                </mixPort>
66                <!--mixPort name="incall playback" role="source"
67                         flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
68                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
69                             samplingRates="48000"
70                             channelMasks="AUDIO_CHANNEL_OUT_STEREO" />
71                </mixPort-->
72                <!--mixPort name="voice call tx" role="source">
73                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
74                             samplingRates="48000"
75                             channelMasks="AUDIO_CHANNEL_OUT_STEREO" />
76                </mixPort-->
77                <mixPort name="voip_rx" role="source"
78                         flags="AUDIO_OUTPUT_FLAG_VOIP_RX">
79                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
80                           samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
81                </mixPort>
82                <mixPort name="primary input" role="sink">
83                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
84                             samplingRates="48000"
85                             channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_INDEX_MASK_3"/>
86                </mixPort>
87                <mixPort name="hotword input" role="sink" flags="AUDIO_INPUT_FLAG_HW_HOTWORD" maxActiveCount="0" >
88                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
89                             samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
90                             channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
91                </mixPort>
92                <!--mixPort name="incall capture" role="sink">
93                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
94                             samplingRates="48000"
95                             channelMasks="AUDIO_CHANNEL_IN_MONO"/>
96                </mixPort-->
97                <!--mixPort name="voice call rx" role="sink">
98                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
99                             samplingRates="48000"
100                             channelMasks="AUDIO_CHANNEL_IN_MONO"/>
101                </mixPort-->
102                <mixPort name="voip_tx" role="sink"
103                         flags="AUDIO_INPUT_FLAG_VOIP_TX">
104                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
105                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
106                </mixPort>
107                <mixPort name="fast input" role="sink" flags="AUDIO_INPUT_FLAG_RAW AUDIO_INPUT_FLAG_FAST">
108                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
109                             samplingRates="48000"
110                             channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
111                </mixPort>
112                <mixPort name="mmap_no_irq_in" role="sink" flags="AUDIO_INPUT_FLAG_MMAP_NOIRQ">
113                    <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
114                             samplingRates="48000"
115                             channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
116                </mixPort>
117                <!--mixPort name="hifi_playback" role="source" /-->
118                <!--mixPort name="hifi_input" role="sink" /-->
119                <!--mixPort name="echo_ref_input" role="sink">
120                    <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
121                             samplingRates="48000"
122                             channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
123                </mixPort-->
124            </mixPorts>
125            <devicePorts>
126                <!-- Output devices declaration, i.e. Sink DEVICE PORT -->
127                <devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
128                </devicePort>
129                <devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink">
130                </devicePort>
131                <devicePort tagName="Speaker Safe" type="AUDIO_DEVICE_OUT_SPEAKER_SAFE" role="sink">
132                </devicePort>
133                <devicePort tagName="Wired Headset" type="AUDIO_DEVICE_OUT_WIRED_HEADSET" role="sink">
134                </devicePort>
135                <devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink">
136                </devicePort>
137                <devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink">
138                </devicePort>
139                <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink">
140                </devicePort>
141                <devicePort tagName="BT SCO Car Kit" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT" role="sink">
142                </devicePort>
143                <devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink">
144                </devicePort>
145                <devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink">
146                </devicePort>
147                <devicePort tagName="Aux Digital" type="AUDIO_DEVICE_OUT_AUX_DIGITAL" role="sink">
148                </devicePort>
149                <devicePort tagName="Telephony Tx" type="AUDIO_DEVICE_OUT_TELEPHONY_TX" role="sink">
150                </devicePort>
151                <!-- Input devices declaration, i.e. Source DEVICE PORT -->
152                <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
153                </devicePort>
154                <devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source">
155                </devicePort>
156                <devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
157                </devicePort>
158                <devicePort tagName="BT SCO Headset Mic" type="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET" role="source">
159                </devicePort>
160                <devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink"
161                            encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
162                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
163                             samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
164                </devicePort>
165                <devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink"
166                            encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
167                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
168                             samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
169                </devicePort>
170                <devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink"
171                            encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC">
172                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
173                             samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
174                </devicePort>
175                <devicePort tagName="USB Device In" type="AUDIO_DEVICE_IN_USB_DEVICE" role="source">
176                </devicePort>
177                <devicePort tagName="USB Headset In" type="AUDIO_DEVICE_IN_USB_HEADSET" role="source">
178                </devicePort>
179                <!-- AUDIO_DEVICE_IN_VOICE_CALL and AUDIO_DEVICE_IN_TELEPHONY_RX are in the same value -->
180                <devicePort tagName="Voice Call And Telephony Rx" type="AUDIO_DEVICE_IN_VOICE_CALL" role="source">
181                </devicePort>
182                <devicePort tagName="Echo Ref In" type="AUDIO_DEVICE_IN_ECHO_REFERENCE" role="source">
183                </devicePort>
184            </devicePorts>
185            <!-- route declaration, i.e. list all available sources for a given sink -->
186            <routes>
187                <route type="mix" sink="Speaker"
188                       sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
189                <route type="mix" sink="Speaker Safe"
190                       sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
191                <route type="mix" sink="Earpiece"
192                       sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
193                <route type="mix" sink="BT A2DP Out"
194                       sources="primary output,deep buffer,voip_rx,compressed_offload"/>
195                <route type="mix" sink="BT A2DP Headphones"
196                       sources="primary output,deep buffer,voip_rx,compressed_offload"/>
197                <route type="mix" sink="BT A2DP Speaker"
198                       sources="primary output,deep buffer,voip_rx,compressed_offload"/>
199                <route type="mix" sink="USB Device Out"
200                       sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
201                <route type="mix" sink="USB Headset Out"
202                       sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
203                <route type="mix" sink="BT SCO"
204                       sources="primary output,deep buffer,voip_rx,compressed_offload"/>
205                <route type="mix" sink="BT SCO Headset"
206                       sources="primary output,deep buffer,voip_rx,compressed_offload"/>
207                <route type="mix" sink="BT SCO Car Kit"
208                       sources="primary output,deep buffer,voip_rx,compressed_offload"/>
209                <!--route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" /-->
210                <route type="mix" sink="primary input"
211                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
212                <route type="mix" sink="hotword input"
213                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
214                <!--route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" /-->
215                <!--route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" /-->
216                <route type="mix" sink="voip_tx"
217                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
218                <route type="mix" sink="fast input"
219                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In"/>
220                <route type="mix" sink="mmap_no_irq_in"
221                       sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In"/>
222                <!--route type="mix" sink="hifi_input" sources="USB Device In,USB Headset In" /-->
223                <!--route type="mix" sink="echo_ref_input" sources="Echo Ref In"/-->
224            </routes>
225        </module>
226        <!-- Bluetooth Audio HAL -->
227        <xi:include href="bluetooth_audio_policy_configuration_7_0.xml"/>
228        <!-- Usb Audio HAL -->
229        <module name="usbv2" halVersion="2.0">
230            <mixPorts>
231                <mixPort name="usb_accessory output" role="source">
232                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
233                             samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
234                </mixPort>
235            </mixPorts>
236            <devicePorts>
237                <devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink">
238                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
239                             samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
240                </devicePort>
241            </devicePorts>
242            <routes>
243                <route type="mix" sink="USB Host Out"
244                       sources="usb_accessory output"/>
245            </routes>
246        </module>
247        <!-- Remote Submix Audio HAL -->
248        <xi:include href="r_submix_audio_policy_configuration.xml"/>
249    </modules>
250    <!-- End of Modules section -->
251    <!-- Volume section -->
252    <xi:include href="audio_policy_volumes.xml"/>
253    <xi:include href="default_volume_tables.xml"/>
254    <!-- End of Volume section -->
255</audioPolicyConfiguration>
256