This tutorial is only for C790 and C779. It should be noted that C790 supports audio and supports resolution up to 1080P@60HZ, but C779 does not support audio and the resolution is only 1080P@50HZ
1. Edit /boot/config.txt (sudo permission required).
sudo nano /boot/firmware/config.txt
- Add the following content:
dtoverlay=tc358743
- If your modules C790 support audio, add the following content to enable audio support. If you use C779, please ignore this step
dtoverlay=tc358743-audio
- If (and only if) you have a device such as the C790 that supports the 22pin connector with all 4 lanes wired out, and are using a Compute Module with the CAM1 connector that also has all 4 lanes wired up, you can use:
dtoverlay=tc358743,4lane=1
- Then reboot the raspberry Pi board, this is very important!DON'T miss this step!
sudo reboot
- After adding the driver configuration, restart the Raspberry Pi for it to take effect. If the configuration is correct, execute ls /dev/video* in the terminal, and you should see video devices listed:
ls /dev/video1
/dev/video1
2. Execute the following command to find the media node corresponding to the CSI as media0, under the rp1-cfe (platform: 1f00128000.csi) field:
blikvm@blikvm:~ $ v4l2-ctl --list-devices
pispbe (platform:1000880000.pisp_be):
/dev/video20
/dev/video21
/dev/video22
/dev/video23
/dev/video24
/dev/video25
/dev/video26
/dev/video27
/dev/video28
/dev/video29
/dev/video30
/dev/video31
/dev/video32
/dev/video33
/dev/video34
/dev/video35
/dev/video36
/dev/video37
/dev/media1
/dev/media2
rp1-cfe (platform:1f00128000.csi):
/dev/video0
/dev/video1
/dev/video2
/dev/video3
/dev/video4
/dev/video5
/dev/video6
/dev/video7
/dev/media0
rpivid (platform:rpivid):
/dev/video19
/dev/media3PS: Please remember the media number in line 33. The following commands must use the same media number.
2.1 Create an EDID file with the following command.
sudo nano edid60.txt
00 ff ff ff ff ff ff 00 52 62 00 37 00 00 00 00 01 1b 01 03 80 46 28 78 0a cf 74 a3 57 4c b0 23 09 48 4c 21 08 00 b3 00 95 00 a9 40 90 40 81 00 81 80 81 40 01 01 02 3a 80 18 71 38 2d 40 58 2c 45 00 00 d0 52 00 00 1e 02 3a 80 d0 72 38 2d 40 10 2c 45 80 00 d0 52 00 00 1e 00 00 00 fc 00 33 32 46 48 44 5f 4c 43 44 5f 54 56 0a 00 00 00 fd 00 30 3e 0f 46 11 00 0a 20 20 20 20 20 20 01 38 02 03 30 f1 52 10 9f 04 13 05 14 03 02 11 12 20 21 22 15 16 01 06 07 2c 09 07 07 15 07 50 57 06 00 3f 06 c0 83 01 00 00 67 03 0c 00 10 00 b0 2d 01 1d 80 3e 73 38 2d 40 7e 2c 45 80 00 d0 52 00 00 1e 01 1d 80 d0 72 1c 2d 20 10 2c 25 80 00 d0 52 00 00 9e 01 1d 00 bc 52 d0 1e 20 b8 28 55 40 00 d0 52 00 00 1e 01 1d 80 18 71 1c 16 20 58 2c 25 00 00 d0 52 00 00 9e 00 00 00 00 00 00 00 8f
Copy the above content and paste them into the file then save it.
2.2 Loading the EDID data with the following command:
For the Debian version 12 (Bookworm),
v4l2-ctl -d /dev/v4l-subdev2 --set-edid=file=/home/pi/1080P60EDID.txt --fix-edid-checksums
For the Debian version 13 (trixie),
v4l2-ctl -d /dev/v4l-subdev2 --set-edid=file=/home/pi/1080P60EDID.txt
PS:Pay attention to the directory of your edid file
3. Locate the node corresponding to tc358743 as v4l-subdev2, and the pad0 of rp1-cfe-csi2_ch0 as video0:
- Note: The /dev/media0 here comes from the media number obtained in the previous step.
media-ctl -d /dev/media0 -p
4. To query the current input source information, if the resolution displays as 0, it indicates that no input source signal has been detected. In this case, you should check the hardware connections and follow the steps mentioned above to troubleshoot.
- v4l2-ctl -d /dev/v4l-subdev2 --query-dv-timings
blikvm@blikvm:~ $ v4l2-ctl -d /dev/v4l-subdev2 --query-dv-timings
Active width: 1920
Active height: 1080
Total width: 2750
Total height: 1125
Frame format: progressive
Polarities: -vsync -hsync
Pixelclock: 74250000 Hz (24.00 frames per second)
Horizontal frontporch: 0
Horizontal sync: 830
Horizontal backporch: 0
Vertical frontporch: 0
Vertical sync: 45
Vertical backporch: 0
Standards:
Flags:5. Confirm the current input source information.
v4l2-ctl -d /dev/v4l-subdev2 --set-dv-bt-timings query
6. Initialize media0.
media-ctl -d /dev/media0 -r
Note: The /dev/media0 here comes from the media number obtained in the step 2.
7. Connect CSI2's pad4 to rp1-cfe-csi2_ch0's pad0.
media-ctl -d /dev/media0 -l ''\''csi2'\'':4 -> '\''rp1-cfe-csi2_ch0'\'':0 [1]'
8. Configure the media node.
media-ctl -d /dev/media0 -V ''\''csi2'\'':0 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]' media-ctl -d /dev/media0 -V ''\''csi2'\'':4 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'
Note: The /dev/media0 here comes from the media number obtained in the step 2.
9. Set the output format.
v4l2-ctl -v width=1920,height=1080,pixelformat=RGB3
10. Capture two frames for testing to verify if tc358743 is functioning properly. Other methods, such as using GStreamer, are not currently available.
v4l2-ctl --verbose -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat='RGB3' --stream-mmap=4 --stream-skip=3 --stream-count=2 --stream-to=hdmiin.yuv --stream-poll
11. If you have installed a desktop version of Raspberry Pi, you can use ffplay to directly play YUV files.
ffplay -f rawvideo -video_size 1920x1080 -pixel_format bgr24 hdmiin.yuv
On a Windows computer, you can use software like 7yuv to view .yuv files. For the tutorial with an input format of 19201080, you should select BGR888 in the top right corner of 7yuv and set the resolution to 19201080 to view the two frames you just captured.
Enable comment auto-refresher
Anonymous user #4
Permalink |
Anonymous user #3
Permalink |
Anonymous user #2
Permalink |
Anonymous user #2
Anonymous user #1
Permalink |