none
Explicit feedback with usbaudio2.sys RRS feed

  • Question

  • We are developing a 4-channel, 48K UADC2.0 compliant USB audio interface. It enumerates and streams (for a while) but the host driver (usbaudio2.sys) never issues IN tokens for feedback despite the fact that we have a properly defined feedback endpoint and our OUT endpoint is configured for isochronous, asynchronous data operation. We can capture the complete enumeration process including the host querying the fixed sample rate of 48K. When we select our device as the speaker output the driver starts streaming to the OUT endpoint (using the first 2 channels as 24-bit speaker output and placing silence in the other 2 channels) but it never issues a single IN token to the same endpoint number as the OUT endpoint number to read the 4-byte feedback value.
    Friday, March 13, 2020 12:14 AM

Answers

  • Lowering the bInterval value for our feedback endpoint from 0x08 to 0x04 caused the host to issue IN tokens for feedback packets. Thanks so much for your help.
    • Marked as answer by jvl642 Tuesday, March 17, 2020 4:36 PM
    Tuesday, March 17, 2020 4:36 PM

All replies

  • Hello jvl642,

    It's hard to say this issue is driver related or user application related based on limited information.

    Could you show more detailed information like what's kind of application type you are working on, Win32 C++, WPF or others? Refer to Choose your app platform.

    And do you use any third-party library or just use Windows APIs? For Windows APIs, do you use which technology listed in "Desktop Win32 apps develop - Audio and Video"?

    And could you show some code lines or APIs related to "never issues IN tokens" problem? So we can do a further investigation.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, March 13, 2020 6:32 AM
  • Perhaps I have posted this to the wrong forum. We are developing an embedded platform (a guitar amplifier) that has a highspeed USB interface so that the user can use it like a sound card or speaker (for playback from the computer) and a microphone (for recording their guitar playing). The user can play music on the computer (selecting the amp as the speaker output) and the amp mixes the played music with the guitar output. It plays the combined sound to the amplified speakers and returns the guitar portion to the computer for recording. To test it, we select our amp as the speaker output of the PC and then play audio from the computer to the amp over USB using any available music player but often just use a browser playing youtube videos. We can see from the USB analyzer (and from the driver logs) that the operating system recognizes our amp as a class-compliant USB audio device and is loading the "in-box" usbaudio2.sys driver. From the analyzer we can see that the driver queries the sample rate from our amp (48000 samples per second), enables the OUT streaming interface and routes audio to the amp. However, the driver never issues IN tokens to query the actual rate from the amp and as a result never adjusts the audio packet size and eventually we get a buffer overflow and audio drops out. Our amp computes the sample rate of our internal clock relative to the USB SOF and is trying to report it every 16 milliseconds (per the isochronous explicit feedback protocol) but the in-box driver never queries the feedback endpoint inbetween sending OUT audio packets. When we run the same amp on Mac OS the OS does query the amp for explicit feedback allowing the amp and the computer to remain in sync. I can provide much more detailed information such as our USB descriptors, excerpts from our trace capture on the USB analyzer or just notes from what we are observing in the debugger on the embedded platform. BTW, we updated one of two identical PCs to the latest Win10 (1909) and USB audio stopped altogether so we are avoiding updating the other PC at this time.
    Friday, March 13, 2020 4:43 PM
  • Hello jvl642,

    This forum is for "Discuss topics and ask questions related to pro-audio application development (such as DAW’s, Plug-Ins, Soft-Synths, and more) on the Windows platform." Refer to Audio and Video development.

    Since your issue is driver related I'll move it to Windows Hardware WDK and Driver Development forum for more professional support.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 16, 2020 9:08 AM
  • Thanks, much.
    Monday, March 16, 2020 4:18 PM
  • If you can share the full configuration descriptor for your device, that would be good.   Check the bInterval of your feedback endpoints.  The Microsoft USB stack only supports bIntervals of 1, 2, 3, 4.  So if you are advertising a larger value than that in the endpoint descriptors it won't work.

    Monday, March 16, 2020 7:14 PM
  • It is currently using bInterval of 0x04 (1 per ms) but we had it running at 0x01 (1 per microframe). Here is the descriptor.

    Thanks.

    Information for device Product Y (VID=0xABCD PID=0xA451):

    Connection Information:
    ------------------------------
    Device current bus speed: HighSpeed
    Device supports USB 1.1 specification
    Device supports USB 2.0 specification
    Device address: 0x0022
    Current configuration value: 0x01
    Number of open pipes: 0

    Device Descriptor:
    ------------------------------
    0x12    bLength
    0x01    bDescriptorType
    0x0200  bcdUSB
    0xEF    bDeviceClass      (Miscellaneous device)
    0x02    bDeviceSubClass   
    0x01    bDeviceProtocol   
    0x40    bMaxPacketSize0   (64 bytes)
    0xABCD  idVendor
    0xA451  idProduct
    0x0100  bcdDevice
    0x01    iManufacturer   "Company X"
    0x02    iProduct   "Product Y"
    0x00    iSerialNumber
    0x01    bNumConfigurations

    Device Qualifier Descriptor:
    ------------------------------
    0x0A    bLength
    0x06    bDescriptorType
    0x0200  bcdUSB
    0x00    bDeviceClass      
    0x00    bDeviceSubClass   
    0x00    bDeviceProtocol   
    0x40    bMaxPacketSize0   (64 bytes)
    0x00    bNumConfigurations
    0x00    bReserved

    Configuration Descriptor:
    ------------------------------
    0x09    bLength
    0x02    bDescriptorType
    0x00DA  wTotalLength   (218 bytes)
    0x03    bNumInterfaces
    0x01    bConfigurationValue
    0x00    iConfiguration
    0xC0    bmAttributes   (Self-powered Device)
    0x00    bMaxPower      (0 mA)

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

    Interface Descriptor:
    ------------------------------
    0x09    bLength
    0x04    bDescriptorType
    0x00    bInterfaceNumber
    0x00    bAlternateSetting
    0x00    bNumEndPoints
    0x01    bInterfaceClass      (Audio Device Class)
    0x01    bInterfaceSubClass   (Audio Control Interface)
    0x20    bInterfaceProtocol   (Audio Protocol IP version 2.00)
    0x00    iInterface

    AC Interface Header Descriptor:
    ------------------------------
    0x09    bLength
    0x24    bDescriptorType
    0x01    bDescriptorSubtype
    0x0200  bcdADC
    0x0A    bCategory   (PRO_AUDIO)
    0x004B  wTotalLength   (75 bytes)
    0x00    bmControls

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

    AC Input Terminal Descriptor:
    ------------------------------
    0x11    bLength
    0x24    bDescriptorType
    0x02    bDescriptorSubtype
    0x01    bTerminalID
    0x0101  wTerminalType   (USB Streaming)
    0x02    bAssocTerminal
    0x10    bCSourceID
    0x04    bNrChannels   (4 channels)
    0x00000000  bmChannelConfig
    0x07    iChannelNames
    0x00    bmControls
    0x00    iTerminal

    AC Output Terminal Descriptor:
    ------------------------------
    0x0C    bLength
    0x24    bDescriptorType
    0x03    bDescriptorSubtype
    0x02    bTerminalID
    0x0301  wTerminalType   (Speaker)
    0x01    bAssocTerminal
    0x01    bSourceID
    0x10    bCSourceID
    0x0000  bmControls
    0x00    iTerminal

    AC Input Terminal Descriptor:
    ------------------------------
    0x11    bLength
    0x24    bDescriptorType
    0x02    bDescriptorSubtype
    0x03    bTerminalID
    0x0201  wTerminalType   (Microphone)
    0x04    bAssocTerminal
    0x10    bCSourceID
    0x04    bNrChannels   (4 channels)
    0x00000000  bmChannelConfig
    0x03    iChannelNames
    0x00    bmControls
    0x00    iTerminal

    AC Output Terminal Descriptor:
    ------------------------------
    0x0C    bLength
    0x24    bDescriptorType
    0x03    bDescriptorSubtype
    0x04    bTerminalID
    0x0101  wTerminalType   (USB Streaming)
    0x03    bAssocTerminal
    0x03    bSourceID
    0x10    bCSourceID
    0x0000  bmControls
    0x00    iTerminal

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

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

    AS Interface Descriptor:
    ------------------------------
    0x10    bLength
    0x24    bDescriptorType
    0x01    bDescriptorSubtype
    0x04    bTerminalLink
    0x00    bmControls
    0x01    bFormatType   (FORMAT_TYPE_1)
    0x00000001  bmFormats
    0x04    bNrChannels   (4 channels)
    0x00000000  bmChannelConfig
    0x03    iChannelNames

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

    Endpoint Descriptor:
    ------------------------------
    0x07    bLength
    0x05    bDescriptorType
    0x83    bEndpointAddress  (IN endpoint 3)
    0x05    bmAttributes      (Transfer: Isochronous / Synch: Asynchronous / Usage: Data)
    0x0310  wMaxPacketSize    (1 x 784 bytes)
    0x04    bInterval         (8 microframes)

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

    Interface Descriptor:
    ------------------------------
    0x09    bLength
    0x04    bDescriptorType
    0x02    bInterfaceNumber
    0x00    bAlternateSetting
    0x00    bNumEndPoints
    0x01    bInterfaceClass      (Audio Device Class)
    0x02    bInterfaceSubClass   (Audio Streaming Interface)
    0x20    bInterfaceProtocol   (Audio Protocol IP version 2.00)
    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   (Audio Protocol IP version 2.00)
    0x00    iInterface

    AS Interface Descriptor:
    ------------------------------
    0x10    bLength
    0x24    bDescriptorType
    0x01    bDescriptorSubtype
    0x01    bTerminalLink
    0x00    bmControls
    0x01    bFormatType   (FORMAT_TYPE_1)
    0x00000001  bmFormats
    0x04    bNrChannels   (4 channels)
    0x00000000  bmChannelConfig
    0x07    iChannelNames

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

    Endpoint Descriptor:
    ------------------------------
    0x07    bLength
    0x05    bDescriptorType
    0x04    bEndpointAddress  (OUT endpoint 4)
    0x05    bmAttributes      (Transfer: Isochronous / Synch: Asynchronous / Usage: Data)
    0x0310  wMaxPacketSize    (1 x 784 bytes)
    0x04    bInterval         (8 microframes)

    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
    0x84    bEndpointAddress  (IN endpoint 4)
    0x11    bmAttributes      (Transfer: Isochronous / Synch: None / Usage: Feedback)
    0x0004  wMaxPacketSize    (1 x 4 bytes)
    0x08    bInterval         (128 microframes)

    Microsoft OS Descriptor is not available. Error code: 0x0000001F

    String Descriptor Table
    --------------------------------
    Index  LANGID  String
    0x00   0x0000  0x0409
    0x01   0x0409  "Company X"
    0x02   0x0409  "Product Y"
    0x07   0x0409  "JAM (L)"
    0x08   0x0409  "JAM (R)"
    0x09   0x0409  "RE-AMP (L)"
    0x0A   0x0409  "RE-AMP (R)"
    0x03   0x0409  "RECORD (L)"
    0x04   0x0409  "RECORD (R)"
    0x05   0x0409  "INPUT MON (L)"
    0x06   0x0409  "INPUT MON (R)"

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

    Connection path for device:
    USB xHCI Compliant Host Controller
    Root Hub
    Product Y (VID=0xABCD PID=0xA451) Port: 7

    Running on: Windows 10 or greater (Build Version 18362)

    Brought to you by TDD v2.12.0, Aug  2 2019, 16:35:05
    [END]

    Tuesday, March 17, 2020 12:12 AM
  • Upon re-reading your reply I just noticed you were referring to the bInterval value for the feedback endpoint (not the audio endpoints) which is currently 0x08. I will lower it to 0x04 and recheck.
    Tuesday, March 17, 2020 4:09 PM
  • Lowering the bInterval value for our feedback endpoint from 0x08 to 0x04 caused the host to issue IN tokens for feedback packets. Thanks so much for your help.
    • Marked as answer by jvl642 Tuesday, March 17, 2020 4:36 PM
    Tuesday, March 17, 2020 4:36 PM