Author Topic: USB 2.0 cameras in motherboard vs in hub  (Read 17343 times)

zubarka

  • Member
  • ***
  • Posts: 2
USB 2.0 cameras in motherboard vs in hub
« on: May 29, 2023, 07:28:13 am »
Hi everyone,

I have a specific problem with USB that I hope someone here can help me with.

On my computer I have one USB 3.0 and one USB 2.0 controller. We are using multiple USB 2.0 cameras for a computer vision application, which
work fine since several compressed streams fit in the available bandwidth of 480Mbit/s. Using the usb ports in the motherboard I have successfully connected up to seven cameras without issue, which I have verified are connected to the same USB 2.0 controller.

However, when I plug in a usb hub (2.0 or 3.0, powered/unpowered, have tested all), I can only get one camera to work at the same time. As soon
as I start the second camera it complains about insufficient bandwidth. To me this is very weird since I know from above test that the bandwidth should not be a problem.

I have tested this on both linux (6.3.4) and Windows 10 with identical results.

We know that we can solve this problem by going to USB 3.0 cameras, but they are unfortunately much more expensive and not as commonly available. We also have external pci-cards with separate USB 2.0 controllers which work, but we are still limited to one camera/controller in that case (and we want to use MANY cameras).

Have anybody else seen this problem or now what the reason could be?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research

zubarka

  • Member
  • ***
  • Posts: 2
Re: USB 2.0 cameras in motherboard vs in hub
« Reply #2 on: May 30, 2023, 08:27:39 am »
Thank you! From what I understand the chipset guarantees full usb 2.0-bandwidth for all ports which explain why multiple cameras work. It is a bit weird though that the OS still only see it as one usb controller.

A follow-up question: I can see (using e.g. usbtop on linux) that my usb 2.0 camera uses a maximum of 10Mb/s when streaming mjpeg-compressed fullHD. Is it not reasonable to think that the controller should be able to handle at least two such streams within its 40Mb/s bandwidth? Yet I always get out-of-bandwidth errors whenever I try to start a second camera.


Renate

  • Frequent Contributor
  • ****
  • Posts: 97
Re: USB 2.0 cameras in motherboard vs in hub
« Reply #3 on: June 14, 2023, 09:01:51 am »
This is not related to your current problem but it might be helpful to someone else.

Host controllers have a finite number of total endpoints that they can manage, I've seen 96.
If you go crazy plugging stuff in with lots of endpoints you might run into this.
A new device will displace an old device.

I made a test device once with 32 endpoints.
Note that the underlying hardware doesn't need to be that big.
You just need to make your descriptors with interfaces and endpoints.