Open main menu

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/media3

PS: 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/edid60.txt --fix-edid-checksums

For the Debian version 13 (trixie),

v4l2-ctl -d /dev/v4l-subdev2 --set-edid=file=/home/pi/edid60.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

X1300v1.0-setting5.png


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.


Return to C790 / C779

Add your comment
Geekworm Wiki welcomes all comments. If you do not want to be anonymous, register or log in. It is free.


Anonymous user #4

6 months ago
Score 0++

I am trying to capture HDMI video from a TC358743 (C790 board) connected to a Raspberry Pi 5 running Linux kernel 6.12.25. The HDMI source is 1920×1080 @ 60Hz. EDID writing and media-ctl link configuration were completed as described in the documentation.

Multiple /dev/video* nodes are present, including /dev/video0 and /dev/video4. I can set formats (e.g., RG16, BYR2) using v4l2-ctl on /dev/video0, but attempting to stream results in:

VIDIOC_STREAMON: Invalid argument

Even OpenCV and ffplay fail to read frames.

Current configuration: • EDID written via /dev/v4l-subdev2 using v4l2-ctl –set-edid • Link configuration via media-ctl: tc358743 11-000f:0 -> csi2:0 csi2:4 -> rp1-cfe-csi2_ch0:0 rp1-cfe-csi2_ch0:0 -> pisp-fe:0 pisp-fe:2 -> rp1-cfe-fe_image0:0 • /dev/video0 supports RG16, BYR2, etc., but none work in practice

Questions: 1. Has anyone successfully used this board with Raspberry Pi 5 and captured video? 2. Which /dev/videoX node and pixel format (pixelformat) were used? 3. Is additional configuration required beyond EDID and media-ctl? 4. Is /dev/video0 (from rp1-cfe-csi2_ch0) the correct device to use? 5. What are common causes of “VIDIOC_STREAMON: Invalid argument” with TC358743?

Any advice would be greatly appreciated. Thank you.

Anonymous user #3

10 months ago
Score 0++
Hi Purchased the C790 for the Raspberry PI 5 I can see the green light on the module but the camera module does not show up on raspi-config. v4l2-ctl --list-devices does not show any text similar at any of the text in the instructions. The CSI cable is connected correctly and the dupont connectors as shown in the instructions. I also tried both CSI ports. I get the same results can you please help.

Anonymous user #2

12 months ago
Score 0++
I'm trying to connect the HDMI-RX end to a Linux (Ubuntu 20.04) PC HDMI port. However, the media-ctl from the media on the Rpi5 shows the message "Failed to open subdev device node". Therefore, no subdevice is found in the /dev/ directory. Is this an issue from the HDMI-TX source?

Anonymous user #2

11 months ago
Score 0++

Issue solved. On Raspberry Pi 5 with Media controller API 6.6.62, the C779 MIPI CSI-2-TX must be connected on the CAM/DISP 1 port as specified from the device tree. Afterwards, a proper EDID file must be loaded on the properly created subdev to be visible by the HDMI-TX source. Example:

v4l2-ctl -d /dev/v4l-subdev2 --set-edid=file=edid.txt --fix-edid-checksums

Anonymous user #1

19 months ago
Score 0++
Anyway to get Chrome/Firefox to recognize it as a webcam? I've tried piping the video through workarounds where you can pipe the video to v4l2loopback, but that was exceptionally slow.