raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.15k stars 5k forks source link

[Pi4B] Can't use USB soundcards simultaneously. Works on Pi 3. #3962

Open biasha2 opened 3 years ago

biasha2 commented 3 years ago

Describe the bug

Multiple USB sound cards (even two) can't play simultaneously in Raspberry Pi 4B. Works fine in RPI3. When trying to play sound second attempt fails with "Not enough bandwidth". Bandwidth is not that high. Seems it is not properly calculated/checked by USB driver. Also Pi3 works with even higher bandwidth.

To reproduce

Playing 10secs one by one - OK

pi@raspberrypi:~ $ aplay -d 10 -c 2 -t raw -D hw:v15 -f S24_3LE -r 44100 /dev/zero
Playing raw data '/dev/zero' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo
pi@raspberrypi:~ $ aplay -d 10 -c 2 -t raw -D hw:v15_1 -f S24_3LE -r 44100 /dev/zero
Playing raw data '/dev/zero' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo

Playing 10secs simultaneously - FAIL

pi@raspberrypi:~ $ aplay -d 10 -c 2 -t raw -D hw:v15 -f S24_3LE -r 44100 /dev/zero & aplay -d 10 -c 2 -t raw -D hw:v15_1 -f S24_3LE -r 44100 /dev/zero
[1] 691
Playing raw data '/dev/zero' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo
Playing raw data '/dev/zero' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo
aplay: set_params:1403: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (125011 125012)
PERIOD_SIZE: 5513
PERIOD_BYTES: 33078
PERIODS: (3 4)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 132300
TICK_TIME: 0
pi@raspberrypi:~ $
[1]+  Done                    aplay -d 10 -c 2 -t raw -D hw:v15 -f S24_3LE -r 44100 /dev/zero

pi@raspberrypi:~ $ sudo journalctl -e
Nov 17 02:37:37 raspberrypi kernel: usb 1-1.2: Not enough bandwidth for new device state.
Nov 17 02:37:37 raspberrypi kernel: usb 1-1.2: Not enough bandwidth for altsetting 1
Nov 17 02:37:37 raspberrypi kernel: usb 1-1.2: 1:1: usb_set_interface failed (-28)

Expected behaviour

Both soundcards work. Just like it work on Raspberry 3, look:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.4.72-v7+ #1356 SMP Thu Oct 22 13:56:54 BST 2020 armv7l GNU/Linux

pi@raspberrypi:~ $ aplay -d 10 -c 2 -t raw -D hw:v15 -f S24_3LE -r 44100 /dev/zero & aplay -d 10 -c 2 -t raw -D hw:v15_1 -f S24_3LE -r 44100 /dev/zero & sudo usbtop
Bus ID 0 (All USB buses)        To device       From device
  Device ID 1 :                 0.00 kb/s       0.00 kb/s
  Device ID 2 :                 0.00 kb/s       0.00 kb/s
  Device ID 3 :                 8.52 kb/s       5.42 kb/s
  Device ID 6 :                 291.17 kb/s     30.30 kb/s
  Device ID 8 :                 291.17 kb/s     30.30 kb/s
Bus ID 1 (USB bus number 1)     To device       From device
  Device ID 1 :                 0.00 kb/s       0.00 kb/s
  Device ID 2 :                 0.00 kb/s       0.00 kb/s
  Device ID 3 :                 8.52 kb/s       5.42 kb/s
  Device ID 6 :                 291.17 kb/s     30.30 kb/s
  Device ID 8 :                 291.17 kb/s     30.30 kb/s
^Cpi@raspberrypi:~ $
[1]-  Done                    aplay -d 10 -c 2 -t raw -D hw:v15 -f S24_3LE -r 44100 /dev/zero
[2]+  Done                    aplay -d 10 -c 2 -t raw -D hw:v15_1 -f S24_3LE -r 44100 /dev/zero

Actual behaviour

But on 4B attempt to open second sound card fails with error from usb subsystem: "Not enough bandwidth for new device state.". ALSA returns error to the application. First card works. When first card stops playing I can finally play sound on the second card.

System

Logs

Nov 17 02:37:37 raspberrypi kernel: usb 1-1.2: Not enough bandwidth for new device state.
Nov 17 02:37:37 raspberrypi kernel: usb 1-1.2: Not enough bandwidth for altsetting 1
Nov 17 02:37:37 raspberrypi kernel: usb 1-1.2: 1:1: usb_set_interface failed (-28)

Additional context

Being inspired by new powerful USB3.0 controller advertisement I've ordered Pi4 specially to connect many (like 5-6) USB sound cards. It's pity that I can't connect even 2. And Pi 3 (not even 3+) works better!

Both soundcards are USB AudioQuest DragonFly Black v1.5. It has only one stereo out, no mic, nothing else. Tried on lowest possible frequency - 44100. While Pi 3 works fine with 96000. Only Ethernet cable, Power, and these 2 USB cards are connected to the device. Does not matter which ports, blue or 2.0 give the same result. Using 3.0 or 2.0 hub does not change anything. I heard Type-C port can be used with power via gpio, but it does not work for me this way.

usbtop reports about 374.11 kb/s which is much less than even USB 2.0 can handle.

pi@raspberrypi:~ $ aplay -d 10 -c 2 -t raw -D hw:v15 -f S24_3LE -r 44100 /dev/zero & sudo usbtop
Bus ID 0 (All USB buses)        To device       From device
  Device ID 1 :                 0.00 kb/s       0.00 kb/s
  Device ID 2 :                 0.00 kb/s       0.00 kb/s
  Device ID 3 :                 374.11 kb/s     109.74 kb/s
  Device ID 4 :                 0.00 kb/s       0.00 kb/s
Bus ID 1 (USB bus number 1)     To device       From device
  Device ID 1 :                 0.00 kb/s       0.00 kb/s
  Device ID 2 :                 0.00 kb/s       0.00 kb/s
  Device ID 3 :                 374.10 kb/s     109.74 kb/s
  Device ID 4 :                 0.00 kb/s       0.00 kb/s
Bus ID 2 (USB bus number 2)     To device       From device
  Device ID 1 :                 0.00 kb/s       0.00 kb/s
^Cpi@raspberrypi:

Here are USB details:

pi@raspberrypi:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 21b4:0083
Bus 001 Device 003: ID 21b4:0083
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~ $ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 1: Dev 3, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 1: Dev 3, If 2, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 2: Dev 4, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 4, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 4, If 2, Class=Human Interface Device, Driver=usbhid, 12M
pi@raspberrypi:~ $ sudo lsusb -v

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         3
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            5.04
  iManufacturer           3 Linux 5.4.75-v7l+ xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:01:00.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0
Hub Descriptor:
  bLength              12
  bDescriptorType      42
  nNbrPorts             4
  wHubCharacteristic 0x0009
    Per-port power switching
    Per-port overcurrent protection
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  bHubDecLat          0.0 micro seconds
  wHubDelay             0 nano seconds
  DeviceRemovable    0x00
 Hub Port Status:
   Port 1: 0000.02a0 5Gbps power Rx.Detect
   Port 2: 0000.02a0 5Gbps power Rx.Detect
   Port 3: 0000.02a0 5Gbps power Rx.Detect
   Port 4: 0000.02a0 5Gbps power Rx.Detect
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x000f
  bNumDeviceCaps          1
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x02
      Latency Tolerance Messages (LTM) Supported
    wSpeedsSupported   0x0008
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   3
      Lowest fully-functional device speed is SuperSpeed (5Gbps)
    bU1DevExitLat           4 micro seconds
    bU2DevExitLat         231 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 001 Device 004: ID 21b4:0083
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x21b4
  idProduct          0x0083
  bcdDevice            1.06
  iManufacturer           1 AudioQuest
  iProduct                2 AudioQuest DragonFly Black v1.5
  iSerial                 3 AQDFBLxxxxxxxxxx
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0098
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower               40mA
    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                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x0027
        bInCollection           1
        baInterfaceNr(0)        1
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             9
        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      6 (FEATURE_UNIT)
        bUnitID                 5
        bSourceID               9
        bControlSize            2
        bmaControls(0)     0x0003
          Mute Control
          Volume Control
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID               5
        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           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0
      iInterface              0
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           9
        bDelay                  1 frames
        wFormatTag         0x0001 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     0x024c  1x 588 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress         129
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay         0x0000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0003  1x 3 bytes
        bInterval               1
        bRefresh                5
        bSynchAddress           0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              5 DragonFly HID MQA
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      21
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              32
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 001 Device 003: ID 21b4:0083
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x21b4
  idProduct          0x0083
  bcdDevice            1.06
  iManufacturer           1 AudioQuest
  iProduct                2 AudioQuest DragonFly Black v1.5
  iSerial                 3 AQDFBLyyyyyyyyyy
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0098
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower               40mA
    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                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x0027
        bInCollection           1
        baInterfaceNr(0)        1
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             9
        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      6 (FEATURE_UNIT)
        bUnitID                 5
        bSourceID               9
        bControlSize            2
        bmaControls(0)     0x0003
          Mute Control
          Volume Control
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID               5
        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           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0
      iInterface              0
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           9
        bDelay                  1 frames
        wFormatTag         0x0001 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     0x024c  1x 588 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress         129
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay         0x0000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0003  1x 3 bytes
        bInterval               1
        bRefresh                5
        bSynchAddress           0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              5 DragonFly HID MQA
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      21
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              32
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x2109 VIA Labs, Inc.
  idProduct          0x3431 Hub
  bcdDevice            4.21
  iManufacturer           0
  iProduct                1 USB2.0 Hub
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             4
  wHubCharacteristic 0x00e0
    Ganged power switching
    Ganged overcurrent protection
    TT think time 32 FS bits
    Port indicators
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent    100 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0103 power enable connect
   Port 2: 0000.0103 power enable connect
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x002a
  bNumDeviceCaps          3
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      HIRD Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat           4 micro seconds
    bU2DevExitLat         231 micro seconds
  Container ID Device Capability:
    bLength                20
    bDescriptorType        16
    bDevCapabilityType      4
    bReserved               0
    ContainerID             {30eef35c-07d5-2549-b001-802d79434c30}
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            5.04
  iManufacturer           3 Linux 5.4.75-v7l+ xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:01:00.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             1
  wHubCharacteristic 0x0009
    Per-port power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x02
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0503 highspeed power enable connect
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered
P33M commented 3 years ago

https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=273027

There is a limit of a maximum of 1023 bytes of periodic full-speed data per frame on Pi 4's VL805 USB controller. Your two audio devices have a single Isochronous endpoint alternate setting of 588 bytes (and frame interval of one frame), so you can't use both at once.

A workaround is to use the USB-C connector's OTG functionality in xHCI host mode. rpi-update firmware has a recent bugfix that allows the use of the config.txt option otg_mode=1 which will swap the dwc2 controller for the xHCI host.

You will need a USB-C hub, preferably one with power-delivery, that acts as an in-line breakout. One like this, for example: https://www.amazon.co.uk/UGREEN-Aluminum-Pass-Through-Thunderbolt-Compatible/dp/B077FSBGQK/

Alternatively, power the Pi 4 through GPIO pins and use a USB-C to USB Type-A adapter, then plug a regular USB2 hub into the adapter.

biasha2 commented 3 years ago

Thank you for the explanation.

So,

  1. Is this a hardware limitation of the VIA Lab's VL805 controller and can't be resolved? Or
  2. Is this a firmware errata that should be resolved in the EEPROM code? Should I raise this issue on the https://github.com/raspberrypi/rpi-eeprom instead? Sounds to me like Raspberry team should forward it to VIA. Or
  3. Should it be resolved by software calculation of the bandwidth? I've tried XHCI_SW_BW_CHECKING quirk, but it just freezes.

The proposed workaround does not really work for me: When I use USB2 hub it puts 12M limit on the hub, and I receive bandwidth error on 3rd soundcard connected. /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M |__ Port 1: Dev 41, If 0, Class=Hub, Driver=hub/4p, 12M If I use USB3 hub (not the one you've linked though) then lsusb does not see it, not sure why. No errors from the journalctl. Plus it's hard for me to power through GPIO, because I want hat.

For now I transfer sound via ethernet to the Pi3. And Pi3 can easily handle 5 soundcards that I have. With any hub for 5th... But this looks extremely lame. I've obtained Pi4 mainly because of a superior USB support described at https://www.raspberrypi.org/documentation/hardware/raspberrypi/usb/README.md "General limitations (not Pi 4)", "Devices with known issues (not Pi 4)" it says... But in reality its grangma does job much better.

It's just odd and sad :( You should describe such limitations in red on the first page...

P33M commented 3 years ago

The workaround isn't working because your hub is incorrectly detected as a full-speed hub (not high speed). Have you updated the firmware+kernel? What is the output of vcgencmd version after running rpi-update?

biasha2 commented 3 years ago

The workaround indeed works after rpi-update (tested with usb3 hub). However as I said, powering though GPIO is hard for me because of the hat. And seems that 3 ampere usb data y-cables don't exist. Thank you for the workaround anyway.

But is it going to be addressed in a proper way somewhen? What is the answer to my question above - #1, #2 or #3? It's kinda weird to detour main usb controller to make usb devices to work.

P33M commented 3 years ago

Some time ago we raised this issue with Via and this resulted in a firmware (0138a1) that moved the FS periodic bandwidth cap from 792 bytes/frame to 1024 bytes/frame. There is likely to be an underlying hardware limitation due to the way FS period transactions are scheduled.

The controller doesn't support the XHCI CHECK_BANDWIDTH command. Calculating bandwidth requirements in software will just replicate the checks done by the XHCI firmware.

Darry77 commented 3 years ago

The workaround indeed works after rpi-update (tested with usb3 hub). However as I said, powering though GPIO is hard for me because of the hat. And seems that 3 ampere usb data y-cables don't exist. Thank you for the workaround anyway.

But is it going to be addressed in a proper way somewhen? What is the answer to my question above - #1, #2 or #3? It's kinda weird to detour main usb controller to make usb devices to work.

I use a USB 3.1 hub with USB PD (power delivery) support over USB-C that successfully powers the Pi 4 .

The USB 3.1 hub has 3 USB A ports and is powered by a 30W USB PD power supply . I believe the USB PD power supply is only actually capable of providing 3A when outputting 5V (I doubt this USB 3.1 hub can actually run on anything other than 5V ). If my assumptions are correct, the the USB 3.1 HUB and Pi 4 are sharing 5V at a max of 3A and seem to be working fine, power-wise . Ironically the USB 3.1 hub has a Via chipset .

The next part of my USB setup is an externally powered USB 2.0 multi-TT (transaction translator hub), which, AFAIK, is important if one wants to run multiple full bandwidth USB 1.1 devices over USB 2.0. This multi-TT USB 2.0 hub is connected to the aforementioned USB 3.1 hub that powers the Pi4 .

Finally, I have 3 USB 1.1 "CM106 like" devices (probably actually CM6206 variants) and a Fiio E10K (also USB 1.1) connected to the multi-TT USB 2.0 hub .

I have tested the behavior of this setup with simultaneous 3-way USB 1.1 traffic (2 16-bit stereo streams at 44.1KHz and 48KHz being recorded and one 24-bit 48KHz stereo stream being played back), so far, I am not getting any USB bandwidth errors or apparent bandwidth related audio glitches .

PSU : RAVPower RP-PC144 USB 3.1 hub with USB PD : Ankmax P531H USB 2.0 multi-TT hub : Plugable USB2-HUB-AG7 USB-C cable between Pi 4 and USB 3.1 hub : Ugreen cable rated for 5V/3A, 9V/3A,12V/3A, 15V/3A, Max. 20V/3A(60W)

EDIT : My Pi 4 is a rev 1.2 which has the issue with USB PD fixed, AFAIK .

vschi commented 3 years ago

I have the same issue. It would be great if there would be a build in solution instead of adding more hardware than needed in order to overcome this limitation. To overcome this issue I have ordered already 5 different USB soundcards as I thought the problem is caused by them.

I would also like to run 4 USB soundcards on a Raspberry Pi 4B and play continuously mp3 music. Strangly I'm sometimes able to run music on 2 USB soundcards. But it depends on the mood of the Raspberry or the order of play command.

Or does anybody have another solution for this behavior?

JokerJinlee123 commented 2 years ago

I have tried to use three 2.0 USB Hubs with one sound card plugs in the first port of each hub. The remaining USB port of Raspberry Pi 4 is connected with one sound card using direct plug in method. Turns out it unexpectedly works well and perfect. I am able to control each sound card and play simultaneously even though the "dmesg" still showed the error "usb_set_interface failed (-28)". Not sure how does it work, I assume that the USB hub actually has used certain amount of bandwidth so each port will not share the bandwidth.

mildmojo commented 2 years ago

I'm getting this same failure on a brand new Pi 4B 8GB:

After connecting 2 or 3 USB sound devices, connecting an additional sound device triggers a stream of "Not enough bandwidth for new device state" in dmesg logs.

Things I've tried after reading and re-reading this github issue, the forum thread about this issue from 2020, and the forum thread about the firmware update from 2020:

I'm developing an audio gadget, so the USB-C port is in OTG mode and I'm unable to use it as an additional host mode port.

I don't fully understand the issue here; for some people the firmware update back in 2020 seemed to solve their problems. I don't think biasha2 got an answer about whether it's is a hardware issue or a firmware issue.

So, is this solvable, or is it a permanent USB limitation on all Pi 4s? What is the limitation? I thought it was that each transaction translator has a chunk of bandwidth to split between full-speed devices, and the onboard single-TT VL805 quickly exhausts itself after one or two audio devices. I thought a multi-TT hub was supposed to wrap each device in its own partitioned bandwidth pool. That doesn't seem to be happening, or maybe there's a bug in the VL805's bandwidth prediction that's not taking multi-TT hubs into account? Would a CM4 in a carrier board with a multi-TT hub chip behave any better?

Here are my lsusb outputs when I have 3 audio devices attached to one USB3 multi-TT hub (VIA VL817 chipset) connected to a USB3 port on the Pi, after the system's already started spewing usb 1-1.1.4: Not enough bandwidth errors into dmesg output:

lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 1: Dev 5, If 0, Class=Hub, Driver=hub/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 37, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 38, If 3, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 1: Dev 38, If 1, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 1: Dev 38, If 2, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 1: Dev 38, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 39, If 4, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 2: Dev 39, If 2, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 39, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 39, If 3, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 2: Dev 39, If 1, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 40, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 40, If 1, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 40, If 2, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 40, If 3, Class=Human Interface Device, Driver=usbhid, 12M
lsusb -v
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            5.15
  iManufacturer           3 Linux 5.15.61-v8+ dwc2_hsotg
  iProduct                2 DWC OTG Controller
  iSerial                 1 fe980000.usb
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             1
  wHubCharacteristic 0x0008
    Ganged power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood        1 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0000
Device Status:     0x0001
  Self Powered

Bus 002 Device 005: ID 2109:0817 VIA Labs, Inc. USB3.0 Hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 3.10 bDeviceClass 9 Hub bDeviceSubClass 0 bDeviceProtocol 3 bMaxPacketSize0 9 idVendor 0x2109 VIA Labs, Inc. idProduct 0x0817 bcdDevice 90.34 iManufacturer 1 VIA Labs, Inc. iProduct 2 USB3.0 Hub iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x001f bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 19 Transfer Type Interrupt Synch Type None Usage Type Feedback wMaxPacketSize 0x0002 1x 2 bytes bInterval 8 bMaxBurst 0 Hub Descriptor: bLength 12 bDescriptorType 42 nNbrPorts 4 wHubCharacteristic 0x0009 Per-port power switching Per-port overcurrent protection bPwrOn2PwrGood 175 * 2 milli seconds bHubContrCurrent 0 milli Ampere bHubDecLat 0.4 micro seconds wHubDelay 2292 nano seconds DeviceRemovable 0x00 Hub Port Status: Port 1: 0000.02a0 lowspeed L1 Port 2: 0000.02a0 lowspeed L1 Port 3: 0000.02a0 lowspeed L1 Port 4: 0000.02a0 lowspeed L1 Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 0x002a bNumDeviceCaps 3 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType 16 bDevCapabilityType 2 bmAttributes 0x00000002 HIRD Link Power Management (LPM) Supported SuperSpeed USB Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 3 bmAttributes 0x00 wSpeedsSupported 0x000e Device can operate at Full Speed (12Mbps) Device can operate at High Speed (480Mbps) Device can operate at SuperSpeed (5Gbps) bFunctionalitySupport 1 Lowest fully-functional device speed is Full Speed (12Mbps) bU1DevExitLat 4 micro seconds bU2DevExitLat 231 micro seconds Container ID Device Capability: bLength 20 bDescriptorType 16 bDevCapabilityType 4 bReserved 0 ContainerID {30eef35c-07d5-2549-b001-802d79434c30} Device Status: 0x000d Self Powered U1 Enabled U2 Enabled

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 3.00 bDeviceClass 9 Hub bDeviceSubClass 0 bDeviceProtocol 3 bMaxPacketSize0 9 idVendor 0x1d6b Linux Foundation idProduct 0x0003 3.0 root hub bcdDevice 5.15 iManufacturer 3 Linux 5.15.61-v8+ xhci-hcd iProduct 2 xHCI Host Controller iSerial 1 0000:01:00.0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x001f bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0004 1x 4 bytes bInterval 12 bMaxBurst 0 Hub Descriptor: bLength 12 bDescriptorType 42 nNbrPorts 4 wHubCharacteristic 0x0009 Per-port power switching Per-port overcurrent protection bPwrOn2PwrGood 50 * 2 milli seconds bHubContrCurrent 0 milli Ampere bHubDecLat 0.0 micro seconds wHubDelay 0 nano seconds DeviceRemovable 0x00 Hub Port Status: Port 1: 0000.0263 5Gbps power suspend enable connect Port 2: 0000.02a0 5Gbps power Rx.Detect Port 3: 0000.02a0 5Gbps power Rx.Detect Port 4: 0000.02a0 5Gbps power Rx.Detect Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 0x000f bNumDeviceCaps 1 SuperSpeed USB Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 3 bmAttributes 0x02 Latency Tolerance Messages (LTM) Supported wSpeedsSupported 0x0008 Device can operate at SuperSpeed (5Gbps) bFunctionalitySupport 1 Lowest fully-functional device speed is Full Speed (12Mbps) bU1DevExitLat 4 micro seconds bU2DevExitLat 231 micro seconds Device Status: 0x0001 Self Powered

Bus 001 Device 040: ID 0b05:17a0 ASUSTek Computer, Inc. Xonar U3 sound card Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x0b05 ASUSTek Computer, Inc. idProduct 0x17a0 Xonar U3 sound card bcdDevice 1.00 iManufacturer 3 C-Media Electronics Inc. iProduct 1 USB Advanced Audio Device iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0125 bNumInterfaces 4 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA 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 0x0080 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 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 2 wTerminalType 0x0201 Microphone bAssocTerminal 0 bNrChannels 2 wChannelConfig 0x0003 Left Front (L) Right Front (R) iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 3 wTerminalType 0x0603 Line Connector bAssocTerminal 0 bNrChannels 2 wChannelConfig 0x0003 Left Front (L) Right Front (R) iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 4 wTerminalType 0x0605 SPDIF interface 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 9 iTerminal 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 7 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID 8 iTerminal 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 5 (SELECTOR_UNIT) bUnitID 8 bNrInPins 3 baSourceID(0) 10 baSourceID(1) 11 baSourceID(2) 12 iSelector 0 AudioControl Interface Descriptor: bLength 13 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 9 bSourceID 1 bControlSize 2 bmaControls(0) 0x0201 Mute Control Loudness Control bmaControls(1) 0x0002 Volume Control bmaControls(2) 0x0002 Volume Control iFeature 0 AudioControl Interface Descriptor: bLength 10 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 10 bSourceID 2 bControlSize 1 bmaControls(0) 0x01 Mute Control bmaControls(1) 0x02 Volume Control bmaControls(2) 0x02 Volume Control iFeature 0 AudioControl Interface Descriptor: bLength 10 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 11 bSourceID 3 bControlSize 1 bmaControls(0) 0x01 Mute Control bmaControls(1) 0x02 Volume Control bmaControls(2) 0x02 Volume Control iFeature 0 AudioControl Interface Descriptor: bLength 10 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 12 bSourceID 4 bControlSize 1 bmaControls(0) 0x01 Mute Control bmaControls(1) 0x00 bmaControls(2) 0x00 iFeature 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 1 frames wFormatTag 0x0001 PCM AudioStreaming Interface Descriptor: bLength 20 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 2 bSubframeSize 2 bBitResolution 16 bSamFreqType 4 Discrete tSamFreq[ 0] 8000 tSamFreq[ 1] 16000 tSamFreq[ 2] 44100 tSamFreq[ 3] 48000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 9 Transfer Type Isochronous Synch Type Adaptive Usage Type Data wMaxPacketSize 0x00c8 1x 200 bytes bInterval 1 bRefresh 0 bSynchAddress 0 AudioStreaming Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x01 Sampling Frequency bLockDelayUnits 1 Milliseconds wLockDelay 0x0001 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 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 7 bDelay 1 frames wFormatTag 0x0001 PCM AudioStreaming Interface Descriptor: bLength 20 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 2 bSubframeSize 2 bBitResolution 16 bSamFreqType 4 Discrete tSamFreq[ 0] 8000 tSamFreq[ 1] 16000 tSamFreq[ 2] 44100 tSamFreq[ 3] 48000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x00c8 1x 200 bytes bInterval 1 bRefresh 0 bSynchAddress 0 AudioStreaming Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x01 Sampling Frequency bLockDelayUnits 0 Undefined wLockDelay 0x0000 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.00 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 50 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x87 EP 7 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 1 Device Status: 0x0000 (Bus Powered)

Bus 001 Device 039: ID 0a12:1004 Cambridge Silicon Radio, Ltd REIYIN Bluetooth Audio WT04 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x0a12 Cambridge Silicon Radio, Ltd idProduct 0x1004 bcdDevice 36.06 iManufacturer 1 iProduct 2 REIYIN Bluetooth Audio WT04 iSerial 3 ABCDEF0123456789 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x00f3 bNumInterfaces 5 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 96mA 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 0x0047 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 10 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 2 bSourceID 1 bControlSize 1 bmaControls(0) 0x03 Mute Control Volume Control bmaControls(1) 0x00 bmaControls(2) 0x00 iFeature 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 3 wTerminalType 0x0301 Speaker bAssocTerminal 0 bSourceID 2 iTerminal 0 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 4 wTerminalType 0x0201 Microphone bAssocTerminal 0 bNrChannels 1 wChannelConfig 0x0001 Left Front (L) iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 5 bSourceID 4 bControlSize 1 bmaControls(0) 0x02 Volume Control bmaControls(1) 0x00 iFeature 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 6 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID 5 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 6 bDelay 0 frames wFormatTag 0x0001 PCM AudioStreaming Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 1 bSubframeSize 2 bBitResolution 16 bSamFreqType 1 Discrete tSamFreq[ 0] 48000 AudioStreaming Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x00 bLockDelayUnits 2 Decoded PCM samples wLockDelay 0x0000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0060 1x 96 bytes bInterval 1 bRefresh 0 bSynchAddress 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 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 0x0001 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 AudioStreaming Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x81 Sampling Frequency MaxPacketsOnly bLockDelayUnits 2 Decoded PCM samples wLockDelay 0x0000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x03 EP 3 OUT bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x00c0 1x 192 bytes bInterval 1 bRefresh 0 bSynchAddress 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 98 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 4 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 65 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x89 EP 9 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 1 Device Status: 0x0000 (Bus Powered)

Bus 001 Device 038: ID 05ac:110a Apple, Inc. USB-C to 3.5mm Headphone Jack Adapter Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.01 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x05ac Apple, Inc. idProduct 0x110a bcdDevice 26.11 iManufacturer 1 Apple, Inc. iProduct 2 USB-C to 3.5mm Headphone Jack Adapter iSerial 3 DWH222306W3JKLTAG bNumConfigurations 3 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x00f8 bNumInterfaces 4 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 300mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 1 Audio bFunctionSubClass 0 bFunctionProtocol 32 iFunction 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 1 Control Device bInterfaceProtocol 32 iInterface 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bcdADC 2.00 bCategory 4 wTotalLength 0x0040 bmControls 0x00 AudioControl Interface Descriptor: bLength 17 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bCSourceID 9 bNrChannels 2 bmChannelConfig 0x00000003 Front Left (FL) Front Right (FR) iChannelNames 0 bmControls 0x0000 iTerminal 0 AudioControl Interface Descriptor: bLength 18 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 2 bSourceID 1 bmaControls(0) 0x00000003 Mute Control (read/write) bmaControls(1) 0x0000000c Volume Control (read/write) bmaControls(2) 0x0000000c Volume Control (read/write) iFeature 0 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 3 wTerminalType 0x0302 Headphones bAssocTerminal 0 bSourceID 2 bCSourceID 9 bmControls 0x0000 iTerminal 0 AudioControl Interface Descriptor: bLength 8 bDescriptorType 36 bDescriptorSubtype 10 (CLOCK_SOURCE) bClockID 9 bmAttributes 7 Internal programmable clock (synchronized to SOF) bmControls 0x07 Clock Frequency Control (read/write) Clock Validity Control (read-only) bAssocTerminal 0 iClockSource 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0006 1x 6 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 32 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 32 iInterface 0 AudioStreaming Interface Descriptor: bLength 16 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 1 bmControls 0x05 Active Alternate Setting Control (read-only) Valid Alternate Setting Control (read-only) bFormatType 1 bmFormats 0x00000001 PCM bNrChannels 2 bmChannelConfig 0x00000003 Front Left (FL) Front Right (FR) iChannelNames 0 AudioStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bSubslotSize 3 bBitResolution 24 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 13 Transfer Type Isochronous Synch Type Synchronous Usage Type Data wMaxPacketSize 0x0120 1x 288 bytes bInterval 1 AudioStreaming Endpoint Descriptor: bLength 8 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x00 bmControls 0x00 bLockDelayUnits 1 Milliseconds wLockDelay 0x0064 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 32 iInterface 0 AudioStreaming Interface Descriptor: bLength 16 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 1 bmControls 0x05 Active Alternate Setting Control (read-only) Valid Alternate Setting Control (read-only) bFormatType 1 bmFormats 0x00000001 PCM bNrChannels 2 bmChannelConfig 0x00000003 Front Left (FL) Front Right (FR) iChannelNames 0 AudioStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bSubslotSize 2 bBitResolution 16 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 13 Transfer Type Isochronous Synch Type Synchronous Usage Type Data wMaxPacketSize 0x00c0 1x 192 bytes bInterval 1 AudioStreaming Endpoint Descriptor: bLength 8 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x00 bmControls 0x00 bLockDelayUnits 1 Milliseconds wLockDelay 0x0064 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 31 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x85 EP 5 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 42 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x86 EP 6 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x007c bNumInterfaces 4 bConfigurationValue 2 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 300mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 1 Audio bFunctionSubClass 33 bFunctionProtocol 48 iFunction 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 1 Control Device bInterfaceProtocol 48 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0006 1x 6 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 48 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 48 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 13 Transfer Type Isochronous Synch Type Synchronous Usage Type Data wMaxPacketSize 0x0120 1x 288 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 48 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 13 Transfer Type Isochronous Synch Type Synchronous Usage Type Data wMaxPacketSize 0x00c0 1x 192 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 31 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x85 EP 5 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 42 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x86 EP 6 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x011b bNumInterfaces 4 bConfigurationValue 3 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 300mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 1 Audio bFunctionSubClass 1 Control Device bFunctionProtocol 48 iFunction 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 1 Control Device bInterfaceProtocol 48 iInterface 0 AudioControl Interface Descriptor: bLength 10 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bCategory 15 wTotalLength 0x005d bmControls 0x00000001 Latency control Control (read-only) AudioControl Interface Descriptor: bLength 20 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bCSourceID 9 bmControls 0x00000000 wClusterDescrID 0x0020 wExTerminalDescrID 0x0000 wConnectorsDescrID 0x0000 wTerminalDescrStr 0x0000 AudioControl Interface Descriptor: bLength 19 bDescriptorType 36 bDescriptorSubtype 7 (FEATURE_UNIT) bUnitID 2 bSourceID 1 bmaControls(0) 0x00000003 Mute Control (read/write) bmaControls(1) 0x0000000c Volume Control (read/write) bmaControls(2) 0x0000000c Volume Control (read/write) wFeatureDescrStr 0x0000 AudioControl Interface Descriptor: bLength 19 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 3 wTerminalType 0x0302 Headphones bAssocTerminal 0 bSourceID 2 bCSourceID 9 bmControls 0x00000000 wExTerminalDescrID 0x0000 wConnectorsDescrID 0x0000 wTerminalDescrStr 0x0000 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 11 (CLOCK_SOURCE) bClockID 9 bmAttributes 3 Internal clock (synchronized to SOF) bmControls 0x00000007 Clock Frequency Control (read/write) Clock Validity Control (read-only) bReferenceTerminal 0 wClockSourceStr 0x0000 AudioControl Interface Descriptor: bLength 13 bDescriptorType 36 bDescriptorSubtype 16 (POWER_DOMAIN) bPowerDomainID 40 waRecoveryTime(1) 0x0258 waRecoveryTime(2) 0x1770 bNrEntities 2 baEntityID(0) 1 baEntityID(1) 3 wPDomainDescrStr 0x0000 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0006 1x 6 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 48 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 48 iInterface 0 AudioStreaming Interface Descriptor: bLength 23 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 1 bmControls 0x00000005 Active Alternate Setting Control (read-only) Valid Alternate Setting Control (read-only) wClusterDescrID 0x0020 bmFormats 0x0000000000000001 bSubslotSize 3 bBitResolution 24 bmAuxProtocols 0x0000 bControlSize 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 13 Transfer Type Isochronous Synch Type Synchronous Usage Type Data wMaxPacketSize 0x0120 1x 288 bytes bInterval 1 AudioStreaming Endpoint Descriptor: bLength 10 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmControls 0x00000000 bLockDelayUnits 1 Milliseconds wLockDelay 0x0064 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 48 iInterface 0 AudioStreaming Interface Descriptor: bLength 23 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 1 bmControls 0x00000005 Active Alternate Setting Control (read-only) Valid Alternate Setting Control (read-only) wClusterDescrID 0x0020 bmFormats 0x0000000000000001 bSubslotSize 2 bBitResolution 16 bmAuxProtocols 0x0000 bControlSize 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 13 Transfer Type Isochronous Synch Type Synchronous Usage Type Data wMaxPacketSize 0x00c0 1x 192 bytes bInterval 1 AudioStreaming Endpoint Descriptor: bLength 10 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmControls 0x00000000 bLockDelayUnits 1 Milliseconds wLockDelay 0x0064 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 31 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x85 EP 5 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 42 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x86 EP 6 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 0x002a bNumDeviceCaps 4 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType 16 bDevCapabilityType 2 bmAttributes 0x00000000 (Missing must-be-set LPM bit!) Configuration Summary Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 16 bcdVersion 1.00 bClass 1 bSubClass 1 bProtocol 48 bConfigurationCount 1 bConfigurationIndex(0) 3 Configuration Summary Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 16 bcdVersion 1.00 bClass 1 bSubClass 33 bProtocol 48 bConfigurationCount 1 bConfigurationIndex(0) 2 Configuration Summary Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 16 bcdVersion 1.00 bClass 1 bSubClass 0 bProtocol 32 bConfigurationCount 1 bConfigurationIndex(0) 1 Device Status: 0x0002 (Bus Powered) Remote Wakeup Enabled

Bus 001 Device 037: ID 2109:2817 VIA Labs, Inc. USB2.0 Hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.10 bDeviceClass 9 Hub bDeviceSubClass 0 bDeviceProtocol 2 TT per port bMaxPacketSize0 64 idVendor 0x2109 VIA Labs, Inc. idProduct 0x2817 bcdDevice 90.34 iManufacturer 1 VIA Labs, Inc. iProduct 2 USB2.0 Hub iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0029 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 bInterfaceProtocol 1 Single TT iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0001 1x 1 bytes bInterval 12 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 bInterfaceProtocol 2 TT per port iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0001 1x 1 bytes bInterval 12 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 4 wHubCharacteristic 0x00e9 Per-port power switching Per-port overcurrent protection TT think time 32 FS bits Port indicators bPwrOn2PwrGood 175 * 2 milli seconds bHubContrCurrent 100 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0103 power enable connect Port 2: 0000.0103 power enable connect Port 3: 0000.0100 power Port 4: 0000.0103 power enable connect Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 0x002a bNumDeviceCaps 3 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType 16 bDevCapabilityType 2 bmAttributes 0x00000006 BESL Link Power Management (LPM) Supported SuperSpeed USB Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 3 bmAttributes 0x00 wSpeedsSupported 0x000e Device can operate at Full Speed (12Mbps) Device can operate at High Speed (480Mbps) Device can operate at SuperSpeed (5Gbps) bFunctionalitySupport 1 Lowest fully-functional device speed is Full Speed (12Mbps) bU1DevExitLat 4 micro seconds bU2DevExitLat 231 micro seconds Container ID Device Capability: bLength 20 bDescriptorType 16 bDevCapabilityType 4 bReserved 0 ContainerID {30eef35c-07d5-2549-b001-802d79434c30} Device Status: 0x0001 Self Powered

Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.10 bDeviceClass 9 Hub bDeviceSubClass 0 bDeviceProtocol 1 Single TT bMaxPacketSize0 64 idVendor 0x2109 VIA Labs, Inc. idProduct 0x3431 Hub bcdDevice 4.21 iManufacturer 0 iProduct 1 USB2.0 Hub iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0019 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0001 1x 1 bytes bInterval 12 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 4 wHubCharacteristic 0x00e0 Ganged power switching Ganged overcurrent protection TT think time 32 FS bits Port indicators bPwrOn2PwrGood 50 * 2 milli seconds bHubContrCurrent 100 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0503 highspeed power enable connect Port 2: 0000.0100 power Port 3: 0000.0100 power Port 4: 0000.0100 power Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 0x002a bNumDeviceCaps 3 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType 16 bDevCapabilityType 2 bmAttributes 0x00000002 HIRD Link Power Management (LPM) Supported SuperSpeed USB Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 3 bmAttributes 0x00 wSpeedsSupported 0x000e Device can operate at Full Speed (12Mbps) Device can operate at High Speed (480Mbps) Device can operate at SuperSpeed (5Gbps) bFunctionalitySupport 1 Lowest fully-functional device speed is Full Speed (12Mbps) bU1DevExitLat 4 micro seconds bU2DevExitLat 231 micro seconds Container ID Device Capability: bLength 20 bDescriptorType 16 bDevCapabilityType 4 bReserved 0 ContainerID {30eef35c-07d5-2549-b001-802d79434c30} Device Status: 0x0001 Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 9 Hub bDeviceSubClass 0 bDeviceProtocol 1 Single TT bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0002 2.0 root hub bcdDevice 5.15 iManufacturer 3 Linux 5.15.61-v8+ xhci-hcd iProduct 2 xHCI Host Controller iSerial 1 0000:01:00.0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0019 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0004 1x 4 bytes bInterval 12 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 1 wHubCharacteristic 0x0009 Per-port power switching Per-port overcurrent protection TT think time 8 FS bits bPwrOn2PwrGood 10 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x02 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0503 highspeed power enable connect Device Status: 0x0001 Self Powered

I had such high hopes for the "new" Pi 4's supposed USB upgrades, but this has been a bad experience so far. :grimacing:

Darry77 commented 2 years ago

I'm getting this same failure on a brand new Pi 4B 8GB:

* RPi OS 11 (bullseye)

* Kernel 5.15.61-v8+

* Bootloader 507b2360eb46af23c05844b289dc5ae4ecfc3cca (from `vcgencmd bootloader_version`)

* VL805 firmware 000138a1 (from `sudo rpi-eeprom-update`)

After connecting 2 or 3 USB sound devices, connecting an additional sound device triggers a stream of "Not enough bandwidth for new device state" in dmesg logs.

Things I've tried after reading and re-reading this github issue, the forum thread about this issue from 2020, and the forum thread about the firmware update from 2020:

* Verified that I have VL805 firmware `000138a1` with `sudo rpi-eeprom-update`

* Tried multiple multi-TT USB hubs with Realtek and VIA chipsets (MTT verified by checking `lsusb -v` and finding `bDeviceProtocol 2 TT per port`)

* Tried every combination of connecting sound devices; all on one MTT hub, one each on 3 MTT hubs and one plugged directly, devices split between two or more hubs, using the Pi's USB2/USB3 ports, etc.

I'm developing an audio gadget, so the USB-C port is in OTG mode and I'm unable to use it as an additional host mode port.

I don't fully understand the issue here; for some people the firmware update back in 2020 seemed to solve their problems. I don't think biasha2 got an answer about whether it's is a hardware issue or a firmware issue.

So, is this solvable, or is it a permanent USB limitation on all Pi 4s? What is the limitation? I thought it was that each transaction translator has a chunk of bandwidth to split between full-speed devices, and the onboard single-TT VL805 quickly exhausts itself after one or two audio devices. I thought a multi-TT hub was supposed to wrap each device in its own partitioned bandwidth pool. That doesn't seem to be happening, or maybe there's a bug in the VL805's bandwidth prediction that's not taking multi-TT hubs into account? Would a CM4 in a carrier board with a multi-TT hub chip behave any better?

Here are my lsusb outputs when I have 3 audio devices attached to one USB3 multi-TT hub (VIA VL817 chipset) connected to a USB3 port on the Pi, after the system's already started spewing usb 1-1.1.4: Not enough bandwidth errors into dmesg output: lsusb -t lsusb -v

I had such high hopes for the "new" Pi 4's supposed USB upgrades, but this has been a bad experience so far. 😬

I had the same issue you do and tried pretty much the same things you did before giving up on the VL805 and USB 1.x full speed devices .

One possible workaround might be to use USB 2.0 high speed (or faster) devices . I presume that you are using USB 1.x full speed ones.

As for the CM carrier board, AFAICR, it does not have a discrete USB controller (VL805) and neither does the compute module itself, so the only USB controller is the one integrated into the Pi SOC . However, the CM carrier does have a PCIE slot, so you might be able to use a different USB controller on a PCIE add-in card, which might work better. See https://pipci.jeffgeerling.com/#usb-cards for possible options .

mildmojo commented 2 years ago

One possible workaround might be to use USB 2.0 high speed (or faster) devices . I presume that you are using USB 1.x full speed ones.

Yeah, even the audio devices I have that enumerate as USB 2.0 are still full-speed, not high-speed. I have half a dozen of them: a $5 junk adapter, a brand-new Apple USB-C headphone adapter, a prosumer audio interface, an ESS Sabre DAC, etc. and they're all full-speed. Seems incredibly common for audio, and it would be difficult to even shop for "real" high-speed USB 2.0 devices.

My design goals for my project include the ability to use any number of USB audio devices of any type, though I'd settle for 5 or 6 of them. And really, it seems silly that the Pi 4 can't handle half a dozen full-speed devices, when the Pi 3 reportedly handles them much better.

As for the CM carrier board

Oh, I wasn't talking about the official board, I meant the dozens of third-party boards. Any CM4 carrier that supports USB3 has its own PCIe USB chip, external to the CM4. It just happens that a lot of them chose to use the VL805, too, for symmetry with the Pi 4.

My questions were: is this bug limited to the VL805, and can it be fixed or is it permanent?

For example, on my laptop PC, I can replicate this "not enough bandwidth" failure by connecting 4 full-speed audio devices to a single-TT USB 2.0 hub. However, if I connect those devices to a multi-TT hub, then plug that hub into the single-TT hub attached to the PC, the problem goes away. In theory, that setup is the same as the situation on the Pi, where I'm connecting my multi-TT hub fulla full-speed audio devices to the Pi's onboard single-TT hub, which is connected to the Pi's USB controller. Why does that fail on the Pi but not on my PC?