Skip to main content

MIPI CSI-2 cameras

The camera.mipi provider reports the image sensors behind the Modalix ISP. It rescans on media and video4linux uevents. Discovery opens device nodes read-only and issues query ioctls only; it never sets a format or link, and never streams.

Each /dev/mediaN of the simaai-v4l2-vid driver is read with MEDIA_IOC_G_TOPOLOGY, and each MEDIA_ENT_F_CAM_SENSOR entity in its graph is one camera. Other drivers' media devices (for example uvcvideo) are ignored.

Identity​

id is camera:<sensor entity name>, for example camera:imx477 5-001a: the sensor driver, I2C bus and address. libcamera uses the same name, so it is also the name CameraInput accepts. Two sensors with the same name, for example on two media devices, would share an id, so the scan fails with an error that names both media devices instead.

Fields​

FieldPresentMeaning
type, idalwayscamera, and the identity above
backendalwaysmipi
modelwhen the name has oneThe first word of the entity name, e.g. imx477
availabilityalways{"state": "unknown", "reason": ...}: the media controller has no read-only ownership state
camera_namealwaysThe sensor entity name, to pass to CameraInput
media_devicealways/dev/mediaN (routing only; not identity)
bus_infowhen reportedThe media device bus from MEDIA_IOC_DEVICE_INFO, e.g. platform:csi2video@1
ispalways{"state": "available", "device_path", "device_paths"}, or {"state": "unavailable", "reason"} with modes: []
csi_receiverwhen linkedThe entity the sensor's source pad links to, e.g. csidev-40c3000.csi
sensor_timingwhen readablepixel_rate (pixels/s), hblank_min, vblank_min, width, height, read from the sensor's /dev/v4l-subdevN
max_fpswith sensor_timingpixel_rate / ((width + hblank_min) * (height + vblank_min)), to two decimals

sensor_timing comes from the sensor's sub-device interface (named through /sys/dev/char/<major>:<minor>): the active format of the linked source pad (VIDIOC_SUBDEV_G_FMT), the current V4L2_CID_PIXEL_RATE, and the minimums of V4L2_CID_HBLANK and V4L2_CID_VBLANK. It is omitted when any of them is missing.

The ISP output nodes are the video4linux entries named isp_v4l2-vid-cap-out with card arm-isp-out. When several are present, only the modes they all share are reported.

Modes​

Modes are the ISP output formats and discrete sizes, which is what CameraInput can capture. Each mode has format (FourCC), width, height and isp_output: true. A mode carries frame_intervals, in the same form as for USB cameras, only when the ISP reports intervals for its size. The DevKit's ISP reports none, so its modes have no frame rate; max_fps and sensor_timing describe the sensor's limit.

Errors​

CodeWhen
io.permission_deniedA media device cannot be opened (EACCES, EPERM), or /dev cannot be listed (EACCES)
io.openAny other open or query failure of a media device
peripherals.discovery_failedAn unnamed sensor entity, or two sensors with the same name (their ids would collide)

A device that disappears mid-scan is skipped. ISP failures never fail the scan; they make isp unavailable with the reason.

Example​

The IMX477 on a Modalix DevKit, with modes abbreviated (nine in all: three formats, three sizes). The graph and ISP sizes are transcribed from the DevKit; the sensor-timing values are as the DevKit reports them but are covered by tests only.

{"type": "camera", "id": "camera:imx477 5-001a", "model": "imx477",
"availability": {"state": "unknown", "reason": "The media controller does not expose a reliable read-only ownership state; discovery does not acquire, configure, or stream from the camera."},
"modes": [{"format": "AR24", "width": 1920, "height": 1080, "isp_output": true},
{"format": "AR24", "width": 2048, "height": 1080, "isp_output": true}],
"backend": "mipi", "camera_name": "imx477 5-001a", "media_device": "/dev/media0",
"bus_info": "platform:csi2video@1",
"isp": {"state": "available", "device_path": "/dev/video1", "device_paths": ["/dev/video1"]},
"csi_receiver": "csidev-40c3000.csi",
"sensor_timing": {"pixel_rate": 840000000, "hblank_min": 9332, "vblank_min": 48,
"width": 1920, "height": 1080},
"max_fps": 66.18}