Skip to content

Pi 5 CSI-2: Camera can drop the first frame after stop and restart #5821

Closed
@njhollinghurst

Description

@njhollinghurst

Describe the bug

When using a CSI-2 camera with Raspberry Pi 5 (RP1 CFE), after stopping streaming and starting anew (e.g. using rpicam-vid), the first frame seems intermittently to be lost.

It's most likely because the CFE driver puts the SNPS CSI-2 Host into reset during cfe_stop_streaming() -> csi2_close_rx() -> dphy_stop(). Simulations suggest that this can result in a truncated data packet over the IDI bus, which confuses CSI2AXI and causes one or more later packets to be discarded before it gets back into sync.

Possibly the fix (if there is one) is either to reset CSI-2 Host less aggressively or reset CSI2AXI more aggressively, so that they remain in sync; or failing that, to defer stopping CFE until the camera has finished streaming.

cc @naushir @6by9

Steps to reproduce the behaviour

Not easily - need e.g. IM477 with synchronized cameras or external trigger to show the lost frame.

Device (s)

Other

System

rpi-6.1.y

Logs

No response

Additional context

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions