USB Isochronous Transfers Not Accessed by Hardware

Source: Microsoft Support

RAPID PUBLISHING

RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

Symptom

USB Isochronous transfers to a High-Speed USB device may complete later than scheduled, often with no packets transferred.  This may occur when the StartFrame value is explicitly set to a large value after current frame (for example, more than 16ms from the Current Frame).

Cause



To help reduce the amount of power consumed by USB host controllers, Windows Vista disables the periodic scheduler for the USB 2.0 Enhanced (EHCI) host controller if there are no periodic transfers pending.  USB Periodic Transfers include Isochronous and Interrupt transfer types.  On the RTM version of Windows Vista, a check is scheduled every 500ms (1/2 second) to re-enable the periodic scheduler if any periodic transfers have been queued.


If periodic transfers are queued while the periodic scheduler is disabled, they will not be processed until the periodic scheduler is re-enabled.  If the scheduled start time for the periodic transfers has already passed by the time the periodic scheduler resumes, the pending transfers are completed with a status of USBD_STATUS_ISO_NOT_ACCESSED_BY_HW (0xC0020000) for each packet in the transfer.  This status is reported in the Status field of each USBD_ISO_PACKET_DESCRIPTOR structure submitted to the USB stack in the _URB_ISOCH_TRANSFER structure used to describe a URB_FUNCTION_ISOCH_TRANSFER request.

Resolution



This issue is resolved in Windows Server 2008 and Windows Vista Service Pack 1.


Starting in Windows Server 2008 and Windows Vista Service Pack 1, the periodic scheduler for the USB 2.0 (EHCI) host controller is enabled immediately when periodic transfers are queued, so that these transfers can occur when scheduled.


To work around this issue on Windows Vista RTM version, you may prevent the periodic scheduler from being disabled by adding the following registry value for the USB EHCI controller to which the target USB device is attached:


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_xxxx&DEV_yyyy&SUBSYS_zzzzvvvv&REV_ww\qqqqqqqq\Device Parameters]
"EnHcPeriodicIdle"=dword:00000000


Where the following values correspond to the specific USB EHCI controller instance in your system:
xxxx = PCI Vendor ID
yyyy = PCI Device ID
zzzz = PCI Subsystem Vendor ID
vvvv = PCI Subsystem Device ID
ww = PCI device Revision number
qqqqqqqq = Device Instance ID


These values can be obtained from the "Device Instance Path" string on the Details tab of the device Properties for the USB2 Ehanced Host Controller device as displayed in Device Manager.

More Information



USB Periodic Transfers include Isochronous and Interrupt transfer types.


More information is available in the USB 2.0 specification, available for download from http://www.usb.org/developers/docs.


When a driver submits a USB Isochronous transfer request to the Microsoft Windows USB stack, the driver submits an IRP_MJ_INTERNAL_DEVICE_CONTROL I/O Request Packet (IRP), with the following parameters:
  • Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_URB
  • (Input): Parameters.Others.Argument1 = pointer to URB structure
  • (Output): Parameters.Others.Argument1 = pointer to URB structure


The URB (USB Request Block) structure for an Isochronous Transfer includes a _URB_HEADER structure which includes the following members:
  • Length: Specifies the length, in bytes, of the URB.
  • Function = URB_FUNCTION_ISOCH_TRANSFER
  • Status: Contains a USB_STATUS_XXX code on return from the host controller driver.


For an Isochronous Transfer, the URB structure also contains a _URB_ISOCH_TRANSFER structure, which contains the following members:
  • Hdr: Pointer to a _URB_HEADER structure that specifies the URB header information.
  • PipeHandle: Specifies an opaque handle to the isochronous pipe (endpoint).
  • TransferFlags: Specifies zero, one, or a combination of the following flags:
    • USBD_TRANSFER_DIRECTION_IN
    • USBD_SHORT_TRANSFER_OK
    • USBD_START_ISO_TRANSFER_ASAP
  • TransferBufferLength: Specifies the length, in bytes, of the buffer specified in TransferBuffer or described in TransferBufferMDL. The host controller driver returns the number of bytes sent to or read from the pipe in this member.
  • TransferBuffer: Pointer to a resident buffer for the transfer or is NULL if an MDL is supplied in TransferBufferMDL.
  • TransferBufferMDL: Pointer to an MDL that describes a resident buffer or is NULL if a buffer is supplied in TransferBuffer.
  • StartFrame: Specifies the frame number the transfer should begin on, if START_ISO_TRANSFER_ASAP is not set in TransferFlags.  If START_ISO_TRANSFER_ASAP is set in TransferFlags, this member contains the frame number that the transfer began on, when the request is returned by the host controller driver.
  • NumberOfPackets: Specifies the number of packets described by the variable-length array member IsoPacket.
  • ErrorCount: Contains the number of packets that completed with an error condition on return from the host controller driver.
  • IsoPacket: Contains a variable-length array of USBD_ISO_PACKET_DESCRIPTOR structures that describe each transfer packet of the isochronous transfer.


 A USBD_ISO_PACKET_DESCRIPTOR structure contains the following members:
  • Offset: Specifies the offset, in bytes, of the buffer for this packet from the beginning of the entire isochronous transfer buffer.
  • Length: Contains the number of bytes read (on return from the host controller driver) or the number of bytes to write to the isochronous pipe.
  • Status: Contains the status, on return from the host controller driver, of this transfer packet.

DISCLAIMER

MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.


TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
Eigenschappen

Artikel-id: 968202 - Laatst bijgewerkt: 20 feb. 2009 - Revisie: 1

Feedback