tegra-vi4 15700000.vi: Status: 7 channel:00 frame:0001 with RAW12 Full HD 120 fps

Hello,

I try to use a sensor that can send a Full HD RAW12 image at 120 fps. However the TX2 fails to accept that stream although the pixel rate is lower than the ones of my two other (5 Mpixels and 12 Mpixels) sensors

At user level, I have

nvidia@cam5-phdm:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1936,height=1096 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1
VIDIOC_DQBUF: failed: Input/output error

nvidia@cam5-phdm:~

and the kernel says :

[ 7662.035998] tegra-vi4 15700000.vi: Status:  7 channel:00 frame:0001
[ 7662.042271] tegra-vi4 15700000.vi:          timestamp sof 7671158601312 eof 7671166645664 data 0x00000001
[ 7662.051840] tegra-vi4 15700000.vi:          capture_id 114729 stream  0 vchan  0

I tried to boost the vi/csi clocks, and also tried ./jetson_clocks.sh but neither did help.

Even worse : after that failed capture, if I try to reboot the kernel, the kernel won’t boot. I need to powercycle it to boot it again.

What can be done to make it work ?

hello phdm,

  1. may I know what’s your pixel clock settings? you might access Sensor Software Driver Programming Guide, and check formula to calculate sensor pixel clock.
  2. if you still see the same failulre, please have a try to reduce the frame-rate, for example, 60-fps to check if the v4l2 standard controls works.

pix_clk_hz was set to 297000000 which is the exact sensors tx clock divided by 12 (the pixel size). I have set it a little bit higher (310000000) but I get the same error.

I have other sensor types with a higher pix_clk_hz, but a lower framerate because the images are bigger, and they work perfectly.

I have also tried 60 fps, but that does not reduce the sensor’s tx clock, and I again get the same error.
I also tried 30 fps with again the same error.

What does ‘Status 7’ means ?

hello phdm,

could you please clarify what’s “other” sensor types?
please share some information between workable and non-workable types.

BTW,
please also check vi_notify header files for the details of error status,
thanks

<i>$l4t-r32.2/public_sources/kernel/nvidia/drivers/video/tegra/host/vi/vi_notify.h</i>

#define CAPTURE_STATUS_CHANSEL_SHORT_FRAME7

my good working sensors are
5 Megapixels @ 68.3 fps with pix_clk_hz set to 360000000
12 Megapixels @ 23.4 fps with pix_clk_hz set to 300000000

What is the exact definition of SHORT_FRAME here ?

hello phdm,

VI engine allocate the buffers following the device tree properties settings, and it expect the streaming should also match the signal settings.
SHORT_FRAME failure usually caused by erroneous active_h property settings, which means the signal is less then VI expected.
please review the sensor specification for the image readout diagram, you should review the active regions and also the embedded metadata lines.
thanks

AFAIK, my “active_h” setting is good : “1096”. Is it possible to know how many lines were actually received ?

hello phdm,

there’s a way to check, you should enable VI tracing logs.
for example,

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace

please check the register dump of CHANSEL_PXL_EOF, 2-bytes in the beginning shown the total active lines (first line=0) received by the VI engine.
for example,
below register dump shows lines= 0x02cf = 720.

tag:CHANSEL_PXL_EOF channel:0x00 frame:1 vi_tstamp:3735249193 data:0x02cf0002

Hello JerryChang,

I have tested with the following pipeline

gst-launch-1.0 v4l2src num-buffers=2 device=/dev/video0 '!' video/x-raw,format=GRAY8,height=1096,framerate=1/1 '!' nvvidconv ! nvjpegenc ! multifilesink location=/tmp/fullhd120fps-%02d.jpg

That gives me actually 1 image, instead of 2, and the image is not complete : top part (436-439 lines) shows a part of the real scene, and the bottom part is pure black.

Find below the trace result. Unfortunately, there is no CHANSEL_PXL_EOF line in it.

nvidia@cam5-phdm:/tmp$ sudo cat /sys/kernel/debug/tracing/trace
# tracer: nop                                                  
#                                                              
# entries-in-buffer/entries-written: 44/44   #P:4              
#                                                              
#                              _-----=> irqs-off               
#                             / _----=> need-resched           
#                            | / _---=> hardirq/softirq        
#                            || / _--=> preempt-depth          
#                            ||| /     delay                   
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION       
#              | |       |   ||||       |         |            
     kworker/0:2-3116  [000] ...1  3535.990578: rtos_queue_peek_from_isr_failed: tstamp:110789160378 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3535.990582: rtcpu_start: tstamp:110789161324
     kworker/0:2-3116  [000] ...1  3536.198578: rtos_queue_peek_from_isr_failed: tstamp:110794161250 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3536.354605: rtos_queue_peek_from_isr_failed: tstamp:110799161755 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3536.510580: rtos_queue_peek_from_isr_failed: tstamp:110804162290 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3536.666577: rtos_queue_peek_from_isr_failed: tstamp:110809162768 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3536.826581: rtos_queue_peek_from_isr_failed: tstamp:110814163279 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3536.826585: rtcpu_vinotify_handle_msg: tstamp:110814383689 tag:CHANSEL_PXL_SOF channel:0x00 frame:1 vi_tstamp:3440200741 data:0x00000001
     kworker/0:2-3116  [000] ...1  3536.826586: rtcpu_vinotify_handle_msg: tstamp:110814383841 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:3440200748 data:0x00000000
     kworker/0:2-3116  [000] ...1  3536.826586: rtcpu_vinotify_handle_msg: tstamp:110814385993 tag:CHANSEL_LOAD_FRAMED channel:0x01 frame:1 vi_tstamp:3440203176 data:0x08000000
     kworker/0:2-3116  [000] ...1  3536.826587: rtcpu_vinotify_handle_msg: tstamp:110814635107 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:1 vi_tstamp:3440452126 data:0x00000001
     kworker/0:2-3116  [000] ...1  3536.826587: rtcpu_vinotify_handle_msg: tstamp:110814635291 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:3440452129 data:0x00000000
     kworker/0:2-3116  [000] ...1  3536.978588: rtos_queue_peek_from_isr_failed: tstamp:110819163803 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3537.134639: rtos_queue_peek_from_isr_failed: tstamp:110824164307 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3537.290633: rtos_queue_peek_from_isr_failed: tstamp:110829164812 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3537.446635: rtos_queue_peek_from_isr_failed: tstamp:110834165587 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3537.602724: rtos_queue_peek_from_isr_failed: tstamp:110839166175 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3537.758656: rtos_queue_peek_from_isr_failed: tstamp:110844166602 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3537.914676: rtos_queue_peek_from_isr_failed: tstamp:110849167112 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3538.070791: rtos_queue_peek_from_isr_failed: tstamp:110854167695 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3538.278656: rtos_queue_peek_from_isr_failed: tstamp:110859168122 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3538.434652: rtos_queue_peek_from_isr_failed: tstamp:110864168628 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3538.590668: rtos_queue_peek_from_isr_failed: tstamp:110869169135 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3538.746904: rtos_queue_peek_from_isr_failed: tstamp:110874169646 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3538.850759: rtos_queue_peek_from_isr_failed: tstamp:110877427227 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3538.961159: rtos_queue_peek_from_isr_failed: tstamp:110880872031 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3538.961197: rtcpu_start: tstamp:110880874111
     kworker/0:2-3116  [000] ...1  3539.114581: rtos_queue_peek_from_isr_failed: tstamp:110885872907 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3539.270601: rtos_queue_peek_from_isr_failed: tstamp:110890873416 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3539.426595: rtos_queue_peek_from_isr_failed: tstamp:110895873955 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3539.582578: rtos_queue_peek_from_isr_failed: tstamp:110900874423 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3539.738596: rtos_queue_peek_from_isr_failed: tstamp:110905874932 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3539.738600: rtcpu_vinotify_handle_msg: tstamp:110906253492 tag:CSIMUX_STREAM channel:0xff frame:0 vi_tstamp:3532070667 data:0x00000001
     kworker/0:2-3116  [000] ...1  3539.894615: rtos_queue_peek_from_isr_failed: tstamp:110910875472 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3540.050627: rtos_queue_peek_from_isr_failed: tstamp:110915875996 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3540.206675: rtos_queue_peek_from_isr_failed: tstamp:110920876742 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3540.414626: rtos_queue_peek_from_isr_failed: tstamp:110925877009 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3540.570615: rtos_queue_peek_from_isr_failed: tstamp:110930877502 queue:0x0b4a3c58
     kworker/0:2-3116  [000] ...1  3540.726689: rtos_queue_peek_from_isr_failed: tstamp:110935878007 queue:0x0b4a3c58
     kworker/0:1-3099  [000] ...1  3540.778748: rtcpu_vinotify_handle_msg: tstamp:110937503918 tag:CHANSEL_PXL_SOF channel:0x00 frame:2 vi_tstamp:3563320673 data:0x00000001
     kworker/0:1-3099  [000] ...1  3540.778781: rtcpu_vinotify_handle_msg: tstamp:110937504774 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:3563320681 data:0x00000000
     kworker/0:1-3099  [000] ...1  3540.778793: rtcpu_vinotify_handle_msg: tstamp:110937755361 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:2 vi_tstamp:3563572058 data:0x00000001
     kworker/0:1-3099  [000] ...1  3540.778799: rtcpu_vinotify_handle_msg: tstamp:110937756100 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:3563572062 data:0x00000000
     kworker/0:1-3099  [000] ...1  3540.778822: rtos_queue_peek_from_isr_failed: tstamp:110938812447 queue:0x0b4a3c58
nvidia@cam5-phdm:/tmp$

Just a final thought : speed at which image lines are sent in this mode is

1125 * 120 = 135000 image lines per second

. Could that be a/the problem ?

hello phdm,

these were timing settings, and they’re not very straight forward about the values.
there’s no complete frame since the CHANSEL_SHORT_FRAME failure is reported.
you might also check sensor specification for the VSYNC and HSYNC control registers for the timing settings.
you could also using sensor pixel clock, frame length, line length for calculation, please refer to [Sensor Pixel Clock] session for details.
thanks