Camera stops working after grabbing about 450 images

My application uses the Nano and an ArduCam IMX477 camera to capture images when signaled from a host computer connected through a network connection. This works great for awhile. But it seems that once the camera takes about 450 images it then fails.

I have a thread that is constantly grabbing images to keep the buffer clear. Then when signaled I grab the image and save it at a jpg. I use the same name and just overwrite the image each time.

I’m outputting a log and the last time it failed I got this in the log:
(Argus) Error InsufficientMemory: (propagating from src/eglstream/ImageImpl.cpp, function copyTonvBuffer(), line 553)
(Argus) Error InvalidState: Failed to copy to NvBuffer (in src/eglstream/ImageImpl.cpp, function createNvBuffer(), line 374)
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD… Exiting…
NvBufferGetParams failed for src_dmabuf_fd
nvbuffer_transform Failed
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD… Exiting…
CONSUMER: ERROR OCCURRED
[ WARN:1 ] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap-gstreamer.cpp (1757) handkeMessage OpenCV | GStreamer warning: Embedded video playback halted; module nvarguscamerasrc0 reported: DSICONNECTED
GST_ARGUS: Cleaning Up

Then when it tried to get the image:
(camera:27414): GStreamer-CRITICAL **: 11:32:57.760:
Trying to dispose element pipline0, but it is in READ instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may alse be caused by a refcounting bug in the
application or some element.

Any help would be greatly appreciated. I have no clue as to why it stops or even what these error messages mean.

Thanks,
Fred

Did you verify by v4l2-ctl? And argus_camera APP on Nano?

Turns out it was a problem on my end. I’m using sockets to connect the Nano to another computer and using the network connection as a trigger to grab an image. When I called accept to get the new socket I wasn’t closing it after disconnecting. After about 500 times it would crap out. Once I added the close function call everything seems to be working ok now.

I also switched to using the Argus library instead of OpenCV. This seems to work better too. It seems way faster and it looks like I don’t have to worry about clearing the buffer to get the latest image. It’s a little more difficult to set up, but once it’s done it works nicely.

Thanks for replying.

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