Could not open device '/dev/video0' for reading and writing

Hi everyone!

I’ve spent quite some time now trying to run my PI camera V2.1 on a rock4SE running raspbian without success. My goal here, is really just to test that the camera is working.

I first hadn’t got any /dev/video0 device, so I followed the instructions on the following post: https://www.linuxquestions.org/questions/linux-newbie-8/missing-dev-video0-261133/

“rm /dev/video /dev/video0
mknod /dev/video0 c 81 0
chmod 666 /dev/video0
chgrp video /dev/video0
ln -s /dev/video0 /dev/video”
And I do have a shinny new /dev/video0 although I am not sure it is in any way linked to the actual MSI camera I plugged onto board…

So then I’ve tried launching the following command:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! xvimagesink

which insults me back:

Setting pipeline to PAUSED …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not open device ‘/dev/video0’ for reading and writing.
Additional debug info:
…/sys/v4l2/v4l2_calls.c(622): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: No such device or address
ERROR: pipeline doesn’t want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL …
Freeing pipeline

I’m really not sure why such error happens. I have tried giving to chmod 777 /dev/video0 for testing but it didn’t change anything.

This is rather puzzling to me since this very camera worked just fine on a RPI2.

If you guys have any tip on how to get this simple command working, any workaround anything… that would be apperciated.

try video1, my camera shows up as video1.

Or use v4utils to list available cameras

Thank you for your fast answer.
Launching v4l2-ctl --list-devices, I get:
“Cannot open device /dev/video0, exiting.”

with dmesg | grep video:
[ 13.532387] videodev: Linux video capture interface: v2.00
[ 15.234326] mpp_rkvdec ff660000.rkvdec: shared_video_hevc_cabac is not found!
[ 16.101462] usbcore: registered new interface driver uvcvideo

more simply, by launching ls /dev/:
video-dec0
video-enc0

So it seems like I have no more video1 than video0.
I made sure the camera is plugged but it seems like the driver is just not there.