C779-Software
TC358743 HDMI to CSI-2 install instructions.
The Raspberry Pi Foundation has updated several versions recently;
The use guide of C779/C790/X630 depends on the official Raspberry Pi OS version you are using. Different versions have different usage methods. If you have some questions, please contact us and attach the osversion you are using.(Email: support@geekworm.com)
You can refer to Raspberry pi official forum post
To use the kernel drivers, please update your system. There are a few things that have changed with the 5.4 kernel, so these instructions are for 5.4 or later. If "uname -a" reports anything less, then fix this before proceeding.
pi@raspberrypi:~ $ uname -a Linux raspberrypi 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l GNU/Linux
1. Update & upgrade the raspberry pi system (It will take a long time depend on the different country)
sudo apt-get update sudo apt-get upgrade
2. Enable camera module (the camera is enabled by default in Raspberry pi Bullseys/Bookworm OS)
sudo raspi-config
Navigate to 'Interfacing Options' and hit Enter. Now select the 'Camera' option, and hit the Enter key to enable it. Select “Finish” and select to reboot your Raspberry Pi.
[NOTE] reboot is important!!
3. Edit /boot/config.txt (that will need sudo)
sudo nano /boot/firmware/config.txt
Add the line:
dtoverlay=tc358743
Add the line if your CSI module supports audio also like C790
dtoverlay=tc358743-audio
please append the following setting if (and only if) you have a device such as the Auvidea B102 that supports the 22pin connector with all 4 lanes wired out(such as X1300), 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
4. Check the amount of memory assigned to the CMA heap with "dmesg | grep cma". The first line should be along the lines of
pi@raspberrypi:~ $ dmesg | grep cma [ 0.000000] cma: Reserved 256 MiB at 0x000000001ec00000
If it reports less than 96MB assigned to CMA, then please /boot/firemare/cmdline.txt as following:
sudo nano /boot/firmware/cmdline.txt
then add cma=96M
to the start of the line.
5. Reboot.
sudo reboot
If all is well you should get a /dev/video0 device, and "v4l2-ctl --list-devices" will tell you that it is provided by Unicam. After connecting all the cables, power on the Raspberry Pi, the C779/C790 indicator light is normally green, and after opening the Raspberry Pi terminal, enter the following command:
pi@raspberrypi:~ $ ls /dev/video0 /dev/video0
pi@geekworm:~ $ v4l2-ctl --list-devices bcm2835-codec-decode (platform:bcm2835-codec): /dev/video10 /dev/video11 /dev/video12 /dev/video18 /dev/video31 bcm2835-isp (platform:bcm2835-isp): /dev/video13 /dev/video14 /dev/video15 /dev/video16 /dev/video20 /dev/video21 /dev/video22 /dev/video23 /dev/media0 /dev/media2 unicam (platform:fe801000.csi): /dev/video0 /dev/media4 rpi-hevc-dec (platform:rpi-hevc-dec): /dev/video19 /dev/media3 bcm2835-codec (vchiq:bcm2835-codec): /dev/media1
6. This driver puts all the control in the hands of the user, or the user's application. By default there is no EDID loaded into the chip to allow it to tell the HDMI source what resolutions are supported. There are EDID editors around. If you create a file edid.txt, then you can push this to the device using
The comment of edid.txt file:
00ffffffffffff005262888800888888 1c150103800000780aEE91A3544C9926 0F505400000001010101010101010101 010101010101011d007251d01e206e28 5500c48e2100001e8c0ad08a20e02d10 103e9600138e2100001e000000fc0054 6f73686962612d4832430a20000000FD 003b3d0f2e0f1e0a2020202020200100 020321434e041303021211012021a23c 3d3e1f2309070766030c00300080E300 7F8c0ad08a20e02d10103e9600c48e21 0000188c0ad08a20e02d10103e960013 8e210000188c0aa01451f01600267c43 00138e21000098000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000
cd ~ sudo nano edid.txt #copy the above commend in edid.txt, save&exit;
pi@raspberrypi:~ $ v4l2-ctl --set-edid=file=edid.txt --fix-edid-checksums CTA-861 Header IT Formats Underscanned: yes Audio: yes YCbCr 4:4:4: no YCbCr 4:2:2: no HDMI Vendor-Specific Data Block Physical Address: 3.0.0.0 YCbCr 4:4:4 Deep Color: no 30-bit: no 36-bit: no 48-bit: no CTA-861 Video Capability Descriptor RGB Quantization Range: yes YCC Quantization Range: no PT: Supports both over- and underscan IT: Supports both over- and underscan CE: Supports both over- and underscan
7. The driver does NOT automatically switch to the resolution detected. Use the command:
pi@raspberrypi:~ $ v4l2-ctl --query-dv-timings Active width: 1280 Active height: 720 Total width: 1650 Total height: 750 Frame format: progressive Polarities: -vsync -hsync Pixelclock: 74250000 Hz (60.00 frames per second) Horizontal frontporch: 0 Horizontal sync: 370 Horizontal backporch: 0 Vertical frontporch: 0 Vertical sync: 30 Vertical backporch: 0 Standards: Flags:
You MUST set the timings via "v4l2-ctl --set-dv-bt-timings". You can pass in an index to the detected mode, or use:
v4l2-ctl --set-dv-bt-timings query
to select the currently detected timings.
v4l2-ctl -V
should now reflect the resolution detected.
8. Test video recording
v4l2-ctl --verbose -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat='RGB3' --stream-mmap=4 --stream-skip=3 --stream-count=2 --stream-to=csitest.yuv --stream-poll
The above command will capture frames and save to /home/pi (filename: csitest.yuv)
9. To play the YUV file on Raspberry Pi OS desktop, use FFplay. (Run the following command on local terminal window, Not work if executing the command from SSH).
ffplay -f rawvideo -video_size 1280x720 -pixel_format bgr24 csitest.yuv
If you have other tutorials, please leave them in the comments.
Enable comment auto-refresher
Anonymous user #1
Permalink |
Walker
Harry