V4l2_open create core with JetPack 4.5 or later

Hi all

I have 2 Jetson Nano machines.
One is Jetson Nano A with JetPack 4.4.1.
Other one is Jetson Nano B01 with JetPack 4.5.

I created application which capture from USB camera and evaluate its images.
This application use video 4 linux interface.
Jetson Nano A with JetPack 4.4.1 works fine.
But Jetson Nano B01 with JetPack 4.5 creates core file and die.

minimum source code which reproduces this issue is as follows

#include <string>
#include <libv4l2.h>
#include <linux/videodev2.h>
#include <sys/ioctl.h>
#include <fcntl.h>

int main(int argc, char *argv[])
    int fd = v4l2_open("/dev/video0", O_RDWR);
    return 0;

stack trace is as follows:

(gdb) bt
#0  0x0000007f965d0090 in  () at /usr/lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvargus.so
#1  0x0000007f965d0f9c in  () at /usr/lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvargus.so
#2  0x0000007f965cf8f8 in  () at /usr/lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvargus.so
#3  0x0000007f965cf6b8 in  () at /usr/lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvargus.so
#4  0x0000007f96ac2b20 in  () at /usr/lib/aarch64-linux-gnu/libv4l2.so.0
#5  0x0000007f96abe6c0 in v4l2_fd_open () at /usr/lib/aarch64-linux-gnu/libv4l2.so.0
#6  0x0000007f96abee24 in v4l2_open () at /usr/lib/aarch64-linux-gnu/libv4l2.so.0
#7  0x0000005580ba0e10 in main ()

Does JetPack support v4l2_open ?
When does this issue fixed?
Are there any other document which I should read?

This is a known issue of JP4.5. Related topics:
Libv4l2_nvargus.so source code
VLC fails with L4T 32.5

If you run v4l2src in gstreamer command, it should work fine.

Hi DaneLLL

Thank you for your reply.
I found workaround by myself which is described in that topics on 19th Feb.

That is, I use open() instead of v4l2_open(), it can run fine.
But I forgot to write this workaround.

Should I use open() instead of v4l2_open()?

Calling open() should be fine. It is also called in gst_v4l2_open():
gst-plugins-good/v4l2_calls.c at master · GStreamer/gst-plugins-good · GitHub

Please refer to the source code of v4l2src.

1 Like

Hi DaneLLL,

I already checked source code when I found my workaround.
I am satisfied with your agreement. Thank you very much.

I hope this topics is closed.
What should I do?


Good to know you can continue your development on Jetson Nano. We will update once it is resolved.