USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 41
The bNrInPins field contains the number of Input Pins (p) of the Mixer Unit. This evidently equals the number of audio channel clusters that enter the Mixer Unit. The connectivity of the Input Pins is described via the baSourceID() array, containing p elements. The index i into the array is one-based and directly related to the Input Pin numbers. BaSourceID(i) contains the ID of the Unit or Terminal to which Input Pin i is connected. The cluster descriptors, describing the logical channels entering the Mixer Unit are not repeated here. It is up to the Host software to trace the connections ‘upstream’ to locate the cluster descriptors pertaining to the audio channel clusters.
As mentioned before, every input channel can virtually be mixed into all of the output channels. If n is thetotal number of logical input channels, contained in all the audio channel clusters that are entering the
Mixer Unit:
and m is the number of logical output channels, then there are n x m mixing Controls in the Mixer Unit, some of which may not be programmable.
cite(Note): Both n and m must be limited to 254.
Because a Mixer Unit can redefine the spatial locations of the logical output channels, contained in its output cluster, there is a need for a Mixer output cluster descriptor. The bNrChannels, wChannelConfig and iChannelNames characterize the cluster that leaves the Mixer Unit 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.”
The Mixer Unit Descriptor reports which Controls are programmable in the bmControls bitmap field. This bitmap must be interpreted as a two-dimensional bit array that has a row for each logical input channel and a column for each logical output channel. If a bit at position [u, v] is set, this means that the Mixer Unit contains a programmable mixing Control that connects input channel u to output channel v. If bit [u, v] is clear, this indicates that the connection between input channel u and output channel v is non-programmable. Its fixed value can be retrieved through the appropriate request. The valid range for u is from one to n. The valid range for v is from one to m.
The bmControls field stores the bit array row after row where the MSb of the first byte corresponds to the connection between input channel 1 and output channel 1. If (n x m) is not an integer multiple of 8, the bit array is padded with zeros until an integer number of bytes is occupied. The number of bytes used to store the bit array, N, can be calculated as follows:
IF ((n x m) MOD 8) <> 0 THEN
N = ((n x m) DIV 8) + 1
ELSE
N = ((n x m) DIV 8)
An index to a string descriptor is provided to further describe the Mixer Unit.
The following table details the structure of the Mixer Unit descriptor.
Table 4-5: Mixer Unit Descriptor
| Offset |
Field |
Size |
Value |
Description |
| 0 |
bLength |
1 |
Number |
Size of this descriptor, in bytes: 10+p+N |
| 1 |
bDescriptorType |
1 |
Constant |
CS_INTERFACE descriptor type. |
| 2 |
bDescriptorSubtype |
1 |
Constant |
MIXER_UNIT descriptor subtype. |
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 42
| Offset |
Field |
Size |
Value |
Description |
| 3 |
bUnitID |
1 |
Number |
Constant uniquely identifying the Unit within the audio function. This value is used in all requests to address this Unit. |
| 4 |
bNrInPins |
1 |
Number |
Number of Input Pins of this Unit: p |
| 5 |
baSourceID(1) |
1 |
Number |
ID of the Unit or Terminal to which the first Input Pin of this Mixer Unit is connected. |
| … |
… |
… |
… |
… |
| 5+(p-1) |
baSourceID (p) |
1 |
Number |
ID of the Unit or Terminal to which the last Input Pin of this Mixer Unit is connected. |
| 5+p |
bNrChannels |
1 |
Number |
Number of logical output channels in the Mixer’s output audio channel cluster. |
| 6+p |
wChannelConfig |
2 |
Bitmap |
Describes the spatial location of the logical channels. |
| 8+p |
iChannelNames |
1 |
Index |
Index of a string descriptor, describing the name of the first logical channel. |
| 9+p |
bmControls |
N |
Number |
Bit map indicating which mixing Controls are programmable. |
| 9+p+N |
iMixer |
1 |
Index |
Index of a string descriptor, describing the Mixer Unit. |
4.3.2.4 Selector Unit Descriptor
The Selector Unit is uniquely identified by the value in the bUnitID field of the Selector Unit descriptor (SUD). 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 Selector Unit.
The bNrInPins field contains the number of Input Pins (p) of the Selector Unit. The connectivity of the Input Pins is described via the baSourceID() array that contains p elements. The index i into the array is one-based and directly related to the Input Pin numbers. BaSourceID(i) contains the ID of the Unit or Terminal to which Input Pin i is connected.
The cluster descriptors, describing the logical channels that enter the Selector Unit are not repeated here. In order for a Selector Unit to be legally connected, all of the audio channel clusters that enter the Selector Unit must have the same number of channels. However, the spatial locations of these channels may vary from cluster to cluster. Therefore, the Host software should trace all Input Pins to find their ‘upstream’ connection to locate the cluster descriptors for all the Input Pins that enter the Selector Unit. This further implies that the cluster descriptor, associated with the Output Pin of the Selector Unit can change dynamically, depending on the currently selected position of the Selector Unit.
An index to a string descriptor is provided to further describe the Selector Unit.
The following table details the structure of the Selector Unit descriptor.
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 43
Table 4-6: Selector Unit Descriptor
| Offset |
Field |
Size |
Value |
Description |
| 0 |
bLength |
1 |
Number |
Size of this descriptor, in bytes: 6+p |
| 1 |
bDescriptorType |
1 |
Constant |
CS_INTERFACE descriptor type. |
| 2 |
bDescriptorSubtype |
1 |
Constant |
SELECTOR_UNIT descriptor subtype. |
| 3 |
bUnitID |
1 |
Number |
Constant uniquely identifying the Unit within the audio function. This value is used in all requests to address this Unit. |
| 4 |
bNrInPins |
1 |
Number |
Number of Input Pins of this Unit: p |
| 5 |
baSourceID(1) |
1 |
Number |
ID of the Unit or Terminal to which the first Input Pin of this Selector Unit is connected. |
| … |
… |
… |
… |
… |
| 5+(p-1) |
baSourceID (p) |
1 |
Number |
ID of the Unit or Terminal to which the last Input Pin of this Selector Unit is connected. |
| 5+p |
iSelector |
1 |
Index |
Index of a string descriptor, describing the Selector Unit. |
4.3.2.5 Feature Unit Descriptor
The Feature Unit is uniquely identified by the value in the bUnitID field of the Feature Unit descriptor (FUD). 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 Feature Unit.
The bSourceID field is used to describe the connectivity for this Feature Unit. It contains the ID of the Unit or Terminal to which this Feature Unit is connected via its Input Pin. The cluster descriptor, describing the logical channels entering the Feature Unit 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.
The bmaControls() array is an array of bit-maps, each indicating the availability of certain audio Controls for a specific logical channel or for the master channel 0. For future expandability, the number of bytes occupied by each element (n) of the bmaControls() array is indicated in the bControlSize field. The number of logical channels in the cluster is denoted by ch.
An index to a string descriptor is provided to further describe the Feature Unit.
The layout of the Feature Unit descriptor is detailed in the following table.
Table 4-7: Feature Unit Descriptor
| Offset |
Field |
Size |
Value |
Description |
| 0 |
bLength |
1 |
Number |
Size of this descriptor, in bytes: 7+(ch+1)*n |
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 44
| Offset |
Field |
Size |
Value |
Description |
| 1 |
bDescriptorType |
1 |
Constant |
CS_INTERFACE descriptor type. |
| 2 |
bDescriptorSubtype |
1 |
Constant |
FEATURE_UNIT descriptor subtype. |
| 3 |
bUnitID |
1 |
Number |
Constant uniquely identifying the Unit within the audio function. This value is used in all requests to address this Unit. |
| 4 |
bSourceID |
1 |
Constant |
ID of the Unit or Terminal to which this Feature Unit is connected. |
| 5 |
bControlSize |
1 |
Number |
Size in bytes of an element of the bmaControls() array: n |
| 6 |
bmaControls(0) |
n |
Bitmap |
A bit set to 1 indicates that the mentioned Control is supported for master channel 0: D0: Mute D1: Volume D2: Bass D3: Mid D4: Treble D5: Graphic Equalizer D6: Automatic Gain D7: Delay D8: Bass Boost D9: Loudness D10..(n*8-1): Reserved |
| 6+n |
bmaControls(1) |
n |
Bitmap |
A bit set to 1 indicates that the mentioned Control is supported for logical channel 1. |
| … |
… |
… |
… |
… |
| 6+(ch*n) |
bmaControls(ch) |
n |
Bitmap |
A bit set to 1 indicates that the mentioned Control is supported for logical channel ch. |
| 6+(ch+1)*n |
iFeature |
1 |
Index |
Index of a string descriptor, describing this Feature Unit. |
4.3.2.6 Processing Unit Descriptor
The Processing Unit is uniquely identified by the value in the bUnitID field of the Processing Unit descriptor (PUD). 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 Processing Unit.
The wProcessType field contains a value that fully identifies the Processing Unit. For a list of all supported Processing Unit Types, see Section A.7, “Processing Unit Process Types.”
The bNrInPins field contains the number of Input Pins (p) of the Processing Unit. The connectivity of the Input Pins is described via the baSourceID() array that contains p elements. The index i into the array is one-based and directly related to the Input Pin numbers. BaSourceID(i) contains the ID of the Unit or
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 45
Terminal to which Input Pin i is connected. The cluster descriptors, describing the logical channels entering the Processing Unit are not repeated here. It is up to the Host software to trace the connections ‘upstream’ to locate the cluster descriptors pertaining to the audio channel clusters.
Because a Processing Unit can freely redefine the spatial locations of the logical output channels, contained in its output cluster, there is a need for an output cluster descriptor. The bNrChannels, wChannelConfig, and iChannelNames fields characterize the cluster that leaves the Processing Unit 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.”
The bmControls field is a bitmap, indicating the availability of certain audio Controls in the Processing Unit. For future expandability, the number of bytes occupied by the bmControls field is indicated in the bControlSize field. In general, all Controls are optional. However, some Processing Types may define certain Controls as mandatory. In such a case, the appropriate bit in the bmControls field must be set to one.
The meaning of the bits in the bmControls field is qualified by the wProcessType field. However, bit D0 always represents the Enable Processing Control for all Processing Unit Types. The Enable Processing Control is used to bypass the entire functionality of the Processing Unit. Default behavior is assumed when set to off. In case of a single Input Pin, logical channels entering the Unit are passed unaltered for those channels that are also present in the output cluster. Logical channels not available in the output cluster are absorbed by the Processing Unit. Logical channels present in the output cluster but unavailable in the input cluster are muted. In case of multiple Input Pins, corresponding logical input channels are equally mixed together before being passed to the output.
If the Enable Processing Control is present in a Processing Unit, bit D0 must be set to one. Otherwise, it is set to zero, indicating that the Processing Unit cannot be bypassed.
An index to a string descriptor is provided to further describe the Processing Unit.
The previous fields are common to all Processing Units. However, depending on the value in the wProcessType field, a process-specific part is added to the descriptor. The following paragraphs describe these process-specific parts.
The following table outlines the common part of the Processing Unit descriptor.
Table 4-8: Common Part of the Processing Unit Descriptor
| Offset |
Field |
Size |
Value |
Description |
| 0 |
bLength |
1 |
Number |
Size of this descriptor, in bytes: 13+p+n+x |
| 1 |
bDescriptorType |
1 |
Constant |
CS_INTERFACE descriptor type. |
| 2 |
bDescriptorSubtype |
1 |
Constant |
PROCESSING_UNIT descriptor subtype. |
| 3 |
bUnitID |
1 |
Number |
Constant uniquely identifying the Unit within the audio function. This value is used in all requests to address this Unit. |
| 4 |
wProcessType |
2 |
Constant |
Constant identifying the type of processing this Unit is performing. |
| 6 |
bNrInPins |
1 |
Number |
Number of Input Pins of this Unit: p |
最終更新:2011年05月28日 11:51