当前位置: 首页 > news >正文

基于Android11简单分析audio_policy_configuration.xml

 开篇先贴上一个高通的例子,后续基于此文件做具体分析。

1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <!-- Copyright (c) 2016-2019, The Linux Foundation. All rights reserved
3      Not a Contribution.
4 -->
5 <!-- Copyright (C) 2015 The Android Open Source Project
6 
7      Licensed under the Apache License, Version 2.0 (the "License");
8      you may not use this file except in compliance with the License.
9      You may obtain a copy of the License at
10 
11           http://www.apache.org/licenses/LICENSE-2.0
12 
13      Unless required by applicable law or agreed to in writing, software
14      distributed under the License is distributed on an "AS IS" BASIS,
15      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16      See the License for the specific language governing permissions and
17      limitations under the License.
18 -->
19 
20 <audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
21     <!-- version section contains a “version” tag in the form “major.minor” e.g version=”1.0” -->
22 
23     <!-- Global configuration Decalaration -->
24     <globalConfiguration speaker_drc_enabled="true"/>
25 
26     <!-- Modules section:
27         There is one section per audio HW module present on the platform.
28         Each module section will contains two mandatory tags for audio HAL “halVersion” and “name”.
29         The module names are the same as in current .conf file:
30                 “primary”, “A2DP”, “remote_submix”, “USB”
31         Each module will contain the following sections:
32         “devicePorts”: a list of device descriptors for all input and output devices accessible via this
33         module.
34         This contains both permanently attached devices and removable devices.
35             "gain": constraints applied to the millibel values:
36                 - maxValueMB >= minValueMB
37                 - defaultValueMB >= minValueMB && defaultValueMB <= maxValueMB
38                 - (maxValueMB - minValueMB) % stepValueMB == 0
39                 - (defaultValueMB - minValueMB) % stepValueMB == 0
40         “mixPorts”: listing all output and input streams exposed by the audio HAL
41         “routes”: list of possible connections between input and output devices or between stream and
42         devices.
43             "route": is defined by an attribute:
44                 -"type": <mux|mix> means all sources are mutual exclusive (mux) or can be mixed (mix)
45                 -"sink": the sink involved in this route
46                 -"sources": all the sources than can be connected to the sink via vis route
47         “attachedDevices”: permanently attached devices.
48         The attachedDevices section is a list of devices names. The names correspond to device names
49         defined in <devicePorts> section.
50         “defaultOutputDevice”: device to be used by default when no policy rule applies
51     -->
52     <modules>
53         <!-- Primary Audio HAL -->
54         <module name="primary" halVersion="3.0">
55             <attachedDevices>
56                 <item>Media Bus</item>
57                 <item>Sys Notification Bus</item>
58                 <item>Nav Guidance Bus</item>
59                 <item>Phone Bus</item>
60                 <item>Tts Bus</item>
61                 <item>Vr Tts Bus</item>
62                 <item>Boot Music Bus</item>
63                 <item>Chime Tts Bus</item>
64                 <item>BT Codriver Bus</item>
65                 <item>Projection Vr Tts Bus</item>
66                 <item>Ringtone Bus</item>
67                 <item>Built-In Mic</item>
68                 <item>Built-In Back Mic</item>
69                 <item>FM Tuner</item>
70                 <item>Speaker</item>
71                 <item>Projection Vr Bus In</item>
72                 <item>Projection Phone Bus In</item>
73                 <item>Local Vr Bus In</item>
74                 <item>Projection Esiri Bus In</item>
75             </attachedDevices>
76             <defaultOutputDevice>Media Bus</defaultOutputDevice>
77             <mixPorts>
78                 <mixPort name="media" role="source"
79                          flags="AUDIO_OUTPUT_FLAG_PRIMARY">
80                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
81                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
82                 </mixPort>
83                 <mixPort name="sys_notification" role="source">
84                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
85                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
86                 </mixPort>
87                 <mixPort name="nav_guidance" role="source">
88                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
89                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
90                 </mixPort>
91                 <mixPort name="phone" role="source">
92                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
93                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
94                 </mixPort>
95                 <mixPort name="tts" role="source">
96                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
97                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
98                 </mixPort>
99                 <mixPort name="vr_tts" role="source">
100                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
101                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
102                 </mixPort>
103                 <mixPort name="boot_music" role="source">
104                     <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
105                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
106                 </mixPort>
107                 <mixPort name="chime_tts" role="source">
108                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
109                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
110                 </mixPort>
111                 <mixPort name="bt_codriver" role="source"
112                          flags="AUDIO_OUTPUT_FLAG_RIGHT_ZONE">
113                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
114                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
115                 </mixPort>
116                 <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_PRIMARY">
117                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
118                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
119                 </mixPort>
120                 <mixPort name="raw" role="source"
121                         flags="AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_RAW">
122                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
123                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
124                 </mixPort>
125                 <mixPort name="deep_buffer" role="source"
126                         flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER">
127                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
128                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
129                 </mixPort>
130                 <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
131                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
132                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
133                 </mixPort>
134                 <mixPort name="hifi_playback" role="source" />
135                 <mixPort name="compress_passthrough" role="source"
136                         flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
137                     <profile name="" format="dynamic"
138                              samplingRates="dynamic" channelMasks="dynamic"/>
139                 </mixPort>
140                 <mixPort name="direct_pcm" role="source"
141                         flags="AUDIO_OUTPUT_FLAG_DIRECT">
142                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
143                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
144                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
145                     <profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
146                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
147                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
148                     <profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
149                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
150                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
151                   <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
152                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
153                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
154                 </mixPort>
155 
156                 <mixPort name="bt_codriver_direct_pcm" role="source"
157                          flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_RIGHT_ZONE">
158                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
159                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
160                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
161                     <profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
162                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
163                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
164                     <profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
165                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
166                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
167                   <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
168                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
169                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
170                 </mixPort>
171                 <mixPort name="compressed_offload" role="source"
172                          flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
173                     <profile name="" format="AUDIO_FORMAT_MP3"
174                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
175                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
176                     <profile name="" format="AUDIO_FORMAT_FLAC"
177                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
178                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
179                     <profile name="" format="AUDIO_FORMAT_ALAC"
180                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
181                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
182                     <profile name="" format="AUDIO_FORMAT_APE"
183                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
184                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
185                     <profile name="" format="AUDIO_FORMAT_AAC_LC"
186                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
187                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
188                     <profile name="" format="AUDIO_FORMAT_AAC_HE_V1"
189                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
190                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
191                     <profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
192                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
193                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
194                     <profile name="" format="AUDIO_FORMAT_DTS"
195                              samplingRates="32000,44100,48000"
196                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1"/>
197                     <profile name="" format="AUDIO_FORMAT_DTS_HD"
198                              samplingRates="32000,44100,48000,64000,88200,96000,128000,176400,192000"
199                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
200                     <profile name="" format="AUDIO_FORMAT_WMA"
201                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
202                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
203                     <profile name="" format="AUDIO_FORMAT_WMA_PRO"
204                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
205                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
206                     <profile name="" format="AUDIO_FORMAT_VORBIS"
207                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
208                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
209                     <profile name="" format="AUDIO_FORMAT_AAC_ADTS_LC"
210                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
211                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
212                     <profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V1"
213                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
214                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
215                     <profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V2"
216                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
217                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
218                 </mixPort>
219 
220                 <mixPort name="bt_codriver_offload" role="source"
221                          flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_RIGHT_ZONE">
222                     <profile name="" format="AUDIO_FORMAT_MP3"
223                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
224                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
225                     <profile name="" format="AUDIO_FORMAT_FLAC"
226                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
227                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
228                     <profile name="" format="AUDIO_FORMAT_ALAC"
229                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
230                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
231                     <profile name="" format="AUDIO_FORMAT_APE"
232                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
233                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
234                     <profile name="" format="AUDIO_FORMAT_AAC_LC"
235                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
236                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
237                     <profile name="" format="AUDIO_FORMAT_AAC_HE_V1"
238                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
239                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
240                     <profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
241                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
242                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
243                     <profile name="" format="AUDIO_FORMAT_DTS"
244                              samplingRates="32000,44100,48000"
245                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1"/>
246                     <profile name="" format="AUDIO_FORMAT_DTS_HD"
247                              samplingRates="32000,44100,48000,64000,88200,96000,128000,176400,192000"
248                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
249                     <profile name="" format="AUDIO_FORMAT_WMA"
250                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
251                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
252                     <profile name="" format="AUDIO_FORMAT_WMA_PRO"
253                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
254                              channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
255                     <profile name="" format="AUDIO_FORMAT_VORBIS"
256                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
257                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
258                     <profile name="" format="AUDIO_FORMAT_AAC_ADTS_LC"
259                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
260                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
261                     <profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V1"
262                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
263                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
264                     <profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V2"
265                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
266                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
267                 </mixPort>
268                 <mixPort name="dsd_compress_passthrough" role="source"
269                          flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
270                     <profile name="" format="AUDIO_FORMAT_DSD"
271                              samplingRates="2822400,5644800"
272                              channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
273                 </mixPort>
274                 <mixPort name="voice_tx" role="source">
275                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
276                              samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
277                 </mixPort>
278                 <mixPort name="voip_rx" role="source"
279                          flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
280                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
281                              samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
282                 </mixPort>
283                 <mixPort name="projection_vr_downlink" role="source">
284                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
285                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
286                 </mixPort>
287                 <mixPort name="projection_phone_downlink" role="source"
288                          flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_DIRECT_PROJECTION">
289                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
290                              samplingRates="8000,16000,24000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
291                 </mixPort>
292                 <mixPort name="ringtone" role="source">
293                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
294                              samplingRates="16000,44100,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
295                 </mixPort>
296 
297                 <mixPort name="primary input" role="sink" maxOpenCount="2" maxActiveCount="2">
298                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
299                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
300                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_6,AUDIO_CHANNEL_INDEX_MASK_7"/>
301                 </mixPort>
302                 <mixPort name="surround_sound" role="sink">
303                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
304                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
305                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4,AUDIO_CHANNEL_IN_5POINT1,AUDIO_CHANNEL_INDEX_MASK_6"/>
306                 </mixPort>
307                 <mixPort name="record_24" role="sink">
308                     <profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
309                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,192000"
310                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4"/>
311                     <profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
312                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,192000"
313                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4"/>
314                 </mixPort>
315                 <mixPort name="voice_rx" role="sink">
316                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
317                              samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
318                 </mixPort>
319                 <mixPort name="mmap_no_irq_in" role="sink" flags="AUDIO_INPUT_FLAG_MMAP_NOIRQ">
320                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
321                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
322                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
323                 </mixPort>
324                 <mixPort name="projection_vr_uplink" role="sink" flags="AUDIO_INPUT_FLAG_PROJECTION_VR">
325                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
326                              samplingRates="8000,16000,24000"
327                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
328                 </mixPort>
329                 <mixPort name="projection_phone_uplink" role="sink" flags="AUDIO_INPUT_FLAG_PROJECTION_PHONE">
330                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
331                              samplingRates="8000,16000,24000,32000,48000"
332                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
333                 </mixPort>
334                 <mixPort name="local_vr_uplink" role="sink" flags="AUDIO_INPUT_FLAG_LOCAL_VR">
335                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
336                              samplingRates="16000"
337                              channelMasks="AUDIO_CHANNEL_INDEX_MASK_4,AUDIO_CHANNEL_INDEX_MASK_7"/>
338                 </mixPort>
339                 <mixPort name="projection_esiri_uplink" role="sink">
340                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
341                              samplingRates="16000"
342                              channelMasks="AUDIO_CHANNEL_INDEX_MASK_7,AUDIO_CHANNEL_INDEX_MASK_8"/>
343                 </mixPort>
344             </mixPorts>
345 
346             <devicePorts>
347                 <!-- Output devices declaration, i.e. Sink DEVICE PORT -->
348                 <devicePort tagName="Media Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
349                         address="BUS00_MEDIA">
350                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
351                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
352                     <gains>
353                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
354                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
355                     </gains>
356                 </devicePort>
357                 <devicePort tagName="Sys Notification Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
358                         address="BUS01_SYS_NOTIFICATION">
359                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
360                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
361                     <gains>
362                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
363                                 minValueMB="-7800" maxValueMB="-4800" defaultValueMB="-4800" stepValueMB="3000"/>
364                     </gains>
365                 </devicePort>
366                 <devicePort tagName="Nav Guidance Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
367                         address="BUS02_NAV_GUIDANCE">
368                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
369                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
370                     <gains>
371                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
372                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
373                     </gains>
374                 </devicePort>
375                 <devicePort tagName="Phone Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
376                         address="BUS03_PHONE">
377                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
378                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
379                     <gains>
380                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
381                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
382                     </gains>
383                 </devicePort>
384                 <devicePort tagName="Tts Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
385                         address="BUS04_TTS">
386                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
387                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
388                     <gains>
389                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
390                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
391                     </gains>
392                 </devicePort>
393                 <devicePort tagName="Vr Tts Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
394                         address="BUS05_VR_TTS">
395                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
396                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
397                     <gains>
398                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
399                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
400                     </gains>
401                 </devicePort>
402                 <devicePort tagName="Boot Music Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
403                         address="BUS07_BOOT_MUSIC">
404                     <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
405                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
406                     <gains>
407                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
408                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
409                     </gains>
410                 </devicePort>
411                 <devicePort tagName="Chime Tts Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
412                         address="BUS08_CHIME_TTS">
413                     <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
414                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
415                     <gains>
416                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
417                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
418                     </gains>
419                 </devicePort>
420                 <devicePort tagName="BT Codriver Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
421                         address="BUS09_BT_CODRIVER">
422                     <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
423                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
424                     <gains>
425                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
426                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
427                     </gains>
428                 </devicePort>
429                 <devicePort tagName="Projection Vr Tts Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
430                         address="BUS11_PROJECTION_VR_TTS">
431                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
432                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
433                     <gains>
434                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
435                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
436                     </gains>
437                 </devicePort>
438                 <devicePort tagName="Ringtone Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
439                         address="BUS12_RINGTONE">
440                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
441                              samplingRates="16000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
442                     <gains>
443                         <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
444                                 minValueMB="-7800" maxValueMB="0" defaultValueMB="-5800" stepValueMB="200"/>
445                     </gains>
446                 </devicePort>
447                 <devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
448                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
449                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
450                 </devicePort>
451                 <devicePort tagName="Speaker" role="sink" type="AUDIO_DEVICE_OUT_SPEAKER" address="">
452                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
453                              samplingRates="8000,16000,24000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
454                 </devicePort>
455                 <devicePort tagName="Wired Headset" type="AUDIO_DEVICE_OUT_WIRED_HEADSET" role="sink">
456                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
457                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
458                 </devicePort>
459                 <devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink">
460                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
461                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
462                 </devicePort>
463                 <devicePort tagName="Line" type="AUDIO_DEVICE_OUT_LINE" role="sink">
464                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
465                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
466                 </devicePort>
467                 <devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink">
468                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
469                              samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
470                 </devicePort>
471                 <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink">
472                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
473                              samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
474                 </devicePort>
475                 <devicePort tagName="BT SCO Car Kit" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT" role="sink">
476                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
477                              samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
478                 </devicePort>
479                 <devicePort tagName="BT SCO All" type="AUDIO_DEVICE_OUT_ALL_SCO" role="sink">
480                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
481                              samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
482                 </devicePort>
483                 <devicePort tagName="Telephony Tx" type="AUDIO_DEVICE_OUT_TELEPHONY_TX" role="sink">
484                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
485                              samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
486                 </devicePort>
487                 <devicePort tagName="HDMI" type="AUDIO_DEVICE_OUT_AUX_DIGITAL" role="sink">
488                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
489                              samplingRates="8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,128000,176400,192000" channelMasks="dynamic"/>
490                 </devicePort>
491                 <devicePort tagName="Proxy" type="AUDIO_DEVICE_OUT_PROXY" role="sink">
492                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
493                              samplingRates="8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,128000,176400,192000" channelMasks="dynamic"/>
494                 </devicePort>
495                 <devicePort tagName="FM" type="AUDIO_DEVICE_OUT_FM" role="sink">
496                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
497                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
498                 </devicePort>
499                 <devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink">
500                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
501                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
502                 </devicePort>
503                 <devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink">
504                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
505                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
506                 </devicePort>
507                 <devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink">
508                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
509                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
510                 </devicePort>
511 
512                 <!-- Input devices declaration, i.e. Source DEVICE PORT -->
513                 <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
514                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
515                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
516                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_6,AUDIO_CHANNEL_INDEX_MASK_7"/>
517                 </devicePort>
518                 <devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source">
519                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
520                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
521                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_6,AUDIO_CHANNEL_INDEX_MASK_7"/>
522                 </devicePort>
523                 <devicePort tagName="FM Tuner" type="AUDIO_DEVICE_IN_FM_TUNER" role="source" address="tuner0">
524                     <gains>
525                         <gain name="gain_2" mode="AUDIO_GAIN_MODE_JOINT"
526                               minValueMB="0"
527                               maxValueMB="480"
528                               defaultValueMB="240"
529                               stepValueMB="16"/>
530                     </gains>
531                 </devicePort>
532                 <devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
533                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
534                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
535                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
536                 </devicePort>
537                 <devicePort tagName="BT SCO Headset Mic" type="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET" role="source">
538                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
539                              samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
540                 </devicePort>
541                 <devicePort tagName="Telephony Rx" type="AUDIO_DEVICE_IN_TELEPHONY_RX" role="source">
542                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
543                              samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
544                 </devicePort>
545                 <devicePort tagName="Projection Vr Bus In" type="AUDIO_DEVICE_IN_BUS" role="source"
546                         address="BUS01_PROJECTION_VR_BUS_IN">
547                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
548                              samplingRates="16000,24000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
549                 </devicePort>
550                 <devicePort tagName="Projection Phone Bus In" type="AUDIO_DEVICE_IN_BUS" role="source"
551                         address="BUS02_PROJECTION_PHONE_BUS_IN">
552                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
553                              samplingRates="8000,16000,24000,32000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
554                 </devicePort>
555                 <devicePort tagName="Local Vr Bus In" type="AUDIO_DEVICE_IN_BUS" role="source"
556                         address="BUS03_LOCAL_VR_BUS_IN">
557                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
558                              samplingRates="16000" channelMasks="AUDIO_CHANNEL_INDEX_MASK_4,AUDIO_CHANNEL_INDEX_MASK_7"/>
559                 </devicePort>
560                 <devicePort tagName="Projection Esiri Bus In" type="AUDIO_DEVICE_IN_BUS" role="source"
561                         address="BUS05_PROJECTION_ESIRI_BUS_IN">
562                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
563                              samplingRates="16000" channelMasks="AUDIO_CHANNEL_INDEX_MASK_7,AUDIO_CHANNEL_INDEX_MASK_8"/>
564                 </devicePort>
565             </devicePorts>
566             <!-- route declaration, i.e. list all available sources for a given sink -->
567             <routes>
568                 <route type="mix" sink="Media Bus"
569                        sources="media,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
570                 <route type="mix" sink="Sys Notification Bus"
571                        sources="sys_notification"/>
572                 <route type="mix" sink="Nav Guidance Bus"
573                        sources="nav_guidance"/>
574                 <route type="mix" sink="Phone Bus"
575                        sources="phone"/>
576                 <route type="mix" sink="Tts Bus"
577                        sources="tts"/>
578                 <route type="mix" sink="Vr Tts Bus"
579                        sources="vr_tts"/>
580                 <route type="mix" sink="Boot Music Bus"
581                        sources="boot_music"/>
582                 <route type="mix" sink="Chime Tts Bus"
583                        sources="chime_tts"/>
584                 <route type="mix" sink="BT Codriver Bus"
585                        sources="bt_codriver,bt_codriver_offload,bt_codriver_direct_pcm"/>
586                 <route type="mix" sink="Projection Vr Tts Bus"
587                        sources="projection_vr_downlink"/>
588                 <route type="mix" sink="Ringtone Bus"
589                        sources="ringtone"/>
590                 <route type="mix" sink="Earpiece"
591                        sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
592                 <route type="mix" sink="Speaker"
593                        sources="primary output,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,projection_phone_downlink"/>
594                 <route type="mix" sink="Wired Headset"
595                        sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
596                 <route type="mix" sink="Wired Headphones"
597                        sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
598                 <route type="mix" sink="Line"
599                        sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
600                 <route type="mix" sink="HDMI"
601                        sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,compress_passthrough,voip_rx"/>
602                 <route type="mix" sink="Proxy"
603                        sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload"/>
604                 <route type="mix" sink="FM"
605                        sources="primary output"/>
606                 <route type="mix" sink="BT SCO All"
607                        sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
608                 <route type="mix" sink="Telephony Tx"
609                        sources="voice_tx"/>
610                 <route type="mix" sink="voice_rx"
611                        sources="Telephony Rx"/>
612                 <route type="mix" sink="primary input"
613                        sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
614                 <route type="mix" sink="surround_sound"
615                        sources="Built-In Mic,Built-In Back Mic"/>
616                 <route type="mix" sink="record_24"
617                        sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic"/>
618                 <route type="mix" sink="mmap_no_irq_in"
619                        sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic"/>
620                 <route type="mix" sink="BT A2DP Out"
621                        sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
622                 <route type="mix" sink="BT A2DP Headphones"
623                        sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
624                 <route type="mix" sink="BT A2DP Speaker"
625                        sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
626                 <route type="mix" sink="projection_vr_uplink"
627                        sources="Projection Vr Bus In"/>
628                 <route type="mix" sink="projection_phone_uplink"
629                        sources="Projection Phone Bus In"/>
630                 <route type="mix" sink="local_vr_uplink"
631                        sources="Local Vr Bus In"/>
632                 <route type="mix" sink="projection_esiri_uplink"
633                        sources="Projection Esiri Bus In"/>
634             </routes>
635 
636         </module>
637
638         <!-- A2DP Audio HAL -->
639         <module name="a2dp" halVersion="2.0">
640             <mixPorts>
641                 <mixPort name="a2dp input" role="sink">
642                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
643                              samplingRates="44100,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
644                 </mixPort>
645             </mixPorts>
646 
647             <devicePorts>
648                 <devicePort tagName="BT A2DP In" type="AUDIO_DEVICE_IN_BLUETOOTH_A2DP" role="source">
649                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
650                              samplingRates="44100,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
651                 </devicePort>
652             </devicePorts>
653 
654             <routes>
655                 <route type="mix" sink="a2dp input"
656                        sources="BT A2DP In"/>
657             </routes>
658         </module>

概括来说,这个文件定义了系统会使用到的音频设备,支持的音频流,以及设备与流之间的走向关系。devicePort对应设备,mixPort对应流,routes对应走向关系。

module:

每个module标签对应有自己hal,也就是hal的源码实现都不一样,如primary、usb、a2dp等。

需要注意的是AudioFlinger中通过hal接口IDevicesFactory.openDevice(string device) 打开的就是这个module,而不是一个真实的扬声器或者耳机之类的设备。

每个module都会有一个audio_hal的实现,通常会命名为audio_hw.c,代码路径如下:

android/vendor/qcom/opensource/audio-hal/primary-hal/hal/
android/system/bt/audio_a2dp_hw/
对应到设备端,会看到有两个库,分别是:

audio.primary.sdm845.so
audio.a2dp.default.so


attachedDevices:


永久连接的设备,是devicePort中的一部分。

defaultOutputDevice:


当无策略规则适用时默认会使用这个设备

mixPort:


每一个mixPort都对应一个音频输入或者输出流,配置了自己的格式、采样率以及mask。

其中role有两个角色,source代表此流可以用于输出,如输出到扬声器。sink代表此流可以用于接受输入,如麦克风采集到数据后输出到此流。

flag和profile用于指定此流支持的一些属性配置。

MixPort中的flag

AUDIO_OUTPUT_FLAG

Description

AUDIO_OUTPUT_FLAG_PRIMARY

表示音频流需要输出到主输出设备,一般用于铃声类声音

AUDIO_OUTPUT_FLAG_DIRECT

表示音频流直接输出到音频设备,不需要软件混音,一般用于 HDMI 设备声音输出

AUDIO_OUTPUT_FLAG_FAST

表示音频流需要快速输出到音频设备,一般用于按键音、游戏背景音等对时延要求高的场景

AUDIO_OUTPUT_FLAG_DEEP_BUFFER

表示音频流输出可以接受较大的时延,一般用于音乐、视频播放等对时延要求不高的场景

AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD

表示音频流没有经过软件解码,需要输出到硬件解码器,

devicePort:

包含可从此模块访问的所有输入和输出设备(包括永久连接的设备和可移除设备)的设备描述符列表。有实际的物理设备,在android中有定义的设备类型,比如AUDIO_DEVICE_OUT_SPEAKER、AUDIO_DEVICE_IN_HDMI、AUDIO_DEVICE_OUT_BLUETOOTH_A2DP等等,也可以是动态插拔的外设。同样role有source和sink两个角色。profile于指定此流支持的一些属性配置,表示支持sampleRate、format和channelMask。

devicePort标签可以理解为一个device设备,设备也分output和input,但是不在像mixport那样以role来分,而是以type中含有的关键字“IN”和“OUT”来分,type用于设备的唯一标识。

routes:

route是把deviceport和mixport连接起来的路由,数据由一个stream输出到另一个device,或者从一个device输出到另一个stream,简单来说就是连接设备和流,列出所有可能的连接。

type:表示所有音源相互排斥(mux)或可以混合(mix)。

sink: 可以是设备,也可以是流。每一个route只有一个sink。

source: 同样可以是设备,也可以是流。每一个route中可包含多个source。

<route type="mix" sink="Earpiece" sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
<route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
<route type="mix" sink="Speaker" sources="primary output,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,projection_phone_downlink"/><route type="mix" sink="Wired Headset" sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>

以上配置可以解释为:

1.假定音频流要输出到耳机或扬声器,那么可以采用的音频流(mixPort)可以是primary output, raw 等等。

2.假定音频流要输出到primary input。那么可以使用的设备有 Built-In Mic,Built-In Back Mic等麦克风。

从配置文件中可以看到不同的sink,可能有相同的source。那么具体采用那个source会根据音频策略来决定。比如:

1. 从上层传来了一个compressed_offload的流,到底是输出到耳机还是内置扬声器,会根据是否插入耳机和耳机的优先级来判定。

2. 上层传来请求录音请求,不管是普通录音,还是voip语音电话录音,会从可用的录音设备中查找优先级最高的一个设备进行录音。

audio_policy_configuration初始化逻辑:

audio_policy_configuration.xml在AudioPolicyManager初始化时会被解析。

首先遍历module,再分别遍历输出mixport和输入mixport。如果mixport找到的设备出现在attachedDevices中才会打开此流。

4866 void AudioPolicyManager::onNewAudioModulesAvailableInt(DeviceVector *newDevices)
4867  {
4868      for (const auto& hwModule : mHwModulesAll) {
4869          if (std::find(mHwModules.begin(), mHwModules.end(), hwModule) != mHwModules.end()) {
4870              continue;
4871          }
4872          hwModule->setHandle(mpClientInterface->loadHwModule(hwModule->getName()));
4873          if (hwModule->getHandle() == AUDIO_MODULE_HANDLE_NONE) {
4874              ALOGW("could not open HW module %s", hwModule->getName());
4875              continue;
4876          }
4877          mHwModules.push_back(hwModule);
4878          // open all output streams needed to access attached devices
4879          // except for direct output streams that are only opened when they are actually
4880          // required by an app.
4881          // This also validates mAvailableOutputDevices list
4882          for (const auto& outProfile : hwModule->getOutputProfiles()) {
4883              if (!outProfile->canOpenNewIo()) {
4884                  ALOGE("Invalid Output profile max open count %u for profile %s",
4885                        outProfile->maxOpenCount, outProfile->getTagName().c_str());
4886                  continue;
4887              }
4888              if (!outProfile->hasSupportedDevices()) {
4889                  ALOGW("Output profile contains no device on module %s", hwModule->getName());
4890                  continue;
4891              }
4892              if ((outProfile->getFlags() & AUDIO_OUTPUT_FLAG_TTS) != 0) {
4893                  mTtsOutputAvailable = true;
4894              }
4895              if ((outProfile->getFlags() & AUDIO_OUTPUT_FLAG_DIRECT) != 0) {
4896                  continue;
4897              }
4898              const DeviceVector &supportedDevices = outProfile->getSupportedDevices();
4899              DeviceVector availProfileDevices = supportedDevices.filter(mOutputDevicesAll);
4900              sp<DeviceDescriptor> supportedDevice = 0;
4901              if (supportedDevices.contains(mDefaultOutputDevice)) {
4902                  supportedDevice = mDefaultOutputDevice;
4903              } else {
4904                  // choose first device present in profile's SupportedDevices also part of
4905                  // mAvailableOutputDevices.
4906                  if (availProfileDevices.isEmpty()) {
4907                      continue;
4908                  }
4909                  supportedDevice = availProfileDevices.itemAt(0);
4910              }
4911              if (!mOutputDevicesAll.contains(supportedDevice)) {
4912                  continue;
4913              }
4914              sp<SwAudioOutputDescriptor> outputDesc = new SwAudioOutputDescriptor(outProfile,
4915                                                                                   mpClientInterface);
4916              audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
4917              status_t status = outputDesc->open(nullptr, DeviceVector(supportedDevice),
4918                                                 AUDIO_STREAM_DEFAULT,
4919                                                 AUDIO_OUTPUT_FLAG_NONE, &output);
4920              if (status != NO_ERROR) {
4921                  ALOGW("Cannot open output stream for devices %s on hw module %s",
4922                        supportedDevice->toString().c_str(), hwModule->getName());
4923                  continue;
4924              }
4925              for (const auto &device : availProfileDevices) {
4926                  // give a valid ID to an attached device once confirmed it is reachable
4927                  if (!device->isAttached()) {
4928                      device->attach(hwModule);
4929                      mAvailableOutputDevices.add(device);
4930                      device->setEncapsulationInfoFromHal(mpClientInterface);
4931                      if (newDevices) newDevices->add(device);
4932                      setEngineDeviceConnectionState(device, AUDIO_POLICY_DEVICE_STATE_AVAILABLE);
4933                  }
4934              }
4935              if (mPrimaryOutput == 0 &&
4936                      outProfile->getFlags() & AUDIO_OUTPUT_FLAG_PRIMARY) {
4937                  mPrimaryOutput = outputDesc;
4938              }
4939              if ((outProfile->getFlags() & AUDIO_OUTPUT_FLAG_DIRECT) != 0) {
4940                  outputDesc->close();
4941              } else {
4942                  addOutput(output, outputDesc);
4943                  ALOGI("open output stream for device %s on hw module %s mSamplingRate = %d, mFormat = %d, mChannelMask = %d, mFlags = %d",
4944                      outputDesc->devices().toString().c_str(), hwModule->getName(), outputDesc->getSamplingRate(),
4945                      outputDesc->getFormat(), outputDesc->getChannelMask(), outProfile->getFlags());
4946                  setOutputDevices(outputDesc,
4947                                   DeviceVector(supportedDevice),
4948                                   true,
4949                                   0,
4950                                   NULL);
4951              }
4952          }
4953          // open input streams needed to access attached devices to validate
4954          // mAvailableInputDevices list
4955          for (const auto& inProfile : hwModule->getInputProfiles()) {
4956              if (!inProfile->canOpenNewIo()) {
4957                  ALOGE("Invalid Input profile max open count %u for profile %s",
4958                        inProfile->maxOpenCount, inProfile->getTagName().c_str());
4959                  continue;
4960              }
4961              if (!inProfile->hasSupportedDevices()) {
4962                  ALOGW("Input profile contains no device on module %s", hwModule->getName());
4963                  continue;
4964              }
4965              // chose first device present in profile's SupportedDevices also part of
4966              // available input devices
4967              const DeviceVector &supportedDevices = inProfile->getSupportedDevices();
4968              DeviceVector availProfileDevices = supportedDevices.filter(mInputDevicesAll);
4969              if (availProfileDevices.isEmpty()) {
4970                  ALOGE("%s: Input device list is empty!", __FUNCTION__);
4971                  continue;
4972              }
4973              sp<AudioInputDescriptor> inputDesc =
4974                      new AudioInputDescriptor(inProfile, mpClientInterface);
4975  
4976              audio_io_handle_t input = AUDIO_IO_HANDLE_NONE;
4977              status_t status = inputDesc->open(nullptr,
4978                                                availProfileDevices.itemAt(0),
4979                                                AUDIO_SOURCE_MIC,
4980                                                AUDIO_INPUT_FLAG_NONE,
4981                                                &input);
4982              if (status != NO_ERROR) {
4983                  ALOGW("Cannot open input stream for device %s on hw module %s",
4984                        availProfileDevices.toString().c_str(),
4985                        hwModule->getName());
4986                  continue;
4987              }
4988              for (const auto &device : availProfileDevices) {
4989                  // give a valid ID to an attached device once confirmed it is reachable
4990                  if (!device->isAttached()) {
4991                      device->attach(hwModule);
4992                      device->importAudioPortAndPickAudioProfile(inProfile, true);
4993                      mAvailableInputDevices.add(device);
4994                      if (newDevices) newDevices->add(device);
4995                      setEngineDeviceConnectionState(device, AUDIO_POLICY_DEVICE_STATE_AVAILABLE);
4996                  }
4997              }
4998              inputDesc->close();
4999          }
5000      }
5001  }

比如在打开primary module时:

1. 遍历第一个输出mixport(primary output),routes中包含primary output的有:Earpiece, Speaker, Wired Headset, Wired Headphones, BT SCO, BT SCO Headset,, BT A2DP Out, BT A2DP Headphones, BT A2DP Speaker, HDMI, USB Device Out, Line, FM, Proxy。这部分设备Earpiece和Speaker存在于attachedDevices中,因此primary output流会被打开。

2. 遍历第六个输出mixport(compress_passthrough),routes中包含compress_passthrough的有:HDMI,这个设备不在attachedDevices中,因此开机初始化时compress_passthrough流不会被打开。只有当HDMI插入时才会打开。

相关文章:

基于Android11简单分析audio_policy_configuration.xml

开篇先贴上一个高通的例子&#xff0c;后续基于此文件做具体分析。 1 <?xml version"1.0" encoding"UTF-8" standalone"yes"?> 2 <!-- Copyright (c) 2016-2019, The Linux Foundation. All rights reserved 3 Not a Contribut…...

kafka-manager修改zookeeper端口号后启动仍然连接2181端口

问题描述&#xff1a; zookeeper默认端口号修改为了2182&#xff0c;kafka-manager的配置文件application.conf中也已经修改了zkhosts为新的端口号&#xff0c;然而启动kafka-manger时报错连接连接超时&#xff0c;发现连接的还是2181端口&#xff0c;很奇怪&#xff1f;&…...

RabbitMQ 入门(三)SpringAMQP

一、Spring AMQP 简介 SpringAMQP是基于RabbitMQ封装的一套模板&#xff0c;并且还利用SpringBoot对其实现了自动装配&#xff0c;使用起来非常方便。 SpringAmqp的官方地址&#xff1a;https://spring.io/projects/spring-amqp SpringAMQP提供了三个功能&#xff1a; - 自动…...

celery 项目中mysql 数据库连接数耗尽事故记录

python 项目中使用 celery 中导致mysql数据库连接耗尽记录【mysql数据库连接池使用错误】 结论&#xff1a;由于使用 celery 进行项目的多任务管理&#xff0c;在worker任务定义的过程中&#xff0c;使用了 dbutils 中的 PooledDB 连接池进行 mysql数据库连接&#xff0c; 因此…...

Python数据分析-Scipy科学计算法

1.认识Scipy SciPy&#xff08;发音为 "Sigh Pie"&#xff09;是一个开源的 Python 算法库和数学工具包。 通常与 NumPy、Matplotlib 和 pandas 等库一起使用&#xff0c;这些库共同构成了 Python 的科学计算基础。 2.使用Scipy基本函数 2.1 引用Scipy函数 impor…...

【Python Django + Vue】酒店在线预订系统:用技术说话!

&#x1f393; 作者&#xff1a;计算机毕设小月哥 | 软件开发专家 &#x1f5a5;️ 简介&#xff1a;8年计算机软件程序开发经验。精通Java、Python、微信小程序、安卓、大数据、PHP、.NET|C#、Golang等技术栈。 &#x1f6e0;️ 专业服务 &#x1f6e0;️ 需求定制化开发源码提…...

禁用微软的windos安全中心

目录 一、为什么禁用 二、WDControl_1.5.0程序禁用windows安全中心 步骤1--- 步骤2--- 三、禁用widows安全中心成功 一、为什么禁用 描述&#xff1a;下载第三方软件常常会收到病毒防护秒杀&#xff0c; 第1---直接无法下载 第2---提前下载在U盘解压会被干掉程序文件 …...

2.html编辑器介绍

html编辑器介绍 HTML 编辑器推荐 理论上我们可以使用记事本进行html编码和开发&#xff0c;但是在实际开发html页面的时候&#xff0c;使用一些专业的开发工具可以使我们更加快速和高效的进行开发&#xff0c;下面介绍几种开发工具&#xff1a; VS Code&#xff1a;https://…...

树莓派应用--AI项目实战篇来啦-17.YOLOv8目标检测-安全帽检测

1. YOLOv8介绍 YOLOv8是Ultralytics公司2023年推出的Yolo系列目标检测算法&#xff0c;可以用于图像分类、物体检测和实例分割等任务。YOLOv8作为YOLO系列算法的最新成员&#xff0c;在损失函数、Anchor机制、样本分配策略等方面进行了全面优化和创新。这些改进不仅提高了模型的…...

git-secret介绍

git-secret介绍 git-secret 是一个与git兼容的命令行工具,旨在安全地存储和管理敏感数据,如源代码中的密码、密钥以及敏感文件。它通过 GPG 加密来保护文件,确保只有授权的用户才能访问这些敏感信息。 使用流程 1、安装 Git-Secret:在本地开发环境中安装 git-secret。 2…...

【实战】Nginx+Lua脚本+Redis 实现自动封禁访问频率过高IP

大家好&#xff0c;我是冰河~~ 自己搭建的网站刚上线&#xff0c;短信接口就被一直攻击&#xff0c;并且攻击者不停变换IP&#xff0c;导致阿里云短信平台上的短信被恶意刷取了几千条&#xff0c;加上最近工作比较忙&#xff0c;就直接在OpenResty上对短信接口做了一些限制&am…...

计算机专业大一课程:线性代数探秘

计算机专业大一课程&#xff1a;线性代数探秘 对于计算机专业的大一新生来说&#xff0c;线性代数是一门基础且重要的课程。它不仅是数学的一个分支&#xff0c;更是计算机科学中不可或缺的工具。那么&#xff0c;线性代数究竟包含哪些内容&#xff0c;对我们的计算机学习有何…...

vscode写markdown插入图片视频并放在指定目录

目录 前言正文 前言 各种云文档非常好用&#xff0c;但是当你想把这些资料保存在本地时&#xff0c;markdown我觉得是最好的选择 markdown编辑器也有很多&#xff0c;但我还是觉得vscode最好用&#xff0c;直接粘贴文件就可以插入也类似云文档的使用体验&#xff0c;但是想要…...

鸿蒙富文本显示

1.使用 RichText 组件&#xff08;ArkTS&#xff09; 背景知识&#xff1a;在 ArkTS&#xff08;一种鸿蒙应用开发语言&#xff09;中&#xff0c;RichText组件提供了更强大的富文本显示功能。它允许设置不同的文本样式&#xff0c;包括字体、颜色、字号等多种属性。 Rich Te…...

手写mybatis之细化XML语句构建器,完善静态SQL解析

前言 1&#xff1a;在流程上&#xff0c;通过 DefaultSqlSession#selectOne 方法调用执行器&#xff0c;并通过预处理语句处理器 PreparedStatementHandler 执行参数设置和结果查询。 2&#xff1a;那么这个流程中我们所处理的参数信息&#xff0c;也就是每个 SQL 执行时&#…...

使用Milvus和Llama-agents构建更强大的Agent系统

代理&#xff08;Agent&#xff09;系统能够帮助开发人员创建智能的自主系统&#xff0c;因此变得越来越流行。大语言模型&#xff08;LLM&#xff09;能够遵循各种指令&#xff0c;是管理 Agent 的理想选择&#xff0c;在许多场景中帮助我们尽可能减少人工干预、处理更多复杂任…...

Python 工具库每日推荐【Arrow】

文章目录 引言Python时间日期处理库的重要性今日推荐:Arrow工具库主要功能:使用场景:安装与配置快速上手示例代码代码解释实际应用案例案例:跨时区会议安排器案例分析高级特性时间范围和区间自定义时间格式扩展阅读与资源优缺点分析优点:缺点:总结【 已更新完 TypeScript…...

Win10 安装 Redis 数据库

一、Redis 数据库介绍 Redis 是一个开源的高性能键值对&#xff08;key-value&#xff09;的非关系型数据库。它通常用作数据结构服务器&#xff0c;支持多种类型的数据结构&#xff0c;如字符串&#xff08;strings&#xff09;、哈希&#xff08;hashes&#xff09;、列表&a…...

使用springboot生成war包

1.生成war包 1.1 更改pom包 打开一个springboot 项目 &#xff0c;右击项目名从项目管理器打开 在pom.xml文件中插入以下两个依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><…...

见微知著:OpenEuler系统启动流程

OpenEuler是一个开源的Linux发行版&#xff0c;它的启动流程涉及到多个阶段&#xff0c;包括固件初始化、引导加载程序、内核启动、初始化系统和服务管理器等。下面将详细介绍OpenEuler的启动流程。 一、启动流程 1. 固件初始化&#xff08;BIOS/UEFI&#xff09; 启动过程首…...

支持向量机-笔记

支持向量机&#xff08;Support Vector Machine, SVM&#xff09; 是一种强大的监督学习算法&#xff0c;广泛应用于分类和回归任务&#xff0c;特别是在分类问题中表现优异。SVM 的核心思想是通过寻找一个最优超平面&#xff0c;将不同类别的数据点进行分割&#xff0c;并最大…...

研发线上事故风险解读之缓存篇

专业在线打字练习平台-巧手打字通&#xff0c;只输出有价值的知识。 一 前言 本文继续基于《线上事故案例集》&#xff0c;进一步深入梳理线上事故缓存使用方面的问题点&#xff0c;重点关注缓存在使用和优化过程中可能出现的问题&#xff0c;旨在为读者提供具有实践指导意义的…...

JavaScript前端开发技术

JavaScript前端开发技术 引言 JavaScript&#xff08;简称JS&#xff09;是一种广泛使用的脚本语言&#xff0c;特别在前端开发领域&#xff0c;它几乎成为了网页开发的标配。从简单的表单验证到复杂的单页应用&#xff08;SPA&#xff09;&#xff0c;JavaScript都扮演着不可…...

H.264 编码参数优化策略

一、概述 随着数字媒体技术的发展&#xff0c;视频编码成为了多媒体领域中的重要研究方向之一。而H.264作为一种广泛应用的视频编码标准&#xff0c;具有高压缩比、优质画面和广泛兼容性等优点。为了进一步提高视频质量和压缩效率&#xff0c;对H.264编码参数进行优化成为了一个…...

C++ 游戏开发技术选型指南

C 游戏开发技术选型指南 游戏开发是一个复杂而多元化的领域&#xff0c;而C凭借其高性能和强大的控制能力&#xff0c;成为许多游戏引擎的首选编程语言。在这篇博客中&#xff0c;我们将探讨如何选择合适的C技术栈进行游戏开发&#xff0c;包括技术背景、代码示例、优化实践、…...

基于Python Django的在线考试管理系统

&#x1f34a;作者&#xff1a;计算机毕设匠心工作室 &#x1f34a;简介&#xff1a;毕业后就一直专业从事计算机软件程序开发&#xff0c;至今也有8年工作经验。擅长Java、Python、微信小程序、安卓、大数据、PHP、.NET|C#、Golang等。 擅长&#xff1a;按照需求定制化开发项目…...

《Java基础》变量和数据类型

综述 在开始学习变量之前&#xff0c;我们思考一下为什么需要使用变量。 首先我们从小开始学习加法减法的时候&#xff0c;后来我们再学更难的东西就是代数&#xff0c;其中的x和y是我们要求解的内容&#xff0c;这些内容就是变量。 变量是人的思维的提升&#xff0c;没有变量…...

FLINK内存管理解析,taskmanager、jobmanager

1、在 Flink 中设置内存的方法是配置以下两个选项之一&#xff1a; 1&#xff09;Total Flink memory&#xff1a;taskmanager.memory.flink.sizejobmanager.memory.flink.size 2&#xff09;Total process memory&#xff1a;taskmanager.memory.process.sizejobmanager.mem…...

【AI论文精读13】RAG论文综述2(微软亚研院 2409)P5-可解释推理查询L3

AI知识点总结&#xff1a;【AI知识点】 AI论文精读、项目、思考&#xff1a;【AI修炼之路】 P1&#xff0c;P2&#xff0c;P3&#xff0c;P4 五、可解释推理查询&#xff08;L3&#xff09; ps&#xff1a;P2有四种查询&#xff08;L1&#xff0c;L2&#xff0c;L3&#xff0c;…...

优达学城 Generative AI 课程3:Computer Vision and Generative AI

文章目录 1 官方课程内容自述第 1 课&#xff1a;图像生成简介第 2 课&#xff1a;计算机视觉基础第 3 课&#xff1a;图像生成与生成对抗网络&#xff08;GANs&#xff09;第 4 课&#xff1a;基于 Transformer 的计算机视觉模型第 5 课&#xff1a;扩散模型第 6 课&#xff0…...