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.
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 |