Jetson nano stop camera read stereo IMX219-83 when read camera 4-5h or 24h-48h

I built a 24/7 face recognition program that runs on a jetson nano dev kit. Encountering an error related to reading gstream camera with opencv (stereo camera IMX219-83), when initially reading the camera, it runs normally after about 4-5 hours, then the camera automatically stops and gets an error like below:

(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)
2024-03-20 19:00:02,704 - WARNING - [camera.py:82] - Failed to read frame from camera. Retrying…
CONSUMER: ERROR OCCURRED
[ WARN:0] global /opt/opencv/modules/videoio/src/cap_gstreamer.cpp (488) isPipelinePlaying OpenCV | GStreamer warning: unable to query pipeline state
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)

Please help me solve this problem because it happened continuously (the way I fixed it was by running sudo systemctl restart nvargus-daemon).
jetson nano: Jetpack 4.6.1

I run opencv with the command cv2.videocapture(“nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1640, height=(int)1232, format=(string)NV12, framerate= (fraction)15/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink”, cv2.CAP_GSTREAMER)

Hi,
Please run the command in long run and check if the issue is present:

$ gst-launch-1.0 -v nvarguscamerasrc sensor-id=0 ! "video/x-raw(memory:NVMM), width=(int)1640, height=(int)1232, format=(string)NV12, framerate= (fraction)15/1" ! nvvidconv flip-method=0 ! "video/x-raw, format=(string)BGRx" ! videoconvert ! "video/x-raw, format=(string)BGR" ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0

To check if the issue is still there after eliminating OpenCV.

klog.txt (102.3 KB)
I don’t think it’s because of opencv, but I’m starting to run this command from now on to test and give you feedback. You can take a look at the dmegs log and head -n 1 /etc/nv_tegra_release
#R32 (release), REVISION: 7.1, GCID: 29818004, BOARD: t210ref, EABI: aarch64, DATE: Sat Feb 19 17:05:08 UTC 2022

gst-launch-1.0 -v nvarguscamerasrc sensor-id=0 ! “video/x-raw(memory:NVMM), width=(int)1640, height=(int)1232, format=(string)NV12, framerate= (fraction)15/1” ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0
-bash: syntax error near unexpected token `(’
Can you send me the command that runs incorrectly or give me the command again?
i try cmd: “gst-launch-1.0 -v nvarguscamerasrc sensor-id=0 ! “video/x-raw(memory:NVMM),width=1640,height=1232,format=NV12,framerate=15/1” ! nvvidconv flip-method=0 ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0” yes run

Hi,
Please add " " to all gstcaps and try again.

i try cmd: “gst-launch-1.0 -v nvarguscamerasrc sensor-id=0 ! “video/x-raw(memory:NVMM),width=1640,height=1232,format=NV12,framerate=15/1” ! nvvidconv flip-method=0 ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0”
It’s running. I will give you feedback when it fails or there are strange phenomena

i found this article and it works on jetpack 5.1 don’t know if i can use it on jetpack 4.6. I see an error almost similar to mine, the camera runs for a while then it stops. I didn’t think it was a hardware error, so I researched and found the same error as mine

Hi,
The topic thread should be different from this one since the code base of Jetpack 4 and 5 is different. This one is more like the sensor is not stable and may halt in long run. Would still need to know the result of gst-launch-1.0 command for checking further.

1 Like

I’m not sure, but I’ve run it with gstream and the situation is still fine and up to now I haven’t seen any stops. As I mentioned, my side builds the app 24/7 and closes docker, which means reading the camera with opencv Whether it has an impact or not is unclear?

If there is an error, what information does your side need to check the error?

klog_184_loi.txt (70.2 KB)
This is the logs file when the camera reader program fails " klog_184_loi.txt"
klog_184_run.txt (74.7 KB)
This is the logs file after running “sudo systemctl restart nvargus-daemon” after that the camera reader app runs normally again “klog_184_run.txt”

Hi,
We suggest check stability of the sensor driver. You can refer to the debug tips in
Jetson/l4t/Camera BringUp - eLinux.org

To check further why it fails in the condition. Maybe the camera sensor stops streaming and triggers timeour condition.

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