aguinet / usbtop

usbtop is a top-like utility that shows an estimated instantaneous bandwidth on USB buses and devices.
BSD 3-Clause "New" or "Revised" License
277 stars 45 forks source link

on accuracy #34

Open flugi opened 3 years ago

flugi commented 3 years ago

Hello, I would like to ask how the utilized bandwidth is measured, and what are the chances that the measurements are very wrong. I am benchmarking a USB hub with 3 Kinect devices and usbtop reports ~1800KiB/s for my typical use of a single Kinect sensor. When I run three of them, the results are clearly show a bottleneck as the sum of the three bandwidth numbers usbtop show never exceeds 3000KiB/s, I see frame drops and ~15fps stream instead of 30.

However if I run a different application the same HUB and same Kinect reports 15263 KiB/s when used as webcam.

What could be the reason of these numbers? Is it possible that the actual bandwidth need by the Kinect is much more than what usbtop show?

dfloer commented 2 years ago

I've also been wondering something similar myself. I've got a UVC device and usbtop is only showing around 15MiB/s, which seems far too low for the amount of data it should be pushing. I'd expect more like 93MB/s for an the raw data coming from it.

dfloer commented 2 years ago

I did some more poking, and it seems like usbtop was accurate for the UVC device in bulk mode, but was still showing low for isochronous mode. Potentially there's a bug there.

aguinet commented 2 years ago

Hello everyone,

I unfortunately don't have any equipment that would allow me reproducing these experiments.

Bandwidth estimation happens in the src/usb_stats.cpp file, with this TODO: https://github.com/aguinet/usbtop/blob/master/src/usb_stats.cpp#L37 .

If you have suggestions on better way to compute this, I'm more than open to hear & discuss about them :)

Thanks!