Changes

Jump to navigation Jump to search
Line 9: Line 9:     
This article describes how to call the camera modules of VEYE series and CS series through V4L2 on the raspberry Pi platform.
 
This article describes how to call the camera modules of VEYE series and CS series through V4L2 on the raspberry Pi platform.
 +
==== Camera module list====
 +
{| class="wikitable"
 +
|+Camera module dirver status list
 +
!Series
 +
! Model
 +
! Status
 +
|-
 +
|VEYE series
 +
|VEYE-MIPI-IMX327S
 +
|Done
 +
|-
 +
|VEYE series
 +
|VEYE-MIPI-IMX385
 +
|Done
 +
|-
 +
|VEYE series
 +
|VEYE-MIPI-IMX462
 +
|Done
 +
|-
 +
|CS series
 +
|CS-MIPI-IMX307
 +
|Done
 +
|-
 +
|CS series
 +
|CS-MIPI-SC132
 +
|Done
 +
|}
 +
In addition, FPD-Link3 mode connection is now supported.
    
=== Hardware Setup ===
 
=== Hardware Setup ===
Line 31: Line 59:  
<code>chmod +x *</code>
 
<code>chmod +x *</code>
   −
<code>sudo ./install_driver.sh [camera module]</code>
+
* For Raspberry Pi 5
   −
camera module:could be veye327,csimx307,cssc132,veyecam2m.
+
<code>sudo ./install_driver_rpi5.sh camera_module_name</code>
 +
 
 +
It will install both CAM1 and CAM0 overlays in /boot/config.txt.
 +
 
 +
* For other Raspberry Pi
 +
 
 +
<code>sudo ./install_driver.sh camera_module_name</code>
 +
 
 +
camera_module_name:could be veye327,csimx307,cssc132,veyecam2m.
    
'''Note: veyecam2m is a new version driver that can replace veye327 and supports all modules of the VEYE series with 200W resolution.'''
 
'''Note: veyecam2m is a new version driver that can replace veye327 and supports all modules of the VEYE series with 200W resolution.'''
Line 46: Line 82:  
If you need to change to using the camera by veye_raspicam software, or if you want to change to a driver of another camera module model, you must first uninstall the current driver.
 
If you need to change to using the camera by veye_raspicam software, or if you want to change to a driver of another camera module model, you must first uninstall the current driver.
   −
<code>sudo ./uninstall_driver.sh [camera module]</code>
+
<code>sudo ./uninstall_driver.sh camera_module_name</code>
   −
camera module:could be veye327,csimx307,cssc132,veyecam2m.
+
camera_module_name:could be veye327,csimx307,cssc132,veyecam2m.
 +
 
 +
==== Camera in FPD-Link3 Mode ====
 +
For a camera operating in FPD-Link3 transmission mode, it is necessary to ensure that the ds90ub954 driver is loaded and initialized before loading the camera driver and performing probe.
 +
 
 +
Take the VEYE-MIPI-IMX327S camera in FPD-Link3 mode as an example:
 +
 
 +
Install the drivers correctly:
 +
 
 +
<code>sudo ./install_driver.sh ds90ub954</code>
 +
 
 +
<code>sudo ./install_driver.sh veyecam2m</code>
    
=== Check and Test the Camera ===
 
=== Check and Test the Camera ===
Line 84: Line 131:  
==== List the available video modes ====
 
==== List the available video modes ====
 
<code>v4l2-ctl --list-formats-ext</code>
 
<code>v4l2-ctl --list-formats-ext</code>
 +
===Raspberry Pi 5 Setting===
 +
On Raspberry Pi 5,the drivers now use the media controller API, and we must setup the media graph correctly first. This includes setting up the media pad formats correctly and correctly linking them together.
 +
 +
We provide a series of scripts to implement this functionality, saved in the rpi5_scripts directory.
 +
 +
*./find_entity.sh
 +
 +
<code>$ ./find_entity.sh</code>
 +
 +
<code>Found veyecam2m @ i2c-6 entity on /dev/media0</code>
 +
 +
<code>Plese get frame from /dev/video0 and use /dev/v4l-subdev2 for camera setting.</code>
 +
 +
After a reboot of Raspberry Pi 5, the media node and video node of the camera may change. Therefore, it is recommended to execute <code>./find_entity.sh</code> before performing subsequent operations to identify the device nodes.
 +
 +
The above prompt shows that the system has detected two cameras and their corresponding device nodes.
 +
 +
<code>i2c-4</code> corresponds to the CAM1 port on the board, and <code>i2c-6</code> corresponds to the CAM0 port on the board.
 +
 +
*media_setting_rpi5.sh
   −
=== Preview using VLC ===
+
<code>./media_setting_rpi5.sh</code>
 +
 
 +
<code>Usage: ./media_setting_rpi5.sh veyecam2m/csimx307/cssc132/mvcam -fmt [UYVY/RAW8/RAW10/RAW12] -w [width] -h [height]</code>
 +
 
 +
<code>This shell script is designed to detect the connection of a camera on Raspberry Pi 5.</code>
 +
 
 +
<code>    It utilizes media-ctl and v4l2-ctl commands to configure the linking relationships and data formats of the media pad.</code>
 +
 
 +
<code>    Once completed, you can directly use /dev/video0 or /dev/video8 to obtain image data</code>
 +
 
 +
'''Note: This script must be executed after each startup to complete the configuration of the parameters before proceeding with further operations.'''
 +
 
 +
For instance:
 +
 
 +
<code>./media_setting_rpi5.sh veyecam2m</code>
 +
===Preview===
 +
On a raspberry pi 5, VLC for preview is now having problems and not working.
 +
==== Preview using VLC ====
 
1. Open VLC with command line <code>vlc</code> , or click the icon to launch.
 
1. Open VLC with command line <code>vlc</code> , or click the icon to launch.
   Line 101: Line 185:  
[[File:Play camera using VLC on RPI.png|alt=Play camera using VLC on RPI|center|thumb|1000x1000px|Play camera using VLC on RPI]]
 
[[File:Play camera using VLC on RPI.png|alt=Play camera using VLC on RPI|center|thumb|1000x1000px|Play camera using VLC on RPI]]
 
<br />
 
<br />
 +
======Preview using qv4l2======
 +
Install qv4l2,
    +
<code>sudo apt install qv4l2</code>
 +
 +
1. Open VLC with command line <code>vlc</code> to launch.
 +
 +
2. Hit the <code>▶</code>(Play) button to call the open media window.
 
=== Gstreamer usage samples ===
 
=== Gstreamer usage samples ===
 
<code>export DISPLAY=:0</code>
 
<code>export DISPLAY=:0</code>
Line 123: Line 214:  
==== Preview (VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ====
 
==== Preview (VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ====
 
<code>gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2convert capture-io-mode=dmabuf output-io-mode=dmabuf ! autovideosink sync=false -v</code>
 
<code>gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2convert capture-io-mode=dmabuf output-io-mode=dmabuf ! autovideosink sync=false -v</code>
 +
 +
Or:
 +
 +
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! videoconvert ! autovideosink  sync=false -v</code>
    
==== Preview and Scale with timestamp on (VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ====
 
==== Preview and Scale with timestamp on (VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ====
Line 190: Line 285:  
Because of the high flexibility of our camera parameters, we do not use V4L2 parameters to control, but use scripts to configure parameters.
 
Because of the high flexibility of our camera parameters, we do not use V4L2 parameters to control, but use scripts to configure parameters.
   −
<nowiki>https://github.com/veyeimaging/raspberrypi/tree/master/i2c_cmd</nowiki>
+
https://github.com/veyeimaging/raspberrypi_v4l2/tree/main/i2c_cmd
    
[[VEYE-MIPI-290/327 for Raspberry Pi#Video Control Toolkits Manual|VEYE Series Video Control Toolkits Manual]]
 
[[VEYE-MIPI-290/327 for Raspberry Pi#Video Control Toolkits Manual|VEYE Series Video Control Toolkits Manual]]
Line 198: Line 293:  
=== Notes for CM4 ===
 
=== Notes for CM4 ===
 
Cm4 supports the use of two cameras at the same time. Following above steps will only be able to use CAM1. To use two cameras, follow the following steps:
 
Cm4 supports the use of two cameras at the same time. Following above steps will only be able to use CAM1. To use two cameras, follow the following steps:
 +
 +
===== Hardware Connection =====
 +
Refer to [https://www.raspberrypi.com/documentation/computers/compute-module.html this Raspberry Pi instruction] , add jumper to J6.
    
==== Upgrade dt-blob.bin ====
 
==== Upgrade dt-blob.bin ====
Line 253: Line 351:     
=== Document History ===
 
=== Document History ===
 +
 +
* 2024-01-01
 +
 +
Add support for Raspberrypi 5.
 +
 +
* 20230607
 +
 +
Add FPD-Link3 Driver and Its Description.
    
* 20230304
 
* 20230304

Navigation menu