USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 66
5.2.1.1 Set Request
This request is used to set an attribute of a Control inside an Entity of the audio function. Additionally, the
memory space attribute of an Entity itself can be set through this request.
Table 5-1: Set Request Values
bmRequest
Type
bRequest wValue wIndex wLength Data
00100001B Entity ID
and
Interface
00100010B
SET_CUR
SET_MIN
SET_MAX
SET_RES
SET_MEM
See following
paragraphs
Endpoint
Length of
parameter
block
Parameter
block
The bmRequestType field specifies that this is a SET request (D7=0b0). It is a class-specific request
(D6..5=0b01), directed to either the AudioControl interface or an AudioStreaming interface of the audio
function (D4..0=0b00001) or the isochronous endpoint of an AudioStreaming interface (D4..0=0b00010).
The bRequest field contains a constant, identifying which attribute of the addressed Control or Entity is
to be modified. Possible attributes for a Control are its:
· Current setting attribute (SET_CUR)
· Minimum setting attribute (SET_MIN)
· Maximum setting attribute (SET_MAX)
· Resolution attribute (SET_RES)
Possible attributes for an Entity are its:
· Memory space attribute (SET_MEM)
If the addressed Control or Entity does not support modification of a certain attribute, the control pipe
must indicate a stall when an attempt is made to modify that attribute. In most cases, only the CUR and
MEM attribute will be supported for the Set request. However, this specification does not prevent a
designer from making other attributes programmable. For the list of Request constants, refer to Section
A.9, “Audio Class-Specific Request Codes.”
The wValue field interpretation is qualified by the value in the wIndex field. Depending on what Entity is
addressed, the layout of the wValue field changes. The following paragraphs describe the contents of the
wValue field for each Entity separately. In most cases, the wValue field contains the Control Selector
(CS) in the high byte. It is used to address a particular Control within Entities that can contain multiple
Controls. If the Entity only contains a single Control, there is no need to specify a Control Selector and
the wValue field can be used to pass additional parameters.
The wIndex field specifies the interface or endpoint to be addressed in the low byte and the Entity ID or
zero in the high byte. In case an interface is addressed, the virtual Entity ‘interface’ can be addressed by
specifying zero in the high byte. The values in wIndex must be appropriate to the recipient. Only existing
Entities in the audio function can be addressed and only appropriate interface or endpoint numbers may be
used. If the request specifies an unknown or non-Entity ID or an unknown interface or endpoint number,
the control pipe must indicate a stall.
The actual parameter(s) for the Set request are passed in the data stage of the control transfer. The length
of the parameter block is indicated in the wLength field of the request. The layout of the parameter block
is qualified by both the bRequest and wIndex fields. Refer to the following sections for a detailed
description of the parameter block layout for all possible Entities.
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 67
5.2.1.2 Get Request
This request returns the attribute setting of a specific Control inside an Entity of the audio function.
Additionally, the memory space attribute of an Entity itself can be returned through this request.
Table 5-2: Get Request Values
bmRequest
Type
bRequest wValue wIndex wLength Data
10100001B Entity ID
and
Interface
10100010B
GET_CUR
GET_MIN
GET_MAX
GET_RES
GET_MEM
See following
paragraphs
Endpoint
Length of
parameter
block
Parameter
block
The bmRequestType field specifies that this is a GET request (D7=0b1). It is a class-specific request
(D6..5=0b01), directed to either the AudioControl interface or an AudioStreaming interface of the audio
function (D4..0=0b00001) or the isochronous endpoint of an AudioStreaming interface (D4..0=0b00010).
The bRequest field contains a constant, identifying which attribute of the addressed Control or Entity is
to be returned. Possible attributes for a Control are its:
· Current setting attribute (GET_CUR)
· Minimum setting attribute (GET_MIN)
· Maximum setting attribute (GET_MAX)
· Resolution attribute (GET_RES)
Possible attributes for an Entity are its:
· Memory space attribute (GET_MEM)
If the addressed Control or Entity does not support readout of a certain attribute, the control pipe must
indicate a stall when an attempt is made to read that attribute. For the list of Request constants, refer to
Section A.9, “Audio Class-Specific Request Codes.”
The wValue field interpretation is qualified by the value in the wIndex field. Depending on what Entity is
addressed, the layout of the wValue field changes. The following paragraphs describe the contents of the
wValue field for each Entity separately. In most cases, the wValue field contains the Control Selector
(CS) in the high byte. It is used to address a particular Control within Entities that can contain multiple
Controls. If the Entity only contains a single Control, there is no need to specify a Control Selector and
the wValue field can be used to pass additional parameters.
The wIndex field specifies the interface or endpoint to be addressed in the low byte and the Entity ID or
zero in the high byte. In case an interface is addressed, the virtual Entity ‘interface’ can be addressed by
specifying zero in the high byte. The values in wIndex must be appropriate to the recipient. Only existing
Entities in the audio function can be addressed and only appropriate interface or endpoint numbers may be
used. If the request specifies an unknown or non-Entity ID or an unknown interface or endpoint number,
the control pipe must indicate a stall.
The actual parameter(s) for the Get request are returned in the data stage of the control transfer. The
length of the parameter block to return is indicated in the wLength field of the request. If the parameter
block is longer than what is indicated in the wLength field, only the initial bytes of the parameter block
are returned. If the parameter block is shorter than what is indicated in the wLength field, the device
indicates the end of the control transfer by sending a short packet when further data is requested. The
layout of the parameter block is qualified by both the bRequest and wIndex fields. Refer to the following
sections for a detailed description of the parameter block layout for all possible Entities.
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 68
5.2.2 AudioControl Requests
The following sections describe the possible requests that can be used to manipulate the audio Controls an
audio function exposes through its Units. The same layout of the parameter blocks is used for both the Set
and Get requests.
5.2.2.1 Terminal Control Requests
The following paragraphs describe the Set and Get Terminal Control requests.
5.2.2.1.1 Set Terminal Control Request
This request is used to set an attribute of a Terminal Control inside a Terminal of the audio function.
Table 5-3: Set Terminal Control Request Values
bmRequest
Type
bRequest wValue wIndex wLength Data
00100001B SET_CUR
SET_MIN
SET_MAX
SET_RES
CS Terminal ID
and
Interface
Length of
parameter
block
Parameter
block
The bRequest field indicates which attribute the request is manipulating. The MIN, MAX and RES
attributes are usually not supported for the Set request.
The wValue field specifies the Control Selector (CS) in the high byte and zero in the low byte. The
Control Selector indicates which type of Control this request is manipulating. If the request specifies an
unknown or unsupported CS to that Terminal, the control pipe must indicate a stall.
For a description of the parameter block for the Terminal Controls, see Section 5.2.2.1.3, “Terminal
Controls.”
5.2.2.1.2 Get Terminal Control Request
This request returns the attribute setting of a specific Terminal Control inside a Terminal of the audio
function.
Table 5-4: Get Terminal Control Request Values
bmRequest
Type
bRequest wValue wIndex wLength Data
10100001B GET_CUR
GET_MIN
GET_MAX
GET_RES
CS Terminal ID
and
Interface
Length of
parameter
block
Parameter
block
The bRequest field indicates which attribute the request is reading
The wValue field specifies the Control Selector (CS) in the high byte and zero in the low byte. The
Control Selector indicates which type of Control this request is addressing. If the request specifies an
unknown or unsupported CS to that Terminal, the control pipe must indicate a stall.
For a description of the parameter block for the Terminal Controls, see Section 5.2.2.1.3, “Terminal
Controls.”
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 69
5.2.2.1.3 Terminal Controls
For the time being, this specification defines only one Terminal Control. The following section presents a
detailed description.
5.2.2.1.3.1 Copy Protect Control
The Copy Protect Control is used to manipulate the Copy Protection Level (CPL) associated with a
particular Terminal. Not all Terminals are required to support this Control. Only the Terminals that
represent a connection to the audio function where audio streams enter or leave the audio function in a
form that enables lossless duplication should consider Copy Protect Control. Input Terminals in this
category should only support the Get Terminal Copy Protect Control request whereas Output Terminals in
the same category should only support the Set Terminal Copy Protect Control request.
A Copy Protect Control only supports the CUR attribute. The settings for the CUR attribute range from 0
to 2. This means:
· 0: CPL0: Copying is permitted without restriction. The material is either not copyrighted, or the
copyright is not asserted.
· 1: CPL1: One generation of copies may be made. The material is copyright protected and is the
original.
· 2: CPL2: The material is copyright protected and no digital copying is permitted.
The Copy Protect Control honors the request to the best of its abilities. It may round the bCopyProtect
attribute value to its closest available setting. It will report this setting when queried during a Get Control
request.
Table 5-5: Copy Protect Control Parameter Block
Control Selector COPY_PROTECT_CONTROL
wLength 1
Offset Field Size Value Description
0 bCopyProtect 1 Number The setting for the CUR attribute of the
CopyProtect Control.
0x00: CPL0
0x01: CPL1
0x02: CPL2
5.2.2.2 Mixer Unit Control Requests
The following paragraphs describe the Set and Get Mixer Unit Control requests. The Set Mixer Unit
Control request can have two forms. The first form must be supported while the second form can be
optionally implemented. The Get Mixer Unit Control request can have three forms. The first form must be
supported, while the second and third form can be optionally implemented. If the second form of the Set
request is implemented, the second form of the Get request must also be implemented.
USB Device Class Definition for Audio Devices
Release 1.0 March 18, 1998 70
5.2.2.2.1 Set Mixer Unit Control Request
This request is used to set an attribute of a Mixer Control inside a Mixer Unit of the audio function.
Table 5-6: Set Mixer Unit Control Request Values
bmRequest
Type
bRequest wValue wIndex wLength Data
00100001B SET_CUR
SET_MIN
SET_MAX
SET_RES
ICN and OCN Mixer Unit ID
and
Interface
Length of
parameter
block
Parameter
block
The bRequest field indicates which attribute the request is manipulating. The MIN, MAX and RES
attributes are usually not supported for the Set request.
Because the Mixer Unit only contains a single type of Control, there is no need for a Control Selector.
Instead, the wValue field specifies the Input Channel Number (ICN) in the high byte and the Output
Channel Number (OCN) in the low byte of the Mixer Control to be influenced. The ICN is derived from
both the input cluster number and the logical channel number within that cluster, according to the rules
established in Section 4.3.2.3, “Mixer Unit Descriptor.” (ICN=u, OCN=v) If the request specifies an
unknown ICN or OCN to that Unit or refers to a non-programmable Mixer Control in the Mixer Unit, the
control pipe must indicate a stall.
A special case arises when the Input Channel Number and Output Channel Number are both set to 0xFF.
Then a single Set Mixer Unit Control request can be used to set an attribute of all the programmable
Mixer Controls within the Unit. The number of parameters passed in the parameter block must exactly
match the number of programmable Mixer Controls in the Unit. If this is not the case, the control pipe
must indicate a stall. The ordering of the parameters in the parameter block obeys the same rules as
established for the bit ordering in the bmControls field of the Mixer Unit Descriptor. The parameter
block must contain an attribute setting for every Mixer Control that has its bit set in the bmControls field.
The previous description is referred to as the second form of the Set Mixer Unit Control request.
For a description of the parameter block for the Set Mixer Unit Control request, see Section 5.2.2.2.3,
“Mixer Control.”
5.2.2.2.2 Get Mixer Unit Control Request
This request returns the attribute setting of a specific Mixer Control inside a Mixer Unit of the audio
function.
Table 5-7: Get Mixer Unit Control Request Values
bmRequest
Type
bRequest wValue wIndex wLength Data
10100001B GET_CUR
GET_MIN
GET_MAX
GET_RES
ICN and OCN Mixer Unit ID
and
Interface
Length of
parameter
block
Parameter
block
The bRequest field indicates which attribute the request is reading
Because the Mixer Unit only contains a single type of Control, there is no need for a Control Selector.
Instead, the wValue field specifies the Input Channel Number (ICN) in the high byte and the Output
Channel Number (OCN) in the low byte of the Mixer Control to be retrieved. The ICN is derived from
both the input cluster number and the logical channel number within that cluster, according to the rules
最終更新:2011年05月02日 03:33