2025-03-03 5:44 PM
Hi,
I have installed the v4l2 driver for the STEVAL-56G3MAI1 camera module on ubuntu 22.04.05 LTS on a RPI CM4. But I am unable to access the module through /dev/video0.
I have followed the instructions in the linux start guide fro ST BrightSense but I cannot get it to work.
I am not sure if I need to do something in addition to these instructions:
cd en.vd56g3_1.0.3/src
make
sudo cp *.ko /lib/modules/$(uname -r)
sudo depmod -a
sudo reboot
sudo apt update
sudo apt install device-tree-compiler
cd en.vd56g3_1.0.3/dts/rpi1_to_4/
sudo dtc pcb4188_vd56g3.dts -o /boot/firmware/overlays/pcb4188_vd56g3.dtbo
sudo sh -c "echo 'dtoverlay=pcb4188_vd56g3' >> /boot/firmware/config.txt"
sudo reboot
v4l2-ctl --list-devices gives:
unicam (platform:fe801000.csi):
/dev/media3
Cannot open device /dev/video0, exiting.
Is there something I am missing in the setup? Should the driver be placed in a different folder?
Thanks for any assistance!
2025-03-17 2:45 PM
Hi @ds2,
Thank you for your feedback on this topic.
The device tree file must be adapted for the CM4 board, as we provided them for Raspberry Pi 1 to 5 boards. A device tree is very specific to the target platform and somewhat specific to its Linux distribution (specifically its Linux kernel). Our drivers have been tested on Raspberry Pi 1 to 5 with RPI OS.
We are currently looking at the driver compatibility with Ubuntu and the CM4 board. I will get back to you once I have more feedback.
Thanks, Megane.
2025-03-19 6:21 PM
Hi,
Thanks for getting back to me.
I have now installed the v4l2 driver with libcamera on the Raspberry Pi 5 running RPI OS and the camera is recognized but will not stream.
I get this error trying to capture an image using v4l2
v4l2-ctl --device=/dev/video0 --set-fmt-video=width=640,height=480,pixelformat=GREY
v4l2-ctl --device /dev/video0 --stream-mmap --stream-count=1 --stream-to=test_frame.raw
VIDIOC_STREAMON returned -1 (Invalid argument)
This is what dmesg shows:
[ 3.146432] vd56g3: loading out-of-tree module taints kernel.
[ 3.161425] rp1-cfe 1f00110000.csi: Using sensor vd56g3 6-0010 for capture
[ 3.161519] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-csi2_ch0] node id 0 successfully as /dev/video0
[ 3.161545] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-embedded] node id 1 successfully as /dev/video1
[ 3.161571] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-csi2_ch2] node id 2 successfully as /dev/video2
[ 3.161593] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-csi2_ch3] node id 3 successfully as /dev/video3
[ 3.161615] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-fe_image0] node id 4 successfully as /dev/video4
[ 3.162262] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-fe_image1] node id 5 successfully as /dev/video5
[ 3.163741] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-fe_stats] node id 6 successfully as /dev/video6
[ 3.164209] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-fe_config] node id 7 successfully as /dev/video7
[ 3.164523] vd56g3 6-0010: Successfully probe vd56g3 sensor
[ 91.574082] rp1-cfe 1f00110000.csi: csi2_ch0 node link is not enabled.
I have also tried to run the V4L2 python sample code in the linux start guide and it produces this error:
>> get device capabilities
>> device setup
width: 640 height 480
>> init mmap capture
>> Start streaming
Traceback (most recent call last):
File "~/st_start.py", line 46, in <module>
fcntl.ioctl(vd, VIDIOC_STREAMON, buf_type)
OSError: [Errno 22] Invalid argument
2025-04-02 3:22 PM
Hi @ds2,
Sorry for my late reply. We needed to do a few tests on our side as we did not support v4l2 stream yet, but only using Libcamera. I will soon share the procedure for Raspberry Pi 5 running on RPI OS regarding your latest post.
In the meantime, we are now able to stream with Ubuntu 24.04 on RPI5. We have updated the driver to support it, and is now available on Github (it will be on st.com soon): https://github.st.com/IMG-SW-INT/vd56g3-linux-driver/releases/tag/1.0.5.
Here is the procedure we followed:
Update system $ sudo apt update $ sudo apt upgrade # Install requirements for driver compilation (my ubuntu is running kernel 6.8) $ sudo apt install git make gcc linux-headers-6.8.0-1020-raspi $ cd vd56g3/src # Build and install driver $ make $ sudo cp vd56g3.ko /lib/modules/$(uname -r) $ sudo depmod -a # Install devicetree overlay $ cd ../dts/rpi5/ $ sudo dtc pcb4188_vd56g3_cam0.dts -o /boot/firmware/overlays/pcb4188_vd56g3_cam0.dtbo $ echo "dtoverlay=pcb4188_vd56g3_cam0" | sudo tee -a /boot/firmware/config.txt # Reboot and check than probe is OK $ sudo reboot $ sudo dmesg | grep vd56 # Install utils and make sensor stream $ sudo apt install v4l-utils qv4l2 $ media-ctl -p $ qv4l2
Thanks, Megane.
2025-04-27 8:26 PM
Hi @MeganeG ,
Thanks for following up on this. I have got it working with libcamera on RPi OS and I will test the same on Ubuntu 24.04 on RPi5.
Given there is the same pinout on the CM5, will this be possible on it? Also the CM4 is two lanes instead of four, so is it not compatible?
Thanks.
2025-05-09 6:17 AM - edited 2025-05-09 9:31 AM
I am trying to accomplish the same thing but have not been able to get the camera working with libcamera on RPi5 (CM5 module on a CM5 IO board). I have followed the instructions above using the latest drivers downloaded from ST.
After installation dmesg gives:
[ 5.368396] vd56g3: loading out-of-tree module taints kernel.
[ 5.381267] rp1-cfe 1f00110000.csi: Using sensor vd56g3 10-0010 for capture
[ 5.381373] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-csi2_ch0] node id 0 successfully as /dev/video0
[ 5.382001] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-embedded] node id 1 successfully as /dev/video1
[ 5.382079] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-csi2_ch2] node id 2 successfully as /dev/video2
[ 5.382135] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-csi2_ch3] node id 3 successfully as /dev/video3
[ 5.382175] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-fe_image0] node id 4 successfully as /dev/video4
[ 5.383623] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-fe_image1] node id 5 successfully as /dev/video5
[ 5.384127] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-fe_stats] node id 6 successfully as /dev/video6
[ 5.384350] rp1-cfe 1f00110000.csi: Registered [rp1-cfe-fe_config] node id 7 successfully as /dev/video7
[ 5.394846] vd56g3 10-0010: Successfully probe vd66gy sensor
Are there additional steps to make this work with my hardware configuration?
Here is the rpicam output:
$ rpicam-hello
[0:03:01.275487026] [1810] INFO Camera camera_manager.cpp:326 libcamera v0.5.0+59-d83ff0a4
[0:03:01.282568482] [1813] INFO RPI pisp.cpp:720 libpisp version v1.2.1 981977ff21f3 29-04-2025 (14:13:50)
[0:03:01.283535976] [1813] WARN CameraSensorProperties camera_sensor_properties.cpp:473 No static properties available for 'vd56g3'
[0:03:01.283558439] [1813] WARN CameraSensorProperties camera_sensor_properties.cpp:475 Please consider updating the camera sensor properties database
[0:03:01.286129748] [1813] ERROR IPAProxy ipa_proxy.cpp:171 Configuration file 'vd56g3.json' not found for IPA module 'rpi/pisp'
[0:03:01.301154616] [1813] ERROR RPI pipeline_base.cpp:814 Failed to load a suitable IPA library
[0:03:01.301190857] [1813] ERROR RPI pisp.cpp:947 Failed to register camera vd56g3 10-0010: -22
Preview window unavailable
ERROR: *** no cameras available ***
I am using the STEVAL-66GYMAI1 camera module.
2025-05-09 10:20 AM
I notice that rpicam is still using libcamera v0.5.0 instead of the version I attempted to install that was downloaded from ST (libcamera v0.4.0). Could this be the issue?
2025-05-12 8:34 PM
Hello @3FTI ,
You are facing this issue because the tuning file for the ISP for the vd66gy sensor is missing.
You can either wait for the next release that will fix the bug, or fix it manually following indications of this ticket: Solved: error with vd66gy on Raspberry Pi - STMicroelectronics Community
My apologies for the troubles caused,
Best regards,
Jean Poiré
2025-05-13 4:24 AM - edited 2025-05-13 12:18 PM
Hi @Jean_Poire ,
Thanks for this update. I have added the tuning file but rpicam still does not find the camera. Here is the output I am getting now.
$ rpicam-hello
[0:02:23.757856391] [1085] INFO Camera camera_manager.cpp:326 libcamera v0.5.0+59-d83ff0a4
[0:02:23.765017550] [1088] INFO RPI pisp.cpp:720 libpisp version v1.2.1 981977ff21f3 29-04-2025 (14:13:50)
[0:02:23.765995272] [1088] WARN CameraSensorProperties camera_sensor_properties.cpp:473 No static properties available for 'vd56g3'
[0:02:23.766018068] [1088] WARN CameraSensorProperties camera_sensor_properties.cpp:475 Please consider updating the camera sensor properties database
[0:02:23.776118579] [1088] ERROR IPARPI ipa_base.cpp:150 Could not create camera helper for vd56g3
[0:02:23.776150171] [1088] ERROR RPI pipeline_base.cpp:814 Failed to load a suitable IPA library
[0:02:23.776156356] [1088] ERROR RPI pisp.cpp:947 Failed to register camera vd56g3 10-0010: -22
Preview window unavailable
ERROR: *** no cameras available ***
Is it possible that using libcamera v0.5.0 is causing the remaining issues?
2025-05-13 8:49 AM - edited 2025-05-13 9:28 AM
Hi Jean,
I realized the ST driver had been updated to 0.5, so I downloaded and installed and I can now detect the camera. I am still not able to capture an image. rpicam output below:
$ rpicam-hello --list-cameras
Available cameras
-----------------
0 : vd56g3 [1124x1364 10-bit GRBG] (/base/axi/pcie@1000120000/rp1/i2c@88000/fox@10)
Modes: 'SGRBG10_CSI2P' : 320x240 [501.76 fps - (242, 442)/640x480 crop]
480x640 [283.61 fps - (82, 42)/960x1280 crop]
640x480 [220.51 fps - (242, 442)/640x480 crop]
768x1024 [114.73 fps - (178, 170)/768x1024 crop]
1024x768 [148.19 fps - (50, 298)/1024x768 crop]
720x1280 [93.60 fps - (202, 42)/720x1280 crop]
1024x1280 [93.60 fps - (50, 42)/1024x1280 crop]
1120x1360 [88.50 fps - (2, 2)/1120x1360 crop]
1124x1364 [88.26 fps - (0, 0)/1124x1364 crop]
'SGRBG8' : 320x240 [501.76 fps - (242, 442)/640x480 crop]
480x640 [283.61 fps - (82, 42)/960x1280 crop]
640x480 [220.51 fps - (242, 442)/640x480 crop]
768x1024 [114.73 fps - (178, 170)/768x1024 crop]
1024x768 [148.19 fps - (50, 298)/1024x768 crop]
720x1280 [93.60 fps - (202, 42)/720x1280 crop]
1024x1280 [93.60 fps - (50, 42)/1024x1280 crop]
1120x1360 [88.50 fps - (2, 2)/1120x1360 crop]
1124x1364 [88.26 fps - (0, 0)/1124x1364 crop]
$ libcamera-still --nopreview --camera 0 --immediate --mode 640:480:0:P --latest latest --timestamp
[0:08:53.877194337] [1918] INFO Camera camera_manager.cpp:326 libcamera v0.0.0+5536-20fea059-dirty (2025-05-05T14:33:07UTC)
[0:08:53.884211000] [1921] INFO RPI pisp.cpp:720 libpisp version v1.2.1 981977ff21f3 29-04-2025 (14:13:50)
[0:08:53.885157404] [1921] WARN CameraSensorProperties camera_sensor_properties.cpp:473 No static properties available for 'vd56g3'
[0:08:53.885167923] [1921] WARN CameraSensorProperties camera_sensor_properties.cpp:475 Please consider updating the camera sensor properties database
[0:08:53.905421728] [1921] WARN CameraSensor camera_sensor_legacy.cpp:501 'vd56g3 10-0010': No sensor delays found in static properties. Assuming unverified defaults.
[0:08:53.906803650] [1921] INFO RPI pisp.cpp:1179 Registered camera /base/axi/pcie@1000120000/rp1/i2c@88000/fox@10 to CFE device /dev/media1 and ISP device /dev/media0 using PiSP variant BCM2712_D0
Mode selection for 640:480:12:P
SGRBG10_CSI2P,320x240/0 - Score: 2120
SGRBG10_CSI2P,480x640/0 - Score: 3110
SGRBG10_CSI2P,640x480/0 - Score: 1000
SGRBG10_CSI2P,768x1024/0 - Score: 2918
SGRBG10_CSI2P,1024x768/0 - Score: 1168
SGRBG10_CSI2P,720x1280/0 - Score: 3532.5
SGRBG10_CSI2P,1024x1280/0 - Score: 2896
SGRBG10_CSI2P,1120x1360/0 - Score: 2869.41
SGRBG10_CSI2P,1124x1364/0 - Score: 2869.86
SGRBG8,320x240/0 - Score: 3120
SGRBG8,480x640/0 - Score: 4110
SGRBG8,640x480/0 - Score: 2000
SGRBG8,768x1024/0 - Score: 3918
SGRBG8,1024x768/0 - Score: 2168
SGRBG8,720x1280/0 - Score: 4532.5
SGRBG8,1024x1280/0 - Score: 3896
SGRBG8,1120x1360/0 - Score: 3869.41
SGRBG8,1124x1364/0 - Score: 3869.86
Stream configuration adjusted
[0:08:53.912478039] [1918] INFO Camera camera.cpp:1205 configuring streams: (0) 1124x1364-YUV420 (1) 640x480-GRBG_PISP_COMP1
[0:08:53.912603927] [1921] INFO RPI pisp.cpp:1483 Sensor: /base/axi/pcie@1000120000/rp1/i2c@88000/fox@10 - Selected sensor format: 640x480-SGRBG10_1X10 - Selected CFE format: 640x480-PC1G
[0:08:53.919719090] [1921] ERROR V4L2 v4l2_videodevice.cpp:2049 /dev/video6[18:cap]: Failed to start streaming: Invalid argument
ERROR: *** failed to start camera ***
$ 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/media0
/dev/media2
rp1-cfe (platform:1f00110000.csi):
/dev/video0
/dev/video1
/dev/video2
/dev/video3
/dev/video4
/dev/video5
/dev/video6
/dev/video7
/dev/media1
rpi-hevc-dec (platform:rpi-hevc-dec):
/dev/video19
/dev/media3
dmesg output when I try to get an image:
[ 1089.425044] rp1-cfe 1f00110000.csi: Using a link rate of 804 Mbps
[ 1089.425190] rp1-cfe 1f00110000.csi: stream on failed in subdev
[ 1089.427284] ------------[ cut here ]------------
[ 1089.427287] WARNING: CPU: 1 PID: 2348 at drivers/media/v4l2-core/v4l2-subdev.c:455 call_s_stream+0xf4/0x108 [videodev]
[ 1089.427316] Modules linked in: cfg80211 snd_seq_dummy snd_hrtimer snd_seq snd_seq_device bnep binfmt_misc vd56g3(O) imx296 v4l2_cci regmap_i2c spidev hci_uart btbcm bluetooth ecdh_generic ecc aes_ce_blk aes_ce_cipher ghash_ce gf128mul sha2_ce sha256_arm64 rfkill sha1_ce libaes rp1_cfe sha1_generic raspberrypi_hwmon spi_bcm2835 v4l2_fwnode i2c_brcmstb rpi_hevc_dec pisp_be v4l2_mem2mem v4l2_async videobuf2_dma_contig dwc2 videobuf2_memops videobuf2_v4l2 gpio_keys videodev i2c_designware_platform videobuf2_common mc rp1_mailbox i2c_designware_core rp1_pio rp1_adc raspberrypi_gpiomem rp1 nvmem_rmem i2c_dev ledtrig_pattern fuse dm_mod ip_tables x_tables ipv6 vc4 snd_soc_hdmi_codec snd_soc_core snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd drm_display_helper v3d drm_shmem_helper drm_dma_helper cec gpu_sched drm_kms_helper drm drm_panel_orientation_quirks backlight uio_pdrv_genirq uio
[ 1089.427383] CPU: 1 UID: 1000 PID: 2348 Comm: rpicam-hello Tainted: G W O 6.12.25+rpt-rpi-2712 #1 Debian 1:6.12.25-1+rpt1
[ 1089.427388] Tainted: [W]=WARN, [O]=OOT_MODULE
[ 1089.427389] Hardware name: Raspberry Pi Compute Module 5 Rev 1.0 (DT)
[ 1089.427391] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 1089.427393] pc : call_s_stream+0xf4/0x108 [videodev]
[ 1089.427409] lr : cfe_stop_streaming+0xdc/0x210 [rp1_cfe]
[ 1089.427414] sp : ffffc0008513bae0
[ 1089.427416] x29: ffffc0008513bae0 x28: ffffd06f7090cbe8 x27: ffffd06f70a790f8
[ 1089.427419] x26: 0000000000000000 x25: ffff800104bd3e98 x24: ffff8001456e0b40
[ 1089.427423] x23: ffff800104bd0370 x22: 0000000000000000 x21: 0000000000000000
[ 1089.427427] x20: ffff800104bd0000 x19: 0000000000000008 x18: 0000000000000000
[ 1089.427430] x17: 0000000000000000 x16: ffffd06fcf18efa0 x15: 00007fff2c045c30
[ 1089.427433] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
[ 1089.427437] x11: 0000000000000000 x10: 0000000000000000 x9 : ffffd06f709c3264
[ 1089.427440] x8 : ffffc0008513bda8 x7 : 0000000000000005 x6 : 0000000000000025
[ 1089.427443] x5 : ffff800104bd4358 x4 : 0000000000000000 x3 : ffffd06f70a3eb08
[ 1089.427447] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff8001070c9088
[ 1089.427450] Call trace:
[ 1089.427452] call_s_stream+0xf4/0x108 [videodev]
[ 1089.427468] cfe_stop_streaming+0xdc/0x210 [rp1_cfe]
[ 1089.427471] __vb2_queue_cancel+0x34/0x2d8 [videobuf2_common]
[ 1089.427478] vb2_core_streamoff+0x2c/0xd0 [videobuf2_common]
[ 1089.427483] vb2_ioctl_streamoff+0x54/0xa0 [videobuf2_v4l2]
[ 1089.427490] v4l_streamoff+0x2c/0x40 [videodev]
[ 1089.427505] __video_do_ioctl+0x170/0x3e0 [videodev]
[ 1089.427520] video_usercopy+0x1bc/0x780 [videodev]
[ 1089.427535] video_ioctl2+0x20/0x38 [videodev]
[ 1089.427549] v4l2_ioctl+0x48/0x70 [videodev]
[ 1089.427564] __arm64_sys_ioctl+0xb4/0x100
[ 1089.427569] invoke_syscall+0x50/0x120
[ 1089.427574] el0_svc_common.constprop.0+0x48/0xf0
[ 1089.427577] do_el0_svc+0x24/0x38
[ 1089.427580] el0_svc+0x30/0xd0
[ 1089.427585] el0t_64_sync_handler+0x100/0x130
[ 1089.427588] el0t_64_sync+0x190/0x198
[ 1089.427590] ---[ end trace 0000000000000000 ]---