MIPI Camera Streaming not working

Hi,

I have MIPI camera from Khadas, running VIM3 Ubuntu image and trying to connect a camera to any monitoring system.
So far I’ve tried using GitHub - Motion-Project/motion: Motion, a software motion detector. Home page: https://motion-project.github.io/ and GitHub - kerberos-io/agent: An open and scalable video surveillance system for anyone making this world a better and more peaceful place.. Both attempts failed.

When trying to use motion I’ve got errors:

[1:ml1] [ERR] [VID] [Jan 11 16:27:50] v4l2_device_capability: Device does not support capturing.
[1:ml1] [ERR] [VID] [Jan 11 16:27:50] vid_start: V4L2 device failed to open
[1:ml1] [WRN] [ALL] [Jan 11 16:27:50] motion_init: Could not fetch initial image from camera

I’ve also tried to use simple ffmpeg command

ffmpeg -f v4l2 -video_size 1280x720 -i /dev/video0

and got similar results:

[video4linux2,v4l2 @ 0x55936ce790] Not a video capture device.
/dev/video0: No such device

I’ve also run command I’ve found on this forum:

v4l2_test -c 1 -p 0 -F 0 -f 0 -D 0 -R 1 -r 2 -d 2 -N 1000 -n 800 -w 0 -e 1 -I 0 -b /dev/fb0 -v /dev/video0

but it only displayed stream on my screen for couple seconds and nothing chaned.

When running guvcview according to VIM3 docs, everything work as intended.

When I run: v4l2-ctl -D

I’ve got:

Driver Info:
	Driver name      : ARM-camera-isp
	Card type        : juno R2
	Bus info         : platform:isp-v4l2-0
	Driver version   : 4.9.241
	Capabilities     : 0x85201000
		Video Capture Multiplanar
		Read/Write
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x05201000
		Video Capture Multiplanar
		Read/Write
		Streaming
		Extended Pix Format

Is it possible that Video Capture Multiplanar is causing this issue or is it normal?

Thanks in advance

Hello and welcome to the community,
I think your camera has not been recognised by the system yet,

first update the system to the latest:

after your update is finished, make sure that your “os08a10” overlay is enabled correctly, it should be by default.

reboot the system after doing these things, and retry your test for the camera,

please try these things and confirm the diagnosis of your problem :slight_smile:

cheers

v4l2_test -c 1 -p 0 -F 0 -f 0 -D 0 -R 1 -r 2 -d 2 -N 1000 -n 800 -w 0 -e 1 -I 0 -b /dev/fb0 -v /dev/video0

but it only displayed stream on my screen for couple seconds and nothing chaned.

You need to check the v4l2_test program parameters.

-N 1000 means only display 1000 frames, so after 1000 frames the test program exit. If you want to display more time, you can increase this value.

Is it possible that Video Capture Multiplanar is causing this issue or is it normal?

Yes, maybe it is the reason, the MIPI camera is Multiplanar.

Thanks for fast replies and sorry for my late response, I had to reinstall system on khadas because of issues not related to the camera.

Unfortunately after reinstalling a system, upgrading to latest version, ensuring device is presented in /boot/env.txt I cannot even see a camera in v4l2 devices.

System:

Linux Khadas 5.7.0 #0.9.1 SMP Tue Jun 2 17:07:41 CST 2020 aarch64 aarch64 aarch64 GNU/Linux

/boot/env/txt:

overlays=uart3 pwm_f i2c3 os08a10

root@Khadas:~# v4l2-ctl --list-devices
Amlogic Video Decoder (platform:meson-vdec):
/dev/video0

root@Khadas:~# sudo v4l2-ctl --device=/dev/video0 --all
Driver Info:
Driver name : meson-vdec
Card type : Amlogic Video Decoder
Bus info : platform:meson-vdec
Driver version : 5.7.0
Capabilities : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Priority: 2
Format Video Capture Multiplanar:
Width/Height : 1280/720
Pixel Format : ‘NM12’ (Y/CbCr 4:2:0 (N-C))
Field : None
Number of planes : 2
Flags :
Colorspace : Default
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Plane 0 :
Bytes per Line : 1280
Size Image : 983040
Plane 1 :
Bytes per Line : 1280
Size Image : 491520
Format Video Output Multiplanar:
Width/Height : 1280/720
Pixel Format : ‘VP90’ (VP9)
Field : None
Number of planes : 1
Flags :
Colorspace : Default
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Plane 0 :
Bytes per Line : 0
Size Image : 1048576

User Controls

min_number_of_capture_buffers 0x00980927 (int) : min=1 max=32 step=1 default=1 value=1 flags=read-only

It’s also not working in gucview. Can it be issue with latest update?

Please use the image with Linux 4.9, Linux 5.x does not support camera now.

2 Likes