Cameras & sensorsExplainer

USB2 bandwidth and 5MP frame rate: size the data rate first

The USB2 bandwidth a real host carries, the sensor data-rate formula, and why a 5MP RAW8 frame rate over 6 fps overruns it, with the arithmetic and the fixes.

LumaSpec Vision10 min read Share on LinkedIn

On this page 11 sections
  1. 01What a USB2 port really carries
  2. 02The data-rate formula
  3. 03What the log is telling you
  4. 04Why manual exposure tips it over, and brightness does not
  5. 05The fix: cut the rate until the demand fits
  6. 06When to change the link instead of the configuration
  7. 07Sharing the bus halves the budget
  8. 08Checks before you order
  9. 09When it is not the bandwidth
  10. 10The decision, case by case
  11. 11Questions

A 5 MP board camera on a USB2 link runs for hours on auto exposure. Pin the exposure for a bright scene and the log fills with 8 fps heartbeats, a capture return value of 65316 and truncated frame sizes. The camera is not faulty and neither is the cable: the sensor asks the link for more data than USB2 carries. This guide gives you the arithmetic to size any sensor mode against any link — the bandwidth a USB2 port really delivers, the data-rate formula, what truncated receive lengths in the log mean, the frame rates at which a 5 MP RAW8 stream stays clean — and the point at which you change the link instead of the configuration.

What a USB2 port really carries

USB2 high-speed moves 480 Mbit/s of signaling, which is 60 MB/s at the wire. Camera bridges use bulk transfers, and bulk is capped harder: packets are at most 512 bytes, and a 125 μs microframe fits 12 to 13 of them. The hard ceiling is therefore 13 × 512 B × 8,000 microframes/s ≈ 53.2 MB/s.

Token packets, PIDs, CRCs and handshakes ride the same wire, and host controllers rarely fill every slot, so sustained bulk throughput on real hosts lands between about 35 and 43 MB/s — less when anything else shares the bus. We size USB2 camera links to 35 MB/s: 280 Mbit/s of payload, 58 percent of the line rate. The 60 MB/s figure on the box is not a planning number.

The data-rate formula

data rate (B/s) = width_px × height_px × bytes_per_pixel × fps fps ceiling (fps) = link_budget_Bps ÷ (width_px × height_px × bytes_per_pixel)

RAW8 stores one byte per pixel, so a frame is 2592 × 1944 × 1 B = 5,038,848 bytes, about 5.04 MB. At the configured 8 fps the sensor demands 5,038,848 × 8 = 40,310,784 B/s, about 40.3 MB/s — 15 percent over the 35 MB/s budget. The link cannot sustain that frame period, and no exposure value changes the byte count.

The ceiling: 35,000,000 ÷ 5,038,848 = 6.9 fps. Six fps is the highest rate worth configuring: 5,038,848 × 6 = 30,233,088 B/s = 30.2 MB/s, 86 percent of budget. Five fps holds 25.2 MB/s, 72 percent of budget, with room for a shared bus.

Mode, RAW8 Bytes per frame Demand Share of 35 MB/s Verdict
2592 × 1944 @ 5 fps 5.04 MB 25.2 MB/s 72% fits
2592 × 1944 @ 6 fps 5.04 MB 30.2 MB/s 86% fits
2592 × 1944 @ 7 fps 5.04 MB 35.3 MB/s 101% drops frames
2592 × 1944 @ 8 fps 5.04 MB 40.3 MB/s 115% overruns

RAW10 and RAW12 raise bytes per pixel to 1.25 and 1.5, so the same sensor at 8 fps would ask 50.4 and 60.5 MB/s. Neither fits USB2 at a useful rate.

What the log is telling you

Between the 8 fps heartbeats the capture call fails with 65316, and four of the failures carry the data-length error string (USB_CAMERA_DATA_LEN_ERROR) with RECEIVE_LENGTH values of 2,389,476, 3,433,124, 3,981,412 and 3,423,736 bytes. A full RAW8 frame is 5,038,848 bytes, so those frames arrived 47, 68, 79 and 68 percent complete.

That is a receiver falling behind, not line noise. Demand exceeds capacity continuously, the backlog grows, a chunk of a frame is lost, and the transfer ends short. The clean 8 fps lines interleaved with the failures are the host draining the backlog before falling behind again.

Why manual exposure tips it over, and brightness does not

Scene brightness changes pixel values, never the byte count: a RAW8 frame is 5.04 MB of wire data whether it shows a black lab or a light box. Frame rate sets demand.

With AGC and AEC off, the frame period is pinned. The configuration registers show it: 0x3503 set to 0x03 disables both, exposure lives in 0x3500–0x3502 and gain in 0x350A/0x350B in this sensor's configuration. The pinned period is 125 ms at 8 fps, and nothing on the acquisition path can relieve the link.

Auto modes leave relief paths open. Whenever exposure lengthens past the frame period, the sensor slows itself; and newer capture firmware cuts the configured rate automatically when the host falls behind, which is why some setups survive the same overrun. At 40.3 MB/s the demand sits inside the 35–43 MB/s band that real hosts deliver, so those reliefs decide whether the stream mostly works or fails in bursts. Manual exposure closes all of them.

The bright scene is a witness, not a cause: the manual configuration was simply tried first on a bright scene. With the frame period pinned at 8 fps, the demand is identical in a dim room.

The fix: cut the rate until the demand fits

Work down the list and stop at the first option that still meets the application's minimum rate.

  1. Lower the configured frame rate. Reduce the value of the PLL register that sets the sensor clock — 0x3036 in this configuration — or load the lower-rate configuration the module vendor publishes for the mode. At 6 fps the demand is 30.2 MB/s, 86 percent of budget; set 5 fps (25.2 MB/s) if the same host must also serve other USB2 devices.
  2. Drop resolution or bin. 1920 × 1080 RAW8 is 2,073,600 bytes per frame; the ceiling is 35,000,000 ÷ 2,073,600 = 16.9 fps, so configure 15 fps for 31.1 MB/s. 1280 × 1024 is 1,310,720 bytes; the ceiling is 26.7 fps — 25 fps asks 32.8 MB/s (94 percent, tight), so 20 fps at 26.2 MB/s is the comfortable setting.
  3. Keep RAW8. RAW10 or RAW12 adds 25 to 50 percent to the demand, for depth the link cannot afford.
  4. Change the link. Below 6 fps there is no register that helps at 5 MP; see the next section.

Then prove it: stream for ten minutes, divide received frames by elapsed time, and accept the change only at the configured rate with zero length errors.

Link Line rate Usable payload 5 MP RAW8 ceiling Sensible setting
USB2 480 Mbit/s ~35 MB/s 6.9 fps 6 fps
GigE 1 Gbit/s ~115 MB/s 22.8 fps 20 fps
USB3 5 Gbit/s ~400 MB/s 79 fps sensor-limited

GigE carries about 115 MB/s after protocol overhead — 92 percent of its 125 MB/s line rate with jumbo frames — which lifts the 5 MP ceiling to 115,000,000 ÷ 5,038,848 = 22.8 fps. USB3's 5 Gbit/s leaves about 400 MB/s after 8b/10b encoding and protocol overhead, so its ceiling of 400,000,000 ÷ 5,038,848 ≈ 79 fps sits above what any board-level sensor's frame rate reaches: the sensor becomes the limit, not the link.

Start from a 5 MP class sensor. The MV-CB060-10UM-B is a 6 MP USB3 board camera on a 1/1.8" sensor, and the LS-BCM-0020 is a 6.3 MP GigE board camera on the same format. Either streams the 5 MP RAW8 mode with the link far from its limit.

Board-level camerasHikrobot MV-CB060-10UM-B 6 MP Board Level Camera, USB3, IMX178, Mono, Bare Board, V4MV-CB060-10UM-B
Sensor format
1/1.8"
Interface
USB3
Resolution
6-10 MP
Shutter
Rolling
$239.00View partBuild a system with it
Board-level cameras6.3 MP board-level camera, IMX178, 1/1.8" rolling shutter, 18 fps (LS-BCM-0020)LS-BCM-0020
Sensor format
1/1.8"
Lens mount
CS-mount
Resolution
6-10 MP
Shutter
Rolling
$290.00View partBuild a system with it

Where the mode needs speed as well as pixels, the LS-BCM-0003 prints 3.1 MP at 120 fps over USB3 with a global shutter. That demand is 3.1 MB × 120 = 372 MB/s — only USB3 answers it, which is the point: match the link to the mode, not the other way round.

Board-level cameras3.1 MP USB3 board-level camera, IMX252, 1/1.8" global shutter, 120 fps (LS-BCM-0003)LS-BCM-0003
Sensor format
1/1.8"
Lens mount
C-mount
Interface
USB3
Resolution
5 MP
$690.00View partBuild a system with it

Sharing the bus halves the budget

A USB2 hub divides its 480 Mbit/s among the devices behind it. Two cameras streaming concurrently get roughly half each, 17.5 MB/s, and the 5 MP ceiling falls to 17,500,000 ÷ 5,038,848 = 3.5 fps: configure 3 fps per camera, 15.1 MB/s or 86 percent of its share. Four cameras leave 8.75 MB/s each and a 1.7 fps ceiling, at which 5 MP stops being practical — drop resolution or move the link. The USB hub frame-rate budget works the same arithmetic from the symptom side.

Checks before you order

  • Compute the demand for every mode on the product sheet, all bit depths included, and ship only modes at or under the link budget: 35 MB/s on USB2.
  • Leave headroom for bus mates: 86 percent of budget (6 fps at 5 MP) for a dedicated port, 72 percent (5 fps) when the segment is shared.
  • Order a short, shielded camera cable for the run. A marginal USB2 cable truncates frames exactly like an overrun, and you want those two faults distinguishable; the cable finder sorts by length and type.
  • If the plan is a MIPI sensor behind a USB capture bridge, match bridge and host before buying: the bridge matching guide lists what to check.
  • For the whole camera choice — interface, shutter, sensor format — the board camera selection guide walks it, and the camera finder filters by interface and resolution.

When it is not the bandwidth

The decision, case by case

  • 5 MP RAW8 on an existing USB2 port, 6 fps acceptable: set 6 fps through the PLL register (0x3036 here) or a lower-rate configuration — 30.2 MB/s, 86 percent of budget. Shared port: 5 fps, 25.2 MB/s.
  • 5 MP above 6 fps: stop tuning registers and change the link. GigE gives a 22.8 fps ceiling, set 20; USB3 gives 79, above every board sensor's maximum.
  • 1080p RAW8 on USB2: ceiling 16.9 fps; configure 15 (31.1 MB/s).
  • RAW10 or RAW12 at 5 MP: not on USB2 at any useful rate — RAW8 or a faster link.
  • New build rather than a fix: choose the link for the mode, not the mode for the port — start from the board-level cameras category and filter by interface.

For a new station, size camera, lens, light and link in one pass with the configurator below; if you would rather send a mode list and have the matching picked for you, use the contact page.

Build the whole station

The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.

Start with the camera

More on framing the camera choice lives on the cameras topic page.

Questions

How many frames per second can USB2 carry from a 5 MP RAW8 sensor?

About 6.9 fps: 35,000,000 B/s ÷ 5,038,848 B per frame. Configure 6 fps (30.2 MB/s, 14 percent headroom). A 7 fps setting asks 35.3 MB/s and fails only in bursts — the hardest mode to catch on a bench, because the log stays clean for minutes at a time before the backlog truncates a frame.

Why did auto exposure work while manual exposure failed on the same USB2 port?

At 40.3 MB/s the demand sits inside the 35–43 MB/s band that real hosts deliver, so relief decides the outcome. Auto exposure leaves the frame period free to stretch whenever exposure lengthens, and newer capture firmware can cut the configured rate on its own. Manual exposure pins the period at 125 ms, so the overrun fails in bursts instead of hiding. Brightness only changes pixel values, not the byte count.

Does a shorter exposure reduce the bandwidth a camera needs?

No. A RAW8 frame is 5,038,848 bytes at 2592 × 1944 whatever the exposure or scene brightness is; exposure changes pixel values, and the wire carries the same bytes. Only when exposure time exceeds the frame period does the sensor slow its own frame rate, and that is the one exposure change that lowers demand.

How do I lower the frame rate on a config-file MIPI sensor?

Reduce the value of the PLL clock register — 0x3036 in this sensor's configuration — which scales the pixel clock and stretches the frame period with it, or load the lower-rate configuration the module vendor publishes for the mode. After the change, run a ten-minute soak and confirm the measured frame rate matches the configured one with zero length errors before you accept it.

When is USB2 the wrong link for a board camera?

Whenever demand passes 35 MB/s: a 5 MP RAW8 stream above about 6 fps, 1920 × 1080 above about 16 fps, or any RAW10 or RAW12 5 MP stream. GigE lifts the 5 MP ceiling to about 22 fps (roughly 115 MB/s usable) and USB3 to roughly 79 fps (about 400 MB/s usable), where the sensor's own maximum takes over.

Is RAW10 or RAW12 possible over USB2 at 5 MP?

Not at a useful rate. RAW10 puts 1.25 bytes per pixel and RAW12 puts 1.5, so 8 fps asks 50.4 and 60.5 MB/s — both over even the strongest host. Drop to RAW8 (6 fps ceiling), drop resolution, or move the camera to GigE or USB3; RAW8 is the only bit depth that carries 5 MP on USB2 at all.