Hardware/Software Environment:
- Device: Jetson Xavier NX
- JetPack Version: 5.1.2 (L4T 35.3.1)
- Kernel: 5.10.120-tegra
- Camera: [e.g., IMX219, AR0234, or USB cam model]
Issue Description:
Our application hangs indefinitely when calling v4l2_ioctl(fd, VIDIOC_STREAMOFF, &buf_type) for V4L2 capture streams. Stack traces consistently show blocking in NvOsThreadJoin within libtegrav4l2.so, indicating the driver’s internal capture thread fails to terminate.
Key Observations:
Blocking Callstack (from GDB):
#0 __pthread_clockjoin_ex (threadid=281470383349520, thread_return=0x0, clockid=0, abstime=, block=) at pthread_join_common.c:145
#1 0x0000ffff39fe24d8 in NvOsThreadJoin () at /usr/lib/aarch64-linux-gnu/tegra/libnvos.so
#2 0x0000ffff1c9ce454 in () at /usr/lib/aarch64-linux-gnu/tegra/libtegrav4l2.so
#3 0x0000ffff1c9cf290 in () at /usr/lib/aarch64-linux-gnu/tegra/libtegrav4l2.so
#4 0x0000ffff1c9cbb60 in TegraV4L2_Ioctl () at /usr/lib/aarch64-linux-gnu/tegra/libtegrav4l2.so
#5 0x0000ffff1ca2e050 in plugin_ioctl () at /usr/lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvvideocodec.so
#6 0x0000ffff40022390 in v4l2_ioctl () at /lib/aarch64-linux-gnu/libv4l2.so.0
#7 0x0000ffff9c39d6bc in NvV4l2ElementPlane::setStreamStatus(bool) (this=0xffff880e0fe8, status=false) at NvV4l2ElementPlane.cpp:570
#8 0x0000ffff9c39c9c4 in NvV4l2ElementPlane::deinitPlane() (this=0xffff880e0fe8) at NvV4l2ElementPlane.cpp:461
#9 0x0000ffff9c3adb80 in NvV4l2Element::~NvV4l2Element() (this=0xffff880e0dd0, __in_chrg=) at NvV4l2Element.cpp:90
#10 0x0000ffff9c369594 in NvVideoDecoder::~NvVideoDecoder() (this=0xffff880e0dd0, __in_chrg=) at NvVideoDecoder.cpp:85
#11 0x0000ffff9c3695b4 in NvVideoDecoder::~NvVideoDecoder() (this=0xffff880e0dd0, __in_chrg=) at NvVideoDecoder.cpp:87