Nvgstcapture fails second time

Hello,

I have a weird issue:
On the jetson Xavier, running r32.5.1 (jetpack 4.5.1) with a custom camera board with 8 sensors attached, I can do the following things:

  • Start/stop a v4l2 capture works without issue (on any single cam, or all in parallel, does not matter)

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=800 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=99999 --stream-to=/dev/null

  • Running a single camera through the ISP pipeline using argus (nvgstcapture) works the first time.
nvidia@nvidia-desktop:~$ nvgstcapture
...
** Message: 05:43:31.716: <main:4670> iterating capture loop ....
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1280 x 800 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 0.062500, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0
   Camera mode  = 0
   Output Stream W = 1280 H = 800
   seconds to Run    = 0
   Frame Rate = 59.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.


^C** Message: 05:44:05.229: <_intr_handler:4261> User Interrupted..

Terminating the camera pipeline ...
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success
** Message: 05:44:05.433: <main:4680> Capture completed
** Message: 05:44:05.434: <main:4729> Camera application will now exit

  • The second time I try to run nvgstcapture, I get errors on the commandline:
...
** Message: 05:44:20.258: <main:4670> iterating capture loop ....
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1280 x 800 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 0.062500, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0
   Camera mode  = 0
   Output Stream W = 1280 H = 800
   seconds to Run    = 0
   Frame Rate = 59.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
ERROR on bus: by /GstPipeline:capture_native_pipeline/GstBin:cap_bin/GstNvArgusCameraSrc:nvarguscamerasrc0: CANCELLED
debug info:
Argus Error Status
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD... Exiting...

(nvgstcapture:8898): GStreamer-CRITICAL **: 05:44:24.261: gst_mini_object_set_qdata: assertion 'object != NULL' failed
GST_ARGUS: Cleaning up
** Message: 05:44:26.726: <main:4680> Capture completed
** Message: 05:44:26.726: <main:4729> Camera application will now exit

Errors on dmesgs also appear, relating to some fence timeout etc:

[  112.933563] fence timeout on [ffffffc3a3909c00] after 1500ms
[  112.933576] name=[nvhost_sync:43], current value=0 waiting value=1
[  112.933584] ---- mlocks ----
[  112.933588] tegra194-vi5 15c10000.vi: no reply from camera processor
[  112.933598] tegra194-vi5 15c10000.vi: vi capture get status failed

[  112.933892] ---- syncpts ----
[  112.933901] id 2 (disp_a) min 210 max 210 refs 1 (previous client : )
[  112.933906] id 3 (disp_b) min 325 max 325 refs 1 (previous client : )
[  112.933915] id 8 (vblank0) min 6644 max -2 refs 1 (previous client : )
[  112.933929] id 19 (gv11b_511) min 5330 max 5330 refs 1 (previous client : )
[  112.933933] id 20 (gv11b_510) min 11 max 11 refs 1 (previous client : )
[  112.933937] id 21 (gv11b_509) min 557 max 557 refs 1 (previous client : gv11b_509)
[  112.933962] id 22 (gv11b_508) min 4 max 4 refs 1 (previous client : )
[  112.933968] id 23 (15340000.vic_nvgstcapture_0) min 960 max 960 refs 1 (previous client : 15340000.vic_nvgstcapture_0)
[  112.933973] id 24 (15340000.vic_nvgstcapture_0) min 3 max 3 refs 1 (previous client : 15340000.vic_nvgstcapture_0)
[  112.933980] id 28 (15340000.vic_nvgstcapture_0) min 957 max 957 refs 1 (previous client : 15340000.vic_nvgstcapture_0)
[  112.933990] id 36 (gv11b_506_user) min 22 max 0 refs 1 (previous client : )
[  112.934001] id 44 (15340000.vic_nvargus-daemon_0) min 962 max 962 refs 1 (previous client : 15340000.vic_nvargus-daemon_0)
[  112.934006] id 45 (15340000.vic_nvargus-daemon_0) min 7 max 7 refs 1 (previous client : gv11b_502)
[  112.934010] id 46 (gv11b_498) min 3 max 3 refs 1 (previous client : 15340000.vic_nvargus-daemon_0)
[  112.934015] id 47 (gv11b_500) min 9 max 9 refs 1 (previous client : gv11b_501)
[  112.934019] id 48 (gv11b_499) min 9 max 9 refs 1 (previous client : gv11b_500)
[  112.934023] id 49 (gv11b_501) min 9 max 9 refs 1 (previous client : gv11b_499)
[  112.934027] id 50 (gv11b_502) min 9 max 9 refs 1 (previous client : gv11b_498)
[  112.934400] [9081] gnvi2ccam 9-0058: gnvi2ccam_s_stream. enable=0

[  112.934619] ---- channels ----
[  112.934642]
               channel 2 - 15820000.se

[  112.934645] NvHost basic channel registers:
[  112.934651] CMDFIFO_STAT_0:  00002040
[  112.934655] CMDFIFO_RDATA_0: 0022aac1
[  112.934661] CMDP_OFFSET_0:   00000000
[  112.934665] CMDP_CLASS_0:    00000000
[  112.934669] CHANNELSTAT_0:   00000000
[  112.934672] The CDMA sync queue is empty.

[  112.934679]
               channel 3 - 15830000.se

[  112.934682] NvHost basic channel registers:
[  112.934686] CMDFIFO_STAT_0:  00002040
[  112.934690] CMDFIFO_RDATA_0: 8521302a
[  112.934694] CMDP_OFFSET_0:   00000000
[  112.934698] CMDP_CLASS_0:    00000000
[  112.934701] CHANNELSTAT_0:   00000000
[  112.934704] The CDMA sync queue is empty.

[  112.934711]
               channel 4 - 15840000.se

[  112.934713] NvHost basic channel registers:
[  112.934717] CMDFIFO_STAT_0:  00002040
[  112.934721] CMDFIFO_RDATA_0: 00000110
[  112.934725] CMDP_OFFSET_0:   00000000
[  112.934728] CMDP_CLASS_0:    00000000
[  112.934732] CHANNELSTAT_0:   00000000
[  112.934735] The CDMA sync queue is empty.

[  112.934744]
               ---- host general irq ----

[  112.934747] sync_intc0mask = 0x00000001
[  112.934751] sync_intmask = 0x50000003
[  112.934753]
               ---- host syncpt irq mask ----

[  112.934756]
               ---- host syncpt irq status ----

[  112.934760] syncpt_thresh_cpu0_int_status(0) = 0x00000000
[  112.934764] syncpt_thresh_cpu0_int_status(1) = 0x00000000
[  112.934768] syncpt_thresh_cpu0_int_status(2) = 0x00000000
[  112.934772] syncpt_thresh_cpu0_int_status(3) = 0x00000000
[  112.934776] syncpt_thresh_cpu0_int_status(4) = 0x00000000
[  112.934780] syncpt_thresh_cpu0_int_status(5) = 0x00000000
[  112.934784] syncpt_thresh_cpu0_int_status(6) = 0x00000000
[  112.934788] syncpt_thresh_cpu0_int_status(7) = 0x00000000
[  112.934792] syncpt_thresh_cpu0_int_status(8) = 0x00000000
[  112.934795] syncpt_thresh_cpu0_int_status(9) = 0x00000000
[  112.934799] syncpt_thresh_cpu0_int_status(10) = 0x00000000
[  112.934802] syncpt_thresh_cpu0_int_status(11) = 0x00000000
[  112.934806] syncpt_thresh_cpu0_int_status(12) = 0x00000000
[  112.934810] syncpt_thresh_cpu0_int_status(13) = 0x00000000
[  112.934813] syncpt_thresh_cpu0_int_status(14) = 0x00000000
[  112.934817] syncpt_thresh_cpu0_int_status(15) = 0x00000000
[  112.934821] syncpt_thresh_cpu0_int_status(16) = 0x00000000
[  112.934824] syncpt_thresh_cpu0_int_status(17) = 0x00000000
[  112.934832] syncpt_thresh_cpu0_int_status(18) = 0x00000000
[  112.934835] syncpt_thresh_cpu0_int_status(19) = 0x00000000
[  112.934839] syncpt_thresh_cpu0_int_status(20) = 0x00000000
[  112.934842] syncpt_thresh_cpu0_int_status(21) = 0x00000000

Strangely enough, if I simply try to run the v4l2 capture again, this works without issue!

Hence, there does not really seem to be any hardware issue or even configuration issue aside from the ISP.
But somehow the ISP clearly gets confused.

=> Is there any way to further debug this/ what could be causing this strange behavior?

Thanks for your feedback.

Hi,
It seems to be a known issue. Please try:
Jetson/L4T/r32.5.x patches - eLinux.org
[camera] 3rdparty application fails to open with USB camera

Hi Daniel,

Thanks for your reply.
FYI I am not using an USB camera, but tried your proposed patch (replacing libv4l2_nvargus.so) anyway.

=> This did not make any difference unfortunately. The next attempt the nvgstcapture still fails and the same dmesg message show up

Never mind, I found it. It was due to the special ub960 deserializer that was connected to it. If I reset the configuration after stopping streaming, it -also- works with arguscam. Pretty bizar that there is a CSI-difference between the v4l and the ISP pipeline. But Im glad it works now

1 Like