I am developing my own camera for Xavier NX. I can use v4l2-ctl to grab image by below command:
$ v4l2-ctl --set-fmt-video=width=1280,height=1024,pixelformat=RG8 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw -d /dev/video0
I can also increase --stream-count to grab multiple frames.
But I can’t use opencv to grab streaming image. Here is test code:
Here is console output when running the above code:
Built with OpenCV 4.1.1
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Capture is opened
Image size: W=1280, H=1024
Here is output from serial debug output:
[ 6835.095879] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 128, err_data 131072
[ 6837.748735] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 6837.748896] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[ 6837.749076] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[ 6837.752841] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel
[ 6837.820134] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 134, err_data 131072
[ 6837.853334] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 128, err_data 131072
[ 6840.564528] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 6840.564688] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[ 6840.564869] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[ 6840.566593] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel
[ 6840.610837] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 134, err_data 131072
I tried gst-launch-1.0
$ gst-launch-1.0 nvarguscamerasrc ! nvoverlaysink
but output like this:
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:557 No cameras available
Got EOS from element “pipeline0”.
Execution ended after 0:00:00.355366777
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
ls /dev can find /dev/video0 and dev/video1, and I can use v4l2-ctl to capture images.
when running above python code, it returns error as below:
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:557 No cameras available
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
same issue it can’t find the camera.
Here are other output for your reference:
$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RGGB’
Name : 8-bit Bayer RGRG/GBGB
Size: Discrete 1280x1024
Interval: Discrete 0.033s (30.000 fps)
$ media-ctl -p
Media controller API version 0.1.0
Media device information
driver tegra194-vi5
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 0.0.0
I have gone through all my codes line by line with imx219’s code, but didn’t find anything I can modify.
Is there any other command I can debug?
Your help will be greate appreciated.
It must be the device tree have problem for below message. Maybe be the devname in tegra_camera_platform not match with kernel driver report.(sc130gs 9-0030)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:557 No cameras available
the port binding and sensor default configuration should be correct since you’re able to enable camera stream with v4l2 standard control to grab several images.
please refer to Camera Architecture Stack, device tree (i.e. DT) properties were important configuration while you’d enable camera via libargus. those camera pipeline initial configurations were define by DT properties.
it usually related to pixel clock settings, please check Sensor Pixel Clock session and examine your sensor pixel clock calculation formulas.
please also check Debug Tips chapter for reference to check your sensor driver.
thanks
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
/GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstNvOverlaySink-nvoverlaysink:nvoverlaysink-nvoverlaysink0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:557 No cameras available
Got EOS from element “pipeline0”.
Execution ended after 0:00:00.095911760
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
Looks like the same error.
Please help to advise if I can check anything else?
Hi,
It is till an issue in your sensor driver. For driver programming, the document is with clear information and we have shared guidance/tips. If you are not able to investigate further, probably you can consider to use existing camera modules from our partners. We have the partner list and please take a look at
Not sure, but you may have your driver to provide RG10 (10 bits bayer) for using ISP as IMX219.
Otherwise sacrify one core for debayering as in my previous pipeline. You would try adding queue plugins around such as (not tested, you might try yourself):
Would this be working, it would just be a workaround.
You’d better fix your camera driver or DT settings as Jerry mentionned, so that you could use HW debayering with Argus.