Feedback endpoint poll rate

Børge Strand-Bergesen <[email protected]>
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAE9Na6GjV=s4Msa6tVPK5cmL9kK8FEaDS3j5APmKz+dAYYObyg@mail.gmail.com>
Hi guys,

I'm maintaining an audio ASIO driver for USB Audio Class 2 (i.e.
Hi-Speed).  It uses libusbK. Descriptor dump from tdd.exe attached.
Code: https://github.com/nikkov/Win-Widget/tree/exp_asio It builds
with VC++08.

Most of it works quite well, but I have trouble setting the poll rate
for a feedback endpoint. This ep lets the Device tell the Host if the
latter needs to adjust the audio sample rate. That's at the core of
asynchronous USB audio.

In line 220 bInterval = 0x04. The Device uses 250us microframes.
Regardless of what I set this bInterval to, the Windows driver polls
the endpoint at a 1ms rate. OS X and Linux support it in built-in
class drivers. OS X polls the ep at quite a different rate. (4 or 8ms
if I remember correctly.) The 0x04 value is a compromize where both
libusbK and OS X are functional. In Linux I haven't yet correlated
bInterval to the actual poll rate.

I'd like to significantly slow down the poll rate. A 32 or 64ms
interval will probably work just fine in the application and reduce
the load on both Host and Device.

I don't know if there is a bug in the descriptor.

Question: What part of the chain (OS, low-level USB driver,
libusbK.sys, libusbk.dll, user mode application) does the actual ep
poll timing? When parsing this value from the descriptor, how is the
poll timing set up?

I have control over the user mode application and Device firmware. And
in both I see that correct feedback data is received and generated,
respectively. I just don't know how to trace it through the Host and
back to the Device.


Thanks,

Borge

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees

_______________________________________________
Libusb-win32-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
UAC2_20140410.txt (text/plain, 11.8 KB)
Information for device QNKTC USB DAC AB-1.2 (VID=0x16D0 PID=0x075D): 

Connection Information:
------------------------------
Connection status: Device connected
Device actual bus speed: High
Device is hub: No
Device adress: 0x0002
Current configuration value: 0x01
Number of open pipes: 4

Device Descriptor:
------------------------------
0x12	bLength
0x01	bDescriptorType
0x0200	bcdUSB
0xEF	bDeviceClass   (Miscellaneous device)
0x02	bDeviceSubClass   
0x01	bDeviceProtocol   
0x40	bMaxPacketSize0   (64 Bytes)
0x16D0	idVendor
0x075D	idProduct
0x1000	bcdDevice
0x01	iManufacturer   "Audio-Widget"
0x02	iProduct   "QNKTC USB DAC AB-1.2"
0x03	iSerialNumber   "1.0.0.0.0.0.A"
0x01	bNumConfigurations

Device Qualifier Descriptor:
------------------------------
0x0A	bLength
0x06	bDescriptorType
0x0200	bcdUSB
0xEF	bDeviceClass   (Miscellaneous device)
0x02	bDeviceSubClass   
0x01	bDeviceProtocol   
0x40	bMaxPacketSize0   (64 Bytes)
0x01	bNumConfigurations 
0x00	bReserved 

Configuration Descriptor:
------------------------------
0x09	bLength
0x02	bDescriptorType
0x00C1	wTotalLength
0x04	bNumInterfaces
0x01	bConfigurationValue
0x00	iConfiguration
0x80	bmAttributes   (Bus-powered Device)
0xFA	bMaxPower   (500 mA)

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x00	bInterfaceNumber
0x00	bAlternateSetting
0x00	bNumEndPoints
0x00	bInterfaceClass   
0x00	bInterfaceSubClass   
0x00	bInterfaceProtocol   
0x00	iInterface

Interface Association Descriptor:
------------------------------
0x08	bLength
0x0B	bDescriptorType
0x01	bFirstInterface
0x02	bInterfaceCount
0x01	bFunctionClass   (Audio Device Class)
0x00	bFunctionSubClass   
0x20	bFunctionProtocol   
0x00	iFunction

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x01	bInterfaceNumber
0x00	bAlternateSetting
0x00	bNumEndPoints
0x01	bInterfaceClass   (Audio Device Class)
0x01	bInterfaceSubClass   (Audio Control Interface)
0x20	bInterfaceProtocol   
0x07	iInterface   "QNKTC USB DAC AB-1.2"

AC Interface Header Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x0200	bcdADC
0x04	bCategory
0x0040	wTotalLength
0x00	bmControls

AC Clock Source Descriptor:
------------------------------
0x08	bLength
0x24	bDescriptorType
0x0A	bDescriptorSubtype
0x05	bClockID
0x01	bmAttributes
0x07	bmControls
0x03	bAssocTerminal
0x05	iClockSource   "Clock 2"

AC Input Terminal Descriptor:
------------------------------
0x11	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x11	bTerminalID
0x0101	wTerminalType   (USB Streaming)
0x00	bAssocTerminal
0x05	bCSourceID
0x02	bNrChannels
0x00000003	bmChannelConfig
0x00	iChannelNames
0x00	bmControls
0x08	iTerminal   "Audio-widget"

AC Feature Unit Descriptor:
------------------------------
0x12	bLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x12	bUnitID
0x11	bSourceID
0x00000003	bmaControls(0)
0x00000003	bmaControls(1)
0x00000003	bmaControls(2)
0x00	iFeature

AC Output Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x03	bDescriptorSubtype
0x13	bTerminalID
0x0302	wTerminalType   (Headphones)
0x00	bAssocTerminal
0x12	bSourceID
0x05	bCSourceID
0x0000	bmControls
0x00	iTerminal

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x02	bInterfaceNumber
0x00	bAlternateSetting
0x00	bNumEndPoints
0x01	bInterfaceClass   (Audio Device Class)
0x02	bInterfaceSubClass   (Audio Streaming Interface)
0x20	bInterfaceProtocol   
0x00	iInterface

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x02	bInterfaceNumber
0x01	bAlternateSetting
0x02	bNumEndPoints
0x01	bInterfaceClass   (Audio Device Class)
0x02	bInterfaceSubClass   (Audio Streaming Interface)
0x20	bInterfaceProtocol   
0x00	iInterface

AS Interface Descriptor:
------------------------------
0x10	bLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x11	bTerminalLink
0x07	bmControls
0x01	bFormatType
0x00000001	bmFormats
0x02	bNrChannels
0x00000003	bmChannelConfig
0x00	iChannelNames

AS Format Type 1 Descriptor:
------------------------------
0x06	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType
0x04	bSubslotSize
0x18	bBitResolution   (24 Bits/sample)

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x02	bEndpointAddress   (OUT Endpoint)
0x05	bmAttributes	(Transfer: Isochronous / Synch: Asynchronous / Usage: Data)
0x0188	wMaxPacketSize   (392 Bytes) 
0x02	bInterval

AS Isochronous Data Endpoint Descriptor:
------------------------------
0x08	bLength
0x25	bDescriptorType
0x01	bDescriptorSubtype
0x00	bmAttributes
0x00	bmControls
0x00	bLockDelayUnits   (Undefined)
0x0000	wLockDelay

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x81	bEndpointAddress   (IN Endpoint)
0x11	bmAttributes	(Transfer: Isochronous / Synch: None / Usage: Feedback)
0x0004	wMaxPacketSize   (4 Bytes) 
0x04	bInterval

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x03	bInterfaceNumber
0x00	bAlternateSetting
0x02	bNumEndPoints
0x03	bInterfaceClass   (Human Interface Device Class)
0x00	bInterfaceSubClass   
0x00	bInterfaceProtocol   
0x00	iInterface

HID Descriptor:
------------------------------
0x09	bLength
0x21	bDescriptorType
0x0111	bcdHID
0x00	bCountryCode
0x01	bNumDescriptors
0x22	bDescriptorType   (Report descriptor)
0x0043	bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x84	bEndpointAddress   (IN Endpoint)
0x03	bmAttributes	(Transfer: Interrupt / Synch: None / Usage: Data)
0x0008	wMaxPacketSize   (8 Bytes) 
0x05	bInterval

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x05	bEndpointAddress   (OUT Endpoint)
0x03	bmAttributes	(Transfer: Interrupt / Synch: None / Usage: Data)
0x0008	wMaxPacketSize   (8 Bytes) 
0x05	bInterval

Other Speed Configuration Descriptor:
------------------------------
0x09	bLength
0x07	bDescriptorType
0x00C1	wTotalLength
0x04	bNumInterfaces
0x01	bConfigurationValue
0x00	iConfiguration
0x80	bmAttributes   (Bus-powered Device)
0xFA	bMaxPower   (500 mA)

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x00	bInterfaceNumber
0x00	bAlternateSetting
0x00	bNumEndPoints
0x00	bInterfaceClass   
0x00	bInterfaceSubClass   
0x00	bInterfaceProtocol   
0x00	iInterface

Interface Association Descriptor:
------------------------------
0x08	bLength
0x0B	bDescriptorType
0x01	bFirstInterface
0x02	bInterfaceCount
0x01	bFunctionClass   (Audio Device Class)
0x01	bFunctionSubClass   (Audio Control Interface)
0x20	bFunctionProtocol   
0x07	iFunction   "QNKTC USB DAC AB-1.2"

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x01	bInterfaceNumber
0x00	bAlternateSetting
0x00	bNumEndPoints
0x01	bInterfaceClass   (Audio Device Class)
0x01	bInterfaceSubClass   (Audio Control Interface)
0x20	bInterfaceProtocol   
0x07	iInterface   "QNKTC USB DAC AB-1.2"

AC Interface Header Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x0200	bcdADC
0x04	bCategory
0x0040	wTotalLength
0x00	bmControls

AC Clock Source Descriptor:
------------------------------
0x08	bLength
0x24	bDescriptorType
0x0A	bDescriptorSubtype
0x05	bClockID
0x01	bmAttributes
0x07	bmControls
0x01	bAssocTerminal
0x00	iClockSource

AC Input Terminal Descriptor:
------------------------------
0x11	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x11	bTerminalID
0x0101	wTerminalType   (USB Streaming)
0x00	bAssocTerminal
0x05	bCSourceID
0x02	bNrChannels
0x00000003	bmChannelConfig
0x00	iChannelNames
0x00	bmControls
0x00	iTerminal

AC Feature Unit Descriptor:
------------------------------
0x12	bLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x12	bUnitID
0x11	bSourceID
0x00000003	bmaControls(0)
0x00000003	bmaControls(1)
0x00000003	bmaControls(2)
0x00	iFeature

AC Output Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x03	bDescriptorSubtype
0x13	bTerminalID
0x0302	wTerminalType   (Headphones)
0x00	bAssocTerminal
0x12	bSourceID
0x05	bCSourceID
0x0000	bmControls
0x00	iTerminal

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x02	bInterfaceNumber
0x00	bAlternateSetting
0x00	bNumEndPoints
0x01	bInterfaceClass   (Audio Device Class)
0x02	bInterfaceSubClass   (Audio Streaming Interface)
0x20	bInterfaceProtocol   
0x00	iInterface

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x02	bInterfaceNumber
0x01	bAlternateSetting
0x02	bNumEndPoints
0x01	bInterfaceClass   (Audio Device Class)
0x02	bInterfaceSubClass   (Audio Streaming Interface)
0x20	bInterfaceProtocol   
0x00	iInterface

AS Interface Descriptor:
------------------------------
0x10	bLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x11	bTerminalLink
0x07	bmControls
0x01	bFormatType
0x00000001	bmFormats
0x02	bNrChannels
0x00000003	bmChannelConfig
0x00	iChannelNames

AS Format Type 1 Descriptor:
------------------------------
0x06	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType
0x04	bSubslotSize
0x18	bBitResolution   (24 Bits/sample)

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x02	bEndpointAddress   (OUT Endpoint)
0x05	bmAttributes	(Transfer: Isochronous / Synch: Asynchronous / Usage: Data)
0x0188	wMaxPacketSize   (392 Bytes) 
0x01	bInterval

AS Isochronous Data Endpoint Descriptor:
------------------------------
0x08	bLength
0x25	bDescriptorType
0x01	bDescriptorSubtype
0x00	bmAttributes
0x00	bmControls
0x00	bLockDelayUnits   (Undefined)
0x0000	wLockDelay

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x81	bEndpointAddress   (IN Endpoint)
0x11	bmAttributes	(Transfer: Isochronous / Synch: None / Usage: Feedback)
0x0004	wMaxPacketSize   (4 Bytes) 
0x01	bInterval

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x03	bInterfaceNumber
0x00	bAlternateSetting
0x02	bNumEndPoints
0x03	bInterfaceClass   (Human Interface Device Class)
0x00	bInterfaceSubClass   
0x00	bInterfaceProtocol   
0x00	iInterface

HID Descriptor:
------------------------------
0x09	bLength
0x21	bDescriptorType
0x0111	bcdHID
0x00	bCountryCode
0x01	bNumDescriptors
0x22	bDescriptorType   (Report descriptor)
0x0043	bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x84	bEndpointAddress   (IN Endpoint)
0x03	bmAttributes	(Transfer: Interrupt / Synch: None / Usage: Data)
0x0008	wMaxPacketSize   (8 Bytes) 
0x05	bInterval

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x05	bEndpointAddress   (OUT Endpoint)
0x03	bmAttributes	(Transfer: Interrupt / Synch: None / Usage: Data)
0x0008	wMaxPacketSize   (8 Bytes) 
0x05	bInterval

String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  0x0409 
0x01   0x0409  "Audio-Widget"
0x02   0x0409  "QNKTC USB DAC AB-1.2"
0x03   0x0409  "1.0.0.0.0.0.A"
0x07   0x0409  "QNKTC USB DAC AB-1.2"
0x05   0x0409  "Clock 2"
0x08   0x0409  "Audio-widget"
0xEE   0x0000  Request failed with 0x0000001F

------------------------------

Connection path for device: 
Intel(R) 82801G (ICH7 Family) USB2 Enhanced Host Controller - 27CC
Root Hub
Generic USB Hub
QNKTC USB DAC AB-1.2 (VID=0x16D0 PID=0x075D)

Brought to you by TDD v1.83.0, Mar  7 2014, 14:22:05
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.