Open /dev/video ,function is not responding

AGX Xavier, opencv3.4.12 ,
MIPI CSI interface, use eight 720p AHD camera; ubuntu 18.04

Hi teams,
When I use command below, all images are ok,eight, cameras can display normally.
gst-launch-1.0 v4l2src device = /dev/video0 ! xvimagesink &
gst-launch-1.0 v4l2src device = /dev/video1 ! xvimagesink &
gst-launch-1.0 v4l2src device = /dev/video2 ! xvimagesink &
gst-launch-1.0 v4l2src device = /dev/video3 ! xvimagesink &
gst-launch-1.0 v4l2src device = /dev/video4 ! xvimagesink &
gst-launch-1.0 v4l2src device = /dev/video5 ! xvimagesink &
gst-launch-1.0 v4l2src device = /dev/video6 ! xvimagesink &
gst-launch-1.0 v4l2src device = /dev/video7 ! xvimagesink &

and then, I tried to open /dev/video with opencv , as below:

cv::VideoCapture capture0;
sleep(3);
capture0.open("/dev/video0")

cv::VideoCapture capture1;
sleep(3);
capture0.open("/dev/video1")    ...    .... ......

sometimes all is ok, but sometimes it will err,and running in the function " capture.open" all the time, nothing is returned.

I got the below log :
[ 36.452606] tegradc 15210000.nvdisplay: blank - powerdown
[ 36.452618] tegradc 15220000.nvdisplay: blank - powerdown
[ 48.487687] vdd-1v8-sd: disabling
[ 48.487741] vdd-epb-1v0: disabling
[ 48.487746] vdd-sdmmc1-sw: disabling
[ 48.487756] vdd-sata-1v5: disabling
[ 48.487764] vdd-1v8-slt: disabling
[ 48.487769] vdd-3v3-slt: disabling
[ 48.487774] vdd-fan: disabling
[ 48.487779] vdd-hdmi-p1-5v0: disabling
[ 48.487784] vdd_sys_en: disabling
[ 298.875546] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 305.595503] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 312.091495] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 318.513830] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 112, err_data 6291554
[ 318.531534] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 683.239730] FAN rising trip_level:1 cur_temp:50000 trip_temps[2]:63000

when the log below occur, The program(capturex.open(“/dev/videx1”) ) enters an endless loop。

[ 318.513830] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags:

at this time, use gst-launch-1.0 v4l2src device = /dev/videox ! xvimagesink &
I got the below log :
stcv@stcv-desktop:~$ gst-launch-1.0 v4l2src device = /dev/video1 ! xvimagesink &
[1] 10308
stcv@stcv-desktop:~$ Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device ‘/dev/video1’ is busy
Additional debug info:
gstv4l2object.c(3754): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Call to S_FMT failed for UYVY @ 1280x720: Device or resource busy
Execution ended after 0:00:00.000359424
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Could you help me have a look ?
thanks

Hi,
For further investigation, you can try to launch the cameras in single gst-launch-1.0 command like:

gst-launch-1.0 v4l2src device=/dev/video0 ! fakesink v4l2src device=/dev/video1 ! fakesink v4l2src device=/dev/video2 ! fakesink v4l2src device=/dev/video3 ! fakesink v4l2src device=/dev/video4 ! fakesink v4l2src device=/dev/video5 ! fakesink v4l2src device=/dev/video6 ! fakesink v4l2src device=/dev/video7 ! fakesink

To check if the cameras can be run well in gstreamer command. If it works, you can try to run multiple cv2.VideoCapture(GSTREAMER_COMMAND) like:
Issue with multi-camera gstreamer capture using OpenCV - #6 by DaneLLL

In fact, the cameras can be run well in gstreamer command. but,the log display this message:

[ 56.683172] vdd-1v8-slt: disabling
[ 56.683177] vdd-3v3-slt: disabling
[ 56.683183] vdd-fan: disabling
[ 56.683188] vdd-hdmi-p1-5v0: disabling
[ 56.683193] vdd_sys_en: disabling
[ 305.638854] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 312.302911] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 315.242848] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 315.242995] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[ 315.243177] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[ 315.246147] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel
[ 321.434855] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 323.946841] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 323.946996] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[ 323.947183] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[ 323.951252] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel

What’s the meaning of this err message? how can i do to improve it?

It could be capture failed sometimes and able recovery back, it could be sensor MIPI timing cause the issue. May need to probe the signal to check if match MIPI spec.

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.