Multi-Camera Links

One coax cable carries a camera fifteen metres where a ribbon cable fails at thirty centimetres. Pick the link by bandwidth, distance and ports, then check the memory bus.

Learn how GMSL2, FPD-Link, GigE Vision and USB3 move pixels, triggers and timestamps for a robot with many cameras, and how to check that a design fits before you build it.

Set six cameras at 1080p60, pick a link, and slide the cable length. Watch four limits turn green or red. Then we build, piece by piece, why each limit exists and how to measure it.

You need a rough idea of what a camera sensor sends (a stream of pixel values, frame after frame) and a little arithmetic. We build the rest from zero.

Part of the Physical AI Systems camera track. It follows Sensor to CSI-2 and V4L2 and the Buffer Queue. Built from vendor data sheets and standards pages, listed in the Field Guide at the end.

Fit the cameras on a link

6
0.3 m

Pixels are RGB8 (24 bits per pixel). CSI-2 uses 4 lanes of 832 Mbit/s, the DS90UB953-Q1 port. GMSL2 uses its 6 Gbit/s forward rate; reach is the vendor claim of "in excess of 15 m"; the CSI-2 reach is the common 30 cm recommendation. The 90% SerDes efficiency, the port counts, the 3 m USB reach, USB's 80% reservation and the 4 memory passes are illustrative. The small SoC memory is a computed example: 32 bits at 4266 MT/s is 17.07 GB/s, and 70% of it is usable.

Chapter 0

Six Cameras, Fifteen Metres, One Computer

See why every multi-camera robot hits the same three limits, and how to count them before you build

Picture a humanoid robot. It has two cameras in the head, two on the wrists, one on the chest and one at the back. The computer that runs its vision sits in the torso. The longest cable is about a metre and a half. You bolt a camera board to the computer with the ribbon cable that came in the box, and it works. You add a wrist camera on a longer cable, and the picture starts to tear.

Nothing is broken. Each camera is fine alone. The trouble is that a ribbon cable has a short reach, and six cameras together ask for much more data than one. This lesson is about the arithmetic that tells you this before you build the robot.

Robot makers know this problem well. Apptronik, a humanoid maker, lists four ways to attach cameras in its public engineering notes on compute and sensing: GigE, GMSL2, USB 3.0 and MIPI. It also asks for precise hardware-level time synchronisation. Four links, one clock. We will learn what each name means.

What a camera sends

A camera sensor reads light as a grid of numbers. Each cell of the grid is a pixel. The sensor sends the grid out one row at a time, then starts the next picture. One picture is a frame. The number of frames per second is the frame rate, written fps.

So the data rate is easy to count. Take the width and the height in pixels. Multiply by the bytes in each pixel. Multiply by the frames per second. A byte is 8 bits, and a plain colour pixel (red, green and blue, 8 bits each) takes 3 bytes. This format is called RGB8.

B
The bandwidth: bytes per second the camera sends. Think of it as the width of a pipe.
W, H
Width and height of the frame in pixels. A 1080p frame is 1920 by 1080.
p
Bytes per pixel. RGB8 is 3. Many sensors send raw 10 or 12 bits per pixel instead, which is less.
f
Frames per second. Sixty means a new frame every 16.7 ms.

1920 × 1080 × 3 × 60 = 373,248,000 bytes/s = 373.2 MB/s = 2.99 Gbit/s

That is one camera. Six of them send 6 × 373.2 = 2,239 MB/s, or 2.24 GB/s. Keep that number. It comes back in Chapter 6, where we compare it with the speed of the computer’s memory.

The three limits

Every link has three numbers. The first is its capacity, how many bits per second it can carry. The second is its reach, how far the cable can run before the signal turns to mush. The third is its ports, how many cameras you can plug in. A fourth limit sits behind all of them: the computer’s memory has to swallow every stream at once.

The budget that decides between GMSL, GigE and USB is the bandwidth you need, times the distance you must cover, times the number of ports you have. A link must pass all three tests. Failing one is enough.

Try it now in the instrument at the top. It starts on USB3 with six cameras at 1080p60, and it fails. Switch to GMSL2 and set the cable to 15 m. It fits. Switch to the CSI-2 ribbon and the cable must shrink to 30 cm. No single link wins on every limit, so you choose by trade-offs.

The failure you will meet first

Suppose you stretch a CSI-2 ribbon from 20 cm to 60 cm. The sensor still sends. The computer still receives. But the receiver checks a CRC on every packet. A CRC is a short check number computed from the packet’s bytes. When a bit flips in transit, the number no longer matches, and the receiver counts an error. On a too-long ribbon, that error count climbs, and frames arrive with torn rows or not at all.

The symptom is a picture with broken stripes. The measurement is the CRC error counter climbing while the cable is long and staying at zero when you swap in a short one. The fix is a link that re-times the signal, which is Chapter 2. First, Chapter 1 shows why the ribbon stops where it does.

  1. The 2 ns wall: why a ribbon cable stops near 30 cm.
  2. GMSL and FPD-Link: one coax that carries pixels, I2C, triggers and power.
  3. Triggers across links: how many microseconds each path costs.
  4. GigE Vision and timestamps: packets, ports, and a clock on the camera.
  5. USB3 and UVC: a shared pipe and its budget.
  6. Aggregate ingest: all streams against the memory bus.
  7. Cables and EMI: the part where the bench wins.
  8. Field Guide: numbers, a checklist, code and sources.
Four 4K30 RGB8 cameras sit on one USB3 hub. Which count is the most direct way to see if the hub can carry them?

Chapter 1

Why a Ribbon Cable Stops at 30 Centimetres

Work out the travel time of a signal on a flex cable, and see why a camera link needs a limit on it

You hold a camera module with a flat flex cable. It plugs into the computer board. You buy a longer cable, 60 cm instead of 20 cm, and the camera stops working. The cable looks the same. The sensor is the same. What changed?

The link here is MIPI CSI-2, the standard way a sensor talks to a processor. Sensor to CSI-2 built it. Its physical layer, called D-PHY, uses a few lanes. A lane is one pair of wires that carries bits in one direction. A separate clock pair carries a beat that tells the receiver when to read each bit.

The data lanes run fast. In the TI DS90UB953-Q1 data sheet, the CSI-2 port runs up to four lanes at 832 Mbit/s each. One bit then lasts 1 / 832,000,000 s = 1.20 ns, about a billionth of a second. Hold that number: the whole link has to get every bit to the receiver within a fraction of 1.2 ns of where it should be.

How long does a signal take to cross a cable?

A signal does not cross a cable instantly. It travels at a fraction of the speed of light. The fraction depends on the board material. In common circuit-board material the signal moves at about half the speed of light in a vacuum, which is roughly 15 cm for every nanosecond. We write this as the velocity v = c / √εr, where c is the speed of light (30 cm/ns) and εr is how strongly the material slows an electric field. A typical value is εr = 4, so v = 30 / 2 = 15 cm/ns.

tfly
The flight time: how long a signal edge takes to cross the cable.
L
The cable length in centimetres.
v
The speed of the signal in the cable, in cm per ns.
c
The speed of light in a vacuum, 30 cm per ns.
εr
The relative permittivity of the board or cable material. We use 4 as an illustrative value; real flex cables vary.

tfly = 30 cm / 15 cm per ns = 2.0 ns   and   60 cm / 15 = 4.0 ns

Now the rule. The MIPI D-PHY specification limits the flight time between the two ends of the link to 2 ns. A reply on the TI E2E forum quotes this limit and points to the interconnect section of the D-PHY specification; it says the 2 ns equals about 25 to 30 cm on circuit-board or flex material. Camera makers say the same thing in plain words: The Imaging Source writes that most camera and processor makers recommend a flex cable of around 30 cm at most. Our derivation, 2 ns times 15 cm per ns, lands on 30 cm. The numbers agree.

Why the limit exists

Flight time on its own is not the danger. A signal that arrives 4 ns late is still a good signal if every lane arrives together. The danger is that a longer cable has more loss, more pickup of noise from neighbours, and more chance that two lanes differ in length. The 2 ns cap keeps the loss and the lane-to-lane difference inside what the receiver can fix. Past it, the specification no longer promises the link works.

Lane mismatch is the part you can count. Say the lanes of a 45 cm cable differ in length by 5%. The longer lane is 2.25 cm longer. That is 2.25 / 15 = 0.15 ns = 150 ps late. One bit is 1.20 ns. So the late lane is off by 150 / 1202 = 12.5% of a bit. At 2.5 Gbit/s one bit is only 0.4 ns, and the same 150 ps is 37% of a bit. Faster links tolerate less cable.

Try it. The slider sets the length. The selector sets the lane speed. The top bar shows the flight time against the 2 ns line. The lower picture shows two lanes of the same bits, the second one delayed by 5% of the cable length. When the delay eats into the middle of a bit, the receiver reads the wrong value and the lane turns red.

Stretch the ribbon

The bar is flight time. The line is the 2 ns limit. Below it, two lanes carry the same bits, and the lower one runs 5% longer. Drag the length, then switch the lane speed.

30 cm

Velocity is 15 cm/ns (εr = 4, illustrative; real cables run about 14 to 17). The 2 ns limit and its 25 to 30 cm equivalent come from the D-PHY flight-time rule as quoted on the TI E2E forum. The 5% lane mismatch and the 25% "eye closed" threshold are illustrative teaching values. 1.5 and 2.5 Gbit/s are example D-PHY lane speeds.

What a SerDes changes

A ribbon pushes parallel lanes a long way and hopes. A SerDes does something else. A serializer sits next to the sensor and squeezes all the lanes into one fast bit stream. A deserializer sits next to the computer and turns that stream back into lanes. Between them is one coax cable. Because the pair drives a known line at a known rate, and because the deserializer recovers a clock from the stream, the lanes at each end are short, clean and perfectly aligned. The long part of the journey is a single wire, where lane mismatch cannot exist.

A signal moves at 15 cm per ns in a flex cable. What is the flight time of a 75 cm cable, and how does it compare with the 2 ns D-PHY limit?

Chapter 2

GMSL and FPD-Link: CSI-2 Over One Coax

Follow the pixels forward and the commands back along a single cable, and fix two cameras that share an address

The camera on the robot’s wrist needs four things from the torso. It needs power. It needs a way to receive settings, such as exposure. It needs a trigger that says “take the picture now”. And its pixels must travel the other way. With a ribbon you would run many wires. With a SerDes link you run one thin coaxial cable, the kind used for TV antennas, and it carries all four.

Two families do this. GMSL (Gigabit Multimedia Serial Link) comes from Maxim, now part of Analog Devices. FPD-Link (Flat Panel Display Link) comes from Texas Instruments. Both were built for car cameras. Robots borrow them because a car and a robot share the same problem: many cameras, long cables, a lot of electrical noise.

One cable, two directions

The cable runs two channels at very different speeds. The forward channel goes from camera to computer and is fast. It carries the video. The back-channel (also called the control channel) goes from computer to camera and is slow. It carries commands.

The numbers come from the data sheets. The TI DS90UB953-Q1, an FPD-Link III serializer, has a 4.16 Gbit/s forward channel and a 50 Mbit/s bidirectional control channel. The Analog Devices MAX9295 serializer family, in GMSL2 mode, runs at a fixed 3 or 6 Gbit/s forward and 187.5 Mbit/s in reverse, over cables longer than 15 m. Both accept coax or shielded twisted pair, and both can send power on the same coax. The Imaging Source summarises it for camera buyers: GMSL2 up to 6 Gbit/s per link, FPD-Link III up to 4, both reaching 15 m.

Now check that a real camera fits. The DS90UB953-Q1 data sheet advertises 2.3 megapixel at 60 fps. A raw sensor often sends 12 bits per pixel. The bit rate is 2,300,000 × 12 × 60 = 1.66 Gbit/s. That is well under 4.16 Gbit/s. The same sheet gives the serializer’s CSI-2 input as up to four lanes at 832 Mbit/s, or 3.33 Gbit/s in all. So the camera side and the cable side are matched with room to spare.

Power over the same wire

The serializer and the camera need electricity. Power over Coax, written PoC, puts a DC voltage on the same centre conductor that carries the data. A small coil (an inductor) at each end lets the DC pass but blocks the fast data, and a capacitor does the reverse. The DS90UB953-Q1 is described as a PoC-compatible transceiver. One cable then replaces the power wire, the data wires and the control wires.

The back-channel carries I2C, GPIO and triggers

A camera sensor is set up over I2C, a two-wire bus where a host writes numbers into the sensor’s registers. Every device on an I2C bus has a 7-bit address, like a house number. The wires of I2C cannot run 15 m. So the SerDes carries I2C for you. The data sheet says the back-channel frame is a 30-bit frame that contains I2C commands and GPIO data. GPIO is a plain pin that can be on or off, and a trigger is just a GPIO pulse.

Count the frame time. A 30-bit frame at 50 Mbit/s takes 30 / 50,000,000 s = 0.6 µs = 600 ns. We use this number again in Chapter 3.

Write to camera 2

The host sends one I2C write to camera 2. Warm dots are pixels flowing in. The pink packet is the command going out. Choose how the cameras are addressed, then press Send.

A model of the data path, not of any one chip. The 30-bit frame and 50 Mbit/s rate are from the DS90UB953-Q1 data sheet (SNLS552E). The address numbers 0x10, 0x18 and 0x19 are illustrative; many real sensors do ship with one fixed address.

Two identical cameras, one address

Here is the trap. Two cameras of the same model have the same fixed I2C address, say 0x10. The host needs to write to camera 2 only. If both cameras sit behind the same bus and both answer to 0x10, the write lands on both, or the two answers collide and the read returns garbage.

The fix is address aliasing (also called address translation). You give each camera a different alias the host will use, and the SerDes swaps the alias for the real address on the way out. The DS90UB953-Q1 data sheet shows the mechanism. Its TARGET_ID_ALIAS_0 register at address 0x41 holds the alias in bits 7:1. When a transaction is addressed to that alias, the transaction is remapped to the address in TARGET_ID_0 (register 0x39) before it crosses the control channel. A zero in the alias field disables the entry.

Worked example. Camera 1 and camera 2 both have real address 0x10. You set alias 0x18 for camera 1 and 0x19 for camera 2. The host writes exposure to 0x19. The link chip on camera 2’s side sees alias 0x19, rewrites it to 0x10, and passes the write to camera 2 only. Camera 1 never sees the frame.

The failure shows as a symptom first: the second camera ignores its settings, or the first camera’s exposure changes when you tune the second. The measurement is a bus scan. On Linux, i2cdetect -y -r <bus> lists the addresses that answer, and a duplicate shows once or not at all. The fix is the alias table. The deserializer has a matching alias facility on its side; read its data sheet for the register names.

Two identical cameras both answer at I2C address 0x10 behind one deserializer. What is the standard fix?

Chapter 3

Triggering Across Links: Back-Channel GPIO vs PTP

Count the microseconds each trigger path costs, and see which offsets you can calibrate away and which you cannot

A robot arm swings a part past two cameras at 2 m/s. Camera A sees the part. Camera B sees it from the side. Software later matches the two pictures to find the part’s position in 3D. This only works if both pictures show the part at the same instant. If camera B is 1 ms late, the part has moved 2 m/s × 0.001 s = 2 mm. The 3D point is wrong by 2 mm, and no filter can tell why.

So we need the cameras to take pictures together. Two ways exist. Either a wire sends a hardware trigger, a pulse that starts the exposure, to all cameras at once. Or every camera runs a shared clock and stamps its frames, and software lines the frames up by stamp. This chapter covers the first. Chapter 4 covers the second.

What delays a trigger

Every trigger takes time to arrive. The delay is two parts. The first is fixed: it is the same every time. It comes from cable length and the chip’s design. The second is jitter: it changes from one trigger to the next. You can measure a fixed delay once and subtract it. You cannot subtract jitter. It sets the floor.

Δtmax
The worst-case time between the two exposures starting.
dA, dB
The fixed delay from the trigger source to each camera.
jA + jB
The jitter on each path, taken at its worst. We add them because the two paths are independent.
Δx
How far a moving object travels during that offset.
v
The object’s speed in metres per second.

The paths and their numbers

Path 1, a software trigger. A program sends a command to each camera in turn. The command waits in the operating system, in a driver queue and on a bus. Its delay can swing by milliseconds. Many plain USB webcams have no trigger input at all, so this is all they offer.

Path 2, back-channel GPIO. The pulse enters the deserializer, rides the control channel in the next 30-bit frame, and leaves the serializer next to the camera. The DS90UB953-Q1 data sheet (Table 6-7) gives typical numbers for a GPIO signal on the back-channel. In synchronous mode, with a 50 Mbit/s back-channel, the latency is 1.5 µs with 0.7 µs of jitter. With a 10 Mbit/s back-channel, in non-synchronous modes, it is 3.2 µs with 3 µs of jitter. At 2.5 Mbit/s it is 12.2 µs with 12 µs of jitter.

Path 3, FrameSync. The same data sheet describes a FrameSync signal, a GPIO pulse the deserializer fans out to all its serializers through the back-channel. The expected skew between serializers is on the order of one back-channel frame, 600 ns at 50 Mbit/s. That is the 30 bits / 50 Mbit/s we counted in Chapter 2.

Path 4, PTP over Ethernet. Here there is no trigger wire. All devices share a clock using the Precision Time Protocol (IEEE 1588; its profile for Ethernet networks that carry time-critical traffic is IEEE 802.1AS, called gPTP). The design goal of 802.1AS is end-point accuracy of 1 µs or better across seven hops, as stated in IEEE 802.1 working-group material. Each device then starts its exposure at a scheduled clock time, or stamps the frame it took. Deterministic Ethernet builds this path in depth, and Time and Sync shows how stamps feed a filter.

Cable length adds a little. A signal in coax moves at roughly two thirds of light speed, which is about 5 ns per metre. A 15 m cable adds 75 ns. A 3 m cable adds 15 ns. The two differ by 60 ns. That is small beside 1.5 µs of latency, but it is a fixed offset that never changes.

Climb the trigger ladder

Pick a path. Set the coax length of camera A and camera B. The bars use a log axis: each grid step is ten times longer. Compare the worst case with one sensor row and one frame.

3 m
15 m

GPIO: 1.5 µs ± 0.7 µs, from DS90UB953-Q1 Table 6-7 (50 Mbit/s, synchronous mode). FrameSync: up to 0.6 µs skew, same data sheet. PTP: 1 µs, the 802.1AS seven-hop goal, with link delay measured and removed by the protocol. Software: 1000 µs of jitter is illustrative; measure your own. Coax at 5 ns/m is illustrative (about two thirds of c). A sensor row of 14.8 µs assumes 1125 total lines in a 16.67 ms frame, typical 1080p timing. The object speed is 2 m/s.

The failure you can find with a flash

Unequal cable lengths give a fixed inter-camera offset. The symptom: moving things always sit a little ahead in one camera’s picture. The measurement is the strobe test from Sensor to CSI-2: flash an LED once, and read which row of each camera caught the light. If camera B always catches it two rows later than camera A, you have a fixed offset of about two rows. The fix: either equalise the cables, or store the fixed offset and shift B’s timestamps by it. Jitter has no such fix. You reduce it by choosing a faster back-channel or a better path.

Camera A has a 3 m trigger cable and camera B has 15 m. The offset between them is the same on every frame, 60 ns. Which description fits it, and what is the cure?

Chapter 4

GigE Vision and Hardware Timestamps

Count the packets in one frame, find the frame rate a gigabit port can carry, and learn where the clock stamp must be taken

A camera hangs over a conveyor belt, 40 m from the cabinet that holds the computer. Ribbon cable is out of the question. A SerDes would work, but the factory already runs Ethernet cable everywhere, and every technician knows how to crimp it. So the camera speaks Ethernet.

GigE Vision is the industry standard that lets a camera do this. It is maintained by the machine vision industry association. The camera is an ordinary Ethernet device. A control protocol sets exposure and starts the stream. A streaming protocol, called GVSP, chops each frame into numbered packets and sends them as UDP datagrams, the simple fire-and-forget kind of network message. If the receiver sees a gap in the numbers, it asks for a resend of the missing packets. Vendors such as Pleora and Teledyne DALSA quote a reach of up to 100 m over Cat5e or Cat6 cable.

How many packets is one frame?

Take a 1080p camera that sends one byte per pixel (Mono8, a grey image). One frame is 1920 × 1080 × 1 = 2,073,600 bytes. Ethernet has a maximum transmission unit, the MTU, which is the biggest packet allowed. The usual MTU is 1500 bytes. The IP header takes 20 bytes and the UDP header takes 8, so 1500 − 28 = 1472 bytes of picture fit in each packet.

The number of packets is 2,073,600 / 1472 = 1408.7, rounded up to 1409. Each packet also costs 38 bytes on the wire for the Ethernet preamble, header, check sequence and the gap between packets. So each packet adds 28 + 38 = 66 bytes of overhead. (We ignore the few bytes of the GVSP header; check the specification for its exact size.) The wire carries 2,073,600 + 1409 × 66 = 2,166,594 bytes per frame.

A gigabit port moves 1,000,000,000 bits per second, which is 125,000,000 bytes per second. One frame then takes 2,166,594 / 125,000,000 = 17.3 ms. The fastest this port can go is 1 / 17.3 ms = 57.7 frames per second. A 60 fps camera does not fit. A vendor comparison quotes about 115 MB/s as the usable rate of a gigabit port, which agrees with this arithmetic once the host side adds its own cost.

Now use jumbo frames: set the MTU to 9000. Each packet carries 8972 bytes of picture. The frame needs 232 packets. The wire carries 2,073,600 + 232 × 66 = 2,088,912 bytes, taking 16.7 ms, or 59.8 fps. Jumbo frames cut the packet count six-fold, from 1409 to 232, which also cuts the work the host does per second. They do not make a 60 fps Mono8 stream fit: 59.8 is still below 60. For colour (RGB8, three bytes per pixel) the same frame is 6.2 MB and needs about 50 ms of wire time with jumbo frames (52 ms at MTU 1500), so a gigabit port gives you about 20 fps at best.

Fill the gigabit port

The top bar is one frame period. The coloured part is the time the frame spends on the wire. The lower strip shows how late a software timestamp is compared with a hardware one.

30 fps
30 µs

1080p frames, 125 MB/s line rate, 66 bytes of IP, UDP and Ethernet overhead per packet, GVSP header ignored: arithmetic from the Ethernet and IP header sizes. Host delay is illustrative: the time from a packet reaching the wire to the kernel stamping it in software. "Tens of microseconds" is a typical order, not a guarantee; measure on your own node.

Where the clock stamp is taken

Chapter 3 started exposures together. This chapter lines frames up by stamp. A timestamp is the time, read off a clock, written next to a frame. For two cameras on a network to agree, their clocks must agree. PTP, the Precision Time Protocol (IEEE 1588), makes one clock the boss and has every other device copy it. The Linux tools are ptp4l and phc2sys from the linuxptp package. GigE Vision 2.0 added PTP, so the camera’s own clock follows the network and the camera stamps each frame at the start of exposure. That stamp is taken at the camera. It does not depend on how busy the host is.

The host side matters for the clock itself. To copy the boss, the host must note exactly when a sync message arrives. The best place to do this is in the network card, at the instant the packet touches the wire. That is a hardware timestamp. If the card cannot, the kernel stamps the packet later, when it handles the interrupt. That is a software timestamp. It is late by whatever the host was doing, typically tens of microseconds.

The failure shows as one node’s clock offset in the ptp4l log wandering by tens of microseconds while the other nodes hold steady. The measurement is ethtool -T <interface>. It prints the timestamping modes the card and driver support. You want to see hardware-transmit, hardware-receive and hardware-raw-clock (the flags are named SOF_TIMESTAMPING_TX_HARDWARE, RX_HARDWARE and RAW_HARDWARE), plus a PTP Hardware Clock index that matches a /dev/ptp device. If only the software flags appear, that node has the problem. The fix is a card with hardware timestamps. Run the check on every node in the fleet, not on one.

A 1080p Mono8 camera needs 60 fps on one gigabit port with jumbo frames. The arithmetic gives 59.8 fps at most. What is the right conclusion?

Chapter 5

USB3 and UVC: A Shared Pipe With a Booking Office

See why the second camera on a hub fails to start, and count how many streams one USB controller can carry

It is week one of a robot prototype. You plug four USB webcams into a four-port hub. You open them one at a time. The first works. The second works. The third fails with a cryptic error. You unplug the hub, plug the third camera straight into the computer, and it works. Nothing is wrong with any camera. The hub ran out of something.

That something is bandwidth, and USB treats it in a special way. This chapter explains the rule, so you can count it before you buy the hub.

UVC and the booking office

Most USB webcams follow UVC, the USB Video Class. UVC defines how a camera describes itself and sends frames, so one driver handles every brand. On Linux that driver is uvcvideo, and the pictures show up as a V4L2 device, the same buffer queue as in V4L2 and the Buffer Queue.

USB has several transfer types. Video uses isochronous transfers. The word means “same time”. A device does not fight for the wire. Instead, the host controller acts like a booking office. When a camera starts, it asks for a fixed slice of every 125 µs or 1 ms time window. If the office has the room, it books it, and the camera keeps that slice for as long as it streams, whether it sends data or not. If the office does not have the room, it says no, and the stream does not start. Nothing is shared at the last moment; it is all decided at start. Buses on the Wire builds this idea from the device side.

Worked example: USB 2.0, then USB3

The Good Penguin, a Linux consultancy, worked through a real case on USB 2.0 high speed. The bus runs at 480 Mbit/s. At most 80% may be booked for isochronous traffic, which is 384 Mbit/s, and at most 100 µs of each 125 µs microframe. One camera endpoint asked for 2 packets of 800 bytes in each microframe, which is 1600 bytes × 8000 microframes per second = 12.8 MB/s = 102.4 Mbit/s of payload. The kernel books it as up to about 130 Mbit/s once the USB protocol overhead is counted. Two such streams use 260 Mbit/s. A third would need 390 Mbit/s, which is more than 384, so the third request fails. The kernel returns -ENOSPC (“no space left on device”), and dmesg shows uvcvideo: Failed to submit URB 0 (-28).

USB 3.2 Gen 1 (the old “USB 3.0”) signals at 5 Gbit/s. It uses an 8b/10b code, which sends 10 bits on the wire for every 8 bits of data. That leaves 5 × 8/10 = 4 Gbit/s, or 500 MB/s, before any protocol overhead. Practical drives reach 400 to 450 MB/s. We model the camera budget with an extra 80% reservation limit, copying the USB 2.0 rule. This is illustrative: read the real limit for your controller from the kernel. The usable budget becomes 4 × 0.8 = 3.2 Gbit/s = 400 MB/s.

Now count. One 1080p60 camera in YUY2 (a format with 2 bytes per pixel) sends 1920 × 1080 × 2 × 60 = 248.8 MB/s. One fits in 400 MB/s. Two need 497.7 MB/s and do not. Even though the USB 3 line rate of 500 MB/s looks big enough for two on paper, the booking rule says no.

Book the hub

Each block is one camera asking for a slice of the budget. The line is the usable limit. The first block that crosses it is refused.

3

Budget: 5 Gbit/s × 8/10 × 80% = 3.2 Gbit/s = 400 MB/s per controller. The 80% rule is the USB 2.0 figure applied to USB3 for teaching; check your controller. MJPEG at 10:1 is illustrative; real compression depends on the scene. Cameras split between two controllers alternate: 1, 3, 5 on the first and 2, 4, 6 on the second. The 5 Gbit/s signalling and 8b/10b coding are from the USB 3.2 Gen 1 specification as summarised by the sources in the Field Guide.

The failure and the fix

The symptom: the second or third camera fails to start. A tool such as v4l2-ctl or OpenCV reports a failed VIDIOC_STREAMON or “No space left on device”. The measurement: run lsusb -t and see whether both cameras hang under the same root hub, which means one controller. The kernel log shows the refusal. The fix, in order of cost: lower the frame rate or resolution; switch the camera to a compressed format such as MJPEG; plug cameras into different root ports on different controllers (the toggle in the device); or leave USB for a link built for many cameras.

The other USB cost: latency

USB cameras also carry a delay that is easy to miss. Transitive Robotics measured the delay from light to screen in a robot video pipeline. They found most of it came from the camera and the USB bus, about 100 ms. The H.264 encode and decode took around 10 ms each or less, and WebRTC added about 10 ms. Part of the 100 ms is the frame itself: a frame is only ready after its last row is read, which at 30 fps is up to 33.3 ms after exposure begins. A driver queue of three buffers holds three frames, which can add 100 ms more (an illustrative bound, not a measurement). For a robot that must react, that delay matters more than the bandwidth.

Two 1080p60 YUY2 cameras share one USB3 controller with a 400 MB/s booking budget. Each camera sends 248.8 MB/s. What happens?

Chapter 6

Aggregate Ingest and the Memory Bus

Add up every stream and every pass over it, then compare the total with the speed of the computer’s memory

The robot runs. Six cameras stream. The links are fine: no CRC errors, no refused USB bookings, every PTP stamp in range. Yet the vision program drops one frame in ten. You look at the CPU monitor. It reads 15% busy. The processor is idle and frames are still lost. What is full?

The answer is the road that every part of the computer shares: the main memory. Every camera frame lands in DRAM, the big pool of memory, and every stage of the vision pipeline reads it back and writes a new copy. A link can be perfect and the memory can still be the limit.

One frame makes several trips

Follow one frame through a typical camera pipeline. The camera interface writes the raw frame into memory: that is one pass over the frame’s bytes. The ISP, the image signal processor that cleans and converts the raw data, reads the frame: a second pass. It writes the cleaned frame back: a third. The neural network engine, the NPU, reads the cleaned frame: a fourth. We count 4 passes in this plain pipeline. A display, a video encoder or a second network adds a pass each.

Each pass moves the full frame again. The traffic on the memory bus is then the data rate of the pixels times the number of passes. Add all cameras and add the other users of memory: the CPU, the GPU, the weights the network reads, the display.

N
The number of cameras.
B
The data rate of one camera, from Chapter 0. For 1080p60 RGB8 it is 373.2 MB/s.
k
The number of passes over each frame in memory. We use 4 as an illustrative value.
O
Everything else that uses memory at the same time.
η
The usable share of the peak. DRAM never delivers 100%; we use 70% as an illustrative value.
M
The peak bandwidth of the memory, from its width and speed.

How fast is memory?

The peak is easy to compute. A memory bus moves a fixed number of bytes with every beat, and it makes a fixed number of beats per second. Peak = (bus width in bits / 8) × transfers per second. NVIDIA lists the Jetson AGX Orin developer kit with 256-bit LPDDR5 at 204.8 GB/s. Check it: 256 / 8 = 32 bytes, times 6.4 billion transfers per second = 204.8 GB/s. A small system might have one 32-bit LPDDR4x channel at 4266 mega-transfers per second: 4 bytes × 4.266 = 17.1 GB/s. A middle part with 128 bits at the same speed gives 16 × 4.266 = 68.3 GB/s. (The last two are computed examples, not named products.)

Now the worked case. Six 1080p60 RGB8 cameras are 6 × 373.2 = 2.24 GB/s of pixels. Four passes make 8.96 GB/s of memory traffic. On the small part, 70% of 17.1 is 11.9 GB/s usable. Add 2 GB/s of other work and the bus is at 11 of 11.9 GB/s: it fits, with 8% to spare. Change to six 4K30 cameras and the pixel rate becomes 6 × 746.5 = 4.48 GB/s, the traffic 17.9 GB/s. That is 150% of the usable bus. On the AGX Orin, the same 17.9 GB/s is 12.5% of the usable 143 GB/s. Same cameras, same links, very different computers.

Meter the memory bus

The warm bar is camera traffic. The grey bar is everything else. The long line is the usable limit. When the sum passes it, frames drop even though the links are fine.

6
4
2.0 GB/s

Peaks: 204.8 GB/s is NVIDIA's figure for the Jetson AGX Orin developer kit (256-bit LPDDR5), reproduced by 32 bytes × 6.4 GT/s. The 17.1 and 68.3 GB/s parts are computed examples (32-bit and 128-bit at 4266 MT/s). The 70% usable share, the passes and the other load are illustrative. Dropped-frame share is the part of camera traffic the bus cannot serve, a simple model.

The failure and how to see it

The symptom is lost frames while the CPU idles and the links report no errors. The CPU is not the limit, so a CPU monitor tells you nothing. The measurement is the memory system’s own counters. Chip makers expose counters for the DRAM controller and for the NoC, the network on chip that links the camera interface, ISP, NPU and memory. On a Jetson, tegrastats prints the load of the external memory controller; other chips have performance-monitor units you read with perf. Read the counters while the cameras run and while they do not, and compare. The fix: fewer passes (let the ISP hand frames to the NPU without a trip through memory), lower the resolution or rate, or move to a computer with a wider memory bus.

The link choice feeds this budget too. A link that delivers less data per camera, such as a compressed USB stream, may still expand to full size before the NPU reads it. Count the frame where it sits in memory, not where it travelled on the cable.

Six 1080p60 RGB8 cameras make 2.24 GB/s of pixels. The pipeline makes 4 passes over each frame. What is the memory traffic from cameras?

Chapter 7

Cable, Connector and EMI Realities for Software People

Read an eye diagram, connect rise time to bandwidth, and find an intermittent link fault by swapping the cable

The robot passes every test on the bench. Then it walks. Every few minutes the wrist camera shows a burst of torn rows and recovers. The log shows CRC errors in bursts. You re-flash the driver. You change the buffer count. Nothing helps, because the fault is not in software. It is a cable that flexes at the wrist, and a connector that opens a hair at each step.

A software person can find this fault in ten minutes with the right habit. This chapter gives the physics for it and the habit.

An edge needs bandwidth

A digital signal is a voltage that jumps between low and high. The jump is not instant. The time it takes to climb from 10% to 90% of the way is the rise time, tr. A wire, a cable and a connector all act like a low-pass filter: they pass slow changes and blunt fast ones. How fast a change they pass is their bandwidth, in hertz. For a simple filter the two are tied by a rule that every signal engineer knows.

BW
The bandwidth at which the channel has lost half its power (the −3 dB point), in hertz.
tr
The 10% to 90% rise time of an edge the channel can pass, in seconds.

tr = 0.5 ns → BW ≈ 0.35 / 0.5 ns = 700 MHz    and    BW = 420 MHz → tr = 0.83 ns

Now connect it to a camera link. Data at 832 Mbit/s lasts 1.2 ns per bit. If the channel is slow, the edge of one bit is still rising when the next bit begins, and the bits smear into each other. That smear is called inter-symbol interference. To keep it small, a common rule of thumb asks for a channel bandwidth of about 0.7 times the bit rate. We use it as an illustrative rule here. For 832 Mbit/s that is 580 MHz, so tr = 0.35 / 0.58 GHz = 0.6 ns, half a bit. At 6 Gbit/s, the same rule asks for 4.2 GHz and an edge of 83 ps.

Cables lose the fast part first

Real cables lose more at high frequency. Two effects cause it. The current in a conductor crowds to its surface as frequency rises (the skin effect), so the wire resists more. And the insulation absorbs a little energy at each swing. In a first model, the loss in decibels grows with the length and with the square root of the frequency. A 3 dB loss is half the power. The frequency where the loss reaches 3 dB is the cable’s bandwidth, and it falls with the square of the length. Double the cable and you cut its bandwidth by four.

This explains the shape of everything in this lesson. A ribbon cable is lossy and has no help, so its reach is short and gets shorter as the lane gets faster. A SerDes receiver adds an equaliser, a filter that boosts exactly the high frequencies the cable ate. It also recovers the clock from the data. So a thin coax can run 15 m.

Watch the eye close

Each trace is a few bits laid over each other. An open eye in the middle means the receiver can tell 0 from 1. Pick a cable, stretch it, add noise from a nearby motor.

0.3 m
5%

A first-order model, not a measurement. Cable loss at 1 GHz is illustrative: 8 dB/m for ribbon, 0.9 dB/m for thin coax. The loss at the Nyquist frequency (half the bit rate) grows as length times the square root of frequency. The SerDes equaliser recovers 25 dB (illustrative); the ribbon and plain coax have none. The traces pass random bits through a one-pole filter whose 3 dB point is solved from the loss left over, plus Gaussian noise; the rise time shown is 0.35 / BW. Real links add reflections, jitter and crosstalk.

The habit: swap the cable

An intermittent link error has only a few possible homes: the cable, a connector, the port on the board, or the noise around it. You can tell which with swaps. First, note the error counter for a minute. Then swap the two cables between two ports. If the error moves with the cable, it is the cable. If it stays on the port, it is the port or the board. If it follows neither and appears when a motor starts, it is noise. Wiggle the connector while the counter runs: a counter that jumps with the wiggle names the connector.

You need a counter to read. The DS90UB953-Q1 offers one. Its built-in self test sends a pseudo-random stream from the serializer. The deserializer counts bad bits in a register named BIST_ERR_COUNT (address 0x57 in the data sheet), and the serializer also monitors back-channel CRC errors. Run the test while you flex the cable and watch the count. This is a far better tool than staring at torn video.

Three cheap habits cut the faults. Use a cable made for the link, with the right shield. Keep it away from motor wires and switching power. And add strain relief so the bend happens in the cable and not at the connector. The bench lessons in Buses on the Wire and Bench and Root Cause show how to measure the signal itself.

A link shows CRC errors in bursts. You swap the cables between two ports and the errors now appear on the other port. What do you conclude?

Chapter 8

Field Guide: Choosing a Camera Link

Keep the numbers, the checklist and the calculator, and know which figures to look up before you quote them

A camera link has four limits: bandwidth per camera, cable reach, port count, and the memory bus behind it all. A SerDes such as GMSL2 or FPD-Link carries a CSI-2 camera 15 m over one coax because it equalises and re-times the signal, and because it returns a back-channel for I2C, GPIO and triggers. GigE Vision gives 100 m and a network clock. USB3 gives a quick prototype and a shared booking budget. The ribbon is for the camera on the same board. Count first, then buy.

The numbers, with where each came from

QuantityValueSource
One camera, 1080p60 RGB8373.2 MB/s, 2.99 Gbit/sArithmetic: 1920 × 1080 × 3 × 60
Six of them2.24 GB/sArithmetic
D-PHY flight-time limit2 ns, about 25 to 30 cmTI E2E forum reply quoting the D-PHY specification; The Imaging Source recommends about 30 cm
DS90UB953-Q1 CSI-2 port4 lanes at 832 Mbit/sTI data sheet SNLS552E
FPD-Link III serializer4.16 Gbit/s forward, 50 Mbit/s control, 30-bit frame = 600 nsTI data sheet SNLS552E
GMSL2 serializer family3 or 6 Gbit/s forward, 187.5 Mbit/s reverse, over 15 mTrade-press summary of the MAX9295 data sheet; confirm in the Analog Devices data sheet for your part
Back-channel GPIO1.5 µs typical latency, 0.7 µs jitter at 50 Mbit/sTI data sheet Table 6-7
FrameSync skewabout 600 ns at 50 Mbit/sTI data sheet section 6.3.5.1
gPTP accuracy goal1 µs over 7 hopsIEEE 802.1 working-group presentations
GigE port, 1080p Mono8, MTU 15001409 packets, 17.3 ms, 57.7 fps at mostArithmetic on Ethernet, IP and UDP header sizes
GigE reachup to 100 m on Cat5e or Cat6Teledyne DALSA and Pleora product pages
USB 3.2 Gen 15 Gbit/s signalling, 4 Gbit/s after 8b/10b, 500 MB/sUSB 3 specification summaries
USB 2.0 isochronous booking80% of 480 Mbit/s = 384 Mbit/s; failure is ENOSPC (-28)The Good Penguin, EHCI scheduler article
USB camera plus bus latencyabout 100 msTransitive Robotics, glass-to-glass breakdown
Jetson AGX Orin memory256-bit LPDDR5, 204.8 GB/sNVIDIA AGX Orin developer kit datasheet; equals 32 bytes × 6.4 GT/s
Bandwidth from rise timeBW ≈ 0.35 / trStandard first-order result
MIPI A-PHY v1.0up to 15 m, 2 to 16 Gbit/s, IEEE 2977-2021MIPI Alliance announcements; the specification is for members, so verify before quoting rates

Two things in this lesson are open items. We did not verify MIPI A-PHY link behaviour in a product, and we did not check NVIDIA’s Holoscan Sensor Bridge at all. Do not quote GMSL or A-PHY rates without the specification for your exact part.

The link chooser

LinkPer cameraReachControl and triggerChoose it when
CSI-2 ribbon4 lanes, about 3.3 Gbit/s in our exampleabout 30 cmI2C and GPIO directThe camera sits on the same board.
GMSL2 or FPD-Link3 to 6 or 4.16 Gbit/s15 m coaxI2C, GPIO, FrameSync on the back-channel; power over coaxMany cameras, moving arms, tight sync.
GigE Vision1 Gbit/s (faster ports exist)100 mEthernet control, PTP stampsDistance, standard cabling, a shared network clock.
USB3 or UVCshared, about 400 MB/s booked per controllera few metresUVC controls; few have a trigger inputA prototype, or one or two cameras.

The checklist

  1. Write each camera’s mode: width, height, bytes per pixel, fps. Compute MB/s.
  2. Pick the link by reach first, then by capacity per camera, then by ports.
  3. Check shared pipes: sum the cameras on any hub or controller against the booking budget.
  4. Plan I2C addresses. Give identical cameras different aliases.
  5. Choose a trigger path. Write its fixed delay and its jitter next to the sensor row time.
  6. Run ethtool -T on every node that needs PTP.
  7. Multiply the pixel rate by the number of passes in memory. Compare with 70% of the DRAM peak.
  8. Choose cables made for the link, with strain relief at every bend. Keep a spare for swap tests.
  9. Read a link-error counter or BIST count while you flex the cable.

The core as code

This calculator is the hero instrument in a few lines. Edit the table with the numbers from your own data sheets.

python
# link: (capacity Gbit/s per camera, efficiency, reach m, ports, shared pipe?)
LINKS = {
    "csi2": (3.328, 1.00, 0.30, 6, False),   # 4 lanes x 832 Mbit/s
    "gmsl2": (6.0,  0.90, 15,   8, False),   # efficiency is illustrative
    "gige":  (1.0,  0.957, 100, 8, False),
    "usb3":  (4.0,  0.80, 3,    4, True),    # one controller, booking limit
}

def fits(n, w, h, bytes_pp, fps, link, dist_m,
         passes=4, dram_gbs=17.066, dram_eff=0.7):
    cap, eff, reach, ports, shared = LINKS[link]
    gbps = w * h * bytes_pp * fps * 8 / 1e9          # one camera
    need = gbps * n if shared else gbps
    mem  = n * w * h * bytes_pp * fps * passes / 1e9     # GB/s on the bus
    return {
        "bandwidth": need <= cap * eff,
        "reach":     dist_m <= reach,
        "ports":     n <= ports,
        "memory":    mem <= dram_gbs * dram_eff,
    }

print(fits(6, 1920, 1080, 3, 60, "gmsl2", 15))   # all True
print(fits(6, 1920, 1080, 3, 60, "usb3", 1))     # bandwidth False

Programming an I2C alias on a Linux host is also short. The register addresses below are for the DS90UB953-Q1 (data sheet SNLS552E): TARGET_ID_0 at 0x39 and TARGET_ID_ALIAS_0 at 0x41, with the 7-bit address in bits 7:1. The data sheet words them from the serializer toward a device on the remote side. The matching pair for a device on the camera side sits on the deserializer, under other register names, so read that data sheet first.

c
#include <sys/ioctl.h>
#include <linux/i2c-dev.h>
#include <i2c/smbus.h>

#define UB953_TARGET_ID_0       0x39
#define UB953_TARGET_ID_ALIAS_0 0x41

/* fd: an open /dev/i2c-N. real7: the device's true 7-bit address (for example 0x10).
   alias7: the address the host will use instead (for example 0x19). */
static int set_alias(int fd, unsigned ser_addr, unsigned real7, unsigned alias7)
{
    if (ioctl(fd, I2C_SLAVE, ser_addr) < 0) return -1;
    if (i2c_smbus_write_byte_data(fd, UB953_TARGET_ID_0, real7 << 1) < 0)
        return -1;                          /* bits 7:1 hold the address */
    return i2c_smbus_write_byte_data(fd, UB953_TARGET_ID_ALIAS_0, alias7 << 1);
}

The checks you run on a real board fit on a few lines of shell.

shell
i2cdetect -y -r 7          # which I2C addresses answer on bus 7
ethtool -T eth0            # hardware-transmit / hardware-receive / PTP Hardware Clock?
ptp4l -i eth0 -m           # watch the offset column against the grandmaster
lsusb -t                   # do both cameras hang under one root hub?
dmesg | grep -i uvcvideo   # look for: Failed to submit URB 0 (-28)
v4l2-ctl --list-devices    # which video nodes the cameras became

Where this sits

This lesson stands between the camera on the board and the system around it. Sensor to CSI-2 and V4L2 and the Buffer Queue come first. Low-Latency Video and The XR Frame Budget pick up the latency story. Deterministic Ethernet builds the PTP path in depth. Buses on the Wire covers I2C and the isochronous idea from the device side. Time and Sync shows how stamps feed estimation. The SoC and interconnect lesson on memory contention is planned for the microcontroller track and does not exist yet. For the wider robot context see Sensor and Actuator Integration and Embedded Linux.

The takeaway. Count before you build. Bandwidth, distance and ports decide the link. A SerDes wins on distance because it equalises, re-times and carries a back-channel. A shared pipe needs a sum. A fixed trigger offset can be calibrated; jitter cannot. And when frames drop with the CPU idle, read the memory counters.

Sources

All numbers in the devices are from these sources or are labelled illustrative. Every device is a model, not a measurement of real silicon. Now go back to the instrument at the top. Set six cameras at 4K30 on GMSL2 at 10 m, and explain which limits fail and why.

Multi-Camera Links
Back: V4L2 and the Buffer Queue · Deterministic Ethernet · Time and Sync · Back to Gleams