IMX219-200 camera not working on Jetson nano (gstreamer error)

Hi,

I have an IMX219-200 camera attached to the Jeston nano. The camera is correctly recognised as /dev/video0.
However, I get an error when I run the following command:

$ gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink

The error I get is the following:

GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD… Exiting…
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: CANCELLED
Additional debug info:
Argus Error Status
Execution ended after 0:00:02.261673283
Setting pipeline to PAUSED …
Setting pipeline to READY …

(gst-launch-1.0:13161): GStreamer-CRITICAL **: 09:42:50.403: gst_mini_object_set_qdata: assertion ‘object != NULL’ failed
GST_ARGUS: Cleaning up

How can I resolve this problem please?

Thank you

Hi @KRM_TO

This pipeline worked with Raspberry Pi Camera Module V2.1:

gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! ‘video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12’ ! nvvidconv flip-method=0 ! ‘video/x-raw,width=960, height=616’ ! nvvidconv ! nvegltransform ! nveglglessink -e

Can you try it?

Regards

Hi @mehmetdeniz ,

Thank you for your reply. I tried the command you provided and I still get the same error. I will copy the full text I get when running the command if this might help:

Setting pipeline to PAUSED …

Using winsys: x11
Pipeline is live and does not need PREROLL …
Got context from element ‘eglglessink0’: gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING …
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21,000000 fps Duration = 47619048 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28,000001 fps Duration = 35714284 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29,999999 fps Duration = 33333334 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29,999999 fps Duration = 33333334 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59,999999 fps Duration = 16666667 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120,000005 fps Duration = 8333333 ; Analog Gain range min 1,000000, max 10,625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 3264 H = 2464
seconds to Run = 0
Frame Rate = 21,000000
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD… Exiting…
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: CANCELLED
Additional debug info:
Argus Error Status
EOS on shutdown enabled – waiting for EOS after Error
Waiting for EOS…

(gst-launch-1.0:14512): GStreamer-CRITICAL **: 11:18:05.020: gst_mini_object_set_qdata: assertion ‘object != NULL’ failed
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 266)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 368)

I searched a lot for a solution but nothing worked. I even tried on a second Jeston nano and I get the same error.

Regards

Hi @KRM_TO

Have you tried this pipeline?

DISPLAY=:0.0 gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1’ ! nvoverlaysink -e

https://www.waveshare.com/wiki/IMX219-200_Camera

Hi @mehmetdeniz ,

Yes I tried it, and I get the same error.

Did you get any failure logs with this:

dmesg | grep imx219

No, no failure logs

The issue might be that your camera runs into a higher resolution than your monitor can do. Does a lower resolution work ?

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), format=NV12, witdh=640, height=480, framerate=30/1' ! nvoverlaysink

Note that if running headless and remotely, this won’t work.

Hi @Honey_Patouceul,

I am not running remotely, I have a monitor connected to the Jetson.
The command you provided does not work, it gives the same error.

In fact, I tried all the available sensor modes, and always the same error.

Do you have video node /dev/video0 ?:

ls -l /dev/video*

If not, there is no driver or it failed to probe camera. You may upload the kernel boot messages:

dmesg > dmesg.log

If /dev/video0 is there, post the output of (v4l2-ctl is provided by apt package v4l-utils):

v4l2-ctl -d0 --list-formats-ext

You may also tell which is your carrier board if not a B01 devkit, and if you have a customized setup (kernel, device tree…).

Yes I have. When I run this command I get:
crw-rw----+ 1 root video 81, 0 avril 15 17:40 /dev/video0

The output of this command is:
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RG10’
Name : 10-bit Bayer RGRG/GBGB
Size: Discrete 3264x2464
Interval: Discrete 0.048s (21.000 fps)
Size: Discrete 3264x1848
Interval: Discrete 0.036s (28.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1640x1232
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)

I have the B01 devkit, and no customized setup (the nano + monitor + keyboard + mouse + ethernet + camera)

On the waveshare wiki page of the IMX219-200 (IMX219-200 Camera - Waveshare Wiki), they use the following command to test the camera:
DISPLAY=:0.0 gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1’ ! nvoverlaysink -e

This command also returns the same error for me. However, what seems odd is that in the command they use a width of 3280 and a height of 2464 which is not an available sensor mode according to the output I get (in a previous reply). The closest available sensor mode is 3264x2464.

I have no experience with Waveshare IMX219-200 sensor, but it may require specific driver and device tree (maybe also a specific ISP config). Contact their support for these.
Standard L4T has driver and device tree support for RPi v2 IMX219 sensor.