ERROR: v4l2 capture: slave not found!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ERROR: v4l2 capture: slave not found!

1,612 Views
zhiyuan_song
Contributor II

When I run the executable on the development board.

[ 1959.306627] ERROR: v4l2 capture: slave not found!
VIDEOIO ERROR: libv4l unable to ioctl S_FMT
VIDEOIO ERROR: libv4l unable to ioctl VIDIOCSPICT

#include <opencv2/ opencv.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui. hpp>
#include <opencv2/videoio. hpp>
#include <iostream>
using nanespace CV;
using namespace std;
int main()
{
cout<<"Built with opencv"<<CV_ VERSION<<endl;
VideoCapture capture(0);
if( !capture. isopened())
cout<<"open camera failed."<<endl;
return - 1;
}
Mat frame;
while( 1)
capture>>frame ;
if(frame . empty())
break;
imshow( "video" , frame);
if(waitKey(20)>0)
break;
}
return 0;

0 Kudos
3 Replies

1,493 Views
igorpadykov
NXP Employee
NXP Employee

Hi song

error may be caused by i2c errors, one can debug it with oscilloscope in

ov5640 I2C probe function ov5640_probe() or similar if other sensor was used

ov5640.c\capture\mxc\platform\media\drivers - linux-imx - i.MX Linux kernel 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,493 Views
zhiyuan_song
Contributor II

When I use the    gst-launch 1.0 imxv4l2src device=/dev/video0! Imxv4l2sink device = / dev/video16 it will work normally。That means there is no problem with I2C。

I'm using opencv to call the camera.

0 Kudos

1,493 Views
igorpadykov
NXP Employee
NXP Employee

you can debug it using AN4553 Using Open Source Debugging

Tools for Linux on i.MX Processors
https://www.nxp.com/docs/en/application-note/AN4553.pdf

Best regards
igor

0 Kudos