We are getting capture stability issues on a Jetson ORIN NX devkit running JetPack 6.2.1. We don’t have plans to move to a newer version.
The setup for the test is the following:
- Enable capture. We tested with a GStreamer pipeline and also with a basic capture application using libnvargus.so. For both we observed the same results:
# Opt1: GStreamer pipeline
gst-launch-1.0 -e \
nvarguscamerasrc silent=false sensor-id=0 ! \
'video/x-raw(memory:NVMM),width=1920,height=1080,format=NV12,framerate=30/1' ! \
nvv4l2h264enc ! h264parse ! mp4mux ! filesink location=/application/cam0.mp4 \
nvarguscamerasrc silent=false sensor-id=1 ! \
'video/x-raw(memory:NVMM),width=1920,height=1080,format=NV12,framerate=30/1' ! \
nvv4l2h264enc ! h264parse ! mp4mux ! filesink location=/application/cam1.mp4
# Opt2: Basic Capture app (attached)
./basic-libnvargus 1920 1080 7200
- Enable CPU stress command
sudo chrt -f 1 stress-ng --cpu 5 --cpu-load 50
- The problem appears after 1-2 minutes:
SCF: Error ResourceAlreadyInUse: (propagating from src/services/capture/FusaCaptureViCsiHw.cpp, function startCaptureInternal(), line 877)
SCF: Error ResourceAlreadyInUse: (propagating from src/services/capture/CaptureRecord.cpp, function doCSItoMemCapture(), line 547)
SCF: Error ResourceAlreadyInUse: (propagating from src/services/capture/CaptureRecord.cpp, function issueCapture(), line 490)
SCF: Error ResourceAlreadyInUse: (propagating from src/services/capture/CaptureServiceDevice.cpp, function issueCaptures(), line 1565)
SCF: Error ResourceAlreadyInUse: (propagating from src/services/capture/CaptureServiceDevice.cpp, function issueCaptures(), line 1394)
Acquired frame. 511
SCF: Error Timeout: (propagating from src/api/Buffer.cpp, function waitForUnlock(), line 644)
SCF: Error Timeout: (propagating from src/components/CaptureContainerImpl.cpp, function returnBuffer(), line 430)
SCF: Error ResourceAlreadyInUse: (propagating from src/common/Utils.cpp, function workerThread(), line 125)
SCF: Error ResourceAlreadyInUse: Worker thread CaptureScheduler frameStart failed (in src/common/Utils.cpp, function workerThread(), line 144)
SCF: Error InvalidState: Capture Scheduler not running (in src/services/capture/CaptureServiceDevice.cpp, function addNewItemToSchedule(), line 1039)
SCF: Error InvalidState: (propagating from src/services/capture/CaptureService.cpp, function addRequest(), line 413)
SCF: Error InvalidState: (propagating from src/components/stages/MemoryToISPCaptureStage.cpp, function doHandleRequest(), line 148)
SCF: Error InvalidState: (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 158)
[basic-app.tar.gz|attachment](upload://npfNpbZ0szeZJMbU4mIPG2jVjdW.gz) (98.1 KB)
SCF: Error InvalidState: Sending critical error event for Session 0
(in src/api/Session.cpp, function sendErrorEvent(), line 1039)
acquireFrame failed: status=6
SCF: Error Timeout: (propagating from src/components/amr/Snapshot.cpp, function waitForNewerSample(), line 91)
SCF_AutocontrolACSync failed to wait for an earlier frame to complete.
SCF: Error Timeout: (propagating from src/components/ac_stages/ACSynchronizeStage.cpp, function doHandleRequest(), line 145)
SCF: Error Timeout: (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 137)
- We tested with the patched libraries found on these posts:
- libnvargus.so.36.4/libnvargus_socketserver.so.36.4: Gstreamer pipleine is not working second time for imx219 - #5 by ShaneCCC
- libnvfusacap.so.r36.4.dis_notify: Nvarguscamerasrc crashes after a few hours of working - #23 by ShaneCCC
- libnvscf.so.36.4.inifinte_2: Nvarguscamerasrc crashes after a few hours of working - #12 by ShaneCCC
We got better stability, instead of taking 1-2 minutes to fail, now it takes about 30-50 minutes. However, it’s still failing after that.
- We also ran some tests changing priority to the capture threads:
- For GStreamer test, we changed nvargus priority to 38 and got better stability:
sudo chrt -f -p 38 $(pgrep nvargus-daemon)
- The same for the basic:
pid=$(pgrep -x basic-libnvargus)
for task in /proc/"$pid"/task/*; do
tid=${task##*/}
name=$(cat "$task/comm")
case "$name" in
"SCF Execution" | \
"IspHw frameComp" | \
"CaptureSchedule" | \
"V4L2CaptureSche" | \
"cuda-EvtHandlr" | \
"PS handleReques" | \
"ViCsiHw frameCo" | \
"ViCsiHw frameSt" | \
"GpuBlitStage" | \
"PiecewiseLinear" | \
"TempBufferAcqui" | \
"CaptureDispatch")
echo "Setting FIFO 38: TID=$tid [$name]"
sudo chrt -f -p 38 "$tid"
;;
esac
done
Even if the stability improved with the priority changes, this is not an acceptable solution for this.
Could you please analyze the case and help us improve the stability?
Enrique Ramirez
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com
basic-app.tar.gz (98.1 KB)