blob: 4555a880343dd655608d33f67be3a15e579dda1a [file] [log] [blame]
Mikhail Naganov159260c2020-07-23 18:08:26 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!-- Copyright (C) 2020 The Android Open Source Project
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
Mikhail Naganov159260c2020-07-23 18:08:26 +000016<xs:schema version="2.0"
17 elementFormDefault="qualified"
18 attributeFormDefault="unqualified"
19 xmlns:xs="http://www.w3.org/2001/XMLSchema">
20 <!-- List the config versions supported by audio policy. -->
21 <xs:simpleType name="version">
22 <xs:restriction base="xs:decimal">
23 <xs:enumeration value="1.0"/>
24 </xs:restriction>
25 </xs:simpleType>
26 <xs:simpleType name="halVersion">
27 <xs:annotation>
28 <xs:documentation xml:lang="en">
Mikhail Naganov7dd87f42020-08-04 23:37:05 +000029 Version of the interface the hal implements. Note that this
30 relates to legacy HAL API versions since HIDL APIs are versioned
31 using other mechanisms.
Mikhail Naganov159260c2020-07-23 18:08:26 +000032 </xs:documentation>
33 </xs:annotation>
34 <xs:restriction base="xs:decimal">
35 <!-- List of HAL versions supported by the framework. -->
36 <xs:enumeration value="2.0"/>
37 <xs:enumeration value="3.0"/>
38 </xs:restriction>
39 </xs:simpleType>
40 <xs:element name="audioPolicyConfiguration">
41 <xs:complexType>
42 <xs:sequence>
43 <xs:element name="globalConfiguration" type="globalConfiguration"/>
44 <xs:element name="modules" type="modules" maxOccurs="unbounded"/>
45 <xs:element name="volumes" type="volumes" maxOccurs="unbounded"/>
46 <xs:element name="surroundSound" type="surroundSound" minOccurs="0" />
47 </xs:sequence>
48 <xs:attribute name="version" type="version"/>
49 </xs:complexType>
50 <xs:key name="moduleNameKey">
51 <xs:selector xpath="modules/module"/>
52 <xs:field xpath="@name"/>
53 </xs:key>
54 <xs:unique name="volumeTargetUniqueness">
55 <xs:selector xpath="volumes/volume"/>
56 <xs:field xpath="@stream"/>
57 <xs:field xpath="@deviceCategory"/>
58 </xs:unique>
59 <xs:key name="volumeCurveNameKey">
60 <xs:selector xpath="volumes/reference"/>
61 <xs:field xpath="@name"/>
62 </xs:key>
63 <xs:keyref name="volumeCurveRef" refer="volumeCurveNameKey">
64 <xs:selector xpath="volumes/volume"/>
65 <xs:field xpath="@ref"/>
66 </xs:keyref>
67 </xs:element>
68 <xs:complexType name="globalConfiguration">
69 <xs:attribute name="speaker_drc_enabled" type="xs:boolean" use="required"/>
70 <xs:attribute name="call_screen_mode_supported" type="xs:boolean" use="optional"/>
71 <xs:attribute name="engine_library" type="engineSuffix" use="optional"/>
72 </xs:complexType>
73 <xs:complexType name="modules">
74 <xs:annotation>
75 <xs:documentation xml:lang="en">
76 There should be one section per audio HW module present on the platform.
77 Each <module/> contains two mandatory tags: “halVersion” and “name”.
78 The module "name" is the same as in previous .conf file.
79 Each module must contain the following sections:
80 - <devicePorts/>: a list of device descriptors for all
81 input and output devices accessible via this module.
82 This contains both permanently attached devices and removable devices.
83 - <mixPorts/>: listing all output and input streams exposed by the audio HAL
84 - <routes/>: list of possible connections between input
85 and output devices or between stream and devices.
86 A <route/> is defined by a set of 3 attributes:
87 -"type": mux|mix means all sources are mutual exclusive (mux) or can be mixed (mix)
88 -"sink": the sink involved in this route
89 -"sources": all the sources than can be connected to the sink via this route
90 - <attachedDevices/>: permanently attached devices.
91 The attachedDevices section is a list of devices names.
92 Their names correspond to device names defined in "devicePorts" section.
93 - <defaultOutputDevice/> is the device to be used when no policy rule applies
94 </xs:documentation>
95 </xs:annotation>
96 <xs:sequence>
97 <xs:element name="module" maxOccurs="unbounded">
98 <xs:complexType>
99 <xs:sequence>
100 <xs:element name="attachedDevices" type="attachedDevices" minOccurs="0">
101 <xs:unique name="attachedDevicesUniqueness">
102 <xs:selector xpath="item"/>
103 <xs:field xpath="."/>
104 </xs:unique>
105 </xs:element>
106 <xs:element name="defaultOutputDevice" type="xs:token" minOccurs="0"/>
107 <xs:element name="mixPorts" type="mixPorts" minOccurs="0"/>
108 <xs:element name="devicePorts" type="devicePorts" minOccurs="0"/>
109 <xs:element name="routes" type="routes" minOccurs="0"/>
110 </xs:sequence>
111 <xs:attribute name="name" type="xs:string" use="required"/>
112 <xs:attribute name="halVersion" type="halVersion" use="required"/>
113 </xs:complexType>
114 <xs:unique name="mixPortNameUniqueness">
115 <xs:selector xpath="mixPorts/mixPort"/>
116 <xs:field xpath="@name"/>
117 </xs:unique>
118 <xs:key name="devicePortNameKey">
119 <xs:selector xpath="devicePorts/devicePort"/>
120 <xs:field xpath="@tagName"/>
121 </xs:key>
122 <xs:unique name="devicePortUniqueness">
123 <xs:selector xpath="devicePorts/devicePort"/>
124 <xs:field xpath="@type"/>
125 <xs:field xpath="@address"/>
126 </xs:unique>
127 <xs:keyref name="defaultOutputDeviceRef" refer="devicePortNameKey">
128 <xs:selector xpath="defaultOutputDevice"/>
129 <xs:field xpath="."/>
130 </xs:keyref>
131 <xs:keyref name="attachedDeviceRef" refer="devicePortNameKey">
132 <xs:selector xpath="attachedDevices/item"/>
133 <xs:field xpath="."/>
134 </xs:keyref>
135 <!-- The following 3 constraints try to make sure each sink port
136 is reference in one an only one route. -->
137 <xs:key name="routeSinkKey">
138 <!-- predicate [@type='sink'] does not work in xsd 1.0 -->
139 <xs:selector xpath="devicePorts/devicePort|mixPorts/mixPort"/>
140 <xs:field xpath="@tagName|@name"/>
141 </xs:key>
142 <xs:keyref name="routeSinkRef" refer="routeSinkKey">
143 <xs:selector xpath="routes/route"/>
144 <xs:field xpath="@sink"/>
145 </xs:keyref>
146 <xs:unique name="routeUniqueness">
147 <xs:selector xpath="routes/route"/>
148 <xs:field xpath="@sink"/>
149 </xs:unique>
150 </xs:element>
151 </xs:sequence>
152 </xs:complexType>
153 <xs:complexType name="attachedDevices">
154 <xs:sequence>
155 <xs:element name="item" type="xs:token" minOccurs="0" maxOccurs="unbounded"/>
156 </xs:sequence>
157 </xs:complexType>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000158 <xs:simpleType name="audioInOutFlags">
159 <xs:annotation>
160 <xs:documentation xml:lang="en">
161 "|" separated list of audio_output_flags_t or audio_input_flags_t.
162 </xs:documentation>
163 </xs:annotation>
164 <xs:restriction base="xs:string">
165 <xs:pattern value="|[_A-Z]+(\|[_A-Z]+)*"/>
166 </xs:restriction>
167 </xs:simpleType>
168 <xs:simpleType name="role">
169 <xs:restriction base="xs:string">
170 <xs:enumeration value="sink"/>
171 <xs:enumeration value="source"/>
172 </xs:restriction>
173 </xs:simpleType>
174 <xs:complexType name="mixPorts">
175 <xs:sequence>
176 <xs:element name="mixPort" minOccurs="0" maxOccurs="unbounded">
177 <xs:complexType>
178 <xs:sequence>
179 <xs:element name="profile" type="profile" minOccurs="0" maxOccurs="unbounded"/>
180 <xs:element name="gains" type="gains" minOccurs="0"/>
181 </xs:sequence>
182 <xs:attribute name="name" type="xs:token" use="required"/>
183 <xs:attribute name="role" type="role" use="required"/>
184 <xs:attribute name="flags" type="audioInOutFlags"/>
185 <xs:attribute name="maxOpenCount" type="xs:unsignedInt"/>
186 <xs:attribute name="maxActiveCount" type="xs:unsignedInt"/>
187 <xs:attribute name="preferredUsage" type="audioUsageList">
188 <xs:annotation>
189 <xs:documentation xml:lang="en">
190 When choosing the mixPort of an audio track, the audioPolicy
191 first considers the mixPorts with a preferredUsage including
192 the track AudioUsage preferred .
193 If non support the track format, the other mixPorts are considered.
194 Eg: a <mixPort preferredUsage="AUDIO_USAGE_MEDIA" /> will receive
195 the audio of all apps playing with a MEDIA usage.
196 It may receive audio from ALARM if there are no audio compatible
197 <mixPort preferredUsage="AUDIO_USAGE_ALARM" />.
198 </xs:documentation>
199 </xs:annotation>
200 </xs:attribute>
201 </xs:complexType>
202 <xs:unique name="mixPortProfileUniqueness">
203 <xs:selector xpath="profile"/>
204 <xs:field xpath="format"/>
205 <xs:field xpath="samplingRate"/>
206 <xs:field xpath="channelMasks"/>
207 </xs:unique>
208 <xs:unique name="mixPortGainUniqueness">
209 <xs:selector xpath="gains/gain"/>
210 <xs:field xpath="@name"/>
211 </xs:unique>
212 </xs:element>
213 </xs:sequence>
214 </xs:complexType>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000215 <xs:simpleType name="audioDevice">
216 <xs:restriction base="xs:string">
217 <xs:enumeration value="AUDIO_DEVICE_NONE"/>
218
219 <xs:enumeration value="AUDIO_DEVICE_OUT_EARPIECE"/>
220 <xs:enumeration value="AUDIO_DEVICE_OUT_SPEAKER"/>
221 <xs:enumeration value="AUDIO_DEVICE_OUT_WIRED_HEADSET"/>
222 <xs:enumeration value="AUDIO_DEVICE_OUT_WIRED_HEADPHONE"/>
223 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO"/>
224 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET"/>
225 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT"/>
226 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP"/>
227 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES"/>
228 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER"/>
229 <xs:enumeration value="AUDIO_DEVICE_OUT_AUX_DIGITAL"/>
230 <xs:enumeration value="AUDIO_DEVICE_OUT_HDMI"/>
231 <xs:enumeration value="AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET"/>
232 <xs:enumeration value="AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET"/>
233 <xs:enumeration value="AUDIO_DEVICE_OUT_USB_ACCESSORY"/>
234 <xs:enumeration value="AUDIO_DEVICE_OUT_USB_DEVICE"/>
235 <xs:enumeration value="AUDIO_DEVICE_OUT_REMOTE_SUBMIX"/>
236 <xs:enumeration value="AUDIO_DEVICE_OUT_TELEPHONY_TX"/>
237 <xs:enumeration value="AUDIO_DEVICE_OUT_LINE"/>
238 <xs:enumeration value="AUDIO_DEVICE_OUT_HDMI_ARC"/>
239 <xs:enumeration value="AUDIO_DEVICE_OUT_SPDIF"/>
240 <xs:enumeration value="AUDIO_DEVICE_OUT_FM"/>
241 <xs:enumeration value="AUDIO_DEVICE_OUT_AUX_LINE"/>
242 <xs:enumeration value="AUDIO_DEVICE_OUT_SPEAKER_SAFE"/>
243 <xs:enumeration value="AUDIO_DEVICE_OUT_IP"/>
244 <xs:enumeration value="AUDIO_DEVICE_OUT_BUS"/>
245 <xs:enumeration value="AUDIO_DEVICE_OUT_PROXY"/>
246 <xs:enumeration value="AUDIO_DEVICE_OUT_USB_HEADSET"/>
247 <xs:enumeration value="AUDIO_DEVICE_OUT_HEARING_AID"/>
248 <xs:enumeration value="AUDIO_DEVICE_OUT_ECHO_CANCELLER"/>
249 <xs:enumeration value="AUDIO_DEVICE_OUT_DEFAULT"/>
250 <xs:enumeration value="AUDIO_DEVICE_OUT_STUB"/>
251
Mikhail Naganov159260c2020-07-23 18:08:26 +0000252 <xs:enumeration value="AUDIO_DEVICE_IN_COMMUNICATION"/>
253 <xs:enumeration value="AUDIO_DEVICE_IN_AMBIENT"/>
254 <xs:enumeration value="AUDIO_DEVICE_IN_BUILTIN_MIC"/>
255 <xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET"/>
256 <xs:enumeration value="AUDIO_DEVICE_IN_WIRED_HEADSET"/>
257 <xs:enumeration value="AUDIO_DEVICE_IN_AUX_DIGITAL"/>
258 <xs:enumeration value="AUDIO_DEVICE_IN_HDMI"/>
259 <xs:enumeration value="AUDIO_DEVICE_IN_VOICE_CALL"/>
260 <xs:enumeration value="AUDIO_DEVICE_IN_TELEPHONY_RX"/>
261 <xs:enumeration value="AUDIO_DEVICE_IN_BACK_MIC"/>
262 <xs:enumeration value="AUDIO_DEVICE_IN_REMOTE_SUBMIX"/>
263 <xs:enumeration value="AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET"/>
264 <xs:enumeration value="AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET"/>
265 <xs:enumeration value="AUDIO_DEVICE_IN_USB_ACCESSORY"/>
266 <xs:enumeration value="AUDIO_DEVICE_IN_USB_DEVICE"/>
267 <xs:enumeration value="AUDIO_DEVICE_IN_FM_TUNER"/>
268 <xs:enumeration value="AUDIO_DEVICE_IN_TV_TUNER"/>
269 <xs:enumeration value="AUDIO_DEVICE_IN_LINE"/>
270 <xs:enumeration value="AUDIO_DEVICE_IN_SPDIF"/>
271 <xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_A2DP"/>
272 <xs:enumeration value="AUDIO_DEVICE_IN_LOOPBACK"/>
273 <xs:enumeration value="AUDIO_DEVICE_IN_IP"/>
274 <xs:enumeration value="AUDIO_DEVICE_IN_BUS"/>
275 <xs:enumeration value="AUDIO_DEVICE_IN_PROXY"/>
276 <xs:enumeration value="AUDIO_DEVICE_IN_USB_HEADSET"/>
277 <xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_BLE"/>
278 <xs:enumeration value="AUDIO_DEVICE_IN_HDMI_ARC"/>
279 <xs:enumeration value="AUDIO_DEVICE_IN_ECHO_REFERENCE"/>
280 <xs:enumeration value="AUDIO_DEVICE_IN_DEFAULT"/>
281 <xs:enumeration value="AUDIO_DEVICE_IN_STUB"/>
282 </xs:restriction>
283 </xs:simpleType>
284 <xs:simpleType name="vendorExtension">
285 <!-- Vendor extension names must be prefixed by "VX_" to distinguish them from AOSP values.
286 Vendor are encouraged to namespace their module names to avoid conflicts.
287 Example for an hypothetical Google virtual reality device:
288 <devicePort tagName="VR" type="VX_GOOGLE_VR" role="sink">
289 -->
290 <xs:restriction base="xs:string">
291 <xs:pattern value="VX_[_a-zA-Z0-9]+"/>
292 </xs:restriction>
293 </xs:simpleType>
294 <xs:simpleType name="extendableAudioDevice">
295 <xs:union memberTypes="audioDevice vendorExtension"/>
296 </xs:simpleType>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000297 <xs:simpleType name="audioFormat">
298 <xs:restriction base="xs:string">
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000299 <xs:enumeration value="AUDIO_FORMAT_DEFAULT" />
Mikhail Naganov159260c2020-07-23 18:08:26 +0000300 <xs:enumeration value="AUDIO_FORMAT_PCM_16_BIT" />
301 <xs:enumeration value="AUDIO_FORMAT_PCM_8_BIT"/>
302 <xs:enumeration value="AUDIO_FORMAT_PCM_32_BIT"/>
303 <xs:enumeration value="AUDIO_FORMAT_PCM_8_24_BIT"/>
304 <xs:enumeration value="AUDIO_FORMAT_PCM_FLOAT"/>
305 <xs:enumeration value="AUDIO_FORMAT_PCM_24_BIT_PACKED"/>
306 <xs:enumeration value="AUDIO_FORMAT_MP3"/>
307 <xs:enumeration value="AUDIO_FORMAT_AMR_NB"/>
308 <xs:enumeration value="AUDIO_FORMAT_AMR_WB"/>
309 <xs:enumeration value="AUDIO_FORMAT_AAC"/>
310 <xs:enumeration value="AUDIO_FORMAT_AAC_MAIN"/>
311 <xs:enumeration value="AUDIO_FORMAT_AAC_LC"/>
312 <xs:enumeration value="AUDIO_FORMAT_AAC_SSR"/>
313 <xs:enumeration value="AUDIO_FORMAT_AAC_LTP"/>
314 <xs:enumeration value="AUDIO_FORMAT_AAC_HE_V1"/>
315 <xs:enumeration value="AUDIO_FORMAT_AAC_SCALABLE"/>
316 <xs:enumeration value="AUDIO_FORMAT_AAC_ERLC"/>
317 <xs:enumeration value="AUDIO_FORMAT_AAC_LD"/>
318 <xs:enumeration value="AUDIO_FORMAT_AAC_HE_V2"/>
319 <xs:enumeration value="AUDIO_FORMAT_AAC_ELD"/>
320 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_MAIN"/>
321 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LC"/>
322 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SSR"/>
323 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LTP"/>
324 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V1"/>
325 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SCALABLE"/>
326 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ERLC"/>
327 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LD"/>
328 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V2"/>
329 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ELD"/>
330 <xs:enumeration value="AUDIO_FORMAT_VORBIS"/>
331 <xs:enumeration value="AUDIO_FORMAT_HE_AAC_V1"/>
332 <xs:enumeration value="AUDIO_FORMAT_HE_AAC_V2"/>
333 <xs:enumeration value="AUDIO_FORMAT_OPUS"/>
334 <xs:enumeration value="AUDIO_FORMAT_AC3"/>
335 <xs:enumeration value="AUDIO_FORMAT_E_AC3"/>
336 <xs:enumeration value="AUDIO_FORMAT_DTS"/>
337 <xs:enumeration value="AUDIO_FORMAT_DTS_HD"/>
338 <xs:enumeration value="AUDIO_FORMAT_IEC61937"/>
339 <xs:enumeration value="AUDIO_FORMAT_DOLBY_TRUEHD"/>
340 <xs:enumeration value="AUDIO_FORMAT_EVRC"/>
341 <xs:enumeration value="AUDIO_FORMAT_EVRCB"/>
342 <xs:enumeration value="AUDIO_FORMAT_EVRCWB"/>
343 <xs:enumeration value="AUDIO_FORMAT_EVRCNW"/>
344 <xs:enumeration value="AUDIO_FORMAT_AAC_ADIF"/>
345 <xs:enumeration value="AUDIO_FORMAT_WMA"/>
346 <xs:enumeration value="AUDIO_FORMAT_WMA_PRO"/>
347 <xs:enumeration value="AUDIO_FORMAT_AMR_WB_PLUS"/>
348 <xs:enumeration value="AUDIO_FORMAT_MP2"/>
349 <xs:enumeration value="AUDIO_FORMAT_QCELP"/>
350 <xs:enumeration value="AUDIO_FORMAT_DSD"/>
351 <xs:enumeration value="AUDIO_FORMAT_FLAC"/>
352 <xs:enumeration value="AUDIO_FORMAT_ALAC"/>
353 <xs:enumeration value="AUDIO_FORMAT_APE"/>
354 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS"/>
355 <xs:enumeration value="AUDIO_FORMAT_SBC"/>
356 <xs:enumeration value="AUDIO_FORMAT_APTX"/>
357 <xs:enumeration value="AUDIO_FORMAT_APTX_HD"/>
358 <xs:enumeration value="AUDIO_FORMAT_AC4"/>
359 <xs:enumeration value="AUDIO_FORMAT_LDAC"/>
360 <xs:enumeration value="AUDIO_FORMAT_E_AC3_JOC"/>
361 <xs:enumeration value="AUDIO_FORMAT_MAT_1_0"/>
362 <xs:enumeration value="AUDIO_FORMAT_MAT_2_0"/>
363 <xs:enumeration value="AUDIO_FORMAT_MAT_2_1"/>
364 <xs:enumeration value="AUDIO_FORMAT_AAC_XHE"/>
365 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_XHE"/>
366 <xs:enumeration value="AUDIO_FORMAT_AAC_LATM"/>
367 <xs:enumeration value="AUDIO_FORMAT_AAC_LATM_LC"/>
368 <xs:enumeration value="AUDIO_FORMAT_AAC_LATM_HE_V1"/>
369 <xs:enumeration value="AUDIO_FORMAT_AAC_LATM_HE_V2"/>
370 <xs:enumeration value="AUDIO_FORMAT_CELT"/>
371 <xs:enumeration value="AUDIO_FORMAT_APTX_ADAPTIVE"/>
372 <xs:enumeration value="AUDIO_FORMAT_LHDC"/>
373 <xs:enumeration value="AUDIO_FORMAT_LHDC_LL"/>
374 <xs:enumeration value="AUDIO_FORMAT_APTX_TWSP"/>
375 </xs:restriction>
376 </xs:simpleType>
377 <xs:simpleType name="extendableAudioFormat">
378 <xs:union memberTypes="audioFormat vendorExtension"/>
379 </xs:simpleType>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000380 <xs:simpleType name="audioUsage">
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000381 <xs:annotation>
382 <xs:documentation xml:lang="en">
383 Audio usage specifies the intended use case for the sound being played.
384 Please consult frameworks/base/media/java/android/media/AudioAttributes.java
385 for the description of each value.
386 </xs:documentation>
387 </xs:annotation>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000388 <xs:restriction base="xs:string">
389 <xs:enumeration value="AUDIO_USAGE_UNKNOWN" />
390 <xs:enumeration value="AUDIO_USAGE_MEDIA" />
391 <xs:enumeration value="AUDIO_USAGE_VOICE_COMMUNICATION" />
392 <xs:enumeration value="AUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING" />
393 <xs:enumeration value="AUDIO_USAGE_ALARM" />
394 <xs:enumeration value="AUDIO_USAGE_NOTIFICATION" />
395 <xs:enumeration value="AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE" />
396 <xs:enumeration value="AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY" />
397 <xs:enumeration value="AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE" />
398 <xs:enumeration value="AUDIO_USAGE_ASSISTANCE_SONIFICATION" />
399 <xs:enumeration value="AUDIO_USAGE_GAME" />
400 <xs:enumeration value="AUDIO_USAGE_VIRTUAL_SOURCE" />
401 <xs:enumeration value="AUDIO_USAGE_ASSISTANT" />
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000402 <xs:enumeration value="AUDIO_USAGE_CALL_ASSISTANT" />
403 <xs:enumeration value="AUDIO_USAGE_EMERGENCY" />
404 <xs:enumeration value="AUDIO_USAGE_SAFETY" />
405 <xs:enumeration value="AUDIO_USAGE_VEHICLE_STATUS" />
406 <xs:enumeration value="AUDIO_USAGE_ANNOUNCEMENT" />
Mikhail Naganov159260c2020-07-23 18:08:26 +0000407 </xs:restriction>
408 </xs:simpleType>
409 <xs:simpleType name="audioUsageList">
410 <xs:list itemType="audioUsage"/>
411 </xs:simpleType>
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000412 <xs:simpleType name="audioContentType">
Mikhail Naganov159260c2020-07-23 18:08:26 +0000413 <xs:annotation>
414 <xs:documentation xml:lang="en">
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000415 Audio content type expresses the general category of the content.
416 Please consult frameworks/base/media/java/android/media/AudioAttributes.java
417 for the description of each value.
Mikhail Naganov159260c2020-07-23 18:08:26 +0000418 </xs:documentation>
419 </xs:annotation>
420 <xs:restriction base="xs:string">
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000421 <xs:enumeration value="AUDIO_CONTENT_TYPE_UNKNOWN"/>
422 <xs:enumeration value="AUDIO_CONTENT_TYPE_SPEECH"/>
423 <xs:enumeration value="AUDIO_CONTENT_TYPE_MUSIC"/>
424 <xs:enumeration value="AUDIO_CONTENT_TYPE_MOVIE"/>
425 <xs:enumeration value="AUDIO_CONTENT_TYPE_SONIFICATION"/>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000426 </xs:restriction>
427 </xs:simpleType>
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000428 <xs:simpleType name="samplingRates">
429 <xs:list itemType="xs:nonNegativeInteger" />
430 </xs:simpleType>
431 <xs:simpleType name="audioChannelMask">
432 <xs:annotation>
433 <xs:documentation xml:lang="en">
434 Audio channel mask specifies presence of particular channels.
435 There are two representations:
436 - representation position (traditional discrete channel specification,
437 e.g. "left", "right");
438 - indexed (this is similar to "tracks" in audio mixing, channels
439 are represented using numbers).
440 </xs:documentation>
441 </xs:annotation>
442 <xs:restriction base="xs:string">
443 <xs:enumeration value="AUDIO_CHANNEL_OUT_MONO"/>
444 <xs:enumeration value="AUDIO_CHANNEL_OUT_STEREO"/>
445 <xs:enumeration value="AUDIO_CHANNEL_OUT_2POINT1"/>
446 <xs:enumeration value="AUDIO_CHANNEL_OUT_2POINT0POINT2"/>
447 <xs:enumeration value="AUDIO_CHANNEL_OUT_2POINT1POINT2"/>
448 <xs:enumeration value="AUDIO_CHANNEL_OUT_3POINT0POINT2"/>
449 <xs:enumeration value="AUDIO_CHANNEL_OUT_3POINT1POINT2"/>
450 <xs:enumeration value="AUDIO_CHANNEL_OUT_QUAD"/>
451 <xs:enumeration value="AUDIO_CHANNEL_OUT_QUAD_BACK"/>
452 <xs:enumeration value="AUDIO_CHANNEL_OUT_QUAD_SIDE"/>
453 <xs:enumeration value="AUDIO_CHANNEL_OUT_SURROUND"/>
454 <xs:enumeration value="AUDIO_CHANNEL_OUT_PENTA"/>
455 <xs:enumeration value="AUDIO_CHANNEL_OUT_5POINT1"/>
456 <xs:enumeration value="AUDIO_CHANNEL_OUT_5POINT1_BACK"/>
457 <xs:enumeration value="AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
458 <xs:enumeration value="AUDIO_CHANNEL_OUT_5POINT1POINT2"/>
459 <xs:enumeration value="AUDIO_CHANNEL_OUT_5POINT1POINT4"/>
460 <xs:enumeration value="AUDIO_CHANNEL_OUT_6POINT1"/>
461 <xs:enumeration value="AUDIO_CHANNEL_OUT_7POINT1"/>
462 <xs:enumeration value="AUDIO_CHANNEL_OUT_7POINT1POINT2"/>
463 <xs:enumeration value="AUDIO_CHANNEL_OUT_7POINT1POINT4"/>
464 <xs:enumeration value="AUDIO_CHANNEL_OUT_MONO_HAPTIC_A"/>
465 <xs:enumeration value="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A"/>
466 <xs:enumeration value="AUDIO_CHANNEL_OUT_HAPTIC_AB"/>
467 <xs:enumeration value="AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB"/>
468 <xs:enumeration value="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
469 <xs:enumeration value="AUDIO_CHANNEL_IN_MONO"/>
470 <xs:enumeration value="AUDIO_CHANNEL_IN_STEREO"/>
471 <xs:enumeration value="AUDIO_CHANNEL_IN_FRONT_BACK"/>
472 <xs:enumeration value="AUDIO_CHANNEL_IN_6"/>
473 <xs:enumeration value="AUDIO_CHANNEL_IN_2POINT0POINT2"/>
474 <xs:enumeration value="AUDIO_CHANNEL_IN_2POINT1POINT2"/>
475 <xs:enumeration value="AUDIO_CHANNEL_IN_3POINT0POINT2"/>
476 <xs:enumeration value="AUDIO_CHANNEL_IN_3POINT1POINT2"/>
477 <xs:enumeration value="AUDIO_CHANNEL_IN_5POINT1"/>
478 <xs:enumeration value="AUDIO_CHANNEL_IN_VOICE_UPLINK_MONO"/>
479 <xs:enumeration value="AUDIO_CHANNEL_IN_VOICE_DNLINK_MONO"/>
480 <xs:enumeration value="AUDIO_CHANNEL_IN_VOICE_CALL_MONO"/>
481 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_1"/>
482 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_2"/>
483 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_3"/>
484 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_4"/>
485 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_5"/>
486 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_6"/>
487 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_7"/>
488 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_8"/>
489 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_9"/>
490 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_10"/>
491 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_11"/>
492 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_12"/>
493 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_13"/>
494 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_14"/>
495 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_15"/>
496 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_16"/>
497 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_17"/>
498 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_18"/>
499 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_19"/>
500 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_20"/>
501 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_21"/>
502 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_22"/>
503 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_23"/>
504 <xs:enumeration value="AUDIO_CHANNEL_INDEX_MASK_24"/>
505 </xs:restriction>
506 </xs:simpleType>
507 <xs:simpleType name="channelMasks">
508 <xs:list itemType="audioChannelMask" />
509 </xs:simpleType>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000510 <xs:complexType name="profile">
511 <xs:attribute name="name" type="xs:token" use="optional"/>
512 <xs:attribute name="format" type="extendableAudioFormat" use="optional"/>
513 <xs:attribute name="samplingRates" type="samplingRates" use="optional"/>
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000514 <xs:attribute name="channelMasks" type="channelMasks" use="optional"/>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000515 </xs:complexType>
516 <xs:simpleType name="gainMode">
517 <xs:restriction base="xs:string">
518 <xs:enumeration value="AUDIO_GAIN_MODE_JOINT"/>
519 <xs:enumeration value="AUDIO_GAIN_MODE_CHANNELS"/>
520 <xs:enumeration value="AUDIO_GAIN_MODE_RAMP"/>
521 </xs:restriction>
522 </xs:simpleType>
523 <xs:complexType name="gains">
524 <xs:sequence>
525 <xs:element name="gain" minOccurs="0" maxOccurs="unbounded">
526 <xs:complexType>
527 <xs:attribute name="name" type="xs:token" use="required"/>
528 <xs:attribute name="mode" type="gainMode" use="required"/>
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000529 <xs:attribute name="channel_mask" type="audioChannelMask" use="optional"/>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000530 <xs:attribute name="minValueMB" type="xs:int" use="optional"/>
531 <xs:attribute name="maxValueMB" type="xs:int" use="optional"/>
532 <xs:attribute name="defaultValueMB" type="xs:int" use="optional"/>
533 <xs:attribute name="stepValueMB" type="xs:int" use="optional"/>
534 <xs:attribute name="minRampMs" type="xs:int" use="optional"/>
535 <xs:attribute name="maxRampMs" type="xs:int" use="optional"/>
536 <xs:attribute name="useForVolume" type="xs:boolean" use="optional"/>
537 </xs:complexType>
538 </xs:element>
539 </xs:sequence>
540 </xs:complexType>
541 <xs:complexType name="devicePorts">
542 <xs:sequence>
543 <xs:element name="devicePort" minOccurs="0" maxOccurs="unbounded">
544 <xs:complexType>
545 <xs:sequence>
546 <xs:element name="profile" type="profile" minOccurs="0" maxOccurs="unbounded"/>
547 <xs:element name="gains" type="gains" minOccurs="0"/>
548 </xs:sequence>
549 <xs:attribute name="tagName" type="xs:token" use="required"/>
550 <xs:attribute name="type" type="extendableAudioDevice" use="required"/>
551 <xs:attribute name="role" type="role" use="required"/>
552 <xs:attribute name="address" type="xs:string" use="optional" default=""/>
553 <!-- Note that XSD 1.0 can not check that a type only has one default. -->
554 <xs:attribute name="default" type="xs:boolean" use="optional">
555 <xs:annotation>
556 <xs:documentation xml:lang="en">
557 The default device will be used if multiple have the same type
558 and no explicit route request exists for a specific device of
559 that type.
560 </xs:documentation>
561 </xs:annotation>
562 </xs:attribute>
563 <xs:attribute name="encodedFormats" type="audioFormatsList" use="optional"
564 default="" />
565 </xs:complexType>
566 <xs:unique name="devicePortProfileUniqueness">
567 <xs:selector xpath="profile"/>
568 <xs:field xpath="format"/>
569 <xs:field xpath="samplingRate"/>
570 <xs:field xpath="channelMasks"/>
571 </xs:unique>
572 <xs:unique name="devicePortGainUniqueness">
573 <xs:selector xpath="gains/gain"/>
574 <xs:field xpath="@name"/>
575 </xs:unique>
576 </xs:element>
577 </xs:sequence>
578 </xs:complexType>
579 <xs:simpleType name="mixType">
580 <xs:restriction base="xs:string">
581 <xs:enumeration value="mix"/>
582 <xs:enumeration value="mux"/>
583 </xs:restriction>
584 </xs:simpleType>
585 <xs:complexType name="routes">
586 <xs:sequence>
587 <xs:element name="route" minOccurs="0" maxOccurs="unbounded">
588 <xs:annotation>
589 <xs:documentation xml:lang="en">
590 List all available sources for a given sink.
591 </xs:documentation>
592 </xs:annotation>
593 <xs:complexType>
594 <xs:attribute name="type" type="mixType" use="required"/>
595 <xs:attribute name="sink" type="xs:string" use="required"/>
596 <xs:attribute name="sources" type="xs:string" use="required"/>
597 </xs:complexType>
598 </xs:element>
599 </xs:sequence>
600 </xs:complexType>
601 <xs:complexType name="volumes">
602 <xs:sequence>
603 <xs:element name="volume" type="volume" minOccurs="0" maxOccurs="unbounded"/>
604 <xs:element name="reference" type="reference" minOccurs="0" maxOccurs="unbounded">
605 </xs:element>
606 </xs:sequence>
607 </xs:complexType>
608 <!-- TODO: Always require a ref for better xsd validations.
609 Currently a volume could have no points nor ref
610 as it can not be forbidden by xsd 1.0.-->
611 <xs:simpleType name="volumePoint">
612 <xs:annotation>
613 <xs:documentation xml:lang="en">
614 Comma separated pair of number.
615 The fist one is the framework level (between 0 and 100).
616 The second one is the volume to send to the HAL.
617 The framework will interpolate volumes not specified.
618 Their MUST be at least 2 points specified.
619 </xs:documentation>
620 </xs:annotation>
621 <xs:restriction base="xs:string">
622 <xs:pattern value="([0-9]{1,2}|100),-?[0-9]+"/>
623 </xs:restriction>
624 </xs:simpleType>
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000625 <xs:simpleType name="audioStreamType">
626 <xs:annotation>
627 <xs:documentation xml:lang="en">
628 Audio stream type describing the intended use case of a stream.
629 Please consult frameworks/base/media/java/android/media/AudioSystem.java
630 for the description of each value.
631 </xs:documentation>
632 </xs:annotation>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000633 <xs:restriction base="xs:string">
634 <xs:enumeration value="AUDIO_STREAM_VOICE_CALL"/>
635 <xs:enumeration value="AUDIO_STREAM_SYSTEM"/>
636 <xs:enumeration value="AUDIO_STREAM_RING"/>
637 <xs:enumeration value="AUDIO_STREAM_MUSIC"/>
638 <xs:enumeration value="AUDIO_STREAM_ALARM"/>
639 <xs:enumeration value="AUDIO_STREAM_NOTIFICATION"/>
640 <xs:enumeration value="AUDIO_STREAM_BLUETOOTH_SCO"/>
641 <xs:enumeration value="AUDIO_STREAM_ENFORCED_AUDIBLE"/>
642 <xs:enumeration value="AUDIO_STREAM_DTMF"/>
643 <xs:enumeration value="AUDIO_STREAM_TTS"/>
644 <xs:enumeration value="AUDIO_STREAM_ACCESSIBILITY"/>
645 <xs:enumeration value="AUDIO_STREAM_ASSISTANT"/>
646 <xs:enumeration value="AUDIO_STREAM_REROUTING"/>
647 <xs:enumeration value="AUDIO_STREAM_PATCH"/>
648 </xs:restriction>
649 </xs:simpleType>
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000650 <xs:simpleType name="audioSource">
651 <xs:annotation>
652 <xs:documentation xml:lang="en">
653 An audio source defines the intended use case for the sound being recorded.
654 Please consult frameworks/base/media/java/android/media/MediaRecorder.java
655 for the description of each value.
656 </xs:documentation>
657 </xs:annotation>
658 <xs:restriction base="xs:string">
659 <xs:enumeration value="AUDIO_SOURCE_DEFAULT"/>
660 <xs:enumeration value="AUDIO_SOURCE_MIC"/>
661 <xs:enumeration value="AUDIO_SOURCE_VOICE_UPLINK"/>
662 <xs:enumeration value="AUDIO_SOURCE_VOICE_DOWNLINK"/>
663 <xs:enumeration value="AUDIO_SOURCE_VOICE_CALL"/>
664 <xs:enumeration value="AUDIO_SOURCE_CAMCORDER"/>
665 <xs:enumeration value="AUDIO_SOURCE_VOICE_RECOGNITION"/>
666 <xs:enumeration value="AUDIO_SOURCE_VOICE_COMMUNICATION"/>
667 <xs:enumeration value="AUDIO_SOURCE_REMOTE_SUBMIX"/>
668 <xs:enumeration value="AUDIO_SOURCE_UNPROCESSED"/>
669 <xs:enumeration value="AUDIO_SOURCE_VOICE_PERFORMANCE"/>
670 <xs:enumeration value="AUDIO_SOURCE_ECHO_REFERENCE"/>
671 <xs:enumeration value="AUDIO_SOURCE_FM_TUNER"/>
672 <xs:enumeration value="AUDIO_SOURCE_HOTWORD"/>
673 </xs:restriction>
674 </xs:simpleType>
675 <!-- Enum values of device_category from Volume.h. -->
Mikhail Naganov159260c2020-07-23 18:08:26 +0000676 <xs:simpleType name="deviceCategory">
677 <xs:restriction base="xs:string">
678 <xs:enumeration value="DEVICE_CATEGORY_HEADSET"/>
679 <xs:enumeration value="DEVICE_CATEGORY_SPEAKER"/>
680 <xs:enumeration value="DEVICE_CATEGORY_EARPIECE"/>
681 <xs:enumeration value="DEVICE_CATEGORY_EXT_MEDIA"/>
682 <xs:enumeration value="DEVICE_CATEGORY_HEARING_AID"/>
683 </xs:restriction>
684 </xs:simpleType>
685 <xs:complexType name="volume">
686 <xs:annotation>
687 <xs:documentation xml:lang="en">
688 Volume section defines a volume curve for a given use case and device category.
689 It contains a list of points of this curve expressing the attenuation in Millibels
690 for a given volume index from 0 to 100.
691 <volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_SPEAKER">
692 <point>0,-9600</point>
693 <point>100,0</point>
694 </volume>
695
696 It may also reference a reference/@name to avoid duplicating curves.
697 <volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_SPEAKER"
698 ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
699 <reference name="DEFAULT_MEDIA_VOLUME_CURVE">
700 <point>0,-9600</point>
701 <point>100,0</point>
702 </reference>
703 </xs:documentation>
704 </xs:annotation>
705 <xs:sequence>
706 <xs:element name="point" type="volumePoint" minOccurs="0" maxOccurs="unbounded"/>
707 </xs:sequence>
Mikhail Naganov7dd87f42020-08-04 23:37:05 +0000708 <xs:attribute name="stream" type="audioStreamType"/>
Mikhail Naganov159260c2020-07-23 18:08:26 +0000709 <xs:attribute name="deviceCategory" type="deviceCategory"/>
710 <xs:attribute name="ref" type="xs:token" use="optional"/>
711 </xs:complexType>
712 <xs:complexType name="reference">
713 <xs:sequence>
714 <xs:element name="point" type="volumePoint" minOccurs="2" maxOccurs="unbounded"/>
715 </xs:sequence>
716 <xs:attribute name="name" type="xs:token" use="required"/>
717 </xs:complexType>
718 <xs:complexType name="surroundSound">
719 <xs:annotation>
720 <xs:documentation xml:lang="en">
721 Surround Sound section provides configuration related to handling of
722 multi-channel formats.
723 </xs:documentation>
724 </xs:annotation>
725 <xs:sequence>
726 <xs:element name="formats" type="surroundFormats"/>
727 </xs:sequence>
728 </xs:complexType>
729 <xs:simpleType name="audioFormatsList">
730 <xs:list itemType="audioFormat" />
731 </xs:simpleType>
732 <xs:complexType name="surroundFormats">
733 <xs:sequence>
734 <xs:element name="format" minOccurs="0" maxOccurs="unbounded">
735 <xs:complexType>
736 <xs:attribute name="name" type="audioFormat" use="required"/>
737 <xs:attribute name="subformats" type="audioFormatsList" />
738 </xs:complexType>
739 </xs:element>
740 </xs:sequence>
741 </xs:complexType>
742 <xs:simpleType name="engineSuffix">
743 <xs:restriction base="xs:string">
744 <xs:enumeration value="default"/>
745 <xs:enumeration value="configurable"/>
746 </xs:restriction>
747 </xs:simpleType>
748</xs:schema>