Jetson Nano nvarguscamerasrc capture "Can not get HW buffer" error

Hello, I’m working on a camera project with the following setup:

  • Jetson Nano b01 module
  • Custom carrier
  • Single CSI camera

I’m developing for Jetpack 4.5 and have had the following behavior:

  • RAW frame capture with v4l2-ctl is possible and works as expected.
  • Attempted capture with nvarguscamerasrc produces error and causes board reboot.
  • Attempted capture with nvarguscamerasrc causes driver to start executing constant power on/off sequences on the camera.

The pipeline I’m using to capture with nvarguscamerasrc is:

  GST_DEBUG=2,*nvarguscamerasrc*:9 gst-launch-1.0 -e nvarguscamerasrc num-buffers=10 sensor-id=0 ! "video/x-raw(memory:NVMM),width=2840,height=2840,format=NV12,framerate=43/1" ! nvvidconv ! "video/x-raw" ! identity silent=false ! fakesink silent=false -v

The gstreamer log shows:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
0:00:04.886367335  7551   0x559b11bca0 DEBUG nvarguscamerasrc gstnvarguscamerasrc.cpp:1311:gst_nv_argus_camera_set_caps:<nvarguscamerasrc0> Received caps video/x- raw(memory:NVMM), width=(int)2840, height=(int)2840, format=(string)NV12, framerate=(fraction)43/1
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = event   ******* (identity0:sink) E (type: stream-start (10254), GstEventStreamStart, stream-id=(string)0b005d52adc96adbba7e610bf954e53e, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;) 0x559b126110
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = event   ******* (fakesink0:sink) E (type: stream-start (10254), GstEventStreamStart, stream-id=(string)0b005d52adc96adbba7e610bf954e53e, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;) 0x559b126110
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)2840, height=(int)2840, format=(string)NV12, framerate=(fraction)43/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)2840, height=(int)2840, format=(string)NV12, framerate=(fraction)43/1
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = video/x-raw, width=(int)2840, height=(int)2840, framerate=(fraction)43/1, format=(string)NV12
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw, width=(int)2840, height=(int)2840, framerate=(fraction)43/1, format=(string)NV12
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = event   ******* (identity0:sink) E (type: caps (12814), GstEventCaps, caps=(GstCaps)"video/x-raw\,\ width\=\(int\)2840\,\ height\=\(int\)2840\,\ framerate\=\(fraction\)43/1\,\ format\=\(string\)NV12";) 0x559b1262d0
/GstPipeline:pipeline0/GstIdentity:identity0.GstPad:src: caps = video/x-raw, width=(int)2840, height=(int)2840, framerate=(fraction)43/1, format=(string)NV12
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = event   ******* (fakesink0:sink) E (type: caps (12814), GstEventCaps, caps=(GstCaps)"video/x-raw\,\ width\=\(int\)2840\,\ height\=\(int\)2840\,\ framerate\=\(fraction\)43/1\,\ format\=\(string\)NV12";) 0x559b126340
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw, width=(int)2840, height=(int)2840, framerate=(fraction)43/1, format=(string)NV12
/GstPipeline:pipeline0/GstIdentity:identity0.GstPad:sink: caps = video/x-raw, width=(int)2840, height=(int)2840, framerate=(fraction)43/1, format=(string)NV12
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw, width=(int)2840, height=(int)2840, framerate=(fraction)43/1, format=(string)NV12
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)2840, height=(int)2840, format=(string)NV12, framerate=(fraction)43/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)2840, height=(int)2840, format=(string)NV12, framerate=(fraction)43/1
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 2840 x 2840 FR = 43,000000 fps Duration = 23255814 ; Analog Gain range min 0,062500, max 63,937500; Exposure Range min 25000, max 683709000;
GST_ARGUS: 1420 x 1420 FR = 81,000000 fps Duration = 12345679 ; Analog Gain range min 0,062500, max 63,937500; Exposure Range min 25000, max 683709000;

GST_ARGUS: 1920 x 1088 FR = 106,000003 fps Duration = 9433962 ; Analog Gain range min 0,062500, max 63,937500; Exposure Range min 25000, max 683709000;

GST_ARGUS: Running with following settings:
  Camera index = 0 
  Camera mode  = 0 
  Output Stream W = 2840 H = 2840 
  seconds to Run    = 0 
 Frame Rate = 43,000000 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD... Exiting...
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: CANCELLED
Additional debug info:
Argus Error Status
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
0:00:16.914390128  7551   0x7f90003450 DEBUG       nvarguscamerasrc 
gstnvarguscamerasrc.cpp:1596:consumer_thread:<nvarguscamerasrc0> consumer_thread: stop_requested=1


(gst-launch-1.0:7551): GStreamer-CRITICAL **: 17:24:15.075: gst_mini_object_set_qdata: assertion 'object != NULL' failed
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = event   ******* (identity0:sink) E (type: eos (28174), ) 0x7f90004800
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = event   ******* (fakesink0:sink) E (type: eos (28174), ) 0x7f90004800

The nvargus-daemon log shows:

=== NVIDIA Libargus Camera Service (0.97.3)=== Listening for connections...
=== gst-launch-1.0[8087]: Connection established (7F984611D0)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
=== gst-launch-1.0[8087]: CameraProvider initialized (0x7f909365f0)LSC: LSC surface is not based on full res!
NvIspAfConfigParamsSanityCheck: Error: positionWorkingHigh is not larger than positionWorkingLow positionWorkingHigh = 0, positionWorkingLow = 0

NvIspAfConfigParamsSanityCheck: Error: positionWorkingHigh is not larger than positionWorkingLow positionWorkingHigh = 0, positionWorkingLow = 0

NvIspAfConfigParamsSanityCheck: Error: positionWorkingHigh is not larger than positionWorkingLow positionWorkingHigh = 0, positionWorkingLow = 0

SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
SCF: Error Timeout: ISP Stats timed out! (in src/services/capture/NvIspHw.cpp, function waitIspStatsFinished(), line 566)
SCF: Error Timeout: ISP port 0 timed out! (in src/services/capture/NvIspHw.cpp, function waitIspFrameEnd(), line 478)
SCF: Error Timeout:  (propagating from src/services/capture/NvIspHw.cpp, function waitIspFrameEnd(), line 524)
SCF: Error Timeout:  (propagating from src/common/Utils.cpp, function workerThread(), line 116)
SCF: Error Timeout: Worker thread IspHw frameComplete failed (in src/common/Utils.cpp, function workerThread(), line 133)

These are the logs up until the carrier board reboots. If any other logs are needed, please let me know

Thanks
Jafeth García

Looks like timeout to capture from sensors.
Does this sensor take long time to initialize?

Hello,
Yes the sensor takes at least 500ms to start a stream.

Try add set_mode_delay_ms in you device tree to try.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.47.1.html#