Home | History | Annotate | Download | only in config
      1 <?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">
     76         <xs:restriction base="xs:string">
     77             <xs:enumeration value="primary"/>
     78             <xs:enumeration value="a2dp"/>
     79             <xs:enumeration value="usb"/>
     80             <xs:enumeration value="r_submix"/>
     81             <xs:enumeration value="codec_offload"/>
     82             <xs:enumeration value="stub"/>
     83         </xs:restriction>
     84     </xs:simpleType>
     85     <xs:complexType name="modules">
     86         <xs:annotation>
     87             <xs:documentation xml:lang="en">
     88                 There should be one section per audio HW module present on the platform.
     89                 Each <module/> contains two mandatory tags: halVersion and name.
     90                 The module "name" is the same as in previous .conf file.
     91                 Each module must contain the following sections:
     92                  - <devicePorts/>: a list of device descriptors for all
     93                    input and output devices accessible via this module.
     94                    This contains both permanently attached devices and removable devices.
     95                  - <mixPorts/>: listing all output and input streams exposed by the audio HAL
     96                  - <routes/>: list of possible connections between input
     97                    and output devices or between stream and devices.
     98                    A <route/> is defined by a set of 3 attributes:
     99                         -"type": mux|mix means all sources are mutual exclusive (mux) or can be mixed (mix)
    100                         -"sink": the sink involved in this route
    101                         -"sources": all the sources than can be connected to the sink via this route
    102                  - <attachedDevices/>: permanently attached devices.
    103                    The attachedDevices section is a list of devices names.
    104                    Their names correspond to device names defined in "devicePorts" section.
    105                  - <defaultOutputDevice/> is the device to be used when no policy rule applies
    106             </xs:documentation>
    107         </xs:annotation>
    108         <xs:sequence>
    109             <xs:element name="module" maxOccurs="unbounded">
    110                 <xs:complexType>
    111                     <xs:sequence>
    112                         <xs:element name="attachedDevices" type="attachedDevices" minOccurs="0">
    113                             <xs:unique name="attachedDevicesUniqueness">
    114                                 <xs:selector xpath="item"/>
    115                                 <xs:field xpath="."/>
    116                             </xs:unique>
    117                         </xs:element>
    118                         <xs:element name="defaultOutputDevice" type="xs:token" minOccurs="0"/>
    119                         <xs:element name="mixPorts" type="mixPorts" minOccurs="0"/>
    120                         <xs:element name="devicePorts" type="devicePorts" minOccurs="0"/>
    121                         <xs:element name="routes" type="routes" minOccurs="0"/>
    122                     </xs:sequence>
    123                     <xs:attribute name="name" type="halName" use="required"/>
    124                     <xs:attribute name="halVersion" type="halVersion" use="required"/>
    125                 </xs:complexType>
    126                 <xs:unique name="mixPortNameUniqueness">
    127                     <xs:selector xpath="mixPorts/mixPort"/>
    128                     <xs:field xpath="@name"/>
    129                 </xs:unique>
    130                 <!-- Although this key constraint is redundant with devicePortNameGlobalKey,
    131                      the set is used to constraint defaultOutputDevice and attachedDevice
    132                      to reference a devicePort of the same module. -->
    133                 <xs:key name="devicePortNameKey">
    134                     <xs:selector xpath="devicePorts/devicePort"/>
    135                     <xs:field xpath="@tagName"/>
    136                 </xs:key>
    137                 <xs:keyref name="defaultOutputDeviceRef" refer="devicePortNameKey">
    138                     <xs:selector xpath="defaultOutputDevice"/>
    139                     <xs:field xpath="."/>
    140                 </xs:keyref>
    141                 <xs:keyref name="attachedDeviceRef" refer="devicePortNameKey">
    142                     <xs:selector xpath="attachedDevices/item"/>
    143                     <xs:field xpath="."/>
    144                 </xs:keyref>
    145                 <!-- The following 3 constraints try to make sure each sink port
    146                      is reference in one an only one route. -->
    147                 <xs:key name="routeSinkKey">
    148                     <!-- predicate [@type='sink'] does not work in xsd 1.0 -->
    149                     <xs:selector xpath="devicePorts/devicePort|mixPorts/mixPort"/>
    150                     <xs:field xpath="@tagName|@name"/>
    151                 </xs:key>
    152                 <xs:keyref name="routeSinkRef" refer="routeSinkKey">
    153                     <xs:selector xpath="routes/route"/>
    154                     <xs:field xpath="@sink"/>
    155                 </xs:keyref>
    156                 <xs:unique name="routeUniqueness">
    157                     <xs:selector xpath="routes/route"/>
    158                     <xs:field xpath="@sink"/>
    159                 </xs:unique>
    160             </xs:element>
    161         </xs:sequence>
    162     </xs:complexType>
    163     <xs:complexType name="attachedDevices">
    164         <xs:sequence>
    165             <xs:element name="item" type="xs:token" minOccurs="0" maxOccurs="unbounded"/>
    166         </xs:sequence>
    167     </xs:complexType>
    168     <!-- TODO: separate values by space for better xsd validations. -->
    169     <xs:simpleType name="audioInOutFlags">
    170         <xs:annotation>
    171             <xs:documentation xml:lang="en">
    172                 "|" separated list of audio_output_flags_t or audio_input_flags_t.
    173             </xs:documentation>
    174         </xs:annotation>
    175         <xs:restriction base="xs:string">
    176             <xs:pattern value="|[_A-Z]+(\|[_A-Z]+)*"/>
    177         </xs:restriction>
    178     </xs:simpleType>
    179     <xs:simpleType name="role">
    180         <xs:restriction base="xs:string">
    181             <xs:enumeration value="sink"/>
    182             <xs:enumeration value="source"/>
    183         </xs:restriction>
    184     </xs:simpleType>
    185     <xs:complexType name="mixPorts">
    186         <xs:sequence>
    187             <xs:element name="mixPort" minOccurs="0" maxOccurs="unbounded">
    188                 <xs:complexType>
    189                     <xs:sequence>
    190                         <xs:element name="profile" type="profile" minOccurs="0" maxOccurs="unbounded"/>
    191                     </xs:sequence>
    192                     <xs:attribute name="name" type="xs:token" use="required"/>
    193                     <xs:attribute name="role" type="role" use="required"/>
    194                     <xs:attribute name="flags" type="audioInOutFlags"/>
    195                 </xs:complexType>
    196                 <xs:unique name="mixPortProfileUniqueness">
    197                     <xs:selector xpath="profile"/>
    198                     <xs:field xpath="format"/>
    199                     <xs:field xpath="samplingRate"/>
    200                     <xs:field xpath="channelMasks"/>
    201                 </xs:unique>
    202             </xs:element>
    203         </xs:sequence>
    204     </xs:complexType>
    205     <!-- Enum values of audio_device_t in audio.h
    206          TODO: generate from hidl to avoid manual sync.
    207          TODO: separate source and sink in the xml for better xsd validations. -->
    208     <xs:simpleType name="audioDevice">
    209         <xs:restriction base="xs:string">
    210             <xs:enumeration value="AUDIO_DEVICE_NONE"/>
    211 
    212             <xs:enumeration value="AUDIO_DEVICE_OUT_EARPIECE"/>
    213             <xs:enumeration value="AUDIO_DEVICE_OUT_SPEAKER"/>
    214             <xs:enumeration value="AUDIO_DEVICE_OUT_SPEAKER_SAFE"/>
    215             <xs:enumeration value="AUDIO_DEVICE_OUT_WIRED_HEADSET"/>
    216             <xs:enumeration value="AUDIO_DEVICE_OUT_WIRED_HEADPHONE"/>
    217             <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO"/>
    218             <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET"/>
    219             <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT"/>
    220             <xs:enumeration value="AUDIO_DEVICE_OUT_ALL_SCO"/>
    221             <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP"/>
    222             <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES"/>
    223             <xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER"/>
    224             <xs:enumeration value="AUDIO_DEVICE_OUT_ALL_A2DP"/>
    225             <xs:enumeration value="AUDIO_DEVICE_OUT_AUX_DIGITAL"/>
    226             <xs:enumeration value="AUDIO_DEVICE_OUT_HDMI"/>
    227             <xs:enumeration value="AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET"/>
    228             <xs:enumeration value="AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET"/>
    229             <xs:enumeration value="AUDIO_DEVICE_OUT_USB_ACCESSORY"/>
    230             <xs:enumeration value="AUDIO_DEVICE_OUT_USB_DEVICE"/>
    231             <xs:enumeration value="AUDIO_DEVICE_OUT_ALL_USB"/>
    232             <xs:enumeration value="AUDIO_DEVICE_OUT_REMOTE_SUBMIX"/>
    233             <xs:enumeration value="AUDIO_DEVICE_OUT_TELEPHONY_TX"/>
    234             <xs:enumeration value="AUDIO_DEVICE_OUT_LINE"/>
    235             <xs:enumeration value="AUDIO_DEVICE_OUT_HDMI_ARC"/>
    236             <xs:enumeration value="AUDIO_DEVICE_OUT_SPDIF"/>
    237             <xs:enumeration value="AUDIO_DEVICE_OUT_FM"/>
    238             <xs:enumeration value="AUDIO_DEVICE_OUT_AUX_LINE"/>
    239             <xs:enumeration value="AUDIO_DEVICE_OUT_IP"/>
    240             <xs:enumeration value="AUDIO_DEVICE_OUT_BUS"/>
    241             <xs:enumeration value="AUDIO_DEVICE_OUT_PROXY"/>
    242             <xs:enumeration value="AUDIO_DEVICE_OUT_USB_HEADSET"/>
    243             <xs:enumeration value="AUDIO_DEVICE_OUT_DEFAULT"/>
    244             <xs:enumeration value="AUDIO_DEVICE_OUT_STUB"/>
    245 
    246             <!-- Due to the xml format, IN types can not be a separated from OUT types -->
    247             <xs:enumeration value="AUDIO_DEVICE_IN_COMMUNICATION"/>
    248             <xs:enumeration value="AUDIO_DEVICE_IN_AMBIENT"/>
    249             <xs:enumeration value="AUDIO_DEVICE_IN_BUILTIN_MIC"/>
    250             <xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET"/>
    251             <xs:enumeration value="AUDIO_DEVICE_IN_ALL_SCO"/>
    252             <xs:enumeration value="AUDIO_DEVICE_IN_WIRED_HEADSET"/>
    253             <xs:enumeration value="AUDIO_DEVICE_IN_AUX_DIGITAL"/>
    254             <xs:enumeration value="AUDIO_DEVICE_IN_HDMI"/>
    255             <xs:enumeration value="AUDIO_DEVICE_IN_TELEPHONY_RX"/>
    256             <xs:enumeration value="AUDIO_DEVICE_IN_VOICE_CALL"/>
    257             <xs:enumeration value="AUDIO_DEVICE_IN_BACK_MIC"/>
    258             <xs:enumeration value="AUDIO_DEVICE_IN_REMOTE_SUBMIX"/>
    259             <xs:enumeration value="AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET"/>
    260             <xs:enumeration value="AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET"/>
    261             <xs:enumeration value="AUDIO_DEVICE_IN_USB_ACCESSORY"/>
    262             <xs:enumeration value="AUDIO_DEVICE_IN_USB_DEVICE"/>
    263             <xs:enumeration value="AUDIO_DEVICE_IN_ALL_USB"/>
    264             <xs:enumeration value="AUDIO_DEVICE_IN_FM_TUNER"/>
    265             <xs:enumeration value="AUDIO_DEVICE_IN_TV_TUNER"/>
    266             <xs:enumeration value="AUDIO_DEVICE_IN_LINE"/>
    267             <xs:enumeration value="AUDIO_DEVICE_IN_SPDIF"/>
    268             <xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_A2DP"/>
    269             <xs:enumeration value="AUDIO_DEVICE_IN_LOOPBACK"/>
    270             <xs:enumeration value="AUDIO_DEVICE_IN_IP"/>
    271             <xs:enumeration value="AUDIO_DEVICE_IN_BUS"/>
    272             <xs:enumeration value="AUDIO_DEVICE_IN_PROXY"/>
    273             <xs:enumeration value="AUDIO_DEVICE_IN_USB_HEADSET"/>
    274             <xs:enumeration value="AUDIO_DEVICE_IN_DEFAULT"/>
    275             <xs:enumeration value="AUDIO_DEVICE_IN_STUB"/>
    276         </xs:restriction>
    277     </xs:simpleType>
    278     <!-- Enum values of audio_format_t in audio.h
    279          TODO: generate from hidl to avoid manual sync. -->
    280     <xs:simpleType name="audioFormat">
    281         <xs:restriction base="xs:string">
    282             <xs:enumeration value="AUDIO_FORMAT_PCM_16_BIT" />
    283             <xs:enumeration value="AUDIO_FORMAT_PCM_8_BIT"/>
    284             <xs:enumeration value="AUDIO_FORMAT_PCM_32_BIT"/>
    285             <xs:enumeration value="AUDIO_FORMAT_PCM_8_24_BIT"/>
    286             <xs:enumeration value="AUDIO_FORMAT_PCM_FLOAT"/>
    287             <xs:enumeration value="AUDIO_FORMAT_PCM_24_BIT_PACKED"/>
    288             <xs:enumeration value="AUDIO_FORMAT_MP3"/>
    289             <xs:enumeration value="AUDIO_FORMAT_AMR_NB"/>
    290             <xs:enumeration value="AUDIO_FORMAT_AMR_WB"/>
    291             <xs:enumeration value="AUDIO_FORMAT_AAC"/>
    292             <xs:enumeration value="AUDIO_FORMAT_AAC_MAIN"/>
    293             <xs:enumeration value="AUDIO_FORMAT_AAC_LC"/>
    294             <xs:enumeration value="AUDIO_FORMAT_AAC_SSR"/>
    295             <xs:enumeration value="AUDIO_FORMAT_AAC_LTP"/>
    296             <xs:enumeration value="AUDIO_FORMAT_AAC_HE_V1"/>
    297             <xs:enumeration value="AUDIO_FORMAT_AAC_SCALABLE"/>
    298             <xs:enumeration value="AUDIO_FORMAT_AAC_ERLC"/>
    299             <xs:enumeration value="AUDIO_FORMAT_AAC_LD"/>
    300             <xs:enumeration value="AUDIO_FORMAT_AAC_HE_V2"/>
    301             <xs:enumeration value="AUDIO_FORMAT_AAC_ELD"/>
    302             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_MAIN"/>
    303             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LC"/>
    304             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SSR"/>
    305             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LTP"/>
    306             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V1"/>
    307             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SCALABLE"/>
    308             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ERLC"/>
    309             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LD"/>
    310             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V2"/>
    311             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ELD"/>
    312             <xs:enumeration value="AUDIO_FORMAT_VORBIS"/>
    313             <xs:enumeration value="AUDIO_FORMAT_HE_AAC_V1"/>
    314             <xs:enumeration value="AUDIO_FORMAT_HE_AAC_V2"/>
    315             <xs:enumeration value="AUDIO_FORMAT_OPUS"/>
    316             <xs:enumeration value="AUDIO_FORMAT_AC3"/>
    317             <xs:enumeration value="AUDIO_FORMAT_E_AC3"/>
    318             <xs:enumeration value="AUDIO_FORMAT_DTS"/>
    319             <xs:enumeration value="AUDIO_FORMAT_DTS_HD"/>
    320             <xs:enumeration value="AUDIO_FORMAT_IEC61937"/>
    321             <xs:enumeration value="AUDIO_FORMAT_DOLBY_TRUEHD"/>
    322             <xs:enumeration value="AUDIO_FORMAT_EVRC"/>
    323             <xs:enumeration value="AUDIO_FORMAT_EVRCB"/>
    324             <xs:enumeration value="AUDIO_FORMAT_EVRCWB"/>
    325             <xs:enumeration value="AUDIO_FORMAT_EVRCNW"/>
    326             <xs:enumeration value="AUDIO_FORMAT_AAC_ADIF"/>
    327             <xs:enumeration value="AUDIO_FORMAT_WMA"/>
    328             <xs:enumeration value="AUDIO_FORMAT_WMA_PRO"/>
    329             <xs:enumeration value="AUDIO_FORMAT_AMR_WB_PLUS"/>
    330             <xs:enumeration value="AUDIO_FORMAT_MP2"/>
    331             <xs:enumeration value="AUDIO_FORMAT_QCELP"/>
    332             <xs:enumeration value="AUDIO_FORMAT_DSD"/>
    333             <xs:enumeration value="AUDIO_FORMAT_FLAC"/>
    334             <xs:enumeration value="AUDIO_FORMAT_ALAC"/>
    335             <xs:enumeration value="AUDIO_FORMAT_APE"/>
    336             <xs:enumeration value="AUDIO_FORMAT_AAC_ADTS"/>
    337             <xs:enumeration value="AUDIO_FORMAT_SBC"/>
    338             <xs:enumeration value="AUDIO_FORMAT_APTX"/>
    339             <xs:enumeration value="AUDIO_FORMAT_APTX_HD"/>
    340             <xs:enumeration value="AUDIO_FORMAT_AC4"/>
    341             <xs:enumeration value="AUDIO_FORMAT_LDAC"/>
    342         </xs:restriction>
    343     </xs:simpleType>
    344     <!-- TODO: Change to a space separated list to xsd enforce correctness. -->
    345     <xs:simpleType name="samplingRates">
    346         <xs:restriction base="xs:string">
    347             <xs:pattern value="[0-9]+(,[0-9]+)*"/>
    348         </xs:restriction>
    349     </xs:simpleType>
    350     <!-- TODO: Change to a space separated list to xsd enforce correctness. -->
    351     <xs:simpleType name="channelMask">
    352         <xs:annotation>
    353             <xs:documentation xml:lang="en">
    354                 Comma (",") separated list of channel flags
    355                 from audio_channel_mask_t.
    356             </xs:documentation>
    357         </xs:annotation>
    358         <xs:restriction base="xs:string">
    359             <xs:pattern value="[_A-Z][_A-Z0-9]*(,[_A-Z][_A-Z0-9]*)*"/>
    360         </xs:restriction>
    361     </xs:simpleType>
    362     <xs:complexType name="profile">
    363         <xs:attribute name="name" type="xs:token" use="required"/>
    364         <xs:attribute name="format" type="audioFormat" use="required"/>
    365         <xs:attribute name="samplingRates" type="samplingRates" use="required"/>
    366         <xs:attribute name="channelMasks" type="channelMask" use="required"/>
    367     </xs:complexType>
    368     <xs:complexType name="devicePorts">
    369         <xs:sequence>
    370             <xs:element name="devicePort" minOccurs="0" maxOccurs="unbounded">
    371                 <xs:complexType>
    372                     <xs:sequence>
    373                         <xs:element name="profile" type="profile" minOccurs="0" maxOccurs="unbounded"/>
    374                     </xs:sequence>
    375                     <xs:attribute name="tagName" type="xs:token" use="required"/>
    376                     <xs:attribute name="type" type="audioDevice" use="required"/>
    377                     <xs:attribute name="role" type="role" use="required"/>
    378                 </xs:complexType>
    379                 <xs:unique name="devicePortProfileUniqueness">
    380                     <xs:selector xpath="profile"/>
    381                     <xs:field xpath="format"/>
    382                     <xs:field xpath="samplingRate"/>
    383                     <xs:field xpath="channelMasks"/>
    384                 </xs:unique>
    385             </xs:element>
    386         </xs:sequence>
    387     </xs:complexType>
    388     <xs:simpleType name="mixType">
    389         <xs:restriction base="xs:string">
    390             <xs:enumeration value="mix"/>
    391             <xs:enumeration value="mux"/>
    392         </xs:restriction>
    393     </xs:simpleType>
    394     <xs:complexType name="routes">
    395         <xs:sequence>
    396             <xs:element name="route" minOccurs="0" maxOccurs="unbounded">
    397                 <xs:annotation>
    398                     <xs:documentation xml:lang="en">
    399                         List all available sources for a given sink.
    400                     </xs:documentation>
    401                 </xs:annotation>
    402                 <xs:complexType>
    403                     <xs:attribute name="type" type="mixType" use="required"/>
    404                     <xs:attribute name="sink" type="xs:string" use="required"/>
    405                     <xs:attribute name="sources" type="xs:string" use="required"/>
    406                 </xs:complexType>
    407             </xs:element>
    408         </xs:sequence>
    409     </xs:complexType>
    410     <xs:complexType name="volumes">
    411         <xs:sequence>
    412             <xs:element name="volume" type="volume" minOccurs="0" maxOccurs="unbounded"/>
    413             <xs:element name="reference" type="reference" minOccurs="0" maxOccurs="unbounded">
    414             </xs:element>
    415         </xs:sequence>
    416     </xs:complexType>
    417     <!-- TODO: Always require a ref for better xsd validations.
    418                Currently a volume could have no points nor ref
    419                as it can not be forbidden by xsd 1.0.-->
    420     <xs:simpleType name="volumePoint">
    421         <xs:annotation>
    422             <xs:documentation xml:lang="en">
    423                 Comma separated pair of number.
    424                 The fist one is the framework level (between 0 and 100).
    425                 The second one is the volume to send to the HAL.
    426                 The framework will interpolate volumes not specified.
    427                 Their MUST be at least 2 points specified.
    428             </xs:documentation>
    429         </xs:annotation>
    430         <xs:restriction base="xs:string">
    431             <xs:pattern value="([0-9]{1,2}|100),-?[0-9]+"/>
    432         </xs:restriction>
    433     </xs:simpleType>
    434     <!-- Enum values of audio_stream_type_t in audio-base.h
    435          TODO: generate from hidl to avoid manual sync. -->
    436     <xs:simpleType name="stream">
    437         <xs:restriction base="xs:string">
    438             <xs:enumeration value="AUDIO_STREAM_VOICE_CALL"/>
    439             <xs:enumeration value="AUDIO_STREAM_SYSTEM"/>
    440             <xs:enumeration value="AUDIO_STREAM_RING"/>
    441             <xs:enumeration value="AUDIO_STREAM_MUSIC"/>
    442             <xs:enumeration value="AUDIO_STREAM_ALARM"/>
    443             <xs:enumeration value="AUDIO_STREAM_NOTIFICATION"/>
    444             <xs:enumeration value="AUDIO_STREAM_BLUETOOTH_SCO"/>
    445             <xs:enumeration value="AUDIO_STREAM_ENFORCED_AUDIBLE"/>
    446             <xs:enumeration value="AUDIO_STREAM_DTMF"/>
    447             <xs:enumeration value="AUDIO_STREAM_TTS"/>
    448             <xs:enumeration value="AUDIO_STREAM_ACCESSIBILITY"/>
    449             <xs:enumeration value="AUDIO_STREAM_REROUTING"/>
    450             <xs:enumeration value="AUDIO_STREAM_PATCH"/>
    451         </xs:restriction>
    452     </xs:simpleType>
    453     <!-- Enum values of device_category from Volume.h.
    454          TODO: generate from hidl to avoid manual sync. -->
    455     <xs:simpleType name="deviceCategory">
    456         <xs:restriction base="xs:string">
    457             <xs:enumeration value="DEVICE_CATEGORY_HEADSET"/>
    458             <xs:enumeration value="DEVICE_CATEGORY_SPEAKER"/>
    459             <xs:enumeration value="DEVICE_CATEGORY_EARPIECE"/>
    460             <xs:enumeration value="DEVICE_CATEGORY_EXT_MEDIA"/>
    461         </xs:restriction>
    462     </xs:simpleType>
    463     <xs:complexType name="volume">
    464         <xs:annotation>
    465             <xs:documentation xml:lang="en">
    466                 Volume section defines a volume curve for a given use case and device category.
    467                 It contains a list of points of this curve expressing the attenuation in Millibels
    468                 for a given volume index from 0 to 100.
    469                 <volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_SPEAKER">
    470                     <point>0,-9600</point>
    471                     <point>100,0</point>
    472                 </volume>
    473 
    474                 It may also reference a reference/@name to avoid duplicating curves.
    475                 <volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_SPEAKER"
    476                         ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
    477                 <reference name="DEFAULT_MEDIA_VOLUME_CURVE">
    478                     <point>0,-9600</point>
    479                     <point>100,0</point>
    480                 </reference>
    481             </xs:documentation>
    482         </xs:annotation>
    483         <xs:sequence>
    484             <xs:element name="point" type="volumePoint" minOccurs="0" maxOccurs="unbounded"/>
    485         </xs:sequence>
    486         <xs:attribute name="stream" type="stream"/>
    487         <xs:attribute name="deviceCategory" type="deviceCategory"/>
    488         <xs:attribute name="ref" type="xs:token" use="optional"/>
    489     </xs:complexType>
    490     <xs:complexType name="reference">
    491         <xs:sequence>
    492             <xs:element name="point" type="volumePoint" minOccurs="2" maxOccurs="unbounded"/>
    493         </xs:sequence>
    494         <xs:attribute name="name" type="xs:token" use="required"/>
    495     </xs:complexType>
    496 </xs:schema>
    497