How to configure MIPI CPHY at 3500 Msps

Hello,

I would like to know how to configure higher MCLK in ORIN`s device tree in a way that I can interface at MIPI source higher than 1500 Msps per lane in CPHY. With the following setup, I can capture video with argus/gstreamer at 1500Msps without any issue.

   i2c@31e0000 {
        //
        // define camera 0
        //
        mycam_cam0: mycam_a@1a { // increments for each camera
            status = "okay";
            compatible = "mycam0";

            // I2C device address
            reg = <0x1a>; // increments for each camera
 
            // V4L2 device node location
            devnode = "video0"; // increments for each camera
 
            // Physical dimensions of sensor
            physical_w = "3.680";
            physical_h = "2.760";
            mclk = "extperiph1";
 
            use_sensor_mode_id = "true";
            reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
 
...

            mode0 {
                mclk_khz = "24000";
                mclk_multiplier = "10";
                num_lanes = "4";
                phy_mode = "CPHY";
                tegra_sinterface = "serial_a";
                discontinuous_clk = "no";
                cil_settletime = "0";
....

I would like to configure it at 3500Msps, but could not achieved even with the target of 1800Msps. It seems like changing mclk_multiplier doesn`t help me to increase MIPI Speed.

My Question is: How I can modify the MIPI CPHY speeds to higher values?

This what I got when I set my sensors MIPI speed to 1800Msps per lane.

My end goal is to increase the resolution to 12MP, and number of cameras through SerDes.
I am using 35.3.1 Jetson.

Thanks in advance.

There’s no any device setting able to configure the CPHY speed.
Only the pix_clk_hz/serdes_pix_clk_hz relative to the timing calculation.

For CPHY
mipi_clock = pix_clk_hz * 7 / 16

Thanks

Thank you for the reply.

How can I find the max limits for this parameters?
Can you point an example DT regarding a valid CPHY setting with high mipi clock?

Best Regards.

You have to try to figure it out.

I fixed the issue by finding a sweet spot for pix_clk_hz. Thank you.

Now I am having difficulties with stability of my capture. After 5-20mins, I am loosing my camera and the following outputs are getting generated. Can you help me how I can debug this?

Here is my gstreamer pipeline:

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! "video/x-raw(memory:NVMM),width=960,height=540,framerate=30/1" ! nvvidconv -v ! xvimagesink

After some minutes I am getting the camera lost.

CONSUMER: ERROR OCCURRED
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: TIMEOUT
Additional debug info:
Argus Error Status
Execution ended after 0:01:36.855881135
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
CONSUMER: ERROR OCCURRED
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: TIMEOUT
Additional debug info:
Argus Error Status
Execution ended after 0:01:54.073866248
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
Freeing pipeline ...
(Argus) Error InvalidState: Argus client is exiting with 2 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 366)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
user@user:~/Downloads$ Freeing pipeline ...
(Argus) Error InvalidState: Argus client is exiting with 2 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 366)

Could check by v4l2-ctl to confirm the sensor driver stability.

v4l2-ctl --stream-mmap --set-ctrl bypass_mode=0

Here are outputs with additional relevant info. I do have 4 Camera inputs coming from a SERDES. Just after 5-20 mins, I am starting to loose my camera captures one by one in 2 mins. The only gstreamer output I got is already provided above.

What would be your comment?

v4l2-ctl --stream-mmap --set-ctrl bypass_mode=0

VIDIOC_S_EXT_CTRLS: failed: Device or resource busy
bypass_mode: Device or resource busy
		VIDIOC_REQBUFS returned -1 (Device or resource busy)

v4l2-ctl --list-devices

NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
	/dev/media0
 
vi-output, analog0 8-001a (platform:tegra-capture-vi:0):
	/dev/video0
	/dev/video1
	/dev/video2
	/dev/video3

v4l2-ctl --all

Driver Info:
	Driver name      : tegra-video
	Card type        : vi-output, analog0 8-001a
	Bus info         : platform:tegra-capture-vi:0
	Driver version   : 5.10.104
	Capabilities     : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : tegra-camrtc-ca
	Model            : NVIDIA Tegra Video Input Device
	Serial           : 
	Bus info         : 
	Media version    : 5.10.104
	Hardware revision: 0x00000003 (3)
	Driver version   : 5.10.104
Interface Info:
	ID               : 0x03000011
	Type             : V4L Video
Entity Info:
	ID               : 0x0000000f (15)
	Name             : vi-output, analog0 8-001a
	Function         : V4L2 I/O
	Pad 0x01000010   : 0: Sink
	  Link 0x02000015: from remote pad 0x1000003 of entity '13e40000.host1x:nvcsi@15a00000-': Data, Enabled
Priority: 2
Video input : 0 (Camera 0: no power)
Format Video Capture:
	Width/Height      : 1920/1280
	Pixel Format      : 'RG12' (12-bit Bayer RGRG/GBGB)
	Field             : None
	Bytes per Line    : 3840
	Size Image        : 4915200
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Full Range)
	Flags             :
 
Camera Controls
 
                     group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                    sensor_mode 0x009a2008 (int64)  : min=0 max=1 step=1 default=0 value=0 flags=slider
                           gain 0x009a2009 (int64)  : min=16 max=356 step=1 default=16 value=355 flags=slider
                       exposure 0x009a200a (int64)  : min=13 max=683709 step=1 default=2495 value=29999 flags=slider
                     frame_rate 0x009a200b (int64)  : min=40 max=40 step=1 default=40 value=40 flags=slider
           sensor_configuration 0x009a2032 (u32)    : min=0 max=4294967295 step=1 default=0 [22] flags=read-only, volatile, has-payload
         sensor_mode_i2c_packet 0x009a2033 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
      sensor_control_i2c_packet 0x009a2034 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=1
				0: 0 (0x0)
				1: 1 (0x1)
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=1
				0: 0 (0x0)
				1: 1 (0x1)
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
				0: 1 (0x1)
				1: 65536 (0x10000)
				2: 131072 (0x20000)
               write_isp_format 0x009a2068 (int)    : min=1 max=1 step=1 default=1 value=1
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
               preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=1 flags=read-only

Looks like argus still locked the source.
Have below command to release the resource or restart the system then checking by v4l2-ctl

sudo service nvargus-daemon stop

The command doesn`t responding within 5mins. I also tried just after a fresh boot.

Looks like unable capture successfully from the sensor.
Get the trace log to check.

https://elinux.org/Jetson/l4t/Camera_BringUp#Steps_to_enable_more_debug_messages

Hi Shane,
Thank you for the guidance, I collected more info about this as attached.

The primary issues I see are:

  • CSIMUX_STREAM error with data=0x100
    It corresponds to FIFO_OVERFLOW_STREAM_2

  • CHANSEL_NOMATCH error with data=0x589
    It corresponds to no_match, CTYPE: Line Start (LS) error, DTYPE: NvCsiDataType_RAW12.

I set my devices MIPI output at 2300MHz DPLL, and also set the NVIDIA`s CPHY interface as the following:

  • pix_clk_hz = “2500000000” as higher than what I need.

I am using quad IMX412 camera in 4056x3040 RAW12 40FPS through quad Serdes link.

Can you comment on what is wrong here?

20240613_141620_log_trace_pipe.txt (183.2 KB)
20240613_141556_log_argus.txt (36.2 KB)
20240613_142249_log_gstreamer.txt (3.4 KB)

Could be the embedded_data_height incorrect in device tree.
Confirm the embedded data line to modify it.

Thanks

Hi,

I don`t have embedded data line in DT and we disabled embedded meta data from Imager. Imager sends only RAW12 data. It seems like setting the SerDes at high speeds caused the CSI Errors. Therefore we reduced the speed to around 2400MHz. With proper setting of pix_clk_hz, I could get somewhat stable capture that can take more than 10hrs (still some times it fails in 3hrs).

Eventually Argus gets fail and my capture gets terminated. The trace log I captured consistently when this happens is noted below. What would be your comment?

CHANSEL_NOMATCH - 0x589 which corresponds to:

  • We have no_match flag set,
  • the error is at Line Start, and
  • data type is 44 → RAW12

Did you boost the clocks to try?

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 3 > /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

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