This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

usb asynchronous

How do I set the usb audio code up for usb asynchronous transfers.

Do I just have to change bmAttributes

USB_ENDPOINT_TYPE_ISOCHRONOUS,

to

USB_ENDPOINT_SYNC_ASYNCHRONOUS

or is it more complexed than that.

Parents
  • Here is a descriptor readout of a typical Async Sink device (Ayre QB9),
    taken from
    list.voyage.hk/.../013449.html

    Compare it with the example's

    lsusb -v
    
    Bus 001 Device 004: ID 21b4:0130
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               1.00
      bDeviceClass            0 (Defined at Interface level)
      bDeviceSubClass         0
      bDeviceProtocol         0
      bMaxPacketSize0        64
      idVendor           0x21b4
      idProduct          0x0130
      bcdDevice            1.71
      iManufacturer           1
      iProduct                2
      iSerial                 3
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength          134
        bNumInterfaces          3
        bConfigurationValue     1
        iConfiguration          0
        bmAttributes         0x80
          (Bus Powered)
        MaxPower              500mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      1 Control Device
          bInterfaceProtocol      0
          iInterface              7
          AudioControl Interface Descriptor:
            bLength                 9
            bDescriptorType        36
            bDescriptorSubtype      1 (HEADER)
            bcdADC               1.00
            wTotalLength           30
            bInCollection           1
            baInterfaceNr( 0)       1
          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                 9
            bDescriptorType        36
            bDescriptorSubtype      3 (OUTPUT_TERMINAL)
            bTerminalID             6
            wTerminalType      0x0301 Speaker
            bAssocTerminal          0
            bSourceID               1
            iTerminal               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0
          iInterface              9
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       1
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0
          iInterface              8
          AudioStreaming Interface Descriptor:
            bLength                 7
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bDelay                  1 frames
            wFormatTag              1 PCM
          AudioStreaming Interface Descriptor:
            bLength                20
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bNrChannels             2
            bSubframeSize           3
            bBitResolution         24
            bSamFreqType            4 Discrete
            tSamFreq[ 0]        44100
            tSamFreq[ 1]        48000
            tSamFreq[ 2]        88200
            tSamFreq[ 3]        96000
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x01  EP 1 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0246  1x 582 bytes
            bInterval               1
            bRefresh                0
            bSynchAddress         129
            AudioControl Endpoint Descriptor:
              bLength                 7
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x01
                Sampling Frequency
              bLockDelayUnits         2 Decoded PCM samples
              wLockDelay              0 Decoded PCM samples
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            1
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0003  1x 3 bytes
            bInterval               1
            bRefresh                1
            bSynchAddress           0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass       254 Application Specific Interface
          bInterfaceSubClass      1 Device Firmware Update
          bInterfaceProtocol      0
          iInterface             14
          Device Firmware Upgrade Interface Descriptor:
            bLength                             7
            bDescriptorType                    33
            bmAttributes                        7
              Will Not Detach
              Manifestation Tolerant
              Upload Supported
              Download Supported
            wDetachTimeout                    250 milliseconds
            wTransferSize                      64 bytes
    

    Tsuneo

Reply
  • Here is a descriptor readout of a typical Async Sink device (Ayre QB9),
    taken from
    list.voyage.hk/.../013449.html

    Compare it with the example's

    lsusb -v
    
    Bus 001 Device 004: ID 21b4:0130
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               1.00
      bDeviceClass            0 (Defined at Interface level)
      bDeviceSubClass         0
      bDeviceProtocol         0
      bMaxPacketSize0        64
      idVendor           0x21b4
      idProduct          0x0130
      bcdDevice            1.71
      iManufacturer           1
      iProduct                2
      iSerial                 3
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength          134
        bNumInterfaces          3
        bConfigurationValue     1
        iConfiguration          0
        bmAttributes         0x80
          (Bus Powered)
        MaxPower              500mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      1 Control Device
          bInterfaceProtocol      0
          iInterface              7
          AudioControl Interface Descriptor:
            bLength                 9
            bDescriptorType        36
            bDescriptorSubtype      1 (HEADER)
            bcdADC               1.00
            wTotalLength           30
            bInCollection           1
            baInterfaceNr( 0)       1
          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                 9
            bDescriptorType        36
            bDescriptorSubtype      3 (OUTPUT_TERMINAL)
            bTerminalID             6
            wTerminalType      0x0301 Speaker
            bAssocTerminal          0
            bSourceID               1
            iTerminal               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0
          iInterface              9
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       1
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0
          iInterface              8
          AudioStreaming Interface Descriptor:
            bLength                 7
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bDelay                  1 frames
            wFormatTag              1 PCM
          AudioStreaming Interface Descriptor:
            bLength                20
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bNrChannels             2
            bSubframeSize           3
            bBitResolution         24
            bSamFreqType            4 Discrete
            tSamFreq[ 0]        44100
            tSamFreq[ 1]        48000
            tSamFreq[ 2]        88200
            tSamFreq[ 3]        96000
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x01  EP 1 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0246  1x 582 bytes
            bInterval               1
            bRefresh                0
            bSynchAddress         129
            AudioControl Endpoint Descriptor:
              bLength                 7
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x01
                Sampling Frequency
              bLockDelayUnits         2 Decoded PCM samples
              wLockDelay              0 Decoded PCM samples
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            1
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0003  1x 3 bytes
            bInterval               1
            bRefresh                1
            bSynchAddress           0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass       254 Application Specific Interface
          bInterfaceSubClass      1 Device Firmware Update
          bInterfaceProtocol      0
          iInterface             14
          Device Firmware Upgrade Interface Descriptor:
            bLength                             7
            bDescriptorType                    33
            bmAttributes                        7
              Will Not Detach
              Manifestation Tolerant
              Upload Supported
              Download Supported
            wDetachTimeout                    250 milliseconds
            wTransferSize                      64 bytes
    

    Tsuneo

Children