nvgstcapture-1.0 failing, but v4l2 captures correct data

Hi,

[b]I am trying to develop a driver for the OnSemi AR0231 image sensor.

I am able to correctly capture raw, streaming data at 31FPS using this command:[/b]

root@tegra-ubuntu:/home/nvidia# gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1928, height=(int)1208, format=(string)I420, framerate=(fraction)31/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvoverlaysink -e

However, when I run nvgstcapture-1.0, the command fails with the following terminal output:

bitrate = 4000000
Encoder Profile = High
** Message: main:5684 iterating capture loop …
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 640 H = 480
seconds to Run = 0
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
CONSUMER: Done Success
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 214)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 317)
^C** Message: <_intr_handler:5104> User Interrupted…

Terminating the camera pipeline …
^C

Here is trace output for nvgstcapture

root@tegra-ubuntu:/home/nvidia# cat /sys/kernel/debug/tracing/trace

tracer: nop

entries-in-buffer/entries-written: 101/101 #P:4

_-----=> irqs-off

/ _----=> need-resched

| / _—=> hardirq/softirq

|| / _–=> preempt-depth

||| / delay

TASK-PID CPU# |||| TIMESTAMP FUNCTION

| | | |||| | |

 kworker/0:2-185   [000] ...1   265.066482: rtos_queue_peek_from_isr_failed: tstamp:8637911101 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   265.066486: rtcpu_start: tstamp:8637911884
 kworker/0:2-185   [000] ...1   265.275751: rtos_queue_peek_from_isr_failed: tstamp:8642888219 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   265.275755: rtos_queue_peek_from_isr_failed: tstamp:8644207975 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   265.275756: rtcpu_start: tstamp:8644208748
 kworker/0:2-185   [000] ...1   265.435647: rtos_queue_peek_from_isr_failed: tstamp:8649208842 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   265.590446: rtos_queue_peek_from_isr_failed: tstamp:8654209345 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   265.746450: rtos_queue_peek_from_isr_failed: tstamp:8659209863 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   265.954447: rtos_queue_peek_from_isr_failed: tstamp:8664210363 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   266.110448: rtos_queue_peek_from_isr_failed: tstamp:8669210867 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   266.266442: rtos_queue_peek_from_isr_failed: tstamp:8674211386 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   266.422443: rtos_queue_peek_from_isr_failed: tstamp:8679211880 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   266.578438: rtos_queue_peek_from_isr_failed: tstamp:8684212388 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   266.734464: rtos_queue_peek_from_isr_failed: tstamp:8689212908 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   266.890483: rtos_queue_peek_from_isr_failed: tstamp:8694213403 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   267.047813: rtos_queue_peek_from_isr_failed: tstamp:8699213908 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   267.202441: rtos_queue_peek_from_isr_failed: tstamp:8704214414 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   267.358445: rtos_queue_peek_from_isr_failed: tstamp:8709214923 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   267.514435: rtos_queue_peek_from_isr_failed: tstamp:8714215429 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   267.670428: rtos_queue_peek_from_isr_failed: tstamp:8719215947 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   267.826428: rtos_queue_peek_from_isr_failed: tstamp:8724216443 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   268.034429: rtos_queue_peek_from_isr_failed: tstamp:8729216949 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   268.190422: rtos_queue_peek_from_isr_failed: tstamp:8734217455 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   268.346421: rtos_queue_peek_from_isr_failed: tstamp:8739217976 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   268.502424: rtos_queue_peek_from_isr_failed: tstamp:8744218471 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   268.658418: rtos_queue_peek_from_isr_failed: tstamp:8749218976 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   268.814417: rtos_queue_peek_from_isr_failed: tstamp:8754219484 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   268.970417: rtos_queue_peek_from_isr_failed: tstamp:8759219988 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   269.126421: rtos_queue_peek_from_isr_failed: tstamp:8764220495 queue:0x0b4a3c58
 kworker/0:2-185   [000] ...1   269.282413: rtos_queue_peek_from_isr_failed: tstamp:8769221006 queue:0x0b4a3c58


also, this is the dmesg output after running nvgstcapture-1.0

[ 843.454672] argus_daemon[2678]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x83000006
[ 843.464010] pgd = ffffffc054d06000
[ 843.467429] [00000000] *pgd=00000000d4d8f003, *pud=00000000d4d8f003, *pmd=0000000000000000

[ 843.477326] CPU: 5 PID: 2678 Comm: argus_daemon Not tainted 4.4.38 #5
[ 843.483767] Hardware name: quill (DT)
[ 843.487442] task: ffffffc0702ca580 ti: ffffffc172d20000 task.ti: ffffffc172d20000
[ 843.494989] PC is at 0x0
[ 843.497518] LR is at 0x7f7e74c6a0
[ 843.500880] pc : [<0000000000000000>] lr : [<0000007f7e74c6a0>] pstate: 60000000
[ 843.508305] sp : 0000007f4cffc920
[ 843.511628] x29: 0000007f4cffe9d0 x28: 0000007f78b533a0
[ 843.516972] x27: 0000007f7e763000 x26: 0000000000000005
[ 843.522308] x25: 0000007f78b53579 x24: 0000007f28006e50
[ 843.527645] x23: 0000007f28006e50 x22: 0000007f78b53560
[ 843.533003] x21: 0000000000000221 x20: 0000007f78b53468
[ 843.538339] x19: 0000007f78b53390 x18: 0000000000000000
[ 843.543677] x17: 0000007f7f1944c0 x16: 0000007f7effb540
[ 843.549031] x15: 0000007f7e781b78 x14: 6572685465727574
[ 843.554390] x13: 7061436663532f69 x12: 70612f637273206d
[ 843.559732] x11: 6f726620676e6974 x10: 0000000000000000
[ 843.565090] x9 : 000000000000000c x8 : 0000000000000062
[ 843.570424] x7 : 0000000000000000 x6 : 000000002800a570
[ 843.575765] x5 : 0000000000000000 x4 : 0000000000000002
[ 843.581095] x3 : 000000000000001f x2 : 0000000000000000
[ 843.586424] x1 : 0000000000000000 x0 : 0000007f28004200

[ 843.593254] Library at 0x0: 0x400000 /usr/sbin/argus_daemon
[ 843.598828] Library at 0x7f7e74c6a0: 0x7f7e6f9000 /usr/lib/aarch64-linux-gnu/tegra/libargus.so
[ 843.607435] vdso base = 0x7f7f36b000
[ 848.591582] set gain
[ 848.593598] imx324 2-0010: imx324_set_gain: gain reg: 0
[ 848.599100] get gainset frame rate
[ 848.602550] imx324 2-0010: imx324_set_frame_rate: val: 75497472, , frame_length: 6313
[ 848.610653] get frame lengthframe length is: set exposure
[ 848.616529] imx324 2-0010: imx324_set_exposure: val: 119837
[ 848.622294] set course time
[ 848.624923] imx324 2-0010: imx324_set_coarse_time: coarse1:3246, FL:6313
[ 848.631840] get course video time
[ 849.005758] imx324 2-0010: imx324_s_stream++ enable 0
[ 849.011032] imx324 2-0010: imx324_power_off: power off

any ideas on how to debug this?

Thanks,
Daniel

hi Daniel,
the raw works but nvgstcapture not work is usually caused by the device tree not configured correctly. you can paste your device configure here, we can help review.

thanks
xingxing

Hi,

To anyone having the same error, it was due to the sensor initialization being too long. decreasing the time to program the sensor and allow data sent to the TX2 is the fix. For me at least.

regards,
Daniel

@daniel.mcginley

There is a “set_mode_delay_ms” option for the device tree which should allow the sensor more time for initialization.