Camera Problem

246 views
Skip to first unread message

jltth...@gmail.com

unread,
Apr 17, 2025, 5:59:01 AM4/17/25
to OpenPnP
Capture d’écran 2025-04-17 113803.pngCapture d’écran 2025-04-17 113040.pngCapture d’écran 2025-04-17 113218.pngCapture d’écran 2025-04-17 113440.pngHello,
I'm resuming my work, which I left off a few years ago. I switched to OpenPnP2 using the Cohesion 3D control board I bought back then.
I had a little trouble getting it back up and running, but I think it's okay now.

I've had a slight problem with the camera since the beginning... they're only detected occasionally. The top one is fine. They're the same two, bottom and top; here are some photos.

Sometimes I have to reset it because it's no longer detected, and it displays a blank image. Or nothing at all.

I went back in the configuration and I'm still having the same problem.
They are recognized by the PC.

vespaman

unread,
Apr 17, 2025, 6:52:57 AM4/17/25
to OpenPnP
Hi,

The first question is if both of the camera are on different root hub. What happens if you power off PC, unplug the down looking camera, and then try the up looking? (you may have to re-select the camera device in OpenPnP).

If it works, then maybe they where on the same root hub, which might not work. (Some people has it working with your resolution/fram rate others not).
If it still does not work, does it work in any other application?

  - Micael

jltth...@gmail.com

unread,
Apr 17, 2025, 10:24:27 AM4/17/25
to OpenPnP
20250417_161216.jpg
Yes, it is possible that there is a problem with the USB hub. The CD3 and the two cameras are together, see photo

jltth...@gmail.com

unread,
Apr 17, 2025, 10:48:24 AM4/17/25
to OpenPnP
I disconnected the downward-facing camera, rebooted... yes, the upward-facing camera works.
What can I do to prevent the cameras from being on the same hub?
I've connected the cameras directly to the PC using different USB ports, and I still have the problem.

Le jeudi 17 avril 2025 à 12:52:57 UTC+2, micael....@gmail.com a écrit :

Toby Dickenson

unread,
Apr 17, 2025, 12:42:44 PM4/17/25
to ope...@googlegroups.com
Maybe the PC has an internal hub, so some physical ports are on the
same bus. You really need only one camera per bus. Can you try
different combinations of ports? "lsusb -t" will show the network of
usb busses, hubs, and devices.

Toby
> --
> You received this message because you are subscribed to the Google Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/openpnp/342eabde-4855-47af-902f-596cebc05392n%40googlegroups.com.

vespaman

unread,
Apr 18, 2025, 2:43:05 AM4/18/25
to OpenPnP
By the looks of the logs, this is a windows machine, so lsusb is probably not available. Last time I used a windows machine (long time ago), I think the device manager could show the internal guts. But maybe I'm wrong about this.

  - Micael

jltth...@gmail.com

unread,
Apr 18, 2025, 5:49:39 AM4/18/25
to OpenPnP
Here are the pictures of what's connected. I have the impression that I have a single hub with multiple ports; it's a laptop.
I tried it with another laptop where the three USB inputs are separate, with two chipsets and an additional USB 3 port. But I'm having the same issues.
Yes, it's a Windows machine, but I don't remember having these issues with OpenPnP1.
Do you think I should install OpenPnP on the NUC? Linux or Windows?Capture d’écran 2025-04-18 114213.png

vespaman

unread,
Apr 18, 2025, 11:26:34 AM4/18/25
to OpenPnP
I'm sorry, it was too many years since I switched away completely from Windows, so i can't help much more. Hopefully someone else can give some help.

If you decide to try linux, you could run from a live image on a computer first, just to see if your computer has a good port setup with 'lsusb -t' as suggested.
 
 - Micael

jltth...@gmail.com

unread,
Apr 18, 2025, 12:18:44 PM4/18/25
to OpenPnP
Yes, the cameras work well on the PC with the Windows camera software.

Jan

unread,
Apr 18, 2025, 4:42:09 PM4/18/25
to ope...@googlegroups.com
Hi all!
I feel compelled to clear up a few usb myths with respect to cameras:
USB is host oriented. Each mainboard may have one or more host
controller which expose USB ports using root hubs with one or more
ports. USB2.0 and USB3.x are common standards today. Unfortunately they
exist in parallel and not on top of each other. That means, that a
USB3.x port offers a USB3 and a USB2 service and is limited by the
protocol the connected device supports. If a device like our cameras
uses USB2, then the entire link between host controller and camera is on
USB2 speed no matter if parts of the link support USB3. This means for
us that
a) there is no gain in useing a USB3 hub for USB2 devices. The link
between pc/hub/root hub and this hub uses the USB2 protocol and is
limited by it.
b) if you need more bandwidth then a single USB2 port can supply, you
need to move one or more devices to a different port on the main board
(which hopefully only exposes root hub ports).
This two items are the reason why the recommendation is to connect each
camera to a separate port directly on the mainboard.
(I did not yet mentioned power concerns. USB hubs often suffer from
providing enought power to each of their ports. Even if the requested
and available power are in sync, problems araise from the fact that the
power supply has a lower rating then assumed.)
To check the details of the USB tree on Windows, you can either use the
Microsoft tool USBview
(https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/usbview)
which is part of the SDK and is not working well for me (on Win11)
anymore or USBTreeView (https://www.uwe-sieber.de/usbtreeview_e.html)
which says that its an updated version of USBView and worked very well
on first try even with installation.

Jan

On 18.04.2025 18:18, jltth...@gmail.com wrote:
> Yes, the cameras work well on the PC with the Windows camera software.
>
> Le vendredi 18 avril 2025 à 17:26:34 UTC+2, micael....@gmail.com a écrit :
>
> I'm sorry, it was too many years since I switched away completely
> from Windows, so i can't help much more. Hopefully someone else can
> give some help.
>
> If you decide to try linux, you could run from a live image on a
> computer first, just to see if your computer has a good port setup
> with 'lsusb -t' as suggested.
>  - Micael
>
> fredag 18 april 2025 kl. 11:49:39 UTC+2 skrev jltth...@gmail.com:
>
> Here are the pictures of what's connected. I have the impression
> that I have a single hub with multiple ports; it's a laptop.
> I tried it with another laptop where the three USB inputs are
> separate, with two chipsets and an additional USB 3 port. But
> I'm having the same issues.
> Yes, it's a Windows machine, but I don't remember having these
> issues with OpenPnP1.
> Do you think I should install OpenPnP on the NUC? Linux or
> Windows?Capture d’écran 2025-04-18 114213.png
> openpnp/342eabde-4855-47af-902f-596cebc05392n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/342eabde-4855-47af-902f-596cebc05392n%40googlegroups.com>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/openpnp/
> c73536d1-5763-4499-a70b-a7adde8d3300n%40googlegroups.com <https://
> groups.google.com/d/msgid/openpnp/c73536d1-5763-4499-a70b-
> a7adde8d3300n%40googlegroups.com?utm_medium=email&utm_source=footer>.

jltth...@gmail.com

unread,
Apr 19, 2025, 4:46:25 AM4/19/25
to OpenPnP
I think I've found the problem. I went back to my backup, and I see that my cameras are working in OpenPnP. I put my last backup back where I left off.
I went to the Cameras tab and tweaked the settings a bit, and the image appeared.
I think it's a bad calibration, even though I did everything through the Issues and Solutions tab.
I'm going to start from scratch and take my time; I may have missed some information.
Thank you for trying to help me. I'll get back to you when I've finally finished the full calibration. Thank you.
Capture d’écran 2025-04-19 103143.pngCapture d’écran 2025-04-19 103228.png

Simon Küppers

unread,
Apr 20, 2025, 2:24:20 PM4/20/25
to 'Jan' via OpenPnP
Awesome, that answers a lot of questions I have been having.

Just to confirm: it's not possible to use 2 cameras (USB2 each) on a USB3 hub connected via a USB 3 capable cable to a USB 3 PC root port?

I.e. the USB2.0 devices will not get their full bandwidth to the root port, although technically the bandwidth would be enough (with a USB 3 protocol)?

How does it actually work then? Are there time slots in the "trunk" connection for each of the downstream devices and those timeslots are the same width for all devices, but USB 2 devices can only use USB 2 timeslots (1 data pair) and USB 3 devices can use USB 3 timeslots (3 data pairs and different encoding)?

There is no conversion from USB 2 to USB 3 being done inside the hub?

Best regards
Simon

vespaman

unread,
Apr 20, 2025, 5:11:10 PM4/20/25
to OpenPnP
If you connect a USB2 device to a USB3 port/hub of any kind, it will downgrade itself to USB2 on all ports on the same hub. So, for instance on the computer, the USB3 port will be downgraded to a USB2 port, and it will normally also be dealt a different port/hub address, so it can be a bit confusing trying to understand how the ports are tied together when moving around both USB2 and USB3 devices on the computer, since the ports will be remapped. This is why it is best to keep all slow USB2 devices on the same root hub (e.g. mouse/keyboards etc), and then another root hub for each camera. Depending on the motherboard/computer, each root hub is connected to 2-4 external USB ports/jacks typically.

However, it can be possible to connect two [USB2] cameras on the same hub, if they together fit within the bandwidth and power budget of the USB 2 protocol (480Mbit). Normally the limit seems to be around 720p/30, but it will depend on the setup of the compression (mjpeg) the camera manufacturer has designed it to.
This is typically also the same with USB3 cameras; they also cannot always be on the same root hub (or external hub) if their combined bandwidth or power budget is above whats available. I have, for example, on my machine two 1920p/120 USB3 cams which needs to sit on different (USB3) root hubs.

If you have 1080p/30, you'd probably will use up the most of USB2 bandwidth, so it probably will work best without any other USB2 devices on the same hub. If you want 1080p/60, you might need USB3.


This above estimations are with MJPEG, YUYV will need much more bw.

  - Micael

Jan

unread,
Apr 22, 2025, 6:29:53 AM4/22/25
to ope...@googlegroups.com
Hi Simon!
No, connection USB2 devices to a USB3 hub has no advantage. USB2 and
USB3 share a single connector but are separate hardware wise. I have not
checked the specification if USB2 and USB3 devices connected to a USB3
hub can be operated in parallel (with the USB3 device at super speed or
higher) But there is no translation between USB2 devices on a hub
sending their data as USB3 from hub to host. (There is such a feature
for USB2 devices where low and full speed communication is translated
into full or high speed)
One more remark: USB2 and USB3 are sets of features and supported
communication speeds. This does not imply that a USB3 device is always
faster then a USB2 device and that a USB2 device is always using high
speed (480MBit). So you have to check the actual device descriptors and
link information to find out details about the actual communication.
Furthermore the USB standard divides the available bandwidth into equal
slots (1ms for full speed (12mbit), 125us for high speed (480Mbit)) and
uses this slots as requested by the device. This means eg. that for
Interrupt endpoints a slot is reserved every configured update interval
or for Isochronous endpoints (which cameras use per default) one or more
slots of the requested size are reserved. According to table 5-5 on page
46 of the USB2.0 specification, the max. bandwidth an Isochronous
endpoint can request is limited to 41%. If my interpretation is correct,
this would support up to two of such endpoints on a single bus. Or in
other words any two USB2.0 Cameras can share a single port, even if both
request maximum bandwidth. Please correct me if this interpretation is
wrong.
Using USBTreeView I've checked my cameras and found that each exposes
multiple interfaces with one Isochronous endpoint each requesting
different bandwidths. This probably indicates that the host/camera
driver/OpenPnP can select the one most suitable. Luckily USBTreeView
reports the active interface in the Connection Information section.
However, the connection is only active, if a software is reading the
camera image. This means, that for correct and reliable information
OpenPnP has to be running and accessing both cameras. (My cameras are
send to D3 (sleep) when not used.)

Jan

Simon Küppers

unread,
Apr 22, 2025, 1:49:41 PM4/22/25
to 'Jan' via OpenPnP
Thanks a lot for the response! Sounds plausible. So USB 3 doesn't actually use the "regular" USB data pair (or maybe just for enumeration).

I had two cameras connected to one root hub and openpnp cannot open the second camera. If I check the Linux Kernel log, it shows that there is insufficient bandwidth.

I could try lowering the resolution setting of the ELP cam, maybe that helps.

Best regards

Jaroslav Brázdil

unread,
Apr 22, 2025, 3:08:19 PM4/22/25
to ope...@googlegroups.com

Hi Simon. I have used one camera on USB 3 and second one on USB 2. It work's for me. Jaroslav


Dne út 22. 4. 2025 19:49 uživatel Simon Küppers <simon.k...@skueppers.de> napsal:
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.

Simon Küppers

unread,
Apr 22, 2025, 3:19:22 PM4/22/25
to ope...@googlegroups.com
That's an interesting solution 😁 so they are different cameras right?

Jaroslav Brázdil

unread,
Apr 22, 2025, 3:47:13 PM4/22/25
to ope...@googlegroups.com

Yes, one USB 3.0 camera on USB 3.0 port and one USB 2.0 camera on USB 2.0 port. It's on old Lenovo all in one PC. It hasn't two USB 2.0 hubs


Dne út 22. 4. 2025 21:19 uživatel Simon Küppers <simon.k...@skueppers.de> napsal:

Ian Arkver

unread,
Apr 22, 2025, 6:30:50 PM4/22/25
to OpenPnP
In theory something like this *might* work...

No idea how well it would play with isochronous streaming and camera drivers though. Not tried it of course. Also no idea whether these are actually available anywhere.

Using a real USB3 camera is a much better fix, if you need it.

--Ian

Jan

unread,
Apr 23, 2025, 4:48:25 AM4/23/25
to ope...@googlegroups.com
Hi Simon!
Do you my chance have information about the requested bandwidth or the
descriptors of your camera?

Jan
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/openpnp/
> AB1E4246-CEFC-4378-99F2-35A0114E6C21%40skueppers.de <https://
> groups.google.com/d/msgid/openpnp/AB1E4246-
> CEFC-4378-99F2-35A0114E6C21%40skueppers.de?
> utm_medium=email&utm_source=footer>.

Jan

unread,
Apr 23, 2025, 5:07:24 AM4/23/25
to ope...@googlegroups.com
I think that's a good solution if the camera is guaranteed to support
SuperSpeed (5gbit). If it's marked as USB3 but actually only supports
HighSpeed (480mbit), the initial issue remains. For SuperSpeed, the
available bandwidth shall be high enough for multiple high speed cameras
and thous could likely be grouped behind a (USB3) hub (suppose the hub
can provide enough power).
I checked the specification again: for USB2 it reads "High-speed
endpoints can allocate at most 80% of a microframe for periodic
transfers." (section 5.6.4, page 47) and table 5-5 on page 46 says, that
the maximum bandwidth an endpoint can request is 41%. I suppose that if
two endpoints request this maximum, this will be considered more then
80% and hence rejected. My FullHD camera is requesting slightly less
then the maximum (in one of its alternate settings), which might explain
why it works for me. (I'm curious if Simone can provide details about
his camera setup that reveals this secret...)
Just as a reminder to all of this: Bottom Vision does not require super
high resolution or super fast speed. So a lower resolution with lower
bandwidth requirements will work well and cause less trouble.

Jan

On 22.04.2025 21:08, Jaroslav Brázdil wrote:
> Hi Simon. I have used one camera on USB 3 and second one on USB 2. It
> work's for me. Jaroslav
>
>
> Dne út 22. 4. 2025 19:49 uživatel Simon Küppers
> <simon.k...@skueppers.de <mailto:simon.k...@skueppers.de>> napsal:
>
> Thanks a lot for the response! Sounds plausible. So USB 3 doesn't
> actually use the "regular" USB data pair (or maybe just for
> enumeration).
>
> I had two cameras connected to one root hub and openpnp cannot open
> the second camera. If I check the Linux Kernel log, it shows that
> there is insufficient bandwidth.
>
> I could try lowering the resolution setting of the ELP cam, maybe
> that helps.
>
> Best regards
>
>
> Am 22. April 2025 12:29:42 MESZ schrieb 'Jan' via OpenPnP
> <ope...@googlegroups.com <mailto:ope...@googlegroups.com>>:
> <ope...@googlegroups.com <mailto:ope...@googlegroups.com>>:
>
> Hi all!
> I feel compelled to clear up a few usb myths with
> respect to cameras:
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> openpnp/AB1E4246-CEFC-4378-99F2-35A0114E6C21%40skueppers.de
> <https://groups.google.com/d/msgid/openpnp/AB1E4246-
> CEFC-4378-99F2-35A0114E6C21%40skueppers.de?
> utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/openpnp/
> CANrSZjAk%2B2_Chfgrw%2BOApjLmdN5O0T%2BAMiAkficgZzwcMV4CuA%40mail.gmail.com <https://groups.google.com/d/msgid/openpnp/CANrSZjAk%2B2_Chfgrw%2BOApjLmdN5O0T%2BAMiAkficgZzwcMV4CuA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

vespaman

unread,
Apr 23, 2025, 6:38:02 AM4/23/25
to OpenPnP
Hi Jan,

I'm not really sure what the discussion is about any longer, but..

If it's marked as USB3 but actually only supports
HighSpeed (480mbit), 

Does such a best actually exist? I know I have seen multiple cameras on Ali saying they are USB3 Hispeed, but in reality they are (at least the ones I have seen), Super Speed. Most likely 5Gb/s.

 
the initial issue remains. For SuperSpeed, the
available bandwidth shall be high enough for multiple high speed cameras
and thous could likely be grouped behind a (USB3) hub (suppose the hub
can provide enough power).

Well, this depends, doesn't it? If resolution is high enough and FPS is high enough, it will not work. Also it will depend upon mjpeg vs YUYV format.

Like I wrote in a previous message, my Super Speed cameras does not work on the same root hub, if operated simultaneously. The second I try to start the second stream camera number two is pushed off the hub.
If they would be >=10Gb/s Super Speed devices, I'd guess they would work.
My previous up cam (also 5Gb Super Speed) 1920x1080@60/mjpeg, would most likely work with a sibling on the same Super Speed root hub.


  - Micael

Simon Küppers

unread,
Apr 24, 2025, 12:58:07 PM4/24/25
to ope...@googlegroups.com
Hi Jan,

I did some digging in lsusb. See below. I would like to keep using
1280x720, cause I need that aspect ratio for detecting a 10x14mm IC
without compositing on the bottom camera. It says this setting uses a
bitrate of 442509360 (422 MBit/s?!).

Interestingly, it also supports a still frame mode. That could be
worthwhile to add to openpnp isn't it? I mean, it just needs a single
image anyway and not a video stream.

Bus 001 Device 004: ID 32e4:9310 HD Camera Manufacturer HD USB Camera
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 [unknown]
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x32e4 HD Camera Manufacturer
  idProduct          0x9310 HD USB Camera
  bcdDevice            0.00
  iManufacturer           2 HD Camera Manufacturer
  iProduct                1 HD USB Camera
  iSerial                 3 2020062301
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x03c3
    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               5 HD USB Camera
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      1 Video Control
      bInterfaceProtocol      0
      iInterface              5 HD USB Camera
      VideoControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdUVC               1.00
        wTotalLength       0x004d
        dwClockFrequency       15.000000MHz
        bInCollection           1
        baInterfaceNr( 0)       1
      VideoControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               4
        iTerminal               0
      VideoControl Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      6 (EXTENSION_UNIT)
        bUnitID                 4
        guidExtensionCode {28f03370-6311-4a2e-ba2c-6890eb334016}
        bNumControls            8
        bNrInPins               1
        baSourceID( 0)          3
        bControlSize            1
        bmControls( 0)       0x0f
        iExtension              0
      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           0x0000001e
          Auto-Exposure Mode
          Auto-Exposure Priority
          Exposure Time (Absolute)
          Exposure Time (Relative)
      VideoControl Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      5 (PROCESSING_UNIT)
      Warning: Descriptor too short
        bUnitID                 3
        bSourceID               1
        wMaxMultiplier          0
        bControlSize            2
        bmControls     0x0000377f
          Brightness
          Contrast
          Hue
          Saturation
          Sharpness
          Gamma
          White Balance Temperature
          Backlight Compensation
          Gain
          Power Line Frequency
          White Balance Temperature, Auto
          White Balance Component, Auto
        iProcessing             0
        bmVideoStandards     0x71
          None
          NTSC - 625/50
          PAL - 525/60
      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               6
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              5 HD USB Camera
      VideoStreaming Interface Descriptor:
        bLength                            15
        bDescriptorType                    36
        bDescriptorSubtype                  1 (INPUT_HEADER)
        bNumFormats                         2
        wTotalLength                   0x0267
        bEndpointAddress                 0x81  EP 1 IN
        bmInfo                              0
        bTerminalLink                       2
        bStillCaptureMethod                 2
        bTriggerSupport                     1
        bTriggerUsage                       1
        bControlSize                        1
        bmaControls( 0)                     0
        bmaControls( 1)                     0
      VideoStreaming Interface Descriptor:
        bLength                            11
        bDescriptorType                    36
        bDescriptorSubtype                  6 (FORMAT_MJPEG)
        bFormatIndex                        1
        bNumFrameDescriptors                8
        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                            30
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         1
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                           1280
        wHeight                           720
        dwMinBitRate                442509360
        dwMaxBitRate                442509360
        dwMaxVideoFrameBufferSize     1843789
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         2
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            640
        wHeight                           480
        dwMinBitRate                147597360
        dwMaxBitRate                147597360
        dwMaxVideoFrameBufferSize      614989
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         3
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            352
        wHeight                           288
        dwMinBitRate                 48801840
        dwMaxBitRate                 48801840
        dwMaxVideoFrameBufferSize      203341
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         4
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            320
        wHeight                           240
        dwMinBitRate                 37005360
        dwMaxBitRate                 37005360
        dwMaxVideoFrameBufferSize      154189
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         5
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            176
        wHeight                           144
        dwMinBitRate                 12306480
        dwMaxBitRate                 12306480
        dwMaxVideoFrameBufferSize       51277
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         6
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            160
        wHeight                           120
        dwMinBitRate                  9357360
        dwMaxBitRate                  9357360
        dwMaxVideoFrameBufferSize       38989
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         7
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            800
        wHeight                           600
        dwMinBitRate                230541360
        dwMaxBitRate                230541360
        dwMaxVideoFrameBufferSize      960589
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  7 (FRAME_MJPEG)
        bFrameIndex                         8
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            960
        wHeight                           720
        dwMinBitRate                331917360
        dwMaxBitRate                331917360
        dwMaxVideoFrameBufferSize     1382989
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)
        bEndpointAddress                 0x00  EP 0 OUT
        bNumImageSizePatterns               8
        wWidth( 0)                       1280
        wHeight( 0)                       720
        wWidth( 1)                        960
        wHeight( 1)                       720
        wWidth( 2)                        800
        wHeight( 2)                       600
        wWidth( 3)                        640
        wHeight( 3)                       480
        wWidth( 4)                        352
        wHeight( 4)                       288
        wWidth( 5)                        320
        wHeight( 5)                       240
        wWidth( 6)                        176
        wHeight( 6)                       144
        wWidth( 7)                        160
        wHeight( 7)                       120
        bNumCompressionPatterns             0
      VideoStreaming Interface Descriptor:
        bLength                            27
        bDescriptorType                    36
        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
        bFormatIndex                        2
        bNumFrameDescriptors                8
        guidFormat {32595559-0000-0010-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                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         1
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                           1280
        wHeight                           720
        dwMinBitRate                147456000
        dwMaxBitRate                147456000
        dwMaxVideoFrameBufferSize     1843200
        dwDefaultFrameInterval        1000000
        bFrameIntervalType                  1
        dwFrameInterval( 0)           1000000
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         2
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            640
        wHeight                           480
        dwMinBitRate                147456000
        dwMaxBitRate                147456000
        dwMaxVideoFrameBufferSize      614400
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         3
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            352
        wHeight                           288
        dwMinBitRate                 48660480
        dwMaxBitRate                 48660480
        dwMaxVideoFrameBufferSize      202752
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         4
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            320
        wHeight                           240
        dwMinBitRate                 36864000
        dwMaxBitRate                 36864000
        dwMaxVideoFrameBufferSize      153600
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         5
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            176
        wHeight                           144
        dwMinBitRate                 12165120
        dwMaxBitRate                 12165120
        dwMaxVideoFrameBufferSize       50688
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         6
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            160
        wHeight                           120
        dwMinBitRate                  9216000
        dwMaxBitRate                  9216000
        dwMaxVideoFrameBufferSize       38400
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         7
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            800
        wHeight                           600
        dwMinBitRate                153600000
        dwMaxBitRate                153600000
        dwMaxVideoFrameBufferSize      960000
        dwDefaultFrameInterval         500000
        bFrameIntervalType                  1
        dwFrameInterval( 0)            500000
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         8
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            960
        wHeight                           720
        dwMinBitRate                165888000
        dwMaxBitRate                165888000
        dwMaxVideoFrameBufferSize     1382400
        dwDefaultFrameInterval         666666
        bFrameIntervalType                  1
        dwFrameInterval( 0)            666666
      VideoStreaming Interface Descriptor:
        bLength                            38
        bDescriptorType                    36
        bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)
        bEndpointAddress                 0x00  EP 0 OUT
        bNumImageSizePatterns               8
        wWidth( 0)                       1280
        wHeight( 0)                       720
        wWidth( 1)                        960
        wHeight( 1)                       720
        wWidth( 2)                        800
        wHeight( 2)                       600
        wWidth( 3)                        640
        wHeight( 3)                       480
        wWidth( 4)                        352
        wHeight( 4)                       288
        wWidth( 5)                        320
        wHeight( 5)                       240
        wWidth( 6)                        176
        wHeight( 6)                       144
        wWidth( 7)                        160
        wHeight( 7)                       120
        bNumCompressionPatterns             0
      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     0x0320  1x 800 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     0x0b20  2x 800 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     0x1320  3x 800 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       0 [unknown]
      bFunctionProtocol       0
      iFunction               4 USB Microphone
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0
      iInterface              4 USB Microphone
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x0029
        bInCollection           1
        baInterfaceNr(0)        3
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Microphone
        bAssocTerminal          0
        bNrChannels             1
        wChannelConfig     0x0000
        iChannelNames           0
        iTerminal               0
      AudioControl Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 2
        bSourceID               1
        bControlSize            2
        bmaControls(0)     0x0001
          Mute Control
        bmaControls(1)     0x0002
          Volume Control
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               2
        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         0x0001 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]        11025
        tSamFreq[ 2]        16000
        tSamFreq[ 3]        22050
        tSamFreq[ 4]        24000
        tSamFreq[ 5]        44100
        tSamFreq[ 6]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0190  1x 400 bytes
        bInterval               4
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay         0x0000
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 [unknown]
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled

Jan

unread,
Apr 25, 2025, 5:16:03 AM4/25/25
to ope...@googlegroups.com
Hi Simon!
Many thanks for the descriptor dump.
The block of six "Interface Descriptor:" of type "Video, Video
Streaming" for Endpoint EP 1 IN show (almost) identical information as
on my camera. The values for "bAlternateSetting" 6 with "wMaxPacketSize
0x1400 3x 1024 bytes" is the maximum the standard supports and
results in allocating 41% of the available bandwidth (according to table
5-5 I mentioned earlier). Having two of this cameras requesting the same
bandwidth is then beyond the specification due to the 80% rule (to my
understanding). Your camera supports an alternative interface
configuration ("bAlternateSetting" == 5) which requests less bandwidth.
If you/the driver/OpenPnP can negotiate to use that, you could get two
cameras to work in parallel. However, I don't know how to enforce that.
Choosing a lower resolution/frame rate in OpenPnP does not (according to
USBTreeView) change the requested bandwidth.
I'd say that your observation is almost in sync with mine.
The max. bandwidth that is requested with the interface descriptor for
alternative setting 6 is given by
wMaxPacketSize 0x1400 3x 1024 bytes and
bInterval 1

wMaxPacketSize is already decoded to 3x 1024 bytes and bInterval == 1
means 1/125us. This can be combined into 3x1024bytes/125us =
24.576bytes/us or 187.5mbit/sec. This is about 39% of the theoretical
480mbit, but does not take the protocol overhead into account. (The
USB2.0 specification has more details around Table 5-5.)
Still image support is likely a good idea, however this would require
new settling configurations and trigger options. And I'm not sure if
this would change the bandwidth issue. At the end you also wont the one
image to be transferred as fast as possible, requiring any available
bandwidth. Until the cameras interface is not changed from Isochronous
to Bulk endpoints, using available bandwidth dynamically is not supported...

Jan

Jan

unread,
Apr 25, 2025, 5:41:30 AM4/25/25
to ope...@googlegroups.com
Hi Micael!

On 23.04.2025 12:38, vespaman wrote:
> Hi Jan,
>
> I'm not really sure what the discussion is about any longer, but..
>
I'd love to gather some information why there are so many issues with
more the one camera. It seems - that's my current best guess - that the
USB2.0 standard did not covered that very well by allowing a maximum,
that is just slightly above 50%. If camera manufacturers just specify
the maximum, no two of such cameras a are supported. If they specify
slightly less, two cameras are likely supported. And then there is the
question with alternative settings: if an alternative setting exists,
that supports two cameras in parallel, how could be enforce it in favor
for slightly less bandwidth.

> If it's marked as USB3 but actually only supports
> HighSpeed (480mbit),
>
>
> Does such a best actually exist? I know I have seen multiple cameras on
> Ali saying they are USB3 Hispeed, but in reality they are (at least the
> ones I have seen), Super Speed. Most likely 5Gb/s.
>
"USB3 Hispeed" sound like what I intended to say: claims USB3, but only
at USB2.0 (480mbit) speed. The standard is precise in that "High Speed"
is 480mbit and supported since USB2.0. USB3.0 adds "Super Speed" which
is 5gbit. Later they specified "Super Speed+" which is 10gbit. At the
same time, they specified something like super transaction translator,
which takes traffic at 5gibt and forwards it at 10gbit trying to utilize
the available bandwidth at best. For Super Speed they also specify that
endpoints can request more bandwidth (up to 16x1024byte/125us). I don't
know yet, if this value is low enough so that two endpoints can request
it in parallel without exceeding the maximum.

> the initial issue remains. For SuperSpeed, the
> available bandwidth shall be high enough for multiple high speed
> cameras
> and thous could likely be grouped behind a (USB3) hub (suppose the hub
> can provide enough power).
>
>
> Well, this depends, doesn't it? If resolution is high enough and FPS is
> high enough, it will not work. Also it will depend upon mjpeg vs YUYV
> format.
>
Yes, I've seen different interface configurations with different
bandwidth requirements. I just don't know how to enforce a specific one
them to improve cooperative behavior.

> Like I wrote in a previous message, my Super Speed cameras does not work
> on the same root hub, if operated simultaneously. The second I try to
> start the second stream camera number two is pushed off the hub.
> If they would be >=10Gb/s Super Speed devices, I'd guess they would work.
> My previous up cam (also 5Gb Super Speed) 1920x1080@60/mjpeg, would most
> likely work with a sibling on the same Super Speed root hub.
>
You may dump the descriptors and post them hear. Maybe that brings some
light in. Anyhow, I'm surprised, that you say "pushed off". To me, the
various descriptors USB offers supports the software to check in
advanced if a certain configuration is valid/supported under current
conditions and it could generate an error indicating if not. I don't
understand why such a rude behavior is needed. There is one exception:
power. Power requirements are part of the descriptors and can be
validated as well. However, I've seen hubs that are shipped with 1A
power supplys while reporting that they can deliver 500mA on each of
their four ports. If you try, the power supply is overloaded resulting
in strange failures of the connected devices. And there is no indication
why that happens...

Jan

Jan

unread,
Apr 25, 2025, 9:21:14 AM4/25/25
to ope...@googlegroups.com
Hi all!
I just found this (Microsoft) document:
https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-bandwidth-allocation
It says "The key to proper bandwidth management is that every USB
device in the system that does isochronous transfers must offer multiple
alternative (Alt) settings for each interface that contains isochronous
endpoints, and client drivers must make judicious use of these Alt
settings. Client drivers should begin by requesting the interface
setting with the highest bandwidth. If the request fails, the client
driver should request interface settings with smaller and smaller
bandwidths until a request succeeds."
This means to me, that a properly designed camera (like the once we've
discussed here) has to expose multiple interfaces with different
bandwidth requirements and a properly designed driver will select the
one that fits best. This shall usually work for two cameras with the
first using their interface with the highest bandwidth rquirements and
the second using whats left and fits with any of their supported
interfaces. I'd turn that into the recommendation, that OpenPnP shall
always open the Uplooking camera before the downlooking.

Jan

Simon Küppers

unread,
Apr 26, 2025, 8:48:50 AM4/26/25
to ope...@googlegroups.com
Hi Jan,

Ah, I think I understand how this works much better now. I quickly
tested what the "real" usage on the USB device was using usbmon and
usbtop. Each camera uses roughly 24MByte/s. I set the linux UVC driver
in trace mode and I could see, that indeed it selects the alternate
setting 6, which is the 3x1024bytes you mentioned per microframe. I
think that matches up.

This means however, that I don't really know how much bandwidth the
camera actually needs, because it uses all the isochronous bandwidth it
has reserved (I think that is how its supposed to work?). I set the
resolution to 320x240 and it still had the same amount of data. I tried
using ffplay to display the data and it seems to suggest roughly 1MB per
videoframe, which would be 30MB/s or 240MBit/s. It's also not possible
to manually set a framerate that the camera doesn't offer (bummer).

There has been some efforts of adding a parameter to the driver to allow
setting the "real" required bandwidth, since a lot of cameras report
wrong numbers here (which I think is also the case here with the 320x240
setting). But it looks like that hasn't gotten into the upstream kernel.
See https://www.thegoodpenguin.co.uk/blog/multiple-uvc-cameras-on-linux/

Anyway, with the 1280x720 bandwidth, I think I am over half of the limit
of USB2.0  anyway and there is really no easy screw to turn to adjust
the USB bandwidth reservations unfortunately.

Best Regards
Simon
Reply all
Reply to author
Forward
0 new messages