How to caculate pix_clk_hz?

hi,dear Support team
I had some problems bring up the CPHY camera module on Orin.
I connected 4 CPHY cameras to Orin.
Each Camera outputs 3VC images

camera 1 
vc0---4096x3072@30fps --- /dev/video0
vc1---4096x3072@30fps --- /dev/video1
vc2---4096x3072@30fps --- /dev/video2

camera 2
vc0---4096x3072@30fps --- /dev/video3
vc1---4096x3072@30fps --- /dev/video4
vc2---4096x3072@30fps --- /dev/video5

camera 3
vc0---4096x3072@30fps --- /dev/video6
vc1---4096x3072@30fps --- /dev/video7
vc2---4096x3072@30fps --- /dev/video8

camera 4 
vc0---4096x3072@30fps --- /dev/video9
vc1---4096x3072@30fps --- /dev/video10
vc2---4096x3072@30fps --- /dev/video11

modex setting:

mode0 { /*scsensor_MODE_4096x3072_30FPS*/
						mclk_khz = "19200";
						num_lanes = "3";
						phy_mode = "CPHY";
						tegra_sinterface = CAMERA2_INTF;
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = SETTLETIME;
						active_w = "4096";
						active_h = "3072";
						mode_type = "bayer";
						pixel_phase = "bggr";
						csi_pixel_bit_depth = "10";
						readout_orientation = "0";
						line_length = "6720";//6720
						inherent_gain = "1";
						mclk_multiplier = "100.00";//100.00
						pix_clk_hz = "1920000000";//1920000000

						gain_factor = "16";
						framerate_factor = "1000000";
						exposure_factor = "1000000";
						min_gain_val = "16"; /* 1.0 */
						max_gain_val = "256"; /* 16.0 */
						step_gain_val = "1"; /* 0.125 */
						default_gain = "16";
						min_hdr_ratio = "1";
						max_hdr_ratio = "1";
						min_framerate = "1500000"; /* 1.5 */
						max_framerate = "30000000"; /* 30 */
						step_framerate = "1";
						default_framerate= "30000000";
						min_exp_time = "34"; /* us */
						max_exp_time = "550385"; /* us */
						step_exp_time = "1";
						default_exp_time = "33334";/* us */
						embedded_metadata_height = "0";

the problem is :When I turn on the device in order to capture the image from video0 to video11,
The Orin system always crashes and reboot when video7 is opening. When I lower the pix_clk_hz value,for example changed from 1920000000 to 1200000000,At this time, all devices can be turned on normally, but all devices may stop the image stream at irregular intervals.Conversely, when I increase the pix_clk_hz value,for example changed from 1920000000 to 21500000000,At this time, only the first six devices can work properly, and when the seventh is opened, the system will crash, and the number of devices that can be opened is one less than before.
How to solve this problem? Orin’s VI performance is not supported?

hello 541449841,

please refer to developer guide, Sensor Pixel Clock for several ways to obtain the correct sensor pixel clock rate.

however, may I know which Jetpack release you’re using?
is it possible for moving to the latest release version to reproduce this failure?

it is the latest release version,R35.3.1
The main problem is that I can’t open more than 6 devices or Orin will crash and reboot.
I can open any six of the 12 devices
for example : video0 video1 video2 video3 video4 video3 ,open video6 Orin will crash and reboot.
also , I can open video2 video3 video5 video1 video7 video9 , open one more videox Orin will crash and reboot.

hello 541449841,

may I know what’s failures from kernel side before crash?
please setup a terminal to gather the kernel logs, i.e.$ dmesg --follow

The mouse and keyboard would not work, and the system would not respond to my actions.
After more attempts, I found that only when my SENSOR MIPI rate exceeds 3.2G will it cause downtime, while all devices will work normally when the MIPI rate is below 2.976G.

Hi Jerry
this is kernel log
log.txt (84 KB)
[ 113.277311] [RCE] BUG: camera-ip/vi5/vi5.c:415 [vi5_check_falcon_failure] “VI FALCON FAILURE: 0x40000000”
[ 113.339484] tegra186-cam-rtcpu bc00000.rtcpu: Alert: Camera RTCPU gone bad! restoring it immediately!!
May need consider VI BW?

hello 541449841,

you may also refer to Orin TRM. it supports up-to 4.5Gsps per trio for running CPHY interface.
please had a try with below commands to boost all the VI/CSI/ISP clocks for testing.

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
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/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
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

hello Jerry
I boost all the VI/CSI/ISP clocks,but nothing changed.
Specifically, when I turned on the seventh device, the first six devices that had been turned on stopped streaming at the same time, and when I tried to terminate the v4l2 caputre, the system went unresponsive and reboot.

hello 541449841,

we’ve an internal discussion thread to investigate this issue, it may takes some time to conclude.
please have six steams, or lower the pixel clock as your temporary solution.
moreover, is it possible to share some details of your real use-case, thanks

First: the sensor
we have 4 sensor connected to Orin ,Image size is 4096x3072@30fps ,Each one has 3 virtual channels in use。

/dev/video3---Camera0-VC3---PDAF channel,Not Use
/dev/video7---Camera1-VC3---PDAF channel,Not Use
/dev/video11---Camera2-VC3---PDAF channel,Not Use
/dev/video15---Camera3-VC3---PDAF channel,Not Use

Second,the dtsi
tegra234-camera-dsv300-a00.dtsi (60.5 KB)

Third,After many attempts, it is found that the direct cause of Orin reboot is not pix_clk_hz but the MIPI rate output by the sensor。
Here are my test steps:

1、sensor MIPI rate set to 2.976Gsps, All 12 videos works well.
2、sensor MIPI rate set to 3.456Gsps,All else unchanged,first 6 videos works well,
When the seventh video opens,first 6 videos will stop stream, use CTRL+C to terminate capture,Orin will crash and reboot.
3、lower or higher the pixel clock, Orin will crash and reboot after  seventh video opens too.

Hi Jerry
Is there any new progress?Thx

hello 541449841,

I’ve already put this into internal discussion,
it may be current CPHY limitation, however, let us takes some time to conclude.

please configure lower pixel clock as your temporary solution, as you’re now able to enable camera use-case with sensor MIPI rate set to 2.976Gsps, for all 12 video streams.

Well, thank you very much for your support

Hi Jerry
Is there any new progress?Thx

it turns-out a CPHY limitation, we’ll update release note for this.

BTW,What is the upper limit of your measurements?

FYI, it has validate up-to 3.0 Gsps.

1 Like

4 Sensor all 12VC work well
OR 2 sensor 6VC work well
when using 3.0G configuration?

How many Gsps can you reach if you only light one Camera

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