raspberrypi / raspiraw

Example app directly receiving raw data from CSI2 sensors
BSD 3-Clause "New" or "Revised" License
259 stars 88 forks source link

Get CSI2 data without I2C #77

Closed remusmp closed 1 year ago

remusmp commented 1 year ago

Hello,

Is it possible to get the CSI2 data without any I2C interaction? I am dealing with an experimental camera that has no I2C lines - it's still under development and all settings are hardcoded on the camera side. All I know is that it always outputs MIPI CSI2 data and it has no I2C. Should I attempt to customize raspiraw and bypass all I2C interactions or is there more to it?

Many thanks!

6by9 commented 1 year ago

I would recommend you use the kernel bcm2835_unicam driver rather than raspiraw.

Without knowing information about what form of CSI2 data it outputs, then you're going to have some problems. CSI2 packets have a data type field that designates either signalling or the image format (YUYV, RAW8, 10, 12, 14, 16, RGB, etc). The receiver must be told the correct data type for the image data, otherwise it will be discarded. It also needs to know the relevant geometry of the image buffer.

I did start on a Linux dummy image sensor driver that would largely just accept any image format and geometry so that the CSI2 receiver was correctly configured. I'll dig it out.

6by9 commented 1 year ago

I've dug out the dummy_sensor driver. Now at https://github.com/6by9/linux/tree/rpi-5.15.y-dummy_sensor, and will be a PR fairly soon.

remusmp commented 1 year ago

Hello 6by9,

Many thanks for rpi-5.15.y-dummy_sensor. It works! Really appreciate it!