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