RobertLukan / rpi-cm4-custom-board

8 stars 0 forks source link

Plan to support 22-pin CSI connector? #3

Open 923552514 opened 7 months ago

923552514 commented 7 months ago

Hello :-) Thank you for this fantastic project! Have you considered supporting a 22-pin connector with an additional 2 data lines? If it is possible to add a 22-pin connector with the implementation of the extra 2 data lines (same pinout as Raspberry Pi Compute Module 4 IO Board), it would enable the use of a 4-lane MIPI-CSI for higher bandwidth. (In fact, I am currently working on getting Sony IMX183 to work with the cm4. Once completed, I will share the project.)

RobertLukan commented 7 months ago

I was considering this option. However what I understood from the raspberry forum and RPI4CM data-sheet that RPI4 can only process(encode) one H264 at 1080p. So I wonder is there any benefit bringing additional two lanes to CAM1 ? If there is, one option would be to replace CAM1 connector with 22-pin as CAM0 supports only two lanes anyway. From the point of view of routing two additional lanes and changing the connector that is not an issue.

923552514 commented 7 months ago

I was considering this option. However what I understood from the raspberry forum and RPI4CM data-sheet that RPI4 can only process(encode) one H264 at 1080p. So I wonder is there any benefit bringing additional two lanes to CAM1 ? If there is, one option would be to replace CAM1 connector with 22-pin as CAM0 supports only two lanes anyway. From the point of view of routing two additional lanes and changing the connector that is not an issue.

Thank you for your response. The 4-lane CSI interface provides greater bandwidth for data transmission, and the IMX183 with its 20MP sensor requires a larger bandwidth for data transfer. For example:

IMX183, a 20MP camera, recording at 4k resolution, 30fps frame rate, and 10-bit ADC color depth. How many lanes are required at a minimum? MIPI CSI data rate = Resolution Width × Resolution Height × Bit Depth × Frame Rate × (1 + Additional Bandwidth Percentage) (1) According to the Raspberry Pi forum website (https://forums.raspberrypi.com/viewtopic.php?t=311683#p1864026), the maximum MIPI CSI speed is 1Gbps. (2) Rate calculation: 3840 2160 10 30 (1+20%) = 2985984000bps ≈ 2.98Gbps (3) lane = 2.98 / 1 ≈ 3, so a minimum of 3 lanes is required.

Therefore, for recording 4k resolution videos, a 4-lane CSI interface is needed. As for why a 22-pin 4-lane interface is still required when the Raspberry Pi only supports H.264, on the one hand, I think it's cool! On the other hand, it's because the bandwidth requirements of most high-resolution CMOS sensors are high (such as the IMX283 lens made by Arducam for DepthAI OAK). With support for a 4-lane CSI interface, I believe the Raspberry Pi will have more possibilities.

RobertLukan commented 7 months ago

Ok you have convinced me :) I will create another version(dev) with 4-lane CSI connector for CAM1. I have one small improvement to make anyway - adding a jumper or a switch that allows powering USB device on Data port. I will wait a bit more if there are any other suggestions and comments before I make another order with JLCPCB. I will also include a Qwiic connector as suggested.

Do you have any timeframe for your project ?