none
Windows driver for USB Audio Device RRS feed

  • Question

  • I am trying to use an Atmel eMPU as a USB Audio gadget device (UAC1). It works on Linux and MAC. On Windows however, 

    , even though the device gets recognized and enumerated as a USB audio device,

    The Windows driver fails to properly “start” the device. When I run a protocol analyzer on it, I find that after the set configuration and set interface transactions, It does a couple of get string descriptor and then totally stops pinging the device. Any help in this regards will be appreciated.

    Thanks,

    Regards

    Swapna


    Swapna Gurumani

    Thursday, January 30, 2014 1:31 AM

Answers

  • This was solved. I examined the USB descriptors using the Windows USBView tool that is part of the WDK. The tool is found in the following location: C:\Program Files (x86)\Windows Kits\8.1\Tools\x86

    There were 2 things wrong in my descriptors:

    1. The header interface descriptor had the following:

    <tt>          </tt><tt>===>Audio Control Interface Header Descriptor<===</tt><tt></tt><tt></tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">bLength:                           0x0B</tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    bDescriptorType:                   0x24
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    bDescriptorSubtype:                0x01
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    bcdADC:                          0x0100
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    wTotalLength:                    0x0029
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">bInCollection:                     0x03</tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    baInterfaceNr[1]:                  0x01
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    baInterfaceNr[2]:                  0x02
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    baInterfaceNr[3]:                  0x00
    </tt><tt style="color:#222222;line-height:normal;"> </tt>

    That's not right.  What that says is that there are three "audio streaming" interfaces associated with this audio control interface, numbered 1, 2, and 0.  But I only have ONE audio streaming interface, number 1.  This should read:

    <tt style="color:#222222;line-height:normal;">          ===>Audio Control Interface Header Descriptor<===
    </tt><tt style="color:#222222;line-height:normal;">bLength:                           0x09</tt><tt style="color:#222222;line-height:normal;">
    bDescriptorType:                   0x24
    </tt><tt style="color:#222222;line-height:normal;">
    bDescriptorSubtype:                0x01
    </tt><tt style="color:#222222;line-height:normal;">
    bcdADC:                          0x0100
    </tt><tt style="color:#222222;line-height:normal;">
    wTotalLength:                    0x0027
    </tt><tt style="color:#222222;line-height:normal;">bInCollection:                     0x01</tt><tt style="color:#222222;line-height:normal;">
    baInterfaceNr[1]:                  0x01
    </tt><tt style="color:#222222;line-height:normal;">
    </tt>
    (Note that the descriptor becomes 2 bytes smaller, which also means the wTotalLength becomes 2 bytes smaller, and I had to reduce the total configuration descriptor length by 2 as well.)<tt style="color:#222222;line-height:normal;"></tt>

    2. The Feature Unit Audio control Interface is also wrong. I had:

      AudioControl Interface Descriptor:
            bLength                13
            bDescriptorType        36
            bDescriptorSubtype      6 (FEATURE_UNIT)
            bUnitID                 2
            bSourceID               1
            bControlSize            2
            bmaControls( 0)      0x01
            bmaControls( 0)      0x00
              Mute Control
      
              Volume Control
         

    Many thanks to Tim Roberts! He helped me solve this issue!


    Swapna Gurumani

    • Marked as answer by swapgg Friday, February 14, 2014 1:46 AM
    Friday, February 14, 2014 1:46 AM

All replies

  • swapgg wrote:
    >
    >I am trying to use an Atmel eMPU as a USB Audio gadget device (UAC1).
    >It works on Linux and MAC. On Windows however, even though the device
    >gets recognized and enumerated as a USB audio device,
    >
    >The Windows driver fails to properly “start” the device. When I run
    >a protocol analyzer on it, I find that after the set configuration
    >and set interface transactions, It does a couple of get string
    >descriptor and then totally stops pinging the device. Any help in
    >this regards will be appreciated.
     
    The later version of Windows have become very picky about USB spec
    compliance.  Can you post your descriptors?
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC&#43;&#43; MVP Providenza & Boekelheide, Inc.
    • Marked as answer by swapgg Friday, February 14, 2014 1:45 AM
    • Unmarked as answer by swapgg Friday, February 14, 2014 1:45 AM
    Saturday, February 1, 2014 4:05 AM
  • Here is my descriptors:
    Bus 006 Device 018: ID 1d6b:0101 Linux Foundation Audio Gadget
    Couldn't open device, some information will be missing
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               1.10
      bDeviceClass            0 (Defined at Interface level)
      bDeviceSubClass         0 
      bDeviceProtocol         0 
      bMaxPacketSize0        64
      idVendor           0x1d6b Linux Foundation
      idProduct          0x0101 Audio Gadget
      bcdDevice            1.27
      iManufacturer           1 
      iProduct                2 
      iSerial                 0 
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength          114
        bNumInterfaces          2
        bConfigurationValue     1
        iConfiguration          0 
        bmAttributes         0xc0
          Self Powered
        MaxPower                2mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      1 Control Device
          bInterfaceProtocol      0 
          iInterface              0 
          AudioControl Interface Descriptor:
            bLength                10
            bDescriptorType        36
            bDescriptorSubtype      1 (HEADER)
            bcdADC               1.00
            wTotalLength           40
            bInCollection           2
            baInterfaceNr( 0)       1
            baInterfaceNr( 1)       2
          AudioControl Interface Descriptor:
            bLength                12
            bDescriptorType        36
            bDescriptorSubtype      2 (INPUT_TERMINAL)
            bTerminalID             1
            wTerminalType      0x0101 USB Streaming
            bAssocTerminal          0
            bNrChannels             2
            wChannelConfig     0x0003
              Left Front (L)
              Right Front (R)
            iChannelNames           0 
            iTerminal               0 
          AudioControl Interface Descriptor:
            bLength                13
            bDescriptorType        36
            bDescriptorSubtype      6 (FEATURE_UNIT)
            bUnitID                 2
            bSourceID               1
            bControlSize            2
            bmaControls( 0)      0x01
            bmaControls( 0)      0x00
              Mute Control
            bmaControls( 1)      0x02
            bmaControls( 1)      0x00
              Volume Control
            bmaControls( 2)      0x02
            bmaControls( 2)      0x00
              Volume Control
            iFeature                0 
          AudioControl Interface Descriptor:
            bLength                 9
            bDescriptorType        36
            bDescriptorSubtype      3 (OUTPUT_TERMINAL)
            bTerminalID             3
            wTerminalType      0x0301 Speaker
            bAssocTerminal          0
            bSourceID               2
            iTerminal               0 
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0 
          iInterface              0 
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       1
          bNumEndpoints           1
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0 
          iInterface              0 
          AudioStreaming Interface Descriptor:
            bLength                 7
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bDelay                  0 frames
            wFormatTag              1 PCM
          AudioStreaming Interface Descriptor:
            bLength                11
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bNrChannels             2
            bSubframeSize           2
            bBitResolution         16
            bSamFreqType            1 Discrete
            tSamFreq[ 0]        48000
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x01  EP 1 OUT
            bmAttributes           13
              Transfer Type            Isochronous
              Synch Type               Synchronous
              Usage Type               Data
            wMaxPacketSize     0x00c0  1x 192 bytes
            bInterval               1
            bRefresh                0
            bSynchAddress           0
            AudioControl Endpoint Descriptor:
              bLength                 7
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x00
              bLockDelayUnits         0 Undefined
              wLockDelay              0 Undefined
    Thanks,

    REgards

    Swapna


    Swapna Gurumani

    Tuesday, February 11, 2014 5:33 PM
  • This was solved. I examined the USB descriptors using the Windows USBView tool that is part of the WDK. The tool is found in the following location: C:\Program Files (x86)\Windows Kits\8.1\Tools\x86

    There were 2 things wrong in my descriptors:

    1. The header interface descriptor had the following:

    <tt>          </tt><tt>===>Audio Control Interface Header Descriptor<===</tt><tt></tt><tt></tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">bLength:                           0x0B</tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    bDescriptorType:                   0x24
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    bDescriptorSubtype:                0x01
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    bcdADC:                          0x0100
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    wTotalLength:                    0x0029
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">bInCollection:                     0x03</tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    baInterfaceNr[1]:                  0x01
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    baInterfaceNr[2]:                  0x02
    </tt><tt style="color:#222222;line-height:normal;"></tt><tt style="color:#222222;line-height:normal;">
    baInterfaceNr[3]:                  0x00
    </tt><tt style="color:#222222;line-height:normal;"> </tt>

    That's not right.  What that says is that there are three "audio streaming" interfaces associated with this audio control interface, numbered 1, 2, and 0.  But I only have ONE audio streaming interface, number 1.  This should read:

    <tt style="color:#222222;line-height:normal;">          ===>Audio Control Interface Header Descriptor<===
    </tt><tt style="color:#222222;line-height:normal;">bLength:                           0x09</tt><tt style="color:#222222;line-height:normal;">
    bDescriptorType:                   0x24
    </tt><tt style="color:#222222;line-height:normal;">
    bDescriptorSubtype:                0x01
    </tt><tt style="color:#222222;line-height:normal;">
    bcdADC:                          0x0100
    </tt><tt style="color:#222222;line-height:normal;">
    wTotalLength:                    0x0027
    </tt><tt style="color:#222222;line-height:normal;">bInCollection:                     0x01</tt><tt style="color:#222222;line-height:normal;">
    baInterfaceNr[1]:                  0x01
    </tt><tt style="color:#222222;line-height:normal;">
    </tt>
    (Note that the descriptor becomes 2 bytes smaller, which also means the wTotalLength becomes 2 bytes smaller, and I had to reduce the total configuration descriptor length by 2 as well.)<tt style="color:#222222;line-height:normal;"></tt>

    2. The Feature Unit Audio control Interface is also wrong. I had:

      AudioControl Interface Descriptor:
            bLength                13
            bDescriptorType        36
            bDescriptorSubtype      6 (FEATURE_UNIT)
            bUnitID                 2
            bSourceID               1
            bControlSize            2
            bmaControls( 0)      0x01
            bmaControls( 0)      0x00
              Mute Control
      
              Volume Control
         

    Many thanks to Tim Roberts! He helped me solve this issue!


    Swapna Gurumani

    • Marked as answer by swapgg Friday, February 14, 2014 1:46 AM
    Friday, February 14, 2014 1:46 AM