USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 36
4 Descriptors
The following sections describe the standard and class-specific USB descriptors for the Audio Interface Class.
4.1 Device Descriptor
Because audio functionality is always considered to reside at the interface level, this class specification does not define a specific audio device descriptor. For audio-only devices, the device descriptor must indicate that class information is to be found at the interface level. Therefore, the bDeviceClass field of the device descriptor must contain zero so that enumeration software looks down at the interface level to determine the Interface Class. The bDeviceSubClass and bDeviceProtocol fields must be set to zero. All other fields of the device descriptor must comply with the definitions in Section 9.6.1, “Descriptor” of the USB Specification. There is no class-specific device descriptor.
4.2 Configuration Descriptor
In analogy to the device descriptor, an audio configuration descriptor is applicable only in the case of audio-only devices. It is identical to the standard configuration descriptor defined in Section 9.6.2, “Configuration” of the USB Specification. There is no class-specific configuration descriptor.
4.3 AudioControl Interface Descriptors
The AudioControl (AC) interface descriptors contain all relevant information to fully characterize the corresponding audio function. The standard interface descriptor characterizes the interface itself, whereas the class-specific interface descriptor provides pertinent information concerning the internals of the audio function. It specifies revision level information and lists the capabilities of each Unit and Terminal.
4.3.1 Standard AC Interface Descriptor
The standard AC interface descriptor is identical to the standard interface descriptor defined in Section
9.6.3, “Interface” of the USB Specification, except that some fields have now dedicated values.
Table 4-1: Standard AC Interface Descriptor
| Offset |
Field |
Size |
Value |
Description |
| 0 |
bLength |
1 |
Number |
Size of this descriptor, in bytes: 9 |
| 1 |
bDescriptorType |
1 |
Constant |
INTERFACE descriptor type |
| 2 |
bInterfaceNumber |
1 |
Number |
Number of interface. A zero-based value identifying the index in the array of concurrent interfaces supported by this configuration. |
| 3 |
bAlternateSetting |
1 |
Number |
Value used to select an alternate setting for the interface identified in the prior field. |
|4|bNumEndpoints|1|Number|Number of endpoints used by this interface (excluding endpoint 0). This
number is either 0 or 1 if the optional status interrupt endpoint is present.|
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 37
| Offset |
Field |
Size |
Value |
Description |
| 5 |
bInterfaceClass |
1 |
Class |
AUDIO. Audio Interface Class code (assigned by the USB). See Section A.1, “Audio Interface Class Code.” |
| 6 |
bInterfaceSubClass |
1 |
Subclass |
AUDIOCONTROL. Audio Interface Subclass code. Assigned by this specification. See Section A.2, “Audio Interface Subclass Codes.” |
| 7 |
bInterfaceProtocol |
1 |
Protocol |
Not used. Must be set to 0. |
| 8 |
iInterface |
1 |
Index |
Index of a string descriptor that describes this interface. |
|
|
|
|
dummy |
4.3.2 Class-Specific AC Interface Descriptor
The class-specific AC interface descriptor is a concatenation of all the descriptors that are used to fully describe the audio function, i.e. all Unit Descriptors (UDs) and Terminal Descriptors (TDs).
The total length of the class-specific AC interface descriptor depends on the number of Units and Terminals in the audio function. Therefore, the descriptor starts with a header that reflects the total length in bytes of the entire class-specific AC interface descriptor in the wTotalLength field. The bcdADC field identifies the release of the Audio Device Class Specification with which this audio function and its descriptors are compliant. The bInCollection field indicates how many AudioStreaming and MIDIStreaming interfaces there are in the Audio Interface Collection to which this AudioControl interface belongs. The baInterfaceNr() array contains the interface numbers of all the AudioStreaming and MIDIStreaming interfaces in the Collection. The bInCollection and baInterfaceNr() fields together provide all necessary information to determine which interfaces together constitute the entire USB interface to the audio function, i.e. describe the Audio Interface Collection.
The order in which the Unit and Terminal descriptors are reported is not important because every descriptor can be identified through its bDescriptorType and bDescriptorSubtype field. The bDescriptorType field identifies the descriptor as being a class-specific interface descriptor. The bDescriptorSubtype field further qualifies the exact nature of the descriptor.
The following table defines the class-specific AC interface header descriptor.
Table 4-2: Class-Specific AC Interface Header Descriptor
| Offset |
Field |
Size |
Value |
Description |
| 0 |
bLength |
1 |
Number |
Size of this descriptor, in bytes: 8+n |
| 1 |
bDescriptorType |
1 |
Constant |
CS_INTERFACE descriptor type. |
| 2 |
bDescriptorSubtype |
1 |
Constant |
HEADER descriptor subtype. |
| 3 |
bcdADC |
2 |
BCD |
Audio Device Class Specification Release Number in Binary-Coded Decimal. |
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 38
| Offset |
Field |
Size |
Value |
Description |
| 5 |
wTotalLength |
2 |
Number |
Total number of bytes returned for the class-specific AudioControl interface descriptor. Includes the combined length of this descriptor header and all Unit and Terminal descriptors. |
| 7 |
bInCollection |
1 |
Number |
The number of AudioStreaming and MIDIStreaming interfaces in the Audio Interface Collection to which this AudioControl interface belongs: n |
| 8 |
baInterfaceNr(1) |
1 |
Number |
Interface number of the first AudioStreaming or MIDIStreaming interface in the Collection. |
| … |
… |
… |
… |
… |
| 8+(n-1) |
baInterfaceNr(n) |
1 |
Number |
Interface number of the last AudioStreaming or MIDIStreaming interface in the Collection. |
This header is followed by one or more Unit and/or Terminal Descriptors. The layout of the descriptors depends on the type of Unit or Terminal they represent. There are seven types of Unit and Terminal Descriptors possible. They are summarized in the following sections. The first four fields are common for all Unit and Terminal Descriptors. They contain the Descriptor Length, Descriptor Type, Descriptor Subtype, and Unit or Terminal ID.
Each Unit and Terminal within the audio function is assigned a unique identification number, the Unit ID (UID) or Terminal ID (TID), contained in the bUnitID or bTerminalID field of the descriptor. The value 0x00 is reserved for undefined ID, effectively restricting the total number of addressable Entities in the audio function (both Units and Terminals) to 255.
Besides uniquely identifying all addressable Entities in an audio function, the IDs also serve to describe the topology of the audio function; i.e. the bSourceID field of a Unit or Terminal descriptor indicates to which other Unit or Terminal this Unit or Terminal is connected.
4.3.2.1 Input Terminal Descriptor
The Input Terminal descriptor (ITD) provides information to the Host that is related to the functional aspects of the Input Terminal.
The Input Terminal is uniquely identified by the value in the bTerminalID field. No other Unit or Terminal within the same alternate setting of the AudioControl interface may have the same ID. This value must be passed in the TerminalID field of each request that is directed to the Terminal.
The wTerminalType field provides pertinent information about the physical entity that the Input Terminal represents. This could be a USB OUT endpoint, an external Line In connection, a microphone, etc. A complete list of Terminal Type codes is provided in a separate document, USB Audio Terminal Types, that is considered part of this specification.
The bAssocTerminal field is used to associate an Output Terminal to this Input Terminal, effectively implementing a bi-directional Terminal pair. If the bAssocTerminal field is used, both associated Terminals must belong to the bi-directional Terminal Type group. If no association exists, the bAssocTerminal field must be set to zero.
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 39
The Host software can treat the associated Terminals as being physically related. In many cases, one Terminal can not exist without the other. A typical example of such a Terminal pair is an Input Terminal, which represents the microphone, and an Output Terminal, which represents the earpiece of a headset.
The bNrChannels, wChannelConfig and iChannelNames fields together constitute the cluster descriptor. They characterize the cluster that leaves the Input Terminal over the single Output Pin (‘downstream’ connection). For a detailed description of the cluster descriptor, see Section 3.7.2.3, “Audio Channel Cluster Format.”
An index to a string descriptor is provided to further describe the Input Terminal.
The following table presents an outline of the Input Terminal descriptor.
Table 4-3: Input Terminal Descriptor
| Offset |
Field |
Size |
Value |
Description |
| 0 |
bLength |
1 |
Number |
Size of this descriptor, in bytes: 12 |
| 1 |
bDescriptorType |
1 |
Constant |
CS_INTERFACE descriptor type. |
| 2 |
bDescriptorSubtype |
1 |
Constant |
INPUT_TERMINAL descriptor subtype. |
| 3 |
bTerminalID |
1 |
Constant |
Constant uniquely identifying the Terminal within the audio function. This value is used in all requests to address this Terminal. |
| 4 |
wTerminalType |
2 |
Constant |
Constant characterizing the type of Terminal. See USB Audio Terminal Types. |
| 6 |
bAssocTerminal |
1 |
Constant |
ID of the Output Terminal to which this Input Terminal is associated. |
| 7 |
bNrChannels |
1 |
Number |
Number of logical output channels in the Terminal’s output audio channel cluster. |
| 8 |
wChannelConfig |
2 |
Bitmap |
Describes the spatial location of the logical channels. |
| 10 |
iChannelNames |
1 |
Index |
Index of a string descriptor, describing the name of the first logical channel. |
| 11 |
iTerminal |
1 |
Index |
Index of a string descriptor, describing the Input Terminal. |
4.3.2.2 Output Terminal Descriptor
The Output Terminal descriptor (OTD) provides information to the Host that is related to the functional aspects of the Output Terminal.
The Output Terminal is uniquely identified by the value in the bTerminalID field. No other Unit or Terminal within the same alternate setting of the AudioControl interface may have the same ID. This value must be passed in the UnitID field of each request that is directed to the Terminal.
The wTerminalType field provides pertinent information about the physical entity the Output Terminal represents. This could be a USB IN endpoint, an external Line Out connection, a speaker system etc. A
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 40
complete list of Terminal Type codes is provided in a separate document, USB Audio Terminal Types that is considered part of this specification.
The bAssocTerminal field is used to associate an Input Terminal to this Output Terminal, effectively implementing a bi-directional Terminal pair. If the bAssocTerminal field is used, both associated Terminals must belong to the bi-directional Terminal Type group. If no association exists, the bAssocTerminal field must be set to zero.
The Host software can treat the associated Terminals as being physically related. In many cases, one Terminal can not exist without the other. A typical example of such a Terminal pair is an Input Terminal, which represents the microphone, and an Output Terminal, which represents the earpiece of a headset.
The bSourceID field is used to describe the connectivity for this Terminal. It contains the ID of the Unit or Terminal to which this Output Terminal is connected via its Input Pin. The cluster descriptor, describing the logical channels entering the Output Terminal is not repeated here. It is up to the Host software to trace the connection ‘upstream’ to locate the cluster descriptor pertaining to this audio channel cluster.
An index to a string descriptor is provided to further describe the Output Terminal.
The following table presents an outline of the Output Terminal descriptor.
Table 4-4: Output Terminal Descriptor
| Offset |
Field |
Size |
Value |
Description |
| 0 |
bLength |
1 |
Number |
Size of this descriptor, in bytes: 9 |
| 1 |
bDescriptorType |
1 |
Constant |
CS_INTERFACE descriptor type. |
| 2 |
bDescriptorSubtype |
1 |
Constant |
OUTPUT_TERMINAL descriptor subtype. |
| 3 |
bTerminalID |
1 |
Constant |
Constant uniquely identifying the Terminal within the audio function. This value is used in all requests to address this Terminal. |
| 4 |
wTerminalType |
2 |
Constant |
Constant characterizing the type of Terminal. See USB Audio Terminal Types. |
| 6 |
bAssocTerminal |
1 |
Constant |
Constant, identifying the Input Terminal to which this Output Terminal is associated. |
| 7 |
bSourceID |
1 |
Constant |
ID of the Unit or Terminal to which this Terminal is connected. |
| 8 |
iTerminal |
1 |
Index |
Index of a string descriptor, describing the Output Terminal. |
4.3.2.3 Mixer Unit Descriptor
The Mixer Unit is uniquely identified by the value in the bUnitID field of the Mixer Unit descriptor (MUD). No other Unit or Terminal within the same alternate setting of the AudioControl interface may have the same ID. This value must be passed in the UnitID field of each request that is directed to the Mixer Unit.
最終更新:2011年05月22日 12:28