blob: 8c05763dd2e7d15897301798a14b72a169faa1dd [file] [log] [blame]
Eric Laurent524bdd32017-05-17 18:32:36 -07001<?xml version="1.0" encoding="UTF-8"?>
2<!-- Copyright (C) 2017 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-->
16<!-- TODO: define a targetNamespace. Note that it will break retrocompatibility -->
17<xs:schema version="2.0"
18 elementFormDefault="qualified"
19 attributeFormDefault="unqualified"
20 xmlns:xs="http://www.w3.org/2001/XMLSchema">
21 <!-- List the config versions supported by audio policy. -->
22 <xs:simpleType name="version">
23 <xs:restriction base="xs:decimal">
24 <xs:enumeration value="1.0"/>
25 </xs:restriction>
26 </xs:simpleType>
27 <xs:simpleType name="halVersion">
28 <xs:annotation>
29 <xs:documentation xml:lang="en">
30 Version of the interface the hal implements.
31 </xs:documentation>
32 </xs:annotation>
33 <xs:restriction base="xs:decimal">
34 <!-- List of HAL versions supported by the framework. -->
35 <xs:enumeration value="2.0"/>
36 <xs:enumeration value="3.0"/>
37 </xs:restriction>
38 </xs:simpleType>
39 <xs:element name="audioPolicyConfiguration">
40 <xs:complexType>
41 <xs:sequence>
42 <xs:element name="globalConfiguration" type="globalConfiguration"/>
43 <xs:element name="modules" type="modules" maxOccurs="unbounded"/>
44 <xs:element name="volumes" type="volumes" maxOccurs="unbounded"/>
45 </xs:sequence>
46 <xs:attribute name="version" type="version"/>
47 </xs:complexType>
48 <xs:key name="moduleNameKey">
49 <xs:selector xpath="modules/module"/>
50 <xs:field xpath="@name"/>
51 </xs:key>
52 <xs:key name="devicePortNameGlobalKey">
53 <xs:selector xpath="modules/module/devicePorts/devicePort"/>
54 <xs:field xpath="@tagName"/>
55 </xs:key>
56 <xs:unique name="volumeTargetUniqueness">
57 <xs:selector xpath="volumes/volume"/>
58 <xs:field xpath="@stream"/>
59 <xs:field xpath="@deviceCategory"/>
60 </xs:unique>
61 <xs:key name="volumeCurveNameKey">
62 <xs:selector xpath="volumes/reference"/>
63 <xs:field xpath="@name"/>
64 </xs:key>
65 <xs:keyref name="volumeCurveRef" refer="volumeCurveNameKey">
66 <xs:selector xpath="volumes/volume"/>
67 <xs:field xpath="@ref"/>
68 </xs:keyref>
69 </xs:element>
70 <xs:complexType name="globalConfiguration">
71 <xs:attribute name="speaker_drc_enabled" type="xs:boolean" use="required"/>
72 </xs:complexType>
73 <!-- Enum values of IDevicesFactory::Device
74 TODO: generate from hidl to avoid manual sync. -->
75 <xs:simpleType name="halName">
Kevin Rocard7558e8c2017-11-22 16:15:26 -080076 <xs:union>
77 <xs:simpleType>
78 <xs:restriction base="xs:string">
79 <xs:enumeration value="primary"/>
80 <xs:enumeration value="a2dp"/>
81 <xs:enumeration value="usb"/>
82 <xs:enumeration value="r_submix"/>
83 <xs:enumeration value="codec_offload"/>
84 <xs:enumeration value="stub"/>
85 </xs:restriction>
86 </xs:simpleType>
87 <xs:simpleType>
88 <!-- Vendor eXtension names must be in the vx namespace.
89 Vendor are encouraged to namespace their module names.
90 Example for an hypothetical Google virtual reality HAL:
91 <module name="vx_google_vr" halVersion="3.0">
92 -->
93 <xs:restriction base="xs:string">
94 <xs:pattern value="vx_[_a-zA-Z0-9]+"/>
95 </xs:restriction>
96 </xs:simpleType>
97 </xs:union>
Eric Laurent524bdd32017-05-17 18:32:36 -070098 </xs:simpleType>
99 <xs:complexType name="modules">
100 <xs:annotation>
101 <xs:documentation xml:lang="en">
102 There should be one section per audio HW module present on the platform.
103 Each <module/> contains two mandatory tags: “halVersion” and “name”.
104 The module "name" is the same as in previous .conf file.
105 Each module must contain the following sections:
106 - <devicePorts/>: a list of device descriptors for all
107 input and output devices accessible via this module.
108 This contains both permanently attached devices and removable devices.
109 - <mixPorts/>: listing all output and input streams exposed by the audio HAL
110 - <routes/>: list of possible connections between input
111 and output devices or between stream and devices.
112 A <route/> is defined by a set of 3 attributes:
113 -"type": mux|mix means all sources are mutual exclusive (mux) or can be mixed (mix)
114 -"sink": the sink involved in this route
115 -"sources": all the sources than can be connected to the sink via this route
116 - <attachedDevices/>: permanently attached devices.
117 The attachedDevices section is a list of devices names.
118 Their names correspond to device names defined in "devicePorts" section.
119 - <defaultOutputDevice/> is the device to be used when no policy rule applies
120 </xs:documentation>
121 </xs:annotation>
122 <xs:sequence>
123 <xs:element name="module" maxOccurs="unbounded">
124 <xs:complexType>
125 <xs:sequence>
126 <xs:element name="attachedDevices" type="attachedDevices" minOccurs="0">
127 <xs:unique name="attachedDevicesUniqueness">
128 <xs:selector xpath="item"/>
129 <xs:field xpath="."/>
130 </xs:unique>
131 </xs:element>
132 <xs:element name="defaultOutputDevice" type="xs:token" minOccurs="0"/>
133 <xs:element name="mixPorts" type="mixPorts" minOccurs="0"/>
134 <xs:element name="devicePorts" type="devicePorts" minOccurs="0"/>
135 <xs:element name="routes" type="routes" minOccurs="0"/>
136 </xs:sequence>
137 <xs:attribute name="name" type="halName" use="required"/>
138 <xs:attribute name="halVersion" type="halVersion" use="required"/>
139 </xs:complexType>
140 <xs:unique name="mixPortNameUniqueness">
141 <xs:selector xpath="mixPorts/mixPort"/>
142 <xs:field xpath="@name"/>
143 </xs:unique>
144 <!-- Although this key constraint is redundant with devicePortNameGlobalKey,
145 the set is used to constraint defaultOutputDevice and attachedDevice
146 to reference a devicePort of the same module. -->
147 <xs:key name="devicePortNameKey">
148 <xs:selector xpath="devicePorts/devicePort"/>
149 <xs:field xpath="@tagName"/>
150 </xs:key>
151 <xs:keyref name="defaultOutputDeviceRef" refer="devicePortNameKey">
152 <xs:selector xpath="defaultOutputDevice"/>
153 <xs:field xpath="."/>
154 </xs:keyref>
155 <xs:keyref name="attachedDeviceRef" refer="devicePortNameKey">
156 <xs:selector xpath="attachedDevices/item"/>
157 <xs:field xpath="."/>
158 </xs:keyref>
159 <!-- The following 3 constraints try to make sure each sink port
160 is reference in one an only one route. -->
161 <xs:key name="routeSinkKey">
162 <!-- predicate [@type='sink'] does not work in xsd 1.0 -->
163 <xs:selector xpath="devicePorts/devicePort|mixPorts/mixPort"/>
164 <xs:field xpath="@tagName|@name"/>
165 </xs:key>
166 <xs:keyref name="routeSinkRef" refer="routeSinkKey">
167 <xs:selector xpath="routes/route"/>
168 <xs:field xpath="@sink"/>
169 </xs:keyref>
170 <xs:unique name="routeUniqueness">
171 <xs:selector xpath="routes/route"/>
172 <xs:field xpath="@sink"/>
173 </xs:unique>
174 </xs:element>
175 </xs:sequence>
176 </xs:complexType>
177 <xs:complexType name="attachedDevices">
178 <xs:sequence>
179 <xs:element name="item" type="xs:token" minOccurs="0" maxOccurs="unbounded"/>
180 </xs:sequence>
181 </xs:complexType>
182 <!-- TODO: separate values by space for better xsd validations. -->
183 <xs:simpleType name="audioInOutFlags">
184 <xs:annotation>
185 <xs:documentation xml:lang="en">
186 "|" separated list of audio_output_flags_t or audio_input_flags_t.
187 </xs:documentation>
188 </xs:annotation>
189 <xs:restriction base="xs:string">
190 <xs:pattern value="|[_A-Z]+(\|[_A-Z]+)*"/>
191 </xs:restriction>
192 </xs:simpleType>
193 <xs:simpleType name="role">
194 <xs:restriction base="xs:string">
195 <xs:enumeration value="sink"/>
196 <xs:enumeration value="source"/>
197 </xs:restriction>
198 </xs:simpleType>
199 <xs:complexType name="mixPorts">
200 <xs:sequence>
201 <xs:element name="mixPort" minOccurs="0" maxOccurs="unbounded">
202 <xs:complexType>
203 <xs:sequence>
204 <xs:element name="profile" type="profile" minOccurs="0" maxOccurs="unbounded"/>
Kevin Rocard488beb22017-07-27 11:41:53 -0700205 <xs:element name="gains" type="gains" minOccurs="0"/>
Eric Laurent524bdd32017-05-17 18:32:36 -0700206 </xs:sequence>
207 <xs:attribute name="name" type="xs:token" use="required"/>
208 <xs:attribute name="role" type="role" use="required"/>
209 <xs:attribute name="flags" type="audioInOutFlags"/>
210 </xs:complexType>
211 <xs:unique name="mixPortProfileUniqueness">
212 <xs:selector xpath="profile"/>
213 <xs:field xpath="format"/>
214 <xs:field xpath="samplingRate"/>
215 <xs:field xpath="channelMasks"/>
216 </xs:unique>
Kevin Rocard488beb22017-07-27 11:41:53 -0700217 <xs:unique name="mixPortGainUniqueness">
218 <xs:selector xpath="gains/gain"/>
219 <xs:field xpath="@name"/>
220 </xs:unique>
Eric Laurent524bdd32017-05-17 18:32:36 -0700221 </xs:element>
222 </xs:sequence>
223 </xs:complexType>
224 <!-- Enum values of audio_device_t in audio.h
225 TODO: generate from hidl to avoid manual sync.
226 TODO: separate source and sink in the xml for better xsd validations. -->
227 <xs:simpleType name="audioDevice">
228 <xs:restriction base="xs:string">
229 <xs:enumeration value="AUDIO_DEVICE_NONE"/>
230
231 <xs:enumeration value="AUDIO_DEVICE_OUT_EARPIECE"/>
232 <xs:enumeration value="AUDIO_DEVICE_OUT_SPEAKER"/>
233 <xs:enumeration value="AUDIO_DEVICE_OUT_SPEAKER_SAFE"/>
234 <xs:enumeration value="AUDIO_DEVICE_OUT_WIRED_HEADSET"/>
235 <xs:enumeration value="AUDIO_DEVICE_OUT_WIRED_HEADPHONE"/>
236 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO"/>
237 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET"/>
238 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT"/>
239 <xs:enumeration value="AUDIO_DEVICE_OUT_ALL_SCO"/>
240 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP"/>
241 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES"/>
242 <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER"/>
243 <xs:enumeration value="AUDIO_DEVICE_OUT_ALL_A2DP"/>
244 <xs:enumeration value="AUDIO_DEVICE_OUT_AUX_DIGITAL"/>
245 <xs:enumeration value="AUDIO_DEVICE_OUT_HDMI"/>
246 <xs:enumeration value="AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET"/>
247 <xs:enumeration value="AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET"/>
248 <xs:enumeration value="AUDIO_DEVICE_OUT_USB_ACCESSORY"/>
249 <xs:enumeration value="AUDIO_DEVICE_OUT_USB_DEVICE"/>
250 <xs:enumeration value="AUDIO_DEVICE_OUT_ALL_USB"/>
251 <xs:enumeration value="AUDIO_DEVICE_OUT_REMOTE_SUBMIX"/>
252 <xs:enumeration value="AUDIO_DEVICE_OUT_TELEPHONY_TX"/>
253 <xs:enumeration value="AUDIO_DEVICE_OUT_LINE"/>
254 <xs:enumeration value="AUDIO_DEVICE_OUT_HDMI_ARC"/>
255 <xs:enumeration value="AUDIO_DEVICE_OUT_SPDIF"/>
256 <xs:enumeration value="AUDIO_DEVICE_OUT_FM"/>
257 <xs:enumeration value="AUDIO_DEVICE_OUT_AUX_LINE"/>
258 <xs:enumeration value="AUDIO_DEVICE_OUT_IP"/>
259 <xs:enumeration value="AUDIO_DEVICE_OUT_BUS"/>
260 <xs:enumeration value="AUDIO_DEVICE_OUT_PROXY"/>
261 <xs:enumeration value="AUDIO_DEVICE_OUT_USB_HEADSET"/>
262 <xs:enumeration value="AUDIO_DEVICE_OUT_DEFAULT"/>
263 <xs:enumeration value="AUDIO_DEVICE_OUT_STUB"/>
264
265 <!-- Due to the xml format, IN types can not be a separated from OUT types -->
266 <xs:enumeration value="AUDIO_DEVICE_IN_COMMUNICATION"/>
267 <xs:enumeration value="AUDIO_DEVICE_IN_AMBIENT"/>
268 <xs:enumeration value="AUDIO_DEVICE_IN_BUILTIN_MIC"/>
269 <xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET"/>
270 <xs:enumeration value="AUDIO_DEVICE_IN_ALL_SCO"/>
271 <xs:enumeration value="AUDIO_DEVICE_IN_WIRED_HEADSET"/>
272 <xs:enumeration value="AUDIO_DEVICE_IN_AUX_DIGITAL"/>
273 <xs:enumeration value="AUDIO_DEVICE_IN_HDMI"/>
274 <xs:enumeration value="AUDIO_DEVICE_IN_TELEPHONY_RX"/>
275 <xs:enumeration value="AUDIO_DEVICE_IN_VOICE_CALL"/>
276 <xs:enumeration value="AUDIO_DEVICE_IN_BACK_MIC"/>
277 <xs:enumeration value="AUDIO_DEVICE_IN_REMOTE_SUBMIX"/>
278 <xs:enumeration value="AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET"/>
279 <xs:enumeration value="AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET"/>
280 <xs:enumeration value="AUDIO_DEVICE_IN_USB_ACCESSORY"/>
281 <xs:enumeration value="AUDIO_DEVICE_IN_USB_DEVICE"/>
282 <xs:enumeration value="AUDIO_DEVICE_IN_ALL_USB"/>
283 <xs:enumeration value="AUDIO_DEVICE_IN_FM_TUNER"/>
284 <xs:enumeration value="AUDIO_DEVICE_IN_TV_TUNER"/>
285 <xs:enumeration value="AUDIO_DEVICE_IN_LINE"/>
286 <xs:enumeration value="AUDIO_DEVICE_IN_SPDIF"/>
287 <xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_A2DP"/>
288 <xs:enumeration value="AUDIO_DEVICE_IN_LOOPBACK"/>
289 <xs:enumeration value="AUDIO_DEVICE_IN_IP"/>
290 <xs:enumeration value="AUDIO_DEVICE_IN_BUS"/>
291 <xs:enumeration value="AUDIO_DEVICE_IN_PROXY"/>
292 <xs:enumeration value="AUDIO_DEVICE_IN_USB_HEADSET"/>
293 <xs:enumeration value="AUDIO_DEVICE_IN_DEFAULT"/>
294 <xs:enumeration value="AUDIO_DEVICE_IN_STUB"/>
295 </xs:restriction>
296 </xs:simpleType>
297 <!-- Enum values of audio_format_t in audio.h
298 TODO: generate from hidl to avoid manual sync. -->
299 <xs:simpleType name="audioFormat">
300 <xs:restriction base="xs:string">
301 <xs:enumeration value="AUDIO_FORMAT_PCM_16_BIT" />
302 <xs:enumeration value="AUDIO_FORMAT_PCM_8_BIT"/>
303 <xs:enumeration value="AUDIO_FORMAT_PCM_32_BIT"/>
304 <xs:enumeration value="AUDIO_FORMAT_PCM_8_24_BIT"/>
305 <xs:enumeration value="AUDIO_FORMAT_PCM_FLOAT"/>
306 <xs:enumeration value="AUDIO_FORMAT_PCM_24_BIT_PACKED"/>
307 <xs:enumeration value="AUDIO_FORMAT_MP3"/>
308 <xs:enumeration value="AUDIO_FORMAT_AMR_NB"/>
309 <xs:enumeration value="AUDIO_FORMAT_AMR_WB"/>
310 <xs:enumeration value="AUDIO_FORMAT_AAC"/>
311 <xs:enumeration value="AUDIO_FORMAT_AAC_MAIN"/>
312 <xs:enumeration value="AUDIO_FORMAT_AAC_LC"/>
313 <xs:enumeration value="AUDIO_FORMAT_AAC_SSR"/>
314 <xs:enumeration value="AUDIO_FORMAT_AAC_LTP"/>
315 <xs:enumeration value="AUDIO_FORMAT_AAC_HE_V1"/>
316 <xs:enumeration value="AUDIO_FORMAT_AAC_SCALABLE"/>
317 <xs:enumeration value="AUDIO_FORMAT_AAC_ERLC"/>
318 <xs:enumeration value="AUDIO_FORMAT_AAC_LD"/>
319 <xs:enumeration value="AUDIO_FORMAT_AAC_HE_V2"/>
320 <xs:enumeration value="AUDIO_FORMAT_AAC_ELD"/>
321 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_MAIN"/>
322 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LC"/>
323 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SSR"/>
324 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LTP"/>
325 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V1"/>
326 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SCALABLE"/>
327 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ERLC"/>
328 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LD"/>
329 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V2"/>
330 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ELD"/>
331 <xs:enumeration value="AUDIO_FORMAT_VORBIS"/>
332 <xs:enumeration value="AUDIO_FORMAT_HE_AAC_V1"/>
333 <xs:enumeration value="AUDIO_FORMAT_HE_AAC_V2"/>
334 <xs:enumeration value="AUDIO_FORMAT_OPUS"/>
335 <xs:enumeration value="AUDIO_FORMAT_AC3"/>
336 <xs:enumeration value="AUDIO_FORMAT_E_AC3"/>
337 <xs:enumeration value="AUDIO_FORMAT_DTS"/>
338 <xs:enumeration value="AUDIO_FORMAT_DTS_HD"/>
339 <xs:enumeration value="AUDIO_FORMAT_IEC61937"/>
340 <xs:enumeration value="AUDIO_FORMAT_DOLBY_TRUEHD"/>
341 <xs:enumeration value="AUDIO_FORMAT_EVRC"/>
342 <xs:enumeration value="AUDIO_FORMAT_EVRCB"/>
343 <xs:enumeration value="AUDIO_FORMAT_EVRCWB"/>
344 <xs:enumeration value="AUDIO_FORMAT_EVRCNW"/>
345 <xs:enumeration value="AUDIO_FORMAT_AAC_ADIF"/>
346 <xs:enumeration value="AUDIO_FORMAT_WMA"/>
347 <xs:enumeration value="AUDIO_FORMAT_WMA_PRO"/>
348 <xs:enumeration value="AUDIO_FORMAT_AMR_WB_PLUS"/>
349 <xs:enumeration value="AUDIO_FORMAT_MP2"/>
350 <xs:enumeration value="AUDIO_FORMAT_QCELP"/>
351 <xs:enumeration value="AUDIO_FORMAT_DSD"/>
352 <xs:enumeration value="AUDIO_FORMAT_FLAC"/>
353 <xs:enumeration value="AUDIO_FORMAT_ALAC"/>
354 <xs:enumeration value="AUDIO_FORMAT_APE"/>
355 <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS"/>
356 <xs:enumeration value="AUDIO_FORMAT_SBC"/>
357 <xs:enumeration value="AUDIO_FORMAT_APTX"/>
358 <xs:enumeration value="AUDIO_FORMAT_APTX_HD"/>
359 <xs:enumeration value="AUDIO_FORMAT_AC4"/>
360 <xs:enumeration value="AUDIO_FORMAT_LDAC"/>
361 </xs:restriction>
362 </xs:simpleType>
363 <!-- TODO: Change to a space separated list to xsd enforce correctness. -->
364 <xs:simpleType name="samplingRates">
365 <xs:restriction base="xs:string">
366 <xs:pattern value="[0-9]+(,[0-9]+)*"/>
367 </xs:restriction>
368 </xs:simpleType>
369 <!-- TODO: Change to a space separated list to xsd enforce correctness. -->
370 <xs:simpleType name="channelMask">
371 <xs:annotation>
372 <xs:documentation xml:lang="en">
373 Comma (",") separated list of channel flags
374 from audio_channel_mask_t.
375 </xs:documentation>
376 </xs:annotation>
377 <xs:restriction base="xs:string">
378 <xs:pattern value="[_A-Z][_A-Z0-9]*(,[_A-Z][_A-Z0-9]*)*"/>
379 </xs:restriction>
380 </xs:simpleType>
381 <xs:complexType name="profile">
Kevin Rocard3092b312017-08-31 16:45:08 -0700382 <xs:attribute name="name" type="xs:token" use="optional"/>
383 <xs:attribute name="format" type="audioFormat" use="optional"/>
384 <xs:attribute name="samplingRates" type="samplingRates" use="optional"/>
385 <xs:attribute name="channelMasks" type="channelMask" use="optional"/>
Eric Laurent524bdd32017-05-17 18:32:36 -0700386 </xs:complexType>
Kevin Rocard488beb22017-07-27 11:41:53 -0700387 <xs:simpleType name="gainMode">
388 <xs:restriction base="xs:string">
389 <xs:enumeration value="AUDIO_GAIN_MODE_JOINT"/>
390 <xs:enumeration value="AUDIO_GAIN_MODE_CHANNELS"/>
391 <xs:enumeration value="AUDIO_GAIN_MODE_RAMP"/>
392 </xs:restriction>
393 </xs:simpleType>
394 <xs:complexType name="gains">
395 <xs:sequence>
396 <xs:element name="gain" minOccurs="0" maxOccurs="unbounded">
397 <xs:complexType>
398 <xs:attribute name="name" type="xs:token" use="required"/>
399 <xs:attribute name="mode" type="gainMode" use="required"/>
400 <xs:attribute name="channel_mask" type="channelMask" use="optional"/>
401 <xs:attribute name="minValueMB" type="xs:int" use="optional"/>
402 <xs:attribute name="maxValueMB" type="xs:int" use="optional"/>
403 <xs:attribute name="defaultValueMB" type="xs:int" use="optional"/>
404 <xs:attribute name="stepValueMB" type="xs:int" use="optional"/>
405 <xs:attribute name="minRampMs" type="xs:int" use="optional"/>
406 <xs:attribute name="maxRampMs" type="xs:int" use="optional"/>
407 </xs:complexType>
408 </xs:element>
409 </xs:sequence>
410 </xs:complexType>
Eric Laurent524bdd32017-05-17 18:32:36 -0700411 <xs:complexType name="devicePorts">
412 <xs:sequence>
413 <xs:element name="devicePort" minOccurs="0" maxOccurs="unbounded">
414 <xs:complexType>
415 <xs:sequence>
416 <xs:element name="profile" type="profile" minOccurs="0" maxOccurs="unbounded"/>
Kevin Rocard488beb22017-07-27 11:41:53 -0700417 <xs:element name="gains" type="gains" minOccurs="0"/>
Eric Laurent524bdd32017-05-17 18:32:36 -0700418 </xs:sequence>
419 <xs:attribute name="tagName" type="xs:token" use="required"/>
420 <xs:attribute name="type" type="audioDevice" use="required"/>
421 <xs:attribute name="role" type="role" use="required"/>
Kevin Rocard488beb22017-07-27 11:41:53 -0700422 <xs:attribute name="address" type="xs:string" use="optional"/>
Eric Laurent524bdd32017-05-17 18:32:36 -0700423 </xs:complexType>
424 <xs:unique name="devicePortProfileUniqueness">
425 <xs:selector xpath="profile"/>
426 <xs:field xpath="format"/>
427 <xs:field xpath="samplingRate"/>
428 <xs:field xpath="channelMasks"/>
429 </xs:unique>
Kevin Rocard488beb22017-07-27 11:41:53 -0700430 <xs:unique name="devicePortGainUniqueness">
431 <xs:selector xpath="gains/gain"/>
432 <xs:field xpath="@name"/>
433 </xs:unique>
Eric Laurent524bdd32017-05-17 18:32:36 -0700434 </xs:element>
435 </xs:sequence>
436 </xs:complexType>
437 <xs:simpleType name="mixType">
438 <xs:restriction base="xs:string">
439 <xs:enumeration value="mix"/>
440 <xs:enumeration value="mux"/>
441 </xs:restriction>
442 </xs:simpleType>
443 <xs:complexType name="routes">
444 <xs:sequence>
445 <xs:element name="route" minOccurs="0" maxOccurs="unbounded">
446 <xs:annotation>
447 <xs:documentation xml:lang="en">
448 List all available sources for a given sink.
449 </xs:documentation>
450 </xs:annotation>
451 <xs:complexType>
452 <xs:attribute name="type" type="mixType" use="required"/>
453 <xs:attribute name="sink" type="xs:string" use="required"/>
454 <xs:attribute name="sources" type="xs:string" use="required"/>
455 </xs:complexType>
456 </xs:element>
457 </xs:sequence>
458 </xs:complexType>
459 <xs:complexType name="volumes">
460 <xs:sequence>
461 <xs:element name="volume" type="volume" minOccurs="0" maxOccurs="unbounded"/>
462 <xs:element name="reference" type="reference" minOccurs="0" maxOccurs="unbounded">
463 </xs:element>
464 </xs:sequence>
465 </xs:complexType>
466 <!-- TODO: Always require a ref for better xsd validations.
467 Currently a volume could have no points nor ref
468 as it can not be forbidden by xsd 1.0.-->
469 <xs:simpleType name="volumePoint">
470 <xs:annotation>
471 <xs:documentation xml:lang="en">
472 Comma separated pair of number.
473 The fist one is the framework level (between 0 and 100).
474 The second one is the volume to send to the HAL.
475 The framework will interpolate volumes not specified.
476 Their MUST be at least 2 points specified.
477 </xs:documentation>
478 </xs:annotation>
479 <xs:restriction base="xs:string">
480 <xs:pattern value="([0-9]{1,2}|100),-?[0-9]+"/>
481 </xs:restriction>
482 </xs:simpleType>
483 <!-- Enum values of audio_stream_type_t in audio-base.h
484 TODO: generate from hidl to avoid manual sync. -->
485 <xs:simpleType name="stream">
486 <xs:restriction base="xs:string">
487 <xs:enumeration value="AUDIO_STREAM_VOICE_CALL"/>
488 <xs:enumeration value="AUDIO_STREAM_SYSTEM"/>
489 <xs:enumeration value="AUDIO_STREAM_RING"/>
490 <xs:enumeration value="AUDIO_STREAM_MUSIC"/>
491 <xs:enumeration value="AUDIO_STREAM_ALARM"/>
492 <xs:enumeration value="AUDIO_STREAM_NOTIFICATION"/>
493 <xs:enumeration value="AUDIO_STREAM_BLUETOOTH_SCO"/>
494 <xs:enumeration value="AUDIO_STREAM_ENFORCED_AUDIBLE"/>
495 <xs:enumeration value="AUDIO_STREAM_DTMF"/>
496 <xs:enumeration value="AUDIO_STREAM_TTS"/>
497 <xs:enumeration value="AUDIO_STREAM_ACCESSIBILITY"/>
498 <xs:enumeration value="AUDIO_STREAM_REROUTING"/>
499 <xs:enumeration value="AUDIO_STREAM_PATCH"/>
500 </xs:restriction>
501 </xs:simpleType>
502 <!-- Enum values of device_category from Volume.h.
503 TODO: generate from hidl to avoid manual sync. -->
504 <xs:simpleType name="deviceCategory">
505 <xs:restriction base="xs:string">
506 <xs:enumeration value="DEVICE_CATEGORY_HEADSET"/>
507 <xs:enumeration value="DEVICE_CATEGORY_SPEAKER"/>
508 <xs:enumeration value="DEVICE_CATEGORY_EARPIECE"/>
509 <xs:enumeration value="DEVICE_CATEGORY_EXT_MEDIA"/>
510 </xs:restriction>
511 </xs:simpleType>
512 <xs:complexType name="volume">
513 <xs:annotation>
514 <xs:documentation xml:lang="en">
515 Volume section defines a volume curve for a given use case and device category.
516 It contains a list of points of this curve expressing the attenuation in Millibels
517 for a given volume index from 0 to 100.
518 <volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_SPEAKER">
519 <point>0,-9600</point>
520 <point>100,0</point>
521 </volume>
522
523 It may also reference a reference/@name to avoid duplicating curves.
524 <volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_SPEAKER"
525 ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
526 <reference name="DEFAULT_MEDIA_VOLUME_CURVE">
527 <point>0,-9600</point>
528 <point>100,0</point>
529 </reference>
530 </xs:documentation>
531 </xs:annotation>
532 <xs:sequence>
533 <xs:element name="point" type="volumePoint" minOccurs="0" maxOccurs="unbounded"/>
534 </xs:sequence>
535 <xs:attribute name="stream" type="stream"/>
536 <xs:attribute name="deviceCategory" type="deviceCategory"/>
537 <xs:attribute name="ref" type="xs:token" use="optional"/>
538 </xs:complexType>
539 <xs:complexType name="reference">
540 <xs:sequence>
541 <xs:element name="point" type="volumePoint" minOccurs="2" maxOccurs="unbounded"/>
542 </xs:sequence>
543 <xs:attribute name="name" type="xs:token" use="required"/>
544 </xs:complexType>
545</xs:schema>