M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

USB performance: Isochronous (audio or video)

Thu Jan 10, 2013 10:51 pm

Hello.

I am starting a new thread (separate to USB redux) to attempt to collate the various issues people have with isochronous devices.

Isochronous transactions in USB are for types of data which need guaranteed timing but no guarantee as to the correctness of the data (truncated or otherwise).

Typically, these devices exclusively use isochronous transactions:
  • * Webcams
    * USB-TV sticks
    * USB video capture or sound capture devices
    * USB "sound cards"
I have limited isochronous hardware available to me - but I do have one very powerful tool - a crappy £4 webcam bought on Ebay. This webcam only offers the following transfer modes:

Code: Select all

Pixel format: YUYV (YUV 4:2:2 (YUYV); MIME type: video/x-raw-yuv)
  Frame size: 640x480
    Frame rates: 30
//  Size:614400B
// Rate: 18000KiB/s

  Frame size: 352x288
    Frame rates: 30
//  Size: 202752B
//  Rate: 5940KiB/s

  Frame size: 320x240
    Frame rates: 30
//  Size: 153600B
//  Rate: 4500KiB/s

  Frame size: 176x144
    Frame rates: 30
//  Size: 50688B
//  Rate: 1485KiB/s

  Frame size: 160x120
    Frame rates: 30
//  Size: 38400B
//  Rate: 1125KiB/s
i.e. only supports uncompressed video transfers with variable resolution - this essentially gives me a giant bandwidth dial with which to change the amount of isochronous traffic on the bus. I have found that smaller transfers typically complete OK, but larger transfers will sporadically fail and there is a snowball's chance in hell of a 640x480 image being transferred.

Smarter products will support multiple sound/video compression or format modes. Webcams will typically support both mjpeg and raw (if they are uvc devices) and USB audio devices will support multiple bitrates and resolution depths.

Could you please post

- what didn't work (from a default raspbian image)
- what did work, and the steps you took to achieve this
If feeling more adventurous, these commands may be of use (as root):
For webcams:

Code: Select all

echo 0xFF > /sys/module/uvcvideo/parameters/trace
Webcams also have the very useful uvcdynctrl package - which if you type uvcdynctrl -f will list supported modes.

For USB audio devices:

Code: Select all

Ask the developer to give you more debug options. Or try a different value for the snd-usb-audio module parameters nrpacks and async_unlink. 
These options will print lots of spam (useful information) to the kernel log, accessed from a command prompt on the pi by typing dmesg (or for attaching as a file, dmesg > blah.txt).

Please attach a lsusb -v output as well.

rp1301
Posts: 5
Joined: Fri Jan 11, 2013 11:36 am

Re: USB performance: Isochronous (audio or video)

Fri Jan 11, 2013 3:59 pm

C-Media based sound cards fail to capture correctly. USB data loss,
around 1% of the data is silently dropped. A USB device which
delivers a measured (on a PC) 47999.1 samples/sec, when used
on the Pi, delivers an erratic 47500 +/- 300 samples/sec.

Period size, buffer size, nrpacks settings make no difference.
Problem seems to be more or less independent of sample rate.

This behaviour on latest Raspbian (2012-12-16-wheezy),
and Archlinux (archlinux-hf-2012-09-18).

Prevents my application from running. Hope it can be fixed!

Triode
Posts: 4
Joined: Mon Nov 19, 2012 11:18 pm

Re: USB performance: Isochronous (audio or video)

Fri Jan 11, 2013 10:04 pm

My async usb audio class 1 hifi dac (Audiolab MDAC) also fails to work.

Async usb audio requires two isochronous connections - an outbound one for the audio stream and a return one which provides feedback on rate. I've seen problems on other embedded arm devices with 1.1 dacs including mine due to the limitation of embedded transaction translators, but with Pi I believe its the underlying loss of packets which cause the problem. The period is every 1ms for the outbound pipe and one every something like 32 for the sync pipe depending on the dac. Devices often also support HID so this creates additional usb endpoints to enable remote control of the host. In the cause of my MDAC the combined requirements mean usb can't schedule this with the usb port forced to 1.1 rates.

What I've found with some arm SoCs before is that the embedded TT is unable to process an outbound split transaction in the same 1ms frame as an inbound split transaction. Unfortunately for audio rates an outbound transaction is required every 1ms hence they don't work. [this is fixed for the other cases by an external high speed hub to bring a real TT] I don't think this is an issue with Pi, but I'd be interested if you know the capability of the TT within the internal hub.

Happy to help test/provide more data for this type of device.

M_P
Posts: 50
Joined: Sun Jan 06, 2013 5:40 pm

Re: USB performance: Isochronous (audio or video)

Sat Jan 12, 2013 2:58 am

Hello M33P,

I've been running trials with several different configurations. I'm running Wheezy 2012-12-16 (3.6.11+ PREEMPT Tue Jan 1 16:33:22 GMT 2013) on a rev.2 board. Here are some logs from earlier trials - it's not running right now but I should have time tomorrow to run those commands you posted.

These are all from my first set of trials - a powered, Staples-brand (rebranded Belkin, I think) seven port hub with a Microsoft LifeCam Cinema and a D-Link DWA-160 A2 Wi-Fi adapter.

I'm using the software package 'motion' just to dump two frames per second to a CIFS mount (another RPi, actually), although I was seeing the same results when dumping to the SD card. The camera is capturing YUYV format at 960x544.

Over five separate trials with the same configuration the result was the same but the time to failure was anywhere between 60 and 747 seconds.

From syslog:

Code: Select all

Jan  7 19:53:03 upfront kernel: [ 1190.687617] hub 1-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
Jan  7 19:53:03 upfront kernel: [ 1190.687663] usb 1-1: USB disconnect, device number 2
Jan  7 19:53:03 upfront kernel: [ 1190.687679] usb 1-1.1: USB disconnect, device number 3
Jan  7 19:53:03 upfront kernel: [ 1190.688070] smsc95xx 1-1.1:1.0: eth0: unregister 'smsc95xx' usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet
Jan  7 19:53:03 upfront wpa_supplicant[1573]: wlan0: CTRL-EVENT-DISCONNECTED bssid=98:2c:be:fb:e0:79 reason=3
Jan  7 19:53:03 upfront kernel: [ 1190.699359] usb 1-1.2: USB disconnect, device number 4
Jan  7 19:53:03 upfront kernel: [ 1190.699389] usb 1-1.2.6: USB disconnect, device number 5
From messages:

Code: Select all

Jan  7 19:53:03 upfront kernel: [ 1190.687663] usb 1-1: USB disconnect, device number 2
Jan  7 19:53:03 upfront kernel: [ 1190.687679] usb 1-1.1: USB disconnect, device number 3
Jan  7 19:53:03 upfront kernel: [ 1190.688070] smsc95xx 1-1.1:1.0: eth0: unregister 'smsc95xx' usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet
Jan  7 19:53:03 upfront kernel: [ 1190.699359] usb 1-1.2: USB disconnect, device number 4
Jan  7 19:53:03 upfront kernel: [ 1190.699389] usb 1-1.2.6: USB disconnect, device number 5
Jan  7 19:53:03 upfront kernel: [ 1190.700117] wlan0: deauthenticating from 98:2c:be:fb:e0:79 by local choice (reason=3)
Jan  7 19:53:03 upfront kernel: [ 1190.710709] cfg80211: Calling CRDA to update world regulatory domain
Jan  7 19:53:03 upfront wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
The kernel log and dmesg don't have anything that doesn't show up in syslog or messages.

In four out of the five trials, the Wi-Fi dongle was re-enumerated after the hiccup - only one time did it fail to come back up and had to be physically removed and reinserted, at which point it came back up and the corresponding light lit back up on the hub.

In all five trials, the camera was not re-enumerated after the hiccup, but would be found again if it was removed and reinserted, and the corresponding light came on then too.

I also found that if the RPi was just rebooted after the hiccup, it would still not find the camera again unless either power was removed from the RPi and hub or the camera was removed and reattached.

lsusb -v:

Code: Select all

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0x9512 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      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 Unused
      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             3
  wHubCharacteristic 0x000d
    Per-port power switching
    Compound device
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent      1 milli Ampere
  DeviceRemovable    0x02
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0503 highspeed power enable connect
   Port 2: 0000.0503 highspeed power enable connect
   Port 3: 0000.0100 power
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
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 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            3.06
  iManufacturer           3 Linux 3.6.11+ dwc_otg_hcd
  iProduct                2 DWC OTG Controller
  iSerial                 1 bcm2708_usb
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    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 Unused
      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.0503 highspeed power enable connect
Device Status:     0x0001
  Self Powered

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0xec00 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               4
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 004: ID 050d:0416 Belkin Components 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x050d Belkin Components
  idProduct          0x0416 
  bcdDevice            0.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      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 Unused
      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             7
  wHubCharacteristic 0x0000
    Ganged power switching
    Ganged overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent      1 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
   Port 5: 0000.0100 power
   Port 6: 0000.0503 highspeed power enable connect
   Port 7: 0000.0503 highspeed power enable connect
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 005: ID 07d1:3a09 D-Link System DWA-160 802.11abgn Xtreme N Dual Band Adapter(rev.A2) [Atheros AR9170+AR9104]
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass       255 Vendor Specific Subclass
  bDeviceProtocol       255 Vendor Specific Protocol
  bMaxPacketSize0        64
  idVendor           0x07d1 D-Link System
  idProduct          0x3a09 DWA-160 802.11abgn Xtreme N Dual Band Adapter(rev.A2) [Atheros AR9170+AR9104]
  bcdDevice            1.07
  iManufacturer          16 ATHER
  iProduct               32 11n adapter
  iSerial                48 12345
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           46
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           4
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass       255 Vendor Specific Subclass
  bDeviceProtocol       255 Vendor Specific Protocol
  bMaxPacketSize0        64
  bNumConfigurations      0
Device Status:     0x0000
  (Bus Powered)

Bus 001 Device 006: ID 045e:075d Microsoft Corp. LifeCam Cinema
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x045e Microsoft Corp.
  idProduct          0x075d LifeCam Cinema
  bcdDevice            1.05
  iManufacturer           1 Microsoft
  iProduct                2 Microsoft® LifeCam Cinema(TM)
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength         1429
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass         14 Video
      bFunctionSubClass       3 Video Interface Collection
      bFunctionProtocol       0 
      iFunction               4 Microsoft® LifeCam Cinema(TM)
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      1 Video Control
      bInterfaceProtocol      0 
      iInterface              4 Microsoft® LifeCam Cinema(TM)
      VideoControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdUVC               1.00
        wTotalLength           85
        dwClockFrequency       30.000000MHz
        bInCollection           1
        baInterfaceNr( 0)       1
      VideoControl Interface Descriptor:
        bLength                18
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Camera Sensor
        bAssocTerminal          0
        iTerminal               0 
        wObjectiveFocalLengthMin      0
        wObjectiveFocalLengthMax      0
        wOcularFocalLength            0
        bControlSize                  3
        bmControls           0x00020a2a
          Auto-Exposure Mode
          Exposure Time (Absolute)
          Focus (Absolute)
          Zoom (Absolute)
          PanTilt (Absolute)
          Focus, Auto
      VideoControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               5
        iTerminal               0 
      VideoControl Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      4 (SELECTOR_UNIT)
        bUnitID                 3
        bNrInPins               1
        baSource( 0)            1
        iSelector               0 
      VideoControl Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      5 (PROCESSING_UNIT)
      Warning: Descriptor too short
        bUnitID                 4
        bSourceID               3
        wMaxMultiplier          0
        bControlSize            2
        bmControls     0x0000155b
          Brightness
          Contrast
          Saturation
          Sharpness
          White Balance Temperature
          Backlight Compensation
          Power Line Frequency
          White Balance Temperature, Auto
        iProcessing             0 
        bmVideoStandards     0x1b
          None
          NTSC - 525/60
          SECAM - 625/50
          NTSC - 625/50
      VideoControl Interface Descriptor:
        bLength                27
        bDescriptorType        36
        bDescriptorSubtype      6 (EXTENSION_UNIT)
        bUnitID                 5
        guidExtensionCode         {29a787c9-d359-6945-8467-ff0849fc19e8}
        bNumControl            16
        bNrPins                 1
        baSourceID( 0)          4
        bControlSize            2
        bmControls( 0)       0xff
        bmControls( 1)       0xff
        iExtension              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               8
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      VideoStreaming Interface Descriptor:
        bLength                            15
        bDescriptorType                    36
        bDescriptorSubtype                  1 (INPUT_HEADER)
        bNumFormats                         2
        wTotalLength                     1075
        bEndPointAddress                  129
        bmInfo                              0
        bTerminalLink                       2
        bStillCaptureMethod                 1
        bTriggerSupport                     1
        bTriggerUsage                       0
        bControlSize                        1
        bmaControls( 0)                    27
        bmaControls( 1)                    27
      VideoStreaming Interface Descriptor:
        bLength                            27
        bDescriptorType                    36
        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
        bFormatIndex                        1
        bNumFrameDescriptors               12
        guidFormat                            {59555932-0000-1000-8000-00aa00389b71}
        bBitsPerPixel                      16
        bDefaultFrameIndex                  1
        bAspectRatioX                       0
        bAspectRatioY                       0
        bmInterlaceFlags                 0x00
          Interlaced stream or variable: No
          Fields per frame: 2 fields
          Field 1 first: No
          Field pattern: Field 1 only
          bCopyProtect                      0
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         1
        bmCapabilities                   0x01
          Still image supported
        wWidth                            640
        wHeight                           480
        dwMinBitRate                 36864000
        dwMaxBitRate                147456000
        dwMaxVideoFrameBufferSize      614400
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            34
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         2
        bmCapabilities                   0x01
          Still image supported
        wWidth                           1280
        wHeight                           720
        dwMinBitRate                110592000
        dwMaxBitRate                147456000
        dwMaxVideoFrameBufferSize     1843200
        dwDefaultFrameInterval        1000000
        bFrameIntervalType                  2
        dwFrameInterval( 0)           1000000
        dwFrameInterval( 1)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         3
        bmCapabilities                   0x01
          Still image supported
        wWidth                            960
        wHeight                           544
        dwMinBitRate                 62668800
        dwMaxBitRate                125337600
        dwMaxVideoFrameBufferSize     1044480
        dwDefaultFrameInterval         666666
        bFrameIntervalType                  3
        dwFrameInterval( 0)            666666
        dwFrameInterval( 1)           1000000
        dwFrameInterval( 2)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            42
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         4
        bmCapabilities                   0x01
          Still image supported
        wWidth                            800
        wHeight                           448
        dwMinBitRate                 43008000
        dwMaxBitRate                114688000
        dwMaxVideoFrameBufferSize      716800
        dwDefaultFrameInterval         500000
        bFrameIntervalType                  4
        dwFrameInterval( 0)            500000
        dwFrameInterval( 1)            666666
        dwFrameInterval( 2)           1000000
        dwFrameInterval( 3)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         5
        bmCapabilities                   0x01
          Still image supported
        wWidth                            640
        wHeight                           360
        dwMinBitRate                 27648000
        dwMaxBitRate                110592000
        dwMaxVideoFrameBufferSize      460800
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         6
        bmCapabilities                   0x01
          Still image supported
        wWidth                            424
        wHeight                           240
        dwMinBitRate                 12211200
        dwMaxBitRate                 48844800
        dwMaxVideoFrameBufferSize      203520
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         7
        bmCapabilities                   0x01
          Still image supported
        wWidth                            352
        wHeight                           288
        dwMinBitRate                 12165120
        dwMaxBitRate                 48660480
        dwMaxVideoFrameBufferSize      202752
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         8
        bmCapabilities                   0x01
          Still image supported
        wWidth                            320
        wHeight                           240
        dwMinBitRate                  9216000
        dwMaxBitRate                 36864000
        dwMaxVideoFrameBufferSize      153600
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         9
        bmCapabilities                   0x01
          Still image supported
        wWidth                            800
        wHeight                           600
        dwMinBitRate                 57600000
        dwMaxBitRate                115200000
        dwMaxVideoFrameBufferSize      960000
        dwDefaultFrameInterval         666666
        bFrameIntervalType                  3
        dwFrameInterval( 0)            666666
        dwFrameInterval( 1)           1000000
        dwFrameInterval( 2)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                        10
        bmCapabilities                   0x01
          Still image supported
        wWidth                            176
        wHeight                           144
        dwMinBitRate                  3041280
        dwMaxBitRate                 12165120
        dwMaxVideoFrameBufferSize       50688
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                        11
        bmCapabilities                   0x01
          Still image supported
        wWidth                            160
        wHeight                           120
        dwMinBitRate                  2304000
        dwMaxBitRate                  9216000
        dwMaxVideoFrameBufferSize       38400
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                        12
        bmCapabilities                   0x01
          Still image supported
        wWidth                           1280
        wHeight                           800
        dwMinBitRate                163840000
        dwMaxBitRate                163840000
        dwMaxVideoFrameBufferSize     2048000
        dwDefaultFrameInterval        1000000
        bFrameIntervalType                  1
        dwFrameInterval( 0)           1000000
      VideoStreaming Interface Descriptor:
        bLength                             6
        bDescriptorType                    36
        bDescriptorSubtype                 13 (COLORFORMAT)
        bColorPrimaries                     1 (BT.709,sRGB)
        bTransferCharacteristics            1 (BT.709)
        bMatrixCoefficients                 4 (SMPTE 170M (BT.601))
      VideoStreaming Interface Descriptor:
        bLength                            11
        bDescriptorType                    36
        bDescriptorSubtype                  6 (FORMAT_MJPEG)
        bFormatIndex                        2
        bNumFrameDescriptors               11
        bFlags                              0
          Fixed-size samples: No
        bDefaultFrameIndex                  1
        bAspectRatioX                       0
        bAspectRatioY                       0
        bmInterlaceFlags                 0x00
          Interlaced stream or variable: No
          Fields per frame: 1 fields
          Field 1 first: No
          Field pattern: Field 1 only
          bCopyProtect                      0
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         1
        bmCapabilities                   0x01
          Still image supported
        wWidth                            640
        wHeight                           480
        dwMinBitRate                 36864000
        dwMaxBitRate                147456000
        dwMaxVideoFrameBufferSize      614400
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         2
        bmCapabilities                   0x01
          Still image supported
        wWidth                           1280
        wHeight                           720
        dwMinBitRate                110592000
        dwMaxBitRate                442368000
        dwMaxVideoFrameBufferSize     1843200
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         3
        bmCapabilities                   0x01
          Still image supported
        wWidth                            960
        wHeight                           544
        dwMinBitRate                 62668800
        dwMaxBitRate                250675200
        dwMaxVideoFrameBufferSize     1044480
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         4
        bmCapabilities                   0x01
          Still image supported
        wWidth                            800
        wHeight                           448
        dwMinBitRate                 43008000
        dwMaxBitRate                172032000
        dwMaxVideoFrameBufferSize      716800
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         5
        bmCapabilities                   0x01
          Still image supported
        wWidth                            640
        wHeight                           360
        dwMinBitRate                 27648000
        dwMaxBitRate                110592000
        dwMaxVideoFrameBufferSize      460800
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         6
        bmCapabilities                   0x01
          Still image supported
        wWidth                            800
        wHeight                           600
        dwMinBitRate                 57600000
        dwMaxBitRate                230400000
        dwMaxVideoFrameBufferSize      960000
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         7
        bmCapabilities                   0x01
          Still image supported
        wWidth                            416
        wHeight                           240
        dwMinBitRate                 11980800
        dwMaxBitRate                 47923200
        dwMaxVideoFrameBufferSize      199680
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         8
        bmCapabilities                   0x01
          Still image supported
        wWidth                            352
        wHeight                           288
        dwMinBitRate                 12165120
        dwMaxBitRate                 48660480
        dwMaxVideoFrameBufferSize      202752
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         9
        bmCapabilities                   0x01
          Still image supported
        wWidth                            176
        wHeight                           144
        dwMinBitRate                  3041280
        dwMaxBitRate                 12165120
        dwMaxVideoFrameBufferSize       50688
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                        10
        bmCapabilities                   0x01
          Still image supported
        wWidth                            320
        wHeight                           240
        dwMinBitRate                  9216000
        dwMaxBitRate                 36864000
        dwMaxVideoFrameBufferSize      153600
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                        11
        bmCapabilities                   0x01
          Still image supported
        wWidth                            160
        wHeight                           120
        dwMinBitRate                  2304000
        dwMaxBitRate                  9216000
        dwMaxVideoFrameBufferSize       38400
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  5
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            500000
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1000000
        dwFrameInterval( 4)           1333333
      VideoStreaming Interface Descriptor:
        bLength                             6
        bDescriptorType                    36
        bDescriptorSubtype                 13 (COLORFORMAT)
        bColorPrimaries                     1 (BT.709,sRGB)
        bTransferCharacteristics            1 (BT.709)
        bMatrixCoefficients                 4 (SMPTE 170M (BT.601))
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0080  1x 128 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0100  1x 256 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0c00  2x 1024 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       6
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x1400  3x 1024 bytes
        bInterval               1
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         2
      bInterfaceCount         2
      bFunctionClass          1 Audio
      bFunctionSubClass       2 Streaming
      bFunctionProtocol       0 
      iFunction               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      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           39
        bInCollection           1
        baInterfaceNr( 0)       3
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0202 Desktop Microphone
        bAssocTerminal          0
        bNrChannels             1
        wChannelConfig     0x0000
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 5
        bSourceID               1
        bControlSize            1
        bmaControls( 0)      0x01
          Mute Control
        bmaControls( 1)      0x02
          Volume Control
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          1
        bSourceID               5
        iTerminal               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      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           3
        bDelay                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                29
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             1
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            7 Discrete
        tSamFreq[ 0]         8000
        tSamFreq[ 1]        16000
        tSamFreq[ 2]        22050
        tSamFreq[ 3]        24000
        tSamFreq[ 4]        32000
        tSamFreq[ 5]        44100
        tSamFreq[ 6]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0100  1x 256 bytes
        bInterval               4
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)
I hope this helps, let me know if there's anything you'd like me to try.

rp1301
Posts: 5
Joined: Fri Jan 11, 2013 11:36 am

Re: USB performance: Isochronous (audio or video)

Sat Jan 12, 2013 10:27 pm

Further to the USB audio capture dropped data...

Booting with kernel option

dwc_otg.speed=1

cures the problem. Capture works reliably then.

M_P
Posts: 50
Joined: Sun Jan 06, 2013 5:40 pm

Re: USB performance: Isochronous (audio or video)

Sun Jan 13, 2013 6:20 am

Well, I just ran the same camera setup with:

Code: Select all

echo 0xFF > /sys/module/uvcvideo/parameters/trace
That gave me a nice 300MB log file for about 30 minutes of uptime. :lol:

Failed again with the same EMI message (as expected, I suppose).

There were a lot (hundreds to thousands) of entries. The vast majority of them were:

Code: Select all

Jan 12 22:22:24 upfront kernel: [  220.779609] uvcvideo: Dropping payload (out of sync).
The second-most common would show up in blocks of about six to ten:

Code: Select all

Jan 12 22:22:24 upfront kernel: [  220.341121] uvcvideo: USB isochronous frame lost (-63).
There would also be the occasional:

Code: Select all

Jan 12 22:22:24 upfront kernel: [  220.626457] uvcvideo: Frame complete (EOF found).
and

Code: Select all

Jan 12 22:22:26 upfront kernel: [  222.382158] uvcvideo: Frame complete (overflow).
It kept this up for about 2100 seconds (which, incidentally, was the longest it had run in this configuration). The camera then shut down, something threw the EMI message into the log, and the USB Wi-Fi was found again automatically:

Code: Select all

Jan 12 22:58:11 upfront kernel: [ 2367.852502] uvcvideo: Dropping payload (out o
f sync).
Jan 12 22:58:11 upfront kernel: [ 2367.852528] uvcvideo: Dropping payload (out of sync).
Jan 12 22:58:11 upfront kernel: [ 2367.852540] uvcvideo: Dropping payload (out of sync).
Jan 12 22:58:11 upfront kernel: [ 2367.885319] uvcvideo: USB isochronous frame lost (-63).
Jan 12 22:58:11 upfront kernel: [ 2367.982049] hub 1-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
Jan 12 22:58:11 upfront kernel: [ 2367.982091] usb 1-1: USB disconnect, device number 2
Jan 12 22:58:11 upfront kernel: [ 2367.982107] usb 1-1.1: USB disconnect, device number 3
I'm not sure if it's relevant, but after I disconnected and reconnected the camera, the following showed up:

Code: Select all

Jan 12 23:06:27 upfront kernel: [ 2863.804158] usb 1-1.2.7: new high-speed USB device number 11 using dwc_otg
Jan 12 23:06:27 upfront kernel: [ 2863.920860] usb 1-1.2.7: New USB device found, idVendor=045e, idProduct=075d
Jan 12 23:06:27 upfront kernel: [ 2863.920920] usb 1-1.2.7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jan 12 23:06:27 upfront kernel: [ 2863.920939] usb 1-1.2.7: Product: Microsoft® LifeCam Cinema(TM)
Jan 12 23:06:27 upfront kernel: [ 2863.920953] usb 1-1.2.7: Manufacturer: Microsoft
Jan 12 23:06:27 upfront kernel: [ 2863.935794] uvcvideo: Probing generic UVC device 1.2.7
Jan 12 23:06:27 upfront kernel: [ 2863.935852] uvcvideo: Found format YUV 4:2:2 (YUYV).
Jan 12 23:06:27 upfront kernel: [ 2863.935871] uvcvideo: - 640x480 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935912] uvcvideo: - 1280x720 (10.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935927] uvcvideo: - 960x544 (15.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935938] uvcvideo: - 800x448 (20.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935948] uvcvideo: - 640x360 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935958] uvcvideo: - 424x240 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935967] uvcvideo: - 352x288 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935977] uvcvideo: - 320x240 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935986] uvcvideo: - 800x600 (15.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.935996] uvcvideo: - 176x144 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936030] uvcvideo: - 160x120 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936043] uvcvideo: - 1280x800 (10.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936053] uvcvideo: Found format MJPEG.
Jan 12 23:06:27 upfront kernel: [ 2863.936064] uvcvideo: - 640x480 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936073] uvcvideo: - 1280x720 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936083] uvcvideo: - 960x544 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936093] uvcvideo: - 800x448 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936103] uvcvideo: - 640x360 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936112] uvcvideo: - 800x600 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936122] uvcvideo: - 416x240 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936155] uvcvideo: - 352x288 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936168] uvcvideo: - 176x144 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936178] uvcvideo: - 320x240 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936188] uvcvideo: - 160x120 (30.0 fps)
Jan 12 23:06:27 upfront kernel: [ 2863.936232] uvcvideo: Found a Status endpoint (addr 83).
Jan 12 23:06:27 upfront kernel: [ 2863.936247] uvcvideo: Found UVC 1.00 device Microsoft® LifeCam Cinema(TM) (045e:075d)
Jan 12 23:06:27 upfront kernel: [ 2863.936699] uvcvideo: Added control 00000000-0000-0000-0000-000000000001/2 to device 1.2.7 entity 1
Jan 12 23:06:27 upfront kernel: [ 2863.936737] uvcvideo: Adding mapping 'Exposure, Auto' to control 00000000-0000-0000-0000-000000000001/2.
Jan 12 23:06:27 upfront kernel: [ 2863.936800] uvcvideo: Added control 00000000-0000-0000-0000-000000000001/4 to device 1.2.7 entity 1
Jan 12 23:06:27 upfront kernel: [ 2863.936822] uvcvideo: Adding mapping 'Exposure (Absolute)' to control 00000000-0000-0000-0000-000000000001/4.
Jan 12 23:06:27 upfront kernel: [ 2863.936847] uvcvideo: Added control 00000000-0000-0000-0000-000000000001/6 to device 1.2.7 entity 1
Jan 12 23:06:27 upfront kernel: [ 2863.936866] uvcvideo: Adding mapping 'Focus (absolute)' to control 00000000-0000-0000-0000-000000000001/6.
Jan 12 23:06:27 upfront kernel: [ 2863.936915] uvcvideo: Added control 00000000-0000-0000-0000-000000000001/11 to device 1.2.7 entity 1
Jan 12 23:06:27 upfront kernel: [ 2863.936939] uvcvideo: Adding mapping 'Zoom, Absolute' to control 00000000-0000-0000-0000-000000000001/11.
Jan 12 23:06:27 upfront kernel: [ 2863.936963] uvcvideo: Added control 00000000-0000-0000-0000-000000000001/13 to device 1.2.7 entity 1
Jan 12 23:06:27 upfront kernel: [ 2863.936984] uvcvideo: Adding mapping 'Pan (Absolute)' to control 00000000-0000-0000-0000-000000000001/13.
Jan 12 23:06:27 upfront kernel: [ 2863.937000] uvcvideo: Adding mapping 'Tilt (Absolute)' to control 00000000-0000-0000-0000-000000000001/13.
Jan 12 23:06:27 upfront kernel: [ 2863.937048] uvcvideo: Added control 00000000-0000-0000-0000-000000000001/8 to device 1.2.7 entity 1
Jan 12 23:06:27 upfront kernel: [ 2863.937071] uvcvideo: Adding mapping 'Focus, Auto' to control 00000000-0000-0000-0000-000000000001/8.
Jan 12 23:06:27 upfront kernel: [ 2863.937092] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/2 to device 1.2.7 entity 4
Jan 12 23:06:27 upfront kernel: [ 2863.937107] uvcvideo: Adding mapping 'Brightness' to control 00000000-0000-0000-0000-000000000101/2.
Jan 12 23:06:27 upfront kernel: [ 2863.937130] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/3 to device 1.2.7 entity 4
Jan 12 23:06:27 upfront kernel: [ 2863.937169] uvcvideo: Adding mapping 'Contrast' to control 00000000-0000-0000-0000-000000000101/3.
Jan 12 23:06:27 upfront kernel: [ 2863.937194] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/7 to device 1.2.7 entity 4
Jan 12 23:06:27 upfront kernel: [ 2863.937210] uvcvideo: Adding mapping 'Saturation' to control 00000000-0000-0000-0000-000000000101/7.
Jan 12 23:06:27 upfront kernel: [ 2863.937231] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/8 to device 1.2.7 entity 4
Jan 12 23:06:27 upfront kernel: [ 2863.937245] uvcvideo: Adding mapping 'Sharpness' to control 00000000-0000-0000-0000-000000000101/8.
Jan 12 23:06:27 upfront kernel: [ 2863.937291] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/10 to device 1.2.7 entity 4
Jan 12 23:06:27 upfront kernel: [ 2863.937314] uvcvideo: Adding mapping 'White Balance Temperature' to control 00000000-0000-0000-0000-000000000101/10.
Jan 12 23:06:27 upfront kernel: [ 2863.937335] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/1 to device 1.2.7 entity 4
Jan 12 23:06:27 upfront kernel: [ 2863.937352] uvcvideo: Adding mapping 'Backlight Compensation' to control 00000000-0000-0000-0000-000000000101/1.
Jan 12 23:06:27 upfront kernel: [ 2863.937374] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/5 to device 1.2.7 entity 4
Jan 12 23:06:27 upfront kernel: [ 2863.937415] uvcvideo: Adding mapping 'Power Line Frequency' to control 00000000-0000-0000-0000-000000000101/5.
Jan 12 23:06:27 upfront kernel: [ 2863.937441] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/11 to device 1.2.7 entity 4
Jan 12 23:06:27 upfront kernel: [ 2863.937460] uvcvideo: Adding mapping 'White Balance Temperature, Auto' to control 00000000-0000-0000-0000-000000000101/11.
Jan 12 23:06:27 upfront kernel: [ 2863.937477] uvcvideo: Scanning UVC chain: OT 2 <- XU 5 <- PU 4 <- SU 3 <- IT 1
Jan 12 23:06:27 upfront kernel: [ 2863.937544] uvcvideo: Found a valid video chain (1 -> 2).
Jan 12 23:06:27 upfront kernel: [ 2863.947887] input: Microsoft® LifeCam CinemaTM) as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2.7/1-1.2.7:1.0/input/input1
Jan 12 23:06:27 upfront kernel: [ 2863.948296] uvcvideo: UVC device initialized.
Jan 12 23:06:27 upfront kernel: [ 2864.037822] uvcvideo: uvc_v4l2_open
Jan 12 23:06:27 upfront kernel: [ 2864.037959] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP)
Jan 12 23:06:27 upfront kernel: [ 2864.038465] uvcvideo: uvc_v4l2_release
Jan 12 23:06:28 upfront kernel: [ 2865.074016] 11:3:1: cannot get freq at ep 0x82
Jan 12 23:09:32 upfront kernel: [ 3048.672314] usb 1-1.2.6: restart device (4)
Jan 12 23:09:34 upfront kernel: [ 3050.721447] usb 1-1.2.6: device restarted successfully.
Jan 12 23:09:34 upfront kernel: [ 3050.723367] ieee80211 phy1: Hardware restart was requested
Sorry it took a while to get this information, let me know if there's any other info I can get for you.

rp1301
Posts: 5
Joined: Fri Jan 11, 2013 11:36 am

Re: USB performance: Isochronous (audio or video)

Mon Jan 14, 2013 1:52 pm

USB audio capture again.

Have reliable capture without needing dwc_otg.speed=1 when the USB card does stereo
capture. Only mono devices need dwc_otg.speed=1 for reliable capture.

Tested all permutations of 3 x mono cards, 2 x stereo cards, on 2 x RPi,
with & without Ethernet active. Completely repeatable. These all C-Media based cards of
different makes.

OS is Raspbian 3.6.11+ #352 PREEMPT.

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB performance: Isochronous (audio or video)

Mon Jan 14, 2013 6:00 pm

Well this is interesting.

I have a (terrible) USB webcam that sends the Pi into a complete hissy fit. It supports the bare minimum of UVC controls and is 640x480 max, but only transmits uncompressed video.

This is great because it's exactly what we need - a steady bitrate out of an isochronous device.

I have found that this webcam *only ever works* with the resolution 320x240 @30fps. The reason behind this is the size and/or configuration of transfers that the UVCvideo driver picks. Most Isoc devices have multiple "alternate" configurations - they will send different packet sizes and numbers of packets depending on which alternate configuration is selected. This is to allow flexibility in allocating bandwidth. My webcam apparently has about 12 - which uvcvideo will select 1 of based on the amount of bandwidth required to stream the video.

Nothing else works except a packet size of 1x768 bytes (uvcvideo will tell you which it uses if you enable the right tracing parameter). I get "EOF in empty frame" and "Isochronous frame lost (-63)" ad infinitum otherwise.

The wierd thing is, every time I use 320x240 (1x768B) the transaction always completes flawlessly. Everything else either returns empty packets or -63 errors (which are a result of frame overrun errors reported by the driver). I might hack the driver to force use of other transfer modes - which will let me probe what works/what doesn't.

My hunch is that the scheduling is horrendously broken for isoc transfers. I can see the driver doesn't respect the periodic intervals very well because it uses some sort of rounding fudge to determine when to request packets.
rp1301 wrote:USB audio capture again.

Have reliable capture without needing dwc_otg.speed=1 when the USB card does stereo
capture. Only mono devices need dwc_otg.speed=1 for reliable capture.

Tested all permutations of 3 x mono cards, 2 x stereo cards, on 2 x RPi,
with & without Ethernet active. Completely repeatable. These all C-Media based cards of
different makes.

OS is Raspbian 3.6.11+ #352 PREEMPT.
Can you post lsusb -v and lsmod with the device(s) plugged in? I suspect that mono/stereo will select different bandwidths.

rp1301
Posts: 5
Joined: Fri Jan 11, 2013 11:36 am

Re: USB performance: Isochronous (audio or video)

Tue Jan 15, 2013 1:51 am

Here is the lsmod.

Code: Select all

Module                  Size  Used by
snd_bcm2835            13018  0
snd_usb_audio         104097  0
snd_usbmidi_lib        18067  1 snd_usb_audio
snd_hwdep               5929  1 snd_usb_audio
snd_seq_midi            4591  0
snd_seq_midi_event      6544  1 snd_seq_midi
snd_rawmidi            21160  2 snd_usbmidi_lib,snd_seq_midi
snd_pcm                77560  2 snd_bcm2835,snd_usb_audio
snd_page_alloc          5145  1 snd_pcm
snd_seq                53329  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device          6438  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              19998  2 snd_pcm,snd_seq
snd                    58447  9 snd_bcm2835,snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_seq,snd_rawmidi,snd_usbmidi_lib,snd_seq_device
evdev                   9426  2
leds_gpio               2235  0
led_class               3562  1 leds_gpio
lsusb -v for the stereo device

Code: Select all

Bus 001 Device 004: ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0d8c C-Media Electronics, Inc.
  idProduct          0x0102 CM106 Like Sound Device
  bcdDevice            0.10
  iManufacturer           0
  iProduct                2 USB Sound Device
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          534
    bNumInterfaces          4
    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              0
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength          200
        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             8
        wChannelConfig     0x063f
          Left Front (L)
          Right Front (R)
          Center Front (C)
          Low Freqency Enhancement (LFE)
          Left Surround (LS)
          Right Surround (RS)
          Side Left (SL)
          Side Right (SR)
        iChannelNames           0
        iTerminal               0
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             4
        wTerminalType      0x0201 Microphone
        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                 8
        bSourceID               4
        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                 9
        bSourceID               4
        bControlSize            1
        bmaControls( 0)      0x01
          Mute Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                25
        bDescriptorType        36
        bDescriptorSubtype      4 (MIXER_UNIT)
        bUnitID                12
        bNrInPins               3
        baSourceID( 0)          1
        baSourceID( 1)          9
        baSourceID( 2)         11
        bNrChannels             8
        wChannelConfig     0x063f
          Left Front (L)
          Right Front (R)
          Center Front (C)
          Low Freqency Enhancement (LFE)
          Left Surround (LS)
          Right Surround (RS)
          Side Left (SL)
          Side Right (SR)
        iChannelNames           0
        bmControls         0x00
        bmControls         0x00
        bmControls         0x00
        iMixer                  0
        junk at descriptor end: 00 00 00 00 00 00 00 00 00
      AudioControl Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                13
        bSourceID              12
        bControlSize            1
        bmaControls( 0)      0x01
          Mute Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        bmaControls( 3)      0x02
          Volume Control
        bmaControls( 4)      0x02
          Volume Control
        bmaControls( 5)      0x02
          Volume Control
        bmaControls( 6)      0x02
          Volume Control
        bmaControls( 7)      0x02
          Volume Control
        bmaControls( 8)      0x02
          Volume Control
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID              13
        iTerminal               0
      AudioControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      4 (MIXER_UNIT)
        bUnitID                17
        bNrInPins               2
        baSourceID( 0)          9
        baSourceID( 1)         11
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0
        bmControls         0x00
        iMixer                  0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            10
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               7
        iTerminal               0
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      5 (SELECTOR_UNIT)
        bUnitID                 7
        bNrInPins               4
        baSource( 0)            8
        baSource( 1)           15
        baSource( 2)           16
        baSource( 3)            2
        iSelector               0
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             6
        wTerminalType      0x0603 Line Connector
        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                15
        bSourceID               6
        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               6
        bControlSize            1
        bmaControls( 0)      0x01
          Mute Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             5
        wTerminalType      0x0605 SPDIF interface
        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              17
        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                16
        bSourceID               5
        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              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                14
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             8
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            2 Discrete
        tSamFreq[ 0]        44100
        tSamFreq[ 1]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0310  1x 784 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      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              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                14
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            2 Discrete
        tSamFreq[ 0]        44100
        tSamFreq[ 1]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x00c4  1x 196 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      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              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                14
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             4
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            2 Discrete
        tSamFreq[ 0]        44100
        tSamFreq[ 1]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0188  1x 392 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      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              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                14
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             6
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            2 Discrete
        tSamFreq[ 0]        44100
        tSamFreq[ 1]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0248  1x 584 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      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              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0188  1x 392 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    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          10
        bDelay                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                14
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            2 Discrete
        tSamFreq[ 0]        44100
        tSamFreq[ 1]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x00c8  1x 200 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      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     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0003  1x 3 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)
And lsusb -v for the mono device

Code: Select all

Bus 001 Device 005: ID 041e:30d3 Creative Technology, Ltd Sound Blaster Play!
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x041e Creative Technology, Ltd
  idProduct          0x30d3 Sound Blaster Play!
  bcdDevice            1.00
  iManufacturer           0
  iProduct                0
  iSerial                 2 121203000422
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          253
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    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          100
        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             1
        wChannelConfig     0x0001
          Left Front (L)
        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                 7
        bDescriptorType        36
        bDescriptorSubtype      5 (SELECTOR_UNIT)
        bUnitID                 8
        bNrInPins               1
        baSource( 0)           10
        iSelector               0
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 9
        bSourceID              15
        bControlSize            1
        bmaControls( 0)      0x01
          Mute Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                10
        bSourceID               2
        bControlSize            1
        bmaControls( 0)      0x43
          Mute Control
          Volume Control
          Automatic Gain Control
        bmaControls( 1)      0x00
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                13
        bSourceID               2
        bControlSize            1
        bmaControls( 0)      0x03
          Mute Control
          Volume Control
        bmaControls( 1)      0x00
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      4 (MIXER_UNIT)
        bUnitID                15
        bNrInPins               2
        baSourceID( 0)          1
        baSourceID( 1)         13
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0
        bmControls         0x00
        iMixer                  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              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                14
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            2 Discrete
        tSamFreq[ 0]        48000
        tSamFreq[ 1]        44100
      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
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         1 Milliseconds
          wLockDelay              1 Milliseconds
    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              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                14
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             1
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            2 Discrete
        tSamFreq[ 0]        48000
        tSamFreq[ 1]        44100
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0064  1x 100 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      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     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              32
Device Status:     0x0000
  (Bus Powered)
Running without dwc_otg.speed=1
Both devices were capturing at the time. The mono device was dropping data although for
some reason less badly than normal. Only difference is two cards plugged in together.

I removed the stereo card and had the mono card running by itself. Now back to bad
data loss (about 47300 samples/sec instead of 48k/sec).

Two stereo cards plugged in together work fine.
Two mono cards plugged in together lose data badly (47.1k/sec and 47.2k/sec).

Tomorrow I will try a video capture device.

rp1301
Posts: 5
Joined: Fri Jan 11, 2013 11:36 am

Re: USB performance: Isochronous (audio or video)

Tue Jan 15, 2013 9:36 am

Tested with USB video capture device

dmesg:

Code: Select all

[27353.470043] usb 1-1.2: new high-speed USB device number 9 using dwc_otg
[27353.600678] usb 1-1.2: New USB device found, idVendor=0ac8, idProduct=3610
[27353.600709] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber                                        =0
[27353.600726] usb 1-1.2: Product: Vimicro USB2.0 UVC PC Camera
[27353.600739] usb 1-1.2: Manufacturer: Vimicro Co.,ltd
[27353.612976] uvcvideo: Found UVC 1.00 device Vimicro USB2.0 UVC PC Camera (0ac8:3610)
[27353.615758] input: Vimicro USB2.0 UVC PC Camera as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input5
All modes fail to work properly. 640x480 doesn't work at all, the others
drop large proportion of frames.

Enabled uvcvideo parameter trace and got lots of

Code: Select all

[28103.253202] uvcvideo: USB isochronous frame lost (-63).
[28103.278838] uvcvideo: Frame complete (EOF found).
[28103.278869] uvcvideo: EOF in empty payload.
[28103.282930] uvcvideo: USB isochronous frame lost (-63).
[28103.440877] uvcvideo: Frame complete (EOF found).
...

Here is lsusb -v for the video device

Code: Select all

Bus 001 Device 009: ID 0ac8:3610 Z-Star Microelectronics Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x0ac8 Z-Star Microelectronics Corp.
  idProduct          0x3610
  bcdDevice            1.00
  iManufacturer           1 Vimicro Co.,ltd
  iProduct                2 Vimicro USB2.0 UVC PC Camera
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          501
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              320mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass         14 Video
      bFunctionSubClass       3 Video Interface Collection
      bFunctionProtocol       0
      iFunction               2 Vimicro USB2.0 UVC PC Camera
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      1 Video Control
      bInterfaceProtocol      0
      iInterface              2 Vimicro USB2.0 UVC PC Camera
      VideoControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdUVC               1.00
        wTotalLength           79
        dwClockFrequency       30.000000MHz
        bInCollection           1
        baInterfaceNr( 0)       1
      VideoControl Interface Descriptor:
        bLength                18
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Camera Sensor
        bAssocTerminal          0
        iTerminal               0
        wObjectiveFocalLengthMin      0
        wObjectiveFocalLengthMax      0
        wOcularFocalLength            0
        bControlSize                  3
        bmControls           0x00040a0e
          Auto-Exposure Mode
          Auto-Exposure Priority
          Exposure Time (Absolute)
          Zoom (Absolute)
          PanTilt (Absolute)
          Privacy
      VideoControl Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      5 (PROCESSING_UNIT)
      Warning: Descriptor too short
        bUnitID                 2
        bSourceID               1
        wMaxMultiplier          0
        bControlSize            2
        bmControls     0x0000547f
          Brightness
          Contrast
          Hue
          Saturation
          Sharpness
          Gamma
          White Balance Temperature
          Power Line Frequency
          White Balance Temperature, Auto
          Digital Multiplier
        iProcessing             0
        bmVideoStandards     0x 9
          None
          SECAM - 625/50
      VideoControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               2
        iTerminal               0
      VideoControl Interface Descriptor:
        bLength                28
        bDescriptorType        36
        bDescriptorSubtype      6 (EXTENSION_UNIT)
        bUnitID                 4
        guidExtensionCode         {5dc717a9-1941-da11-ae0e-000d56ac7b4c}
        bNumControl             9
        bNrPins                 1
        baSourceID( 0)          1
        bControlSize            3
        bmControls( 0)       0xf9
        bmControls( 1)       0x81
        bmControls( 2)       0x80
        iExtension              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               5
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      VideoStreaming Interface Descriptor:
        bLength                            14
        bDescriptorType                    36
        bDescriptorSubtype                  1 (INPUT_HEADER)
        bNumFormats                         1
        wTotalLength                      263
        bEndPointAddress                  130
        bmInfo                              0
        bTerminalLink                       3
        bStillCaptureMethod                 2
        bTriggerSupport                     1
        bTriggerUsage                       1
        bControlSize                        1
        bmaControls( 0)                    27
      VideoStreaming Interface Descriptor:
        bLength                            27
        bDescriptorType                    36
        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
        bFormatIndex                        1
        bNumFrameDescriptors                5
        guidFormat                            {59555932-0000-1000-8000-00aa00389b71}
        bBitsPerPixel                      16
        bDefaultFrameIndex                  1
        bAspectRatioX                       0
        bAspectRatioY                       0
        bmInterlaceFlags                 0x00
          Interlaced stream or variable: No
          Fields per frame: 2 fields
          Field 1 first: No
          Field pattern: Field 1 only
          bCopyProtect                      0
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         1
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            640
        wHeight                           480
        dwMinBitRate                 36864000
        dwMaxBitRate                147456000
        dwMaxVideoFrameBufferSize      614400
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  3
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            666667
        dwFrameInterval( 2)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         2
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            352
        wHeight                           288
        dwMinBitRate                 12126720
        dwMaxBitRate                 48660480
        dwMaxVideoFrameBufferSize      202752
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  3
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            666667
        dwFrameInterval( 2)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         3
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            320
        wHeight                           240
        dwMinBitRate                  9216000
        dwMaxBitRate                 36864000
        dwMaxVideoFrameBufferSize      153600
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  3
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            666667
        dwFrameInterval( 2)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         4
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            176
        wHeight                           144
        dwMinBitRate                  3041280
        dwMaxBitRate                 12165120
        dwMaxVideoFrameBufferSize       50688
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  3
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            666667
        dwFrameInterval( 2)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         5
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            160
        wHeight                           120
        dwMinBitRate                  2304000
        dwMaxBitRate                  9216000
        dwMaxVideoFrameBufferSize       38400
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  3
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)            666667
        dwFrameInterval( 2)           1333333
      VideoStreaming Interface Descriptor:
        bLength                            26
        bDescriptorType                    36
        bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)
        bEndpointAddress                    0
        bNumImageSizePatterns               5
        wWidth( 0)                        640
        wHeight( 0)                       480
        wWidth( 1)                        352
        wHeight( 1)                       288
        wWidth( 2)                        320
        wHeight( 2)                       240
        wWidth( 3)                        176
        wHeight( 3)                       144
        wWidth( 4)                        160
        wHeight( 4)                       120
        bNumCompressionPatterns             5
      VideoStreaming Interface Descriptor:
        bLength                             6
        bDescriptorType                    36
        bDescriptorSubtype                 13 (COLORFORMAT)
        bColorPrimaries                     0 (Unspecified)
        bTransferCharacteristics            0 (Unspecified)
        bMatrixCoefficients                 0 (Unspecified)
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0080  1x 128 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0b00  2x 768 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0c00  2x 1024 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       6
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x1380  3x 896 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       7
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x1400  3x 1024 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

uvcdynctrl -f gives

Code: Select all

Listing available frame formats for device video0:
Pixel format: YUYV (YUV 4:2:2 (YUYV); MIME type: video/x-raw-yuv)
  Frame size: 640x480
    Frame intervals: 1/30, 1/15, 2/15
  Frame size: 352x288
    Frame intervals: 1/30, 1/15, 2/15
  Frame size: 320x240
    Frame intervals: 1/30, 1/15, 2/15
  Frame size: 176x144
    Frame intervals: 1/30, 1/15, 2/15
  Frame size: 160x120
    Frame intervals: 1/30, 1/15, 2/15

Tested all the modes using mencoder:

640x480: 0 frames successfully processed, 1 frames dropped.
352x288: 36 frames successfully processed, 694 frames dropped.
320x240: 48 frames successfully processed, 307 frames dropped.
176x144: 55 frames successfully processed, 1965 frames dropped.
160x120: 34 frames successfully processed, 274 frames dropped.

sbp
Posts: 128
Joined: Wed Sep 26, 2012 7:54 pm

Re: USB performance: Isochronous (audio or video)

Thu Mar 07, 2013 8:38 am

Hi

Is this problem also corrected/improved by the latest USB patch from M33P?
piCorePlayer webpage: https://sites.google.com/site/picoreplayer/home

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB performance: Isochronous (audio or video)

Fri Mar 22, 2013 4:08 pm

Bump

I have a potential fix for the majority of lost isoc IN frames that result in garbled webcam images or dropped frames - most obvious with uvc-based webcams. There are however some wierd things happening with certain makes of cam.
I need more infos - specifically uvc webcams that fail with the following message:
uvcvideo: Non-zero status -5 in video completion handler.

I need the dmesg output from after using the cam with echo 0x600 > /sys/module/uvcvideo/parameters/trace entered.

I would also like some reports on webcams that use the pwc driver - seems to be another popular chipset.

BerryPicker
Posts: 177
Joined: Tue Oct 16, 2012 3:03 pm
Location: The East of England

Re: USB performance: Isochronous (audio or video)

Fri Mar 22, 2013 9:26 pm

M33P wrote: I would also like some reports on webcams that use the pwc driver.
I have a Philips SPC900NC webcam. With guvcview it "works" in 320x240 or less showing a low frame rate but good pictures.
Typing guvcview -v from a console, it reports VID/PID: 0471 0329, driver:pwc.
The same information is recorded in /home/pi/.xsession-errors, along with countless
Could not grab image (select timeout): Resource temporarily unavailable

If I try (as root) echo 0x600 > /sys/module/uvcvideo/parameters/trace I receive back
-bash: /sys/module/uvcvideo/parameters/trace: No such file or directory
I'm guessing this is because V4L2 doesn't recognise this as a uvcvideo device.

dmesg shows this extract:
[ 1975.515566] Linux media interface: v0.10
[ 1975.546464] Linux video capture interface: v2.00
[ 1975.599214] pwc: Philips SPC 900NC USB webcam detected.
[ 1976.120802] pwc: Registered as video0.
and no errors

uvcdynctrl -l gives this extract:
Listing available devices:
video0 Philips SPC 900NC webcam
Media controller device /dev/media0 doesn't exist
ERROR: Unable to list device entities: Invalid device or device cannot be opened. (Code: 5)

lingon
Posts: 115
Joined: Fri Aug 26, 2011 7:31 am

Re: USB performance: Isochronous (audio or video)

Sun Mar 24, 2013 2:03 pm

M33P wrote:Bump

I have a potential fix for the majority of lost isoc IN frames that result in garbled webcam images or dropped frames - most obvious with uvc-based webcams. There are however some wierd things happening with certain makes of cam.
I need more infos - specifically uvc webcams that fail with the following message:
uvcvideo: Non-zero status -5 in video completion handler.

I need the dmesg output from after using the cam with echo 0x600 > /sys/module/uvcvideo/parameters/trace entered.
This is what I get from one of my uvcvideo webcams:

Code: Select all

[  309.286253] usb 1-1.2: new high-speed USB device number 5 using dwc_otg
[  309.551622] usb 1-1.2: New USB device found, idVendor=046d, idProduct=09a6
[  309.551676] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=2
[  309.551695] usb 1-1.2: SerialNumber: 7D08C520
[  309.685431] Linux media interface: v0.10
[  309.711748] Linux video capture interface: v2.00
[  309.746461] uvcvideo: Found UVC 1.00 device <unnamed> (046d:09a6)
[  309.780071] input: UVC Camera (046d:09a6) as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
[  309.780983] usbcore: registered new interface driver uvcvideo
[  309.781005] USB Video Class driver (1.1.1)
[  310.215060] usbcore: registered new interface driver snd-usb-audio
[10511.206767] uvcvideo: Device requested 1280 B/frame bandwidth.
[10511.206800] uvcvideo: Selecting alternate setting 7 (1280 B/frame bandwidth).
[10511.211593] uvcvideo: Allocated 5 URB buffers of 32x1280 bytes each.
[10511.857382] uvcvideo: Control 2/4 value change len 7.
[10511.873375] uvcvideo: Control 2/10 value change len 7.
[10511.905381] uvcvideo: Control 2/4 value change len 7.
[10511.969397] uvcvideo: Control 2/4 value change len 7.
[10512.049401] uvcvideo: Control 2/4 value change len 7.
[10512.113409] uvcvideo: Control 2/4 value change len 7.
[10512.177420] uvcvideo: Control 2/4 value change len 7.
[10512.193419] uvcvideo: Control 2/10 value change len 7.
[10512.241428] uvcvideo: Control 2/4 value change len 7.
[10512.305443] uvcvideo: Control 2/10 value change len 7.
[10512.369447] uvcvideo: Control 2/4 value change len 7.
[10512.385446] uvcvideo: Control 2/10 value change len 7.
[10512.449462] uvcvideo: Control 2/10 value change len 7.
[10512.513471] uvcvideo: Control 2/10 value change len 7.
[10526.243341] uvcvideo: Control 2/10 value change len 7.
[10526.307348] uvcvideo: Control 2/4 value change len 7.
[10526.323339] uvcvideo: Control 2/10 value change len 7.
[10526.371356] uvcvideo: Control 2/4 value change len 7.
[10526.387369] uvcvideo: Control 2/10 value change len 7.
[10526.435357] uvcvideo: Control 2/10 value change len 7.
[10539.109080] uvcvideo: Control 2/4 value change len 7.
[10539.173092] uvcvideo: Control 2/4 value change len 7.
[10544.101758] uvcvideo: Control 2/10 value change len 7.
[10544.181768] uvcvideo: Control 2/10 value change len 7.
[10544.245777] uvcvideo: Control 2/10 value change len 7.
[10544.309786] uvcvideo: Control 2/10 value change len 7.
[10544.437803] uvcvideo: Control 2/10 value change len 7.
[10544.501820] uvcvideo: Control 2/10 value change len 7.
[10544.629834] uvcvideo: Control 2/10 value change len 7.
[10544.645839] uvcvideo: Control 2/10 value change len 7.
[10544.709849] uvcvideo: Control 2/4 value change len 7.
[10544.773848] uvcvideo: Control 2/4 value change len 7.
[10544.789881] uvcvideo: Control 2/10 value change len 7.
[10544.901868] uvcvideo: Control 2/10 value change len 7.
[10545.029883] uvcvideo: Control 2/10 value change len 7.
[10577.242261] uvcvideo: Control 2/10 value change len 7.
[10577.306385] uvcvideo: Control 2/10 value change len 7.
[10577.386280] uvcvideo: Control 2/10 value change len 7.
[10577.450287] uvcvideo: Control 2/10 value change len 7.
[10577.578307] uvcvideo: Control 2/10 value change len 7.
[10577.642315] uvcvideo: Control 2/10 value change len 7.
[10577.706328] uvcvideo: Control 2/10 value change len 7.
[10577.786336] uvcvideo: Control 2/10 value change len 7.
[10578.250403] uvcvideo: Control 2/10 value change len 7.
[10578.314413] uvcvideo: Control 2/10 value change len 7.
[10578.378421] uvcvideo: Control 2/10 value change len 7.
[10578.442423] uvcvideo: Control 2/10 value change len 7.
[10578.506430] uvcvideo: Control 2/4 value change len 7.
[10578.602453] uvcvideo: Control 2/4 value change len 7.
[10578.618446] uvcvideo: Control 2/10 value change len 7.
[10578.650456] uvcvideo: Control 2/4 value change len 7.
[10578.666459] uvcvideo: Control 2/10 value change len 7.
[10578.714464] uvcvideo: Control 2/4 value change len 7.
[10578.730467] uvcvideo: Control 2/10 value change len 7.
[10578.778469] uvcvideo: Control 2/10 value change len 7.
[10578.842486] uvcvideo: Control 2/10 value change len 7.
[10578.906486] uvcvideo: Control 2/10 value change len 7.
[10579.050506] uvcvideo: Control 2/10 value change len 7.
[10579.114521] uvcvideo: Control 2/10 value change len 7.
[10579.178524] uvcvideo: Control 2/10 value change len 7.
[10579.242540] uvcvideo: Control 2/10 value change len 7.
[10587.115608] uvcvideo: Control 2/4 value change len 7.
[10594.508613] uvcvideo: Control 2/4 value change len 7.
[10594.588617] uvcvideo: Control 2/4 value change len 7.
[10598.845200] uvcvideo: Control 2/4 value change len 7.
[10598.909210] uvcvideo: Control 2/4 value change len 7.
[10602.173654] uvcvideo: Control 2/4 value change len 7.
[10602.253664] uvcvideo: Control 2/4 value change len 7.
[10602.317703] uvcvideo: Control 2/4 value change len 7.
[10602.333688] uvcvideo: Control 2/10 value change len 7.
[10602.381684] uvcvideo: Control 2/10 value change len 7.
[10602.445692] uvcvideo: Control 2/10 value change len 7.
[10602.573724] uvcvideo: Control 2/10 value change len 7.
[10609.934702] uvcvideo: Control 2/4 value change len 7.
[10609.998709] uvcvideo: Control 2/4 value change len 7.
[10610.046717] uvcvideo: Control 2/10 value change len 7.
[10610.126734] uvcvideo: Control 2/10 value change len 7.
[10610.174740] uvcvideo: Control 2/10 value change len 7.
[10610.254752] uvcvideo: Control 2/10 value change len 7.
[10618.783902] uvcvideo: Control 2/4 value change len 7.
[10619.247974] uvcvideo: Control 2/10 value change len 7.
[10619.311976] uvcvideo: Control 2/10 value change len 7.
[10619.375990] uvcvideo: Control 2/10 value change len 7.
[10619.456001] uvcvideo: Control 2/10 value change len 7.
[10646.179634] uvcvideo: Control 2/4 value change len 7.
[10648.451934] uvcvideo: Control 2/4 value change len 7.
[10648.515947] uvcvideo: Control 2/4 value change len 7.
[10656.789073] uvcvideo: Control 2/10 value change len 7.
[10656.853083] uvcvideo: Control 2/10 value change len 7.
[10656.917092] uvcvideo: Control 2/10 value change len 7.
[10656.981101] uvcvideo: Control 2/10 value change len 7.
[10657.125114] uvcvideo: Control 2/10 value change len 7.
[10657.189126] uvcvideo: Control 2/10 value change len 7.
[10657.253131] uvcvideo: Control 2/10 value change len 7.
[10657.317146] uvcvideo: Control 2/10 value change len 7.
[10658.453295] uvcvideo: Control 2/10 value change len 7.
[10658.549314] uvcvideo: Control 2/10 value change len 7.
[10658.581317] uvcvideo: Control 2/10 value change len 7.
[10658.661323] uvcvideo: Control 2/10 value change len 7.
[10658.789344] uvcvideo: Control 2/10 value change len 7.
[10658.917364] uvcvideo: Control 2/10 value change len 7.
[10658.981364] uvcvideo: Control 2/10 value change len 7.
[10659.509447] uvcvideo: Control 2/10 value change len 7.
[10659.525436] uvcvideo: Control 2/10 value change len 7.
[10659.605450] uvcvideo: Control 2/10 value change len 7.
[10659.717467] uvcvideo: Control 2/10 value change len 7.
[10665.990322] uvcvideo: Control 2/4 value change len 7.
[10666.054324] uvcvideo: Control 2/4 value change len 7.
[10666.118340] uvcvideo: Control 2/4 value change len 7.
[10666.246353] uvcvideo: Control 2/10 value change len 7.
[10666.262358] uvcvideo: Control 2/10 value change len 7.
[10666.374371] uvcvideo: Control 2/10 value change len 7.
[10666.390370] uvcvideo: Control 2/10 value change len 7.
[10681.048368] uvcvideo: Control 2/4 value change len 7.
[10681.128381] uvcvideo: Control 2/4 value change len 7.
[10681.144373] uvcvideo: Control 2/10 value change len 7.
[10681.192384] uvcvideo: Control 2/10 value change len 7.
[10681.256393] uvcvideo: Control 2/10 value change len 7.
[10681.320406] uvcvideo: Control 2/10 value change len 7.
[10681.480429] uvcvideo: Control 2/10 value change len 7.
[10681.528435] uvcvideo: Control 2/10 value change len 7.
[10681.592436] uvcvideo: Control 2/10 value change len 7.
[10681.656451] uvcvideo: Control 2/10 value change len 7.
[10681.784462] uvcvideo: Control 2/10 value change len 7.
[10681.848477] uvcvideo: Control 2/10 value change len 7.
[10681.976497] uvcvideo: Control 2/10 value change len 7.
[10681.992490] uvcvideo: Control 2/10 value change len 7.
[10682.120515] uvcvideo: Control 2/10 value change len 7.
[10682.184517] uvcvideo: Control 2/10 value change len 7.
[10682.248533] uvcvideo: Control 2/10 value change len 7.
[10682.328544] uvcvideo: Control 2/10 value change len 7.
[10697.738637] uvcvideo: Control 2/4 value change len 7.
[10697.786637] uvcvideo: Control 2/4 value change len 7.
[10704.331526] uvcvideo: Control 2/4 value change len 7.
[10704.395536] uvcvideo: Control 2/4 value change len 7.
[10705.451678] uvcvideo: Control 2/10 value change len 7.
[10705.579716] uvcvideo: Control 2/10 value change len 7.
[10705.595698] uvcvideo: Control 2/10 value change len 7.
[10705.659712] uvcvideo: Control 2/10 value change len 7.
[10705.787731] uvcvideo: Control 2/10 value change len 7.
[10705.867735] uvcvideo: Control 2/10 value change len 7.
[10705.947749] uvcvideo: Control 2/10 value change len 7.
[10705.995761] uvcvideo: Control 2/10 value change len 7.
[10706.139778] uvcvideo: Control 2/10 value change len 7.
[10706.187780] uvcvideo: Control 2/10 value change len 7.
[10706.251786] uvcvideo: Control 2/10 value change len 7.
[10706.347806] uvcvideo: Control 2/10 value change len 7.
[10706.395814] uvcvideo: Control 2/10 value change len 7.
[10706.539834] uvcvideo: Control 2/10 value change len 7.
[10706.587834] uvcvideo: Control 2/10 value change len 7.
[10706.651841] uvcvideo: Control 2/10 value change len 7.
[10706.779859] uvcvideo: Control 2/10 value change len 7.
[10706.795861] uvcvideo: Control 2/10 value change len 7.
[10706.955891] uvcvideo: Control 2/10 value change len 7.
[10706.987906] uvcvideo: Control 2/10 value change len 7.
[10707.051896] uvcvideo: Control 2/10 value change len 7.
[10707.131912] uvcvideo: Control 2/10 value change len 7.
[10707.195923] uvcvideo: Control 2/10 value change len 7.
[10707.355943] uvcvideo: Control 2/10 value change len 7.
[10707.387946] uvcvideo: Control 2/10 value change len 7.
[10707.483955] uvcvideo: Control 2/10 value change len 7.
[10707.531961] uvcvideo: Control 2/10 value change len 7.
[10707.595971] uvcvideo: Control 2/10 value change len 7.
[10707.723988] uvcvideo: Control 2/10 value change len 7.
[10707.788001] uvcvideo: Control 2/10 value change len 7.
[10707.852003] uvcvideo: Control 2/10 value change len 7.
[10707.932016] uvcvideo: Control 2/10 value change len 7.
[10752.722100] uvcvideo: Control 2/4 value change len 7.
[10752.802112] uvcvideo: Control 2/4 value change len 7.
[10767.268076] uvcvideo: Control 2/4 value change len 7.
[10767.332092] uvcvideo: Control 2/4 value change len 7.
[10767.604128] uvcvideo: Control 2/10 value change len 7.
[10767.668130] uvcvideo: Control 2/10 value change len 7.
[10767.764146] uvcvideo: Control 2/10 value change len 7.
[10767.796148] uvcvideo: Control 2/10 value change len 7

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB performance: Isochronous (audio or video)

Sun Mar 24, 2013 4:08 pm

lingon wrote:
This is what I get from one of my uvcvideo webcams:
What is the make/model of cam?
What program are you using to grab images/video off it?
Does it work (no stuttering/garbled frames)?

lingon
Posts: 115
Joined: Fri Aug 26, 2011 7:31 am

Re: USB performance: Isochronous (audio or video)

Sun Mar 24, 2013 5:05 pm

M33P wrote:
lingon wrote:
This is what I get from one of my uvcvideo webcams:
What is the make/model of cam?
What program are you using to grab images/video off it?
Does it work (no stuttering/garbled frames)?
Logitech Quickcam Vision Pro
mjpeg_streamer
Almost all frames are lost and only a few actually can be seen per minute.

More details about my webcams can be found in the USB redux thread:
http://www.raspberrypi.org/phpBB3/viewt ... x&start=75

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB performance: Isochronous (audio or video)

Thu Mar 28, 2013 2:02 pm

Crossposting:

Latest rpi-update kernel (3.6.11+ #399) contains a fix that is reported by several users in the USB redux thread to work well with webcams (Isoc IN) - what I would like is more info for sound devices previously reported to be rife with "static" or other garbled signals - comparison of playback/record before/after.

vmsda
Posts: 32
Joined: Tue Mar 12, 2013 5:02 pm

Re: USB performance: Isochronous (audio or video)

Thu Mar 28, 2013 7:06 pm

M33P wrote:Crossposting:

Latest rpi-update kernel (3.6.11+ #399) contains a fix that is reported by several users in the USB redux thread to work well with webcams (Isoc IN) - what I would like is more info for sound devices ...
I updated the firmware as you suggested and tried a high-rez download but alas, it did not work. To be fair, I think that losses of sync are briefer and shorter, but they have not disappeared, by a long shot. As for 44.1khz/16bit music, it works ok, but then I had already managed to get the same results with the stable kernel, by increasing significantly the value of nrpacks for usb_snd_audio in /etc/modprobe.d.

For the record: my Benchmark DAC1 HDR interfaces across USB in asynchronous mode, as every self-respecting DAC seems to do nowadays.

So it does look like you folks are on the right track, but not quite there yet. Thank you for your efforts.

PS. M33P: for some reason I cannot answer your pm's, my replies all get stuck in Outbox and I could not get them out of there! Sorry.
Samsung 900X, Ubuntu 12.04 host, VirtualBox, Windows 7 guest.
Raspberry Pi running 2013-02-09-wheezy-raspbian.img; Edimax EW-7811Un 802.11b/g/n adapter; Plugable USB2.0 4-port Hub.

User avatar
Paul Webster
Posts: 793
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
Contact: Twitter

Re: USB performance: Isochronous (audio or video)

Fri Mar 29, 2013 8:49 am

(re PMs - I think they stay in Outbox until recipient reads them)

vmsda
Posts: 32
Joined: Tue Mar 12, 2013 5:02 pm

Re: USB performance: Isochronous (audio or video)

Fri Mar 29, 2013 9:42 am

Paul Webster wrote:(re PMs - I think they stay in Outbox until recipient reads them)
Thank you, Paul, that was indeed news to me.
Samsung 900X, Ubuntu 12.04 host, VirtualBox, Windows 7 guest.
Raspberry Pi running 2013-02-09-wheezy-raspbian.img; Edimax EW-7811Un 802.11b/g/n adapter; Plugable USB2.0 4-port Hub.

hoeken
Posts: 5
Joined: Tue Apr 09, 2013 4:33 am

Re: USB performance: Isochronous (audio or video)

Mon Apr 15, 2013 8:31 am

Thanks M33P! This fix works great for me! :D

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB performance: Isochronous (audio or video)

Thu May 02, 2013 12:06 pm

Hm.

While Isoc has improved for pretty much everyone using USB2.0 devices (USB1.1 will still suffer from lost packets due to split transaction breakage noted elsewhere) I'm still annoyed at my webcams "kinda working" - I get 1-2 seconds of uninterrupted video and then a half-garbled frame.

With the default uvcvideo option of nodrop=0 it can simply drop these corrupted frames for YUYV mode (and always drop them for MJPEG) which results in semi-reliable webcam video for most people.

The cause in particular now appears to be sections of kernel code that take a long time to either run inside a critical section or wait for other pieces of hardware. These sections typically run inside _irqsave and _irqrestore calls which cause the ARM to disable interrupts for a long period of time (ignoring any USB interrupts in the process). This is the cause of the remaining "isochronous frame lost (-63)" error messages that still appear sporadically - a HC completed an isoc IN but then the microframe overran and so it raised the Frame Overrun interrupt instead of Transfer Completed.

There is a more subtle effect to running with interrupts disabled for a long period - no more Isoc transactions are queued to the USB core. Due to the extremely limited queueing support for periodic transactions (there isn't any, it's next-frame only) if we miss a queue in microframe N it means we can never send a transaction in microframe N+1.

If we fail to queue packets, and thus don't ask for data then I suspect another form of data loss bites us - the webcam (or whatever) will have internal memory buffer space. This buffer is drained by requesting Isoc IN packets (which will be transmitted by the device with length up to wMaxPacketSize as specified in the endpoint/altsetting descriptor) and filled by the camera/DSP/radio/hamster on the device.

If we fail to drain the device fast enough then the webcam will most likely silently discard the old data. Gsh found this while troubleshooting another type of device that had a realtime datastream - the USB analyzer said that there was lots of bus time without any transactions happening, even though data was available in the device. By a naive calculation I estimate a typical webcam supporting uncompressed mode will have at minimum 4kB of buffer which is roughly 2 microframes worth of data. This would explain why my uncompressed-frame webcam performs a lot better at lower resolutions - less data rate coming out of the camera, leaving more time slack before the buffer overruns.

Next hacks to try:
- Use the data that was transferred on an In Isoc endpoint even though a Frame Overrun occured - it may well be valid
- Fudge UVCvideo's bandwidth calculations or introduce a "gratuitous_bw_overuse" parameter to force higher Isoc packet sizes

Return to “Troubleshooting”