Working with the camera

Which version of system do you use? Khadas official images, self built images, or others?

Ubuntu 22.04 Gnome

Please describe your issue below:

I’ve got a camera to test with the Khadas Edge2 but am unable to get it working correctly.

I can get an output on display using Cheese, but the image is cut in half and on the right there’s a big green border.

Post a console log of your issue below:

khadas@Khadas:~$ v4l2-ctl -d /dev/video24 --set-fmt-video=width=720,height=480,pixelformat=NV12 --stream-mmap=3 --stream-skip=3 --stream-to=./data0.yuv --stream-count=1 --stream-poll
<<<<

This seems to work. It creates a file “data0.yuv” , no idea how to open the file.
Using Cheese the best I get is this. device name rkisp_mainpath


Image cut in pieces and the green border on the right.

VLC can’t show it either when choosing video24
'VLC is unable to open the MRL v4l2:///dev/video24"
I tried every video source.

Any suggestions on how to use this thing? I rather have a gui program to work with it.

You can use ffmpeg to view the picture.

$ ffplay -f rawvideo -pixel_format nv12 -video_size 720x480 data0.yuv
1 Like

Can you try with guvcview?

$ guvcview -d /dev/video24

I checked on my side with a new version of kernel and it works.

1 Like

Thank you for answering. I’m not having any luck.
Doing guvcview -d /dev/video24
No video, I tried all kinds of settings. Many crash the system.

hadas@Khadas:~$ guvcview -d /dev/video24
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev5
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev1
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev7
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev4
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev0
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev6
Failed to query video capabilities: Invalid argument
libv4l2: error getting capabilities: Invalid argument
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev3
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev2
V4L2_CORE: ERROR opening V4L2 interface for /dev/video0
V4L2_CORE: ERROR opening V4L2 interface for /dev/video1
V4L2_CORE: ERROR opening V4L2 interface for /dev/video2
V4L2_CORE: ERROR opening V4L2 interface for /dev/video3
V4L2_CORE: ERROR opening V4L2 interface for /dev/video4
V4L2_CORE: ERROR opening V4L2 interface for /dev/video5
V4L2_CORE: ERROR opening V4L2 interface for /dev/video6
V4L2_CORE: ERROR opening V4L2 interface for /dev/video7
Failed to query video capabilities: Invalid argument
libv4l2: error getting capabilities: Invalid argument
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev9
Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.V4L2_CORE: ERROR opening V4L2 interface for /dev/video16
V4L2_CORE: ERROR opening V4L2 interface for /dev/video17
V4L2_CORE: ERROR opening V4L2 interface for /dev/video18
V4L2_CORE: ERROR opening V4L2 interface for /dev/video19
V4L2_CORE: ERROR opening V4L2 interface for /dev/video20
V4L2_CORE: ERROR opening V4L2 interface for /dev/video21
V4L2_CORE: ERROR opening V4L2 interface for /dev/video22
V4L2_CORE: ERROR opening V4L2 interface for /dev/video23
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev8
Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for capture 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for output 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for output 
V4L2_CORE: Unable to find parent usb device.Using mplane plugin for output 
V4L2_CORE: Unable to find parent usb device.V4L2_CORE: Unable to find parent usb device.V4L2_CORE: Unable to find parent usb device.GUVCVIEW: version 2.0.7
Using mplane plugin for capture 
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
    - FORMAT NOT SUPPORTED BY DECODER -
V4L2_CORE: failed to subscribe events for control 0x009f0001: Inappropriate ioctl for device
V4L2_CORE: failed to subscribe events for control 0x009f0902: Inappropriate ioctl for device
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
V4L2_CORE: (VIDIOC_G_PARM) error: Inappropriate ioctl for device
V4L2_CORE: Unable to set 1/25 fps
V4L2_CORE: (VIDIOC_G_PARM) error: Inappropriate ioctl for device
Couldn't open plugin directory: No such file or directory
No plugins found, falling back on no decorations
arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '6'.
RENDER: (SDL2) Couldn't open window: failed to create an EGL window surface
RENDER: Couldn't init the SDL2 rendering engine
control[0]:(unknown - 0x6) 0x9f0001 'Image Processing Controls'
V4L2_CORE: (VIDIOC_G_PARM) error: Inappropriate ioctl for device
V4L2_CORE: Unable to set 1/1 fps

The camera does get warm, but no video output. If I record video it records the audio, but no image.
The system is up to date. But using 5.10.66
Is there a later kernel that you use or the same?
Thank you!

Hello @NicoD

Please try to update SDL2 and try again.

https://docs.khadas.com/products/sbc/edge2/troubleshooting/ubuntu22.04-fixup

1 Like

Thank you. I’m a step closer.
Now I do get video from my camera with guvcview, but it’s the same as it was with cheese.
It is cut in 3 parts, 2 parts video and one part green.

Springershop adviced me to use NV12. But that gives a way worse result with all green stripes.

With many other settings it seems to crash the desktop.
I’ve tested the camera with Android and there it works “normal”.
Not working great, but it displays the whole video source.

Are you using the same camera as from Springershop.eu? IMX415?

I had to use my own lens with it since the lens delivered was a zoom lens and no ir filter.
So everything super zoomed in and all pink of color.
This lens works better, no zoom and colors are “normal”. But I do have a lot of ghosting going on in Android.

Thank you for the help.

Hello @NicoD

Are you use the command line to start Guvcview?

$ guvcview -d /dev/video24

Yes I am using this on command line.

Antoher difference is that I used another version of kernel on my side which is not released yet, but will soon.

2 Likes