radxa-build / radxa-zero3

Radxa ZERO 3
https://docs.radxa.com/en/rock3
26 stars 3 forks source link

Radxa Camera 8M don't work #15

Closed nerbivol closed 1 month ago

nerbivol commented 3 months ago

System Configuration

I use Radxa Camera 8M and choose Raspberry Pi Camera V2 (because Radxa Camera 8M does not exist in rsetup). image In the file /boot/extlinux/extlinux.conf, the code is as follows:

# /boot/extlinux/extlinux.conf

##
## IMPORTANT WARNING
##
## The configuration of this file is generated automatically.
## Do not edit this file manually, use: u-boot-update
##

default l0
menu title U-Boot menu
prompt 1
timeout 10

label l0
  menu label Debian GNU/Linux 11 (bullseye) 5.10.160-26-rk356x
  linux /boot/vmlinuz-5.10.160-26-rk356x
  initrd /boot/initrd.img-5.10.160-26-rk356x
  fdt /usr/lib/linux-image-5.10.160-26-rk356x/
  fdtoverlay /boot/dtbo/radxa-zero3-rpi-camera-v2.dtbo
  append root=UUID=e4dcf7b3-d6e7-4a53-8267-d85088ac4ff3 console=ttyFIQ0,1500000n8 quiet splash loglevel=4 rw earlycon consoleblank=0 coherent_pool=2M irqchip.gicv3_pseudo_nmi=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1

label l0r
  menu label Debian GNU/Linux 11 (bullseye) 5.10.160-26-rk356x (rescue target)
  linux /boot/vmlinuz-5.10.160-26-rk356x
  initrd /boot/initrd.img-5.10.160-26-rk356x
  fdt /usr/lib/linux-image-5.10.160-26-rk356x/
  fdtoverlay /boot/dtbo/radxa-zero3-rpi-camera-v2.dtbo
  append root=UUID=e4dcf7b3-d6e7-4a53-8267-d85088ac4ff3 console=ttyFIQ0,1500000n8 splash loglevel=4 rw earlycon consoleblank=0 coherent_pool=2M irqchip.gicv3_pseudo_nmi=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 single

When I run the command sudo cheese, I get the following error:

(cheese:1621): cheese-WARNING **: 09:19:15.883: Failed to allocate required memory... ../sys/v4l2/gstv4l2src.c(700): gst_v4l2src_decide_allocation (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source/GstBin:bin28/GstV4l2Src:v4l2src1:
Buffer pool activation failed

When I run the following GStreamer pipeline:

radxa@radxa-zero3:~$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080 ! jpegenc ! multifilesink location=/home/radxa/test.jpg

I get this error:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.003069317
Setting pipeline to NULL ...
Freeing pipeline ...

USB Devices

radxa@radxa-zero3:~$ lsusb
Bus 006 Device 002: ID 2109:0817 VIA Labs, Inc. USB3.0 Hub             
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 004: ID 1a2c:2c27 China Resource Semico Co., Ltd USB Keyboard
Bus 005 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 005 Device 002: ID 2109:2817 VIA Labs, Inc. USB2.0 Hub             
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Video Devices

radxa@radxa-zero3:~$ v4l2-ctl --list-devices
rkisp-statistics (platform: rkisp):
    /dev/video7
    /dev/video8

rkisp_mainpath (platform:rkisp-vir0):
    /dev/video0
    /dev/video1
    /dev/video2
    /dev/video3
    /dev/video4
    /dev/video5
    /dev/video6
    /dev/media0
RadxaYuntian commented 3 months ago

What is the result when you run rsetup - Hardware - Video capture devices? It should save a picture under /root/ folder.

nerbivol commented 3 months ago

image

and output in terminal

image

nerbivol commented 3 months ago

Hardware connections are as follows: image

RadxaYuntian commented 3 months ago

I forgot there was an issue in currently released rsetup regarding camera test. It was fixed in 0.4.6 but it is not released yet.

We will take a look at this.

nerbivol commented 3 months ago

Code for update to 0.4.6 version:

sudo apt-get update
sudo apt-get build-dep --no-install-recommends .
sudo apt-get install git-buildpackage
wget https://github.com/radxa-pkg/rsetup/releases/download/0.4.6/rsetup_0.4.6_all.deb
sudo dpkg -i rsetup_0.4.6_all.deb 

And results from rsetup video capture image

Otput from terminal:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../sys/v4l2/gstv4l2src.c(700): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.020098472
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Freeing pipeline ...
Sviatoslav007 commented 3 months ago

I have a similar problem, the camera from Radxa does not want to connect to the Radxa zero W3 board, which is a very strange problem, given that the software is from the same manufacturer @RadxaYuntian

Radxa-Alvin commented 3 months ago

Please run the following command to see it,check whether the camera is mounted successfully sudo dmesg | grep imx

nerbivol commented 3 months ago
radxa@radxa-zero3:~$ sudo dmesg | grep imx

[sudo] password for radxa: 
[   19.989369] imx219 2-0010: driver version: 00.01.01
[   20.092275] imx219 2-0010: Reading register 100 from 10 failed
[   20.195585] imx219 2-0010: Reading register 100 from 10 failed
[   20.507604] imx219 2-0010: Error -5 setting default controls
[   20.507850] imx219: probe of 2-0010 failed with error -5
Radxa-Alvin commented 3 months ago

It looks like the camera didn't load properly.Need to check whether the cable and camera are normal.

nerbivol commented 3 months ago

It seems the camera isn't working. The cable is connected as shown in the documentation (we've also tried different connections and cables), but we haven't had any success. Do you have functional Radxa camera and Radxa ZERO 3w board units?

nerbivol commented 3 months ago

Please run the following command to see it,check whether the camera is mounted successfully sudo dmesg | grep imx

radxa@radxa-zero3:~$ sudo dmesg | grep imx
[sudo] password for radxa: 
[   19.844757] imx219 2-0010: driver version: 00.01.01
[   19.869602] imx219 2-0010: Model ID 0x0219, Lot ID 0x5b2402, Chip ID 0x06d1
[   19.880573] rockchip-csi2-dphy csi2-dphy0: dphy0 matches m00_b_imx219 2-0010:bus type 5

@Radxa-Alvin does this mean I have a properly connected camera?

nerbivol commented 2 months ago

Update for Current State:

I am encountering multiple errors when executing certain commands on my Radxa Zero 3 device.

Command 1:

radxa@radxa-zero3:~$ sudo rsetup
[sudo] password for radxa: 
error: XDG_RUNTIME_DIR not set in the environment.
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Cannot identify device '/dev/Capture a picture'.
Additional debug info:
../sys/v4l2/v4l2_calls.c(608): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: No such file or directory
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...

Command 2:

radxa@radxa-zero3:~$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080 ! jpegenc ! multifilesink location=/home/radxa/test.jpg
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:19.053323709
Setting pipeline to NULL ...
Freeing pipeline ...

Command 3:

radxa@radxa-zero3:~$ sudo cheese
[sudo] password for radxa:
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
libGL error: failed to create dri screen
libGL error: failed to load driver: rockchip
error: XDG_RUNTIME_DIR not set in the environment.

(cheese:2509): dconf-WARNING **: 10:09:57.859: failed to commit changes to dconf: 
Failed to execute child process “dbus-launch” (No such file or directory)
...

Please let me know if you need more details or further clarification.

nerbivol commented 2 months ago

Can I get any advice or suggestions to help resolve these issues?

RadxaYuntian commented 2 months ago

Can you please take a picture of the back of your ZERO 3? Focus on the CSI connector.

nerbivol commented 2 months ago

image

RadxaYuntian commented 2 months ago

We recently found out that some ZERO 3 uses the wrong CSI connector, which is the one you are having. Those systems will need a different CSI cable, which we plan to provide to the affected customer free of charge. For now please disconnect the camera from ZERO 3 to avoid potential malfunction due to incompatible cable.

Do you happen to still have the card box around? We'd like to check the serial number to determine the affected batch.

nerbivol commented 2 months ago

image

RadxaYuntian commented 2 months ago

Thanks, and I assume both are having camera issue right?

nerbivol commented 2 months ago

Yes

RadxaYuntian commented 2 months ago

Thanks. I'll contact you again once the cable is ready.

nerbivol commented 2 months ago

Can you provide an approximate waiting time for cable production?

RadxaYuntian commented 2 months ago

We just verified the sample working on the affected ZERO 3. We now placed the full production order.

nerbivol commented 2 months ago

Understood. Thank you for your quick response. I look forward to further updates from you

RadxaYuntian commented 2 months ago

Hi nerbivol. The special CSI cable is now ready. Please send your shipping info to support@radxa.com as well as the quantity of affected ZERO 3. We will arrange the shipping to you shortly.

nerbivol commented 1 month ago

We've received the special CSI cable, and I'm happy to report that the camera is working perfectly.