Failed to capture frames on TX2, vi4_fops EINVAL errors

Hi there,

I am having some random issues while trying to get a frame in TX2 via MIPI-CSI ports

The command i run is

gst-launch-1.0 v4l2src device="/dev/videoX" \
    ! video/x-raw, width=1824, height=940, format=YUY2 \
    ! xvimagesink

The camera works until it suddenly stops in an EOS with error “Resourse unavailable”.
Using dmesg --follow to read the kernel buffer i get the following error just when the camera disconnects.

tegra-vi4 15700000.vi: Status:  2 channel:01 frame:0011
tegra-vi4 15700000.vi:          timestamp sof 3378375934208 eof 33784606519520 data 0x000000a2
tegra-vi4 15700000.vi:          capture_id 174776 stream  2 vchan  0
tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout! err = -11
tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11

Err - 11 is errno EINVAL so is a resourse unavailable.

And

[10805.124523] nvcsi 150c0000.nvcsi: csi4_stream_check_status (2) ERROR_STATUS2VI_VC2 = 0x00000008
[10805.134736] nvcsi 150c0000.nvcsi: csi4_stream_check_status (2) INTR_STATUS 0x00000004
[10805.142685] nvcsi 150c0000.nvcsi: csi4_stream_check_status (2) ERR_INTR_STATUS 0x00000004
[10805.153352] nvcsi 150c0000.nvcsi: csi4_stream_check_status (1) ERROR_STATUS2VI_VC2 = 0x00000008
[10805.162739] nvcsi 150c0000.nvcsi: csi4_stream_check_status (1) INTR_STATUS 0x00010806
[10805.170824] nvcsi 150c0000.nvcsi: csi4_stream_check_status (1) ERR_INTR_STATUS 0x00010806

I enabled the kernel trace log using

#!/bin/sh

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

And i got

SIMUX_FRAME channel:0x00 frame:0 vi_tstamp:1975845273 data:0x000000a2
     kworker/1:1-5915  [001] ...1  3213.557705: rtcpu_vinotify_handle_msg: tstamp:100760103190 tag:CSIMUX_FRAME channel:0x00 frame:0 vi_tstamp:1975854968 data:0x000000a2
     kworker/1:1-5915  [001] ...1  3213.557707: rtcpu_vinotify_handle_msg: tstamp:100760181977 tag:CSIMUX_FRAME channel:0x00 frame:0 vi_tstamp:1975933754 data:0x000000a2
     kworker/1:1-5915  [001] ...1  3213.557708: rtcpu_vinotify_handle_msg: tstamp:100760967039 tag:CSIMUX_FRAME channel:0x00 frame:0 vi_tstamp:1976718815 data:0x000000a2
     kworker/1:1-5915  [001] ...1  3213.557709: rtcpu_vinotify_handle_msg: tstamp:100761477087 tag:CSIMUX_FRAME channel:0x00 frame:734 vi_tstamp:1977228865 data:0x00200062
     kworker/1:1-5915  [001] ...1  3213.609700: rtos_queue_peek_from_isr_failed: tstamp:100762561255 queue:0x0b4a3c58
     kworker/1:1-5915  [001] ...1  3213.765697: rtos_queue_peek_from_isr_failed: tstamp:100767561764 queue:0x0b4a3c58
     kworker/1:1-5915  [001] ...1  3213.921695: rtos_queue_peek_from_isr_failed: tstamp:100772562267 queue:0x0b4a3c58
     kworker/1:1-5915  [001] ...1  3214.077699: rtos_queue_peek_from_isr_failed: tstamp:100777562777 queue:0x0b4a3c58
     kworker/1:1-5915  [001] ...1  3214.233697: rtos_queue_peek_from_isr_failed: tstamp:100782563321 queue:0x0b4a3c58
     kworker/1:1-5915  [001] ...1  3214.389697: rtcpu_vinotify_handle_msg: tstamp:100786815599 tag:CSIMUX_FRAME channel:0x00 frame:766 vi_tstamp:2002567376 data:0x000000a2
     kworker/1:1-5915  [001] ...1  3214.389699: rtos_queue_peek_from_isr_failed: tstamp:100787563790 queue:0x0b4a3c58
     kworker/1:1-5915  [001] ...1  3214.545698: rtos_queue_peek_from_isr_failed: tstamp:100792564334 queue:0x0b4a3c58

I have reduced the possible causes to:

  • Camera driver (provided by 3rd party)
  • Physical wear and tear of the ports
  • Some kernel bug in the vi4_fops

We are using

Jetpack 3.2.1a
L4T 28.2.1

This is an old version and we haven’t been able to update it to a newer one because some hardware has been designed for that kernel version.

2 Likes

The CSIMUX_FRAME tell didn’t receive FE(Frame End) package from sensor.

CSIMUX_FRAME channel:0x00 frame:0 vi_tstamp:1975854968 data:0x000000a2
1 Like

Thank you Shane for your quick reply!

Is there any documentation i can follow for this error messages? I’m not an expert in camera driver development.

Also, this could mean anything from an unreliable camera connection to a bad driver implementation?

You may try to update the BSP to r32.7.x

1 Like

Is there any known issue with the previous BSP?

No, but it’s too old to support it.

Excellent! I will see what i can do.

Thank you for your support!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.