Xavier NX MIPI CSI-2 without I2C from FPGA framerate issue

Hi,
I have modified the device tree and ov5693 driver to support camera capture from an FPGA. The Xilinx fpga is sending yuv8 1920x1080 frames at 60fps, MIPI data rate 1400 Mbps, continous clock and 2 lanes . Everything seems to work functionally, picture quality is good, but fps with a simple gstreamer pipeline is around 50fps instead of of 60fps and concequently video is jerky but v4l2-ctl reports 60fps. Any ideas as to what might be wrong?

FPGA dev board allows passing mipi output to a mipi input that can be displayed – that is smooth confirming that issue is not with FPGA.

Jerky video pipeline is:
gst-launch-1.0 -v v4l2src device=“/dev/video0” ! nvvidconv ! nvdrmvideosink conn_id=0 plane_id=1 set_mode=0 -v

Running this pipeline confirms 50fps instead of 60fps issue:
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, width=1920, height=1080, framerate=60/1’ ! fpsdisplaysink text-overlay=0 video-sink=fakesink -v

However when I run the below v4l2-ctl command it prints 60fps consistently.
v4l2-ctl --device /dev/video0 --set-ctrl bypass_mode=0 --stream-mmap

I have boosted the system and NVCSI/VI clocks per below but that did not fix the issue:
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate

I have captured trace info per below and parsed out "vi-output, ov56-1249…sof: " lines, imported that into exel and did delta time calcs and that matched the 60 fps reported by v4l2-ctl and 50 fps reported by gst-launch-1.0
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 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace

For device tree I have increased pix_clk_hz from pix_clk_hz = “148500000”;*/ /2200 × 1125 × 60/
to “182400000” without fixing the issue. Other relevant device tree settings are:
num_lanes = “2”;
tegra_sinterface = “serial_a”;
phy_mode = “DPHY”;
mode_type = “yuv”;
pixel_phase = “yuyv”;
csi_pixel_bit_depth = “8”;
discontinuous_clk = “no”;

my ov5693_mode_tbls.h only supports one format: 1920x1080 60Hz
nv_tegra_release reports:

R35 (release), REVISION: 2.1, GCID: 32413640, BOARD: t186ref, EABI: aarch64, DATE: Tue Jan 24 23:38:33 UTC 2023

My hardware is: Jetson Xanier NX evaluation board
ov5693_mode_tbls.h (3.3 KB)
nv_ov5693.c (31.5 KB)
tegra194-camera-e3333-a00.dtsi (4.7 KB)

hello alanser,

could you please check kernel messages, is there any failures reported while streaming? i.e. $ dmesg --follow

For pipeline below no kernel messages are printed while pipeline is running. See attached pipeline_run1.log.
gst-launch-1.0 -v v4l2src device=“/dev/video0” ! nvvidconv ! nvdrmvideosink conn_id=0 plane_id=1 set_mode=0 -e
pipeline_run1.log (13.9 KB)

hello alanser,

there’s no frame drops reported by fpsdisplaysink also.
could you please try the other plugin, nvv4l2camerasrc.

nvv4l2camerasrc built for YUYV format solved the fps issue.
Thanks for the help!

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