when get raw16 data through vc-id, corr_err: discarding frame 0, flags: 32, err_data 160

We connect two sensors to ub960 through FPD-Link, and connect ub960 to xavier through csi.

We make the sensors output raw16 data, and we make corresponding modifications in drivers and dtsi.

we can get the images from one sensor if we use the cmd like “v4l2-ctl -d /dev/video0”, but if we want to get images from two sensors at the same time(use the cmds “v4l2-ctl -d /dev/video0” and “v4l2-ctl -d /dev/video1”), there are some errors in the dmesg:

tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160
tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160
tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160

I found the “flags: 32” means the error is from CSIMUX_FRAME, and the “err_data 160” means lose the FE package cause the FS_FAULT.

I don’t know what lead to this error.

What’s more, I find if the two sensors connect to different ub960, and to different csi channels in xavier, there will be no problem.

@lisubin328719
Could you try to boost the nvcs/vi clocks to try.

sudo su
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
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate
echo ${max_rate} > /sys/kernel/debug/bpmp/debug/clk/vi/rate
echo ${max_rate} > /sys/kernel/debug/bpmp/debug/clk/isp/rate
echo ${max_rate} > /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate

Also enable the trace log to get more information.

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
cat /sys/kernel/debug/tracing/trace

Hi, ShaneCCC

The rates are already the maximum by default. What else can I try now?

root@xavier:/# cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate
998400000
root@xavier:/# cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate
1190400000
root@xavier:/# cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate
400000000
root@xavier:/# cat /sys/kernel/debug/bpmp/debug/clk/vi/rate
998400000
root@xavier:/# cat /sys/kernel/debug/bpmp/debug/clk/isp/rate
1190400000
root@xavier:/# cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
400000000

Enable the trace to check if can get more information.

Hi, ShaneCCC.

There is no other errors in the trace log.

I think the only error maybe “CSIMUX_FRAME channel:0x00 frame:0 vi_tstamp:11696499587 data:0x000000a0”. It means lose the FE package cause the FS_FAULT.

I don’t know what lead to this error.

The complete log is attached.

trace.log (1.61 MB)

Lost FE means Xavier didn’t receive Frame End package.

Hi, ShaneCCC. What lead to this problem?

We find if the two sensors connect to different ub960, and to different csi channels in xavier, there will be no problem. So the packages output from sensors are OK.

But if the two sensors connect to the same ub960 and then connect to the same 4 lane channel in xavier, the Frame End package will be lost.

I wonder if CSI/VI can’t handle so much data, so the Frame End packages are discarded?

Did you use virtual channel? or just 2x 2 lanes configure?
There’s no problem to handle this kind of case for CSI/V, it could be the ub960’s configure problem.

we use virtual channel through ub960.

From the trace.log there are few things need to check.

Short frame that means sensor not output 1080 height, maybe 107x
kworker/0:6-1872 [000] … 367.620867: rtcpu_vinotify_event: tstamp:11674635564 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:0 vi_tstamp:11674625511 data:0x01000000

And the frame id shouldn’t aways be 0