Difference between revisions of "X630-Software"

From Geekworm Wiki
Jump to navigation Jump to search
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{GD Template Impl}}
 
{{GD Template Impl}}
This wiki describes how to use x630 on the Raspberry Pi OS.
+
This wiki describes how to use x630 on the Raspberry Pi OS. <span style="color:red;">Note: The software can currently be used directly on Raspberry Pi 4B, 3B+/3B/Zero series. Software support for Raspberry Pi 5 software is not available which need to be tested.
 +
 
 +
The Raspberry Pi Foundation has updated several versions recently;
 +
 
 +
The use guide of 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 os version you are using.(<span style="color:red;">Email: support@geekworm.com</span>)
  
 
==For Raspberry Pi OS==
 
==For Raspberry Pi OS==
X630 has two reset mode: '''Hardware reset''' and '''Software reset''' modes, we strongly recommend you use hardware reset mode if you use it on raspberry pi hardware or raspberry pi os, software reset uses GPIO 509 to reset operation through GPIO, which can prevent you from restarting the Raspberry Pi repeatedly, which is very convenient. And on other hardware platforms, X630 actually reserves pins to facilitate you to use custom GPIO pin to implement software reset operations or use directly hardware reset mode.
+
'''NOTE:'''
 +
 
 +
Since the X630 V1.5 version removes the software reset&hardware reset DIP switch, for the V1.5 version, please ignore the use of software reset or directly visit to [[X630-Hardware-Reset]]
  
First, please choose your reset mode based on your hardware and OS (default is software reset mode), you can skip this step if you use software reset, it should be noted that disconnect power supply to the Raspberry Pi before changing dip switch positions.
+
X630 v1.3 has two reset mode: '''Hardware reset''' and '''Software reset''' modes;
  
'''PS:'''
+
 
 +
You can use hardware reset mode if you use it on raspberry pi hardware or raspberry pi os, software reset uses GPIO 509 to reset operation through GPIO, which can prevent you from restarting the Raspberry Pi repeatedly, which is very convenient.
 +
 
 +
 
 +
The user guide of X630 is similar to [[HDMI TO CSI-2|C779]] when X630 is in hardware mode, but X630 supports audio when used with X630-A2, and  [[HDMI TO CSI-2|C779]] does not support audio
 +
 
 +
 
 +
First, please confirm & select X630 work mode according the picture; After November 2021, the default factory mode is hardware mode;
  
 
We found that some users prefer hardware mode, so our factory default settings have been changed to hardware mode
 
We found that some users prefer hardware mode, so our factory default settings have been changed to hardware mode
Line 27: Line 40:
 
Explain:
 
Explain:
 
* Hardware reset: After starting RASPISTILL or RASPIVID <span style="color:red;">once</span> then you will need to reboot Raspberry Pi to restart it again (Please use when operating system cannot control the X630 module via GPIO509)
 
* Hardware reset: After starting RASPISTILL or RASPIVID <span style="color:red;">once</span> then you will need to reboot Raspberry Pi to restart it again (Please use when operating system cannot control the X630 module via GPIO509)
* Software reset: Starting RASPISTILL or RASPIVID <span style="color:red;">multiple times</span> and don't need to reboot Raspberry Pi ('''Recommend''')
+
* Software reset: Starting RASPISTILL or RASPIVID <span style="color:red;">multiple times</span> and don't need to reboot Raspberry Pi.
* Default setting is 'Software reset';
+
* Default setting is 'Hardware reset'.
 
* Please remove the yellow protective film before change dip switch.
 
* Please remove the yellow protective film before change dip switch.
 
<hr/>
 
<hr/>
  
  
'''For Hardware Reset''' - Starting RASPISTILL or RASPIVID once then reboot your Raspberry Pi.
+
'''For Hardware Reset'''  refer to [[X630-Hardware-Reset]]
 
 
(Please use when operating system cannot control the X630 module via GPIO509)
 
 
 
13. To take a photo with the X630 Module
 
raspistill -o image.jpg
 
 
 
Here, "image" is the name of your image that will be saved to your Raspberry Pi
 
 
 
14. If you need to take second image, then you will need to reboot the Raspberry Pi and execute the "raspistill" again
 
sudo reboot
 
 
15. To record a video with the X630 module
 
raspivid -o video.h264 -t 10000
 
 
 
Here, "video" is the name of your video and "10000" is the number of milliseconds.
 
 
 
16. If you need to record second video, then you will need to reboot the Raspberry Pi and execute the "raspivid" again
 
sudo reboot
 
 
 
<hr>
 
'''For Hardware Reset''' - Starting RASPISTILL or RASPIVID once then reboot your Raspberry Pi
 
 
 
Please use the following guide if your dip switch is changed to 'Hardware reset' position.
 
 
 
17. To take a photo with the X630 Module
 
  raspistill -o image.jpg
 
Here, "image.jpg" is the name of your image that will be saved to your Raspberry Pi
 
 
 
18. If you need to take second image, then you will need to reboot the Raspberry Pi and execute the "raspistill" again.
 
sudo reboot
 
 
 
19. To record a video with the X630 module
 
raspivid -o video.h264 -t 10000
 
Here, "video" is the name of your video and "10000" is the number of milliseconds.
 
 
 
20. If you need to record second video, then you will need to reboot the Raspberry Pi and execute the "raspivid" again.
 
sudo reboot
 
 
 
==Audio & Video capturing using GStreamer==
 
 
 
Capturing stereo audio with the <span style="color:red;">X630-A2(will release soon)</span> from the HDMI source is supported.
 
 
 
If you need to run RASPISTILL or RASPIVID again after the GStreamer is installed. You will need to reinstall a fresh Raspberry Pi OS and follow above instructions.
 
 
 
(1) Once booted, update your Raspberry Pi by running the following commands in a terminal window:
 
sudo apt-get update
 
sudo apt-get upgrade -y
 
 
 
(2) Install necessary dependency and remaining plugins for GStreamer
 
sudo apt-get install libx264-dev libjpeg-dev
 
 
 
sudo apt-get install libgstreamer1.0-dev \
 
libgstreamer-plugins-base1.0-dev \
 
libgstreamer-plugins-bad1.0-dev \
 
gstreamer1.0-plugins-ugly \
 
gstreamer1.0-tools
 
 
 
(3) With all GStreamer modules installed let's test the installation with (not via SSH)
 
 
 
gst-launch-1.0 --version
 
gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
 
[[File:TestRPi-X630.png|none]]
 
 
 
(4) Edit /boot/config.txt and enter the following
 
 
 
sudo nano /boot/config.txt
 
 
 
dtoverlay=tc358743
 
dtoverlay=tc358743-audio
 
dtoverlay=cma,cma-128
 
 
Save and exit with ctrl + x, followed by y when prompted to save, and then enter.
 
 
 
(5) Reboot the Raspberry Pi
 
 
 
sudo reboot
 
 
 
(6) Once rebooted and check that the audio drivers / card is available to ALSA.
 
<pre>
 
pi@raspberrypi:~ $ arecord -l
 
**** List of CAPTURE Hardware Devices ****
 
card 1: tc358743 [tc358743], device 0: bcm2835-i2s-dir-hifi dir-hifi-0 [bcm2835-i2s-dir-hifi dir-hifi-0]
 
  Subdevices: 1/1
 
  Subdevice #0: subdevice #0
 
</pre>
 
 
 
Note: card <span style="color:red;">1</span> means that the card number for the TC358743XBG is "1" and it might be different.
 
 
 
(7) Create an EDID file so it can be loaded into the chip to allow it to tell the HDMI source what resolutions are supported.
 
sudo nano edid.txt
 
 
 
enter the following:
 
 
 
00ffffffffffff005262888800888888
 
1c150103800000780aEE91A3544C9926
 
0F505400000001010101010101010101
 
010101010101011d007251d01e206e28
 
5500c48e2100001e8c0ad08a20e02d10
 
103e9600138e2100001e000000fc0054
 
6f73686962612d4832430a20000000FD
 
003b3d0f2e0f1e0a202020202020014f
 
020321434e041303021211012021a23c
 
3d3e1f2309070766030c00300080E300
 
7F8c0ad08a20e02d10103e9600c48e21
 
0000188c0ad08a20e02d10103e960013
 
8e210000188c0aa01451f01600267c43
 
00138e21000098000000000000000000
 
00000000000000000000000000000000
 
00000000000000000000000000000028
 
 
 
Save and exit with ctrl + x, followed by y when prompted to save, and then enter.
 
 
 
(8) Push this to the device using
 
 
 
v4l2-ctl --set-edid=file=edid.txt --fix-edid-checksums
 
 
(9) To print the currently detected timings
 
 
v4l2-ctl --query-dv-timings
 
 
(10) To select the currently detected timings
 
 
 
v4l2-ctl --set-dv-bt-timings query
 
 
(11) Capture the incoming audio (no video)
 
 
 
arecord -D hw:x,0 -V stereo -r 48000 -f S16_LE -c 2 audio.wav
 
 
 
Note: <span style="color:red;">hw:x</span> - You must replace "<span style="color:red;">x</span>" with correct audio card number.
 
 
Press ctrl + c to finish a recording, the file will be saved to /home/pi
 
 
 
(12) Capture the incoming video and audio
 
 
 
 
 
gst-launch-1.0 v4l2src io-mode=0 ! video/x-raw, format=UYVY, framerate=25/1 ! v4l2h264enc output-io-mode=4 ! video/x-h264,profile=high ! h264parse ! queue ! matroskamux name=mux ! filesink location=video.mkv alsasrc device=hw:2 ! audio/x-raw,rate=48000,channels=2 ! audioconvert ! avenc_aac bitrate=48000 ! aacparse ! queue ! mux.
 
 
 
Note: <span style="color:red;">alsasrc device=hw:2</span> - "<span style="color:red;">2</span>" means the audio card number, You must change to correct audio card number.
 
 
 
Press ctrl + c to finish a recording, the file will be saved to /home/pi
 
 
 
==How to check kernel version==
 
Please run the following command to get the linux kernel version
 
uname -a
 
[[File:Raspi-kernel-version.jpg|800px]]
 
  
Maybe you can refer to [https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=281972 TC358743 HDMI to CSI-2 install instructions] if your kernel version is lower than 5.X.
+
'''For Software Reset''' refer to [[X630-Software-Reset]]
  
  

Latest revision as of 09:59, 12 March 2024

This wiki describes how to use x630 on the Raspberry Pi OS. Note: The software can currently be used directly on Raspberry Pi 4B, 3B+/3B/Zero series. Software support for Raspberry Pi 5 software is not available which need to be tested.

The Raspberry Pi Foundation has updated several versions recently;

The use guide of 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 os version you are using.(Email: support@geekworm.com)

For Raspberry Pi OS

NOTE:

Since the X630 V1.5 version removes the software reset&hardware reset DIP switch, for the V1.5 version, please ignore the use of software reset or directly visit to X630-Hardware-Reset

X630 v1.3 has two reset mode: Hardware reset and Software reset modes;


You can use hardware reset mode if you use it on raspberry pi hardware or raspberry pi os, software reset uses GPIO 509 to reset operation through GPIO, which can prevent you from restarting the Raspberry Pi repeatedly, which is very convenient.


The user guide of X630 is similar to C779 when X630 is in hardware mode, but X630 supports audio when used with X630-A2, and C779 does not support audio


First, please confirm & select X630 work mode according the picture; After November 2021, the default factory mode is hardware mode;

We found that some users prefer hardware mode, so our factory default settings have been changed to hardware mode

dip switch

Disconnect power to the Raspberry Pi before changing dip switch positions!!!

SELECTION SWITCH SETTINGS
Hardware reset(Default) HW = 1 SW = 0
Software reset HW = 0 SW = 1
X630 dip switch setting

Explain:

  • Hardware reset: After starting RASPISTILL or RASPIVID once then you will need to reboot Raspberry Pi to restart it again (Please use when operating system cannot control the X630 module via GPIO509)
  • Software reset: Starting RASPISTILL or RASPIVID multiple times and don't need to reboot Raspberry Pi.
  • Default setting is 'Hardware reset'.
  • Please remove the yellow protective film before change dip switch.


For Hardware Reset refer to X630-Hardware-Reset

For Software Reset refer to X630-Software-Reset


Return to X630

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