-

X1300 Software: Difference between revisions

From Geekworm Wiki
Jump to navigation Jump to search
No edit summary
Replace <comments/> with <comment-streams />
 
(20 intermediate revisions by 4 users not shown)
Line 8: Line 8:




Now assumes you've already set up a Raspberry Pi with Raspbian12('''bookworm'''). For help installing the Debian-based OS on your Pi, check out the docs on https://www.raspberrypi.com/
Now assumes you've already set up a Raspberry Pi with Raspbian12('''bookworm''') or Debian 13('''trixie'''). For help installing the Debian-based OS on your Pi, check out the docs on https://www.raspberrypi.com/


To check the kernel version, execute the following command: (OS kernel upgrades often bring about some uncertain issues)
To check the kernel version, execute the following command: (OS kernel upgrades often bring about some uncertain issues)
Line 17: Line 17:




1. To enable the device tree overlay in the '''/boot/firmware/config.txt'''
1. '''To enable the device tree overlay in the /boot/firmware/config.txt'''
  sudo nano /boot/firmware/config.txt
  sudo nano /boot/firmware/config.txt
Add two lines at the end of the file that reads like this:
Add two lines at the end of the file that reads like this:
Line 24: Line 24:
[[File:X1300v1.0-setting2.png|800px]]
[[File:X1300v1.0-setting2.png|800px]]


<span class="tb_red">'''PS:'''</span> If you use [[X630]], please remove <code>,4lane=1</code> and <code>dtoverlay=tc358743-audio</code>  
<span class="tb_red">'''PS:'''</span>  
* If you use [[X630]], please remove <code>,4lane=1</code> and <code>dtoverlay=tc358743-audio</code>  
* '''dtoverlay=tc358743,4lane=1,cam0''' or '''dtoverlay=tc358743,4lane=1,cam1''' is required when use it with CM5 and CM5 IO board such as [[X1500]] /[[X1501]], When using '''CAM/DISP0''' socket of [[X1500]] /[[X1501]], please use the <code>'''cam0'''</code> parameters. When using '''CAM/DISP1''', please use the <code>'''cam1'''</code> parameters.


Press Ctrl + O & Enter to save
Press Ctrl + O & Enter to save
Line 31: Line 33:




2. Reboot the Raspberry Pi 5 for the settings to take effect
2. '''Reboot the Raspberry Pi 5 for the settings to take effect'''
  sudo reboot
  sudo reboot




3.  Check video devices list
3.  '''Check video devices list'''
  v4l2-ctl --list-devices
  v4l2-ctl --list-devices
[[File:X1300v1.0-setting3.png]]
[[File:X1300v1.0-setting3.png]]




4.  Create an 1920*1080P EDID txt file to setup the HDMI to CSI adapter before you can connect it to a HDMI source. This EDID file will enable the video and audio mode supported.
4.  '''Create an 1920*1080P EDID txt file to setup the HDMI to CSI adapter before you can connect it to a HDMI source. This EDID file will enable the video and audio mode supported.'''
  sudo nano 1080P60EDID.txt
  sudo nano 1080P60EDID.txt
Copy below EDID data and paste to 1080P60EDID.txt, or download EDID data from https://github.com/6by9/CSI2_device_config/blob/master/1080P60EDID.txt
Copy below EDID data and paste to 1080P60EDID.txt, or download EDID data from [https://github.com/6by9/CSI2_device_config/blob/master/1080P60EDID.txt EDID link 1] or [https://github.com/FearL0rd/RPi5_hdmi_in_card/tree/main/hdmi2csi2card EDID link 2](EDID link 2 Provides more EDID options)
<pre>
<pre>
00ffffffffffff005262888800888888
00ffffffffffff005262888800888888
Line 63: Line 65:




5. Loading the EDID data
5. '''Loading the EDID data'''
 
For the Debian version 12 (Bookworm),
 
  v4l2-ctl -d /dev/v4l-subdev2 --set-edid=file=/home/pi/1080P60EDID.txt --fix-edid-checksums
  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
'''PS''':Pay attention to the directory of your edid file


Line 72: Line 82:
[[File:X1300v1.0-setting4.png]]
[[File:X1300v1.0-setting4.png]]


<mark>'''PS:''' Make sure to connect the HDMI source device to get the HDMI signal, if you can't get the correct resolution here, consider adjusting the resolution of your source device to match the EDID.</mark>
<mark>'''PS:''' Make sure to connect the HDMI source device to get the HDMI signal, if you can't get the correct resolution 1920x1080P as shown above, please check the resolution of your '''hdmi source device''' to match the EDID.</mark>




Line 94: Line 104:
media-ctl -d /dev/media2 -V ''\''csi2'\'':0 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'
media-ctl -d /dev/media2 -V ''\''csi2'\'':0 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'
media-ctl -d /dev/media2 -V ''\''csi2'\'':4 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'
media-ctl -d /dev/media2 -V ''\''csi2'\'':4 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'
</pre>
<!--
media-ctl -d /dev/media2 -V ''\''tc358743 4-000f'\'':0 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'
media-ctl -d /dev/media2 -V ''\''tc358743 4-000f'\'':0 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'
</pre>
-->
<span class="tb_red">Please note that the '''/dev/media number''' can change. Go to step 3 to check the media number. please change '''/dev/media2''' to '''/dev/media1''' if your media number is 1, and so on</span>
<span class="tb_red">Please note that the '''/dev/media number''' can change. Go to step 3 to check the media number. please change '''/dev/media2''' to '''/dev/media1''' if your media number is 1, and so on</span>


Line 113: Line 125:


==References==
==References==
* [https://github.com/FearL0rd/RPi5_hdmi_in_card RPi5_hdmi_in_card]
Here are a few tutorials:
* [https://github.com/raspberrypi/firmware/issues/1915 ISP freezes with new firmware]
* Tutorial from customers: [https://github.com/geekworm-com/RPi5_hdmi_in_card RPi5_hdmi_in_card] '''(recommend)'''
* [https://github.com/raspberrypi/firmware/issues/1904 Raspberry Pi 5 firmware ignores and responds with incorrect frame buffer pixel depth information]
* Possible software problems: [https://github.com/raspberrypi/firmware/issues/1915 ISP freezes with new firmware] and [https://github.com/raspberrypi/firmware/issues/1904 Raspberry Pi 5 firmware ignores and responds with incorrect frame buffer pixel depth information]


Return to [[X1300]] / [[X1301]]
Return to [[X1300]] / [[X1301]]
==FAQ==
<div class="toccolours mw-collapsible mw-collapsed">
<div style="font-weight:bold;line-height:1.6;">
Q1: kernel version 6.12 is wrong to RPi 5
</div>
<div class="mw-collapsible-content">
A: If you are using kernel version 6.12, there will be errors. Please refer to https://forums.raspberrypi.com/viewtopic.php?t=385709 and wait for the official update of Raspberry Pi.
</div>
</div>


<!--Add review function! -->
<!--Add review function! -->
<comments />
<comment-streams id="main" />


<!--Please choose the  -->
<!--Please choose the  -->

Latest revision as of 10:13, 27 May 2026

This tutorial is only for X1300 and X1301 and X630

This tutorial is mainly based on the tool v4l2-ctl tool and provides a simple example to check whether the x1300 is working properly on the Raspberry Pi 5. It is not only a tutorial, but also a basis for you to check whether the X1300 is damaged. Of course, you can also consider using other video tools such as GStreamer to get similar functions.


Before starting the following tutorial, you must also have completed the physical connection of X1300/X1301, and also ensure that there is HDMI signal transmitted to X1300/X1301


Now assumes you've already set up a Raspberry Pi with Raspbian12(bookworm) or Debian 13(trixie). For help installing the Debian-based OS on your Pi, check out the docs on https://www.raspberrypi.com/

To check the kernel version, execute the following command: (OS kernel upgrades often bring about some uncertain issues)

uname -a

Maybe the result is following:

uname -a
Linux raspberrypi 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux


1. To enable the device tree overlay in the /boot/firmware/config.txt

sudo nano /boot/firmware/config.txt

Add two lines at the end of the file that reads like this:

dtoverlay=tc358743,4lane=1
dtoverlay=tc358743-audio

PS:

  • If you use X630, please remove ,4lane=1 and dtoverlay=tc358743-audio
  • dtoverlay=tc358743,4lane=1,cam0 or dtoverlay=tc358743,4lane=1,cam1 is required when use it with CM5 and CM5 IO board such as X1500 /X1501, When using CAM/DISP0 socket of X1500 /X1501, please use the cam0 parameters. When using CAM/DISP1, please use the cam1 parameters.

Press Ctrl + O & Enter to save

Press Ctrl + X to Exit


2. Reboot the Raspberry Pi 5 for the settings to take effect

sudo reboot


3. Check video devices list

v4l2-ctl --list-devices


4. Create an 1920*1080P EDID txt file to setup the HDMI to CSI adapter before you can connect it to a HDMI source. This EDID file will enable the video and audio mode supported.

sudo nano 1080P60EDID.txt

Copy below EDID data and paste to 1080P60EDID.txt, or download EDID data from EDID link 1 or EDID link 2(EDID link 2 Provides more EDID options)

00ffffffffffff005262888800888888
1c150103800000780aEE91A3544C9926
0F505400000001010101010101010101
010101010101011d007251d01e206e28
5500c48e2100001e8c0ad08a20e02d10
103e9600138e2100001e000000fc0054
6f73686962612d4832430a20000000FD
003b3d0f2e0f1e0a202020202020014f
020322444f841303021211012021223c
3d3e101f2309070766030c00300080E3
007F8c0ad08a20e02d10103e9600c48e
210000188c0ad08a20e02d10103e9600
138e210000188c0aa01451f01600267c
4300138e210000980000000000000000
00000000000000000000000000000000
00000000000000000000000000000015


5. Loading the EDID data

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


6. Query the current HDMI input signal source information. If the resolution shows 0, it means that no input source signal is detected. At this time, you need to check the hardware connection and then repeat the above steps to troubleshoot.

v4l2-ctl -d /dev/v4l-subdev2 --query-dv-timings

PS: Make sure to connect the HDMI source device to get the HDMI signal, if you can't get the correct resolution 1920x1080P as shown above, please check the resolution of your hdmi source device to match the EDID.


7. Applying the screen timing to the capture setup

v4l2-ctl -d /dev/v4l-subdev2 --set-dv-bt-timings query


8. Initialize/reset media

media-ctl -d /dev/media2 -r

Please note that the /dev/media number can change. Go to step 3 to check the media number. please change /dev/media2 to /dev/media1 if your media number is 1, and so on


9. Connect CSI2's pad4 to rp1-cfe-csi2_ch0's pad0.

media-ctl -d /dev/media2 -l ''\''csi2'\'':4 -> '\''rp1-cfe-csi2_ch0'\'':0 [1]'


10. Configure the media node.

media-ctl -d /dev/media2 -V ''\''csi2'\'':0 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'
media-ctl -d /dev/media2 -V ''\''csi2'\'':4 [fmt:RGB888_1X24/1920x1080 field:none colorspace:srgb]'

Please note that the /dev/media number can change. Go to step 3 to check the media number. please change /dev/media2 to /dev/media1 if your media number is 1, and so on


11. Set output formats

v4l2-ctl -v width=1920,height=1080,pixelformat=RGB3


12. Capture frames and save to /home/pi (filename: csitest.yuv)

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=csitest.yuv --stream-poll

13. 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 1920x1080 -pixel_format bgr24 csitest.yuv

References

Here are a few tutorials:

Return to X1300 / X1301

FAQ

Q1: kernel version 6.12 is wrong to RPi 5

A: If you are using kernel version 6.12, there will be errors. Please refer to https://forums.raspberrypi.com/viewtopic.php?t=385709 and wait for the official update of Raspberry Pi.