I’m using a setup with Jetson AGX Orin and 2 cameras AR0820 cameras GMSL2 - MIPI CSI2, i configured the device tree for tegra-capture-vi and NVCSI and sensor modules, but i’m finding an issue
When both cameras are configured to produce images normally, neither camera can produce images. Only when one camera is configured to produce images normally and the other camera is configured to produce images improperly, can the configured camera produce images and the other camera cannot produce images
device tree:
/ {
tegra-capture-vi {
num-channels = <2>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ar0234_vi_in0: endpoint {
vc-id = <0>;
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ar0234_csi_out0>;
};
};
port@1 {
reg = <1>;
ar0234b_vi_in0: endpoint {
vc-id = <0>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ar0234b_csi_out0>;
};
};
};
};
host1x@13e00000 {
nvcsi@15a00000 {
num-channels = <2>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ar0234_csi_in0: endpoint@0 {
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ar0234_ar0234_out0>;
};
};
port@1 {
reg = <1>;
ar0234_csi_out0: endpoint@1 {
remote-endpoint = <&ar0234_vi_in0>;
};
};
};
};
channel@1 {
reg = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ar0234b_csi_in0: endpoint@2 {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ar0234b_ar0234_out0>;
};
};
port@1 {
reg = <1>;
ar0234b_csi_out0: endpoint@3 {
remote-endpoint = <&ar0234b_vi_in0>;
};
};
};
};
};
};
i2c@c250000 {
ar0234_a@11 {
compatible = "onsemi,ar0234";
reg = <0x11>;
status = "okay";
/* Physical dimensions of sensor */
physical_w = "15.0";
physical_h = "12.5";
sensor_model ="ar0234";
/* Defines number of frames to be dropped by driver internally after applying */
/* sensor crop settings. Some sensors send corrupt frames after applying */
/* crop co-ordinates */
post_crop_frame_drop = "0";
/* Convert Gain to unit of dB (decibel) befor passing to kernel driver */
use_decibel_gain = "true";
/* enable CID_SENSOR_MODE_ID for sensor modes selection */
use_sensor_mode_id = "true";
mode0 {/*mode IMX424_MODE_3840X1080_CROP_30FPS*/
vc_id = "0";
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_e";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
dynamic_pixel_bit_depth = "16";
csi_pixel_bit_depth = "16";
mode_type = "yuv";
pixel_phase = "uyvy"; //yuyv uyvy
readout_orientation = "0";
inherent_gain = "1";
active_w = "3840";
active_h = "2160";
line_length = "4440"; //3840 4000 4440
pix_clk_hz = "74250000";
serdes_pix_clk_hz = "200000000";
// deskew_initial_enable = "true";
gain_factor = "10";
min_gain_val = "0"; /* dB */
max_gain_val = "300"; /* dB */
step_gain_val = "3"; /* 0.3 */
default_gain = "0";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "30000000";
max_framerate = "30000000";
step_framerate = "1";
default_framerate = "30000000";
exposure_factor = "1000000";
min_exp_time = "59"; /*us, 2 lines*/
max_exp_time = "33333";
step_exp_time = "1";
default_exp_time = "33333";/* us */
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ar0234_ar0234_out0: endpoint {
vc-id = <0>;
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ar0234_csi_in0>;
};
};
};
gmsl-link {
src-csi-port = "b";
dst-csi-port = "a";
serdes-csi-link = "e";
csi-mode = "1x4";
st-vc = <0>;
vc-id = <0>;
num-lanes = <4>;
streams = "ued-u1", "raw12";
};
};
};
i2c@3180000 {
ar0234b_a@11 {
compatible = "onsemi,ar0234b";
reg = <0x11>;
status = "okay";
/* Physical dimensions of sensor */
physical_w = "15.0";
physical_h = "12.5";
sensor_model ="ar0234";
/* Defines number of frames to be dropped by driver internally after applying */
/* sensor crop settings. Some sensors send corrupt frames after applying */
/* crop co-ordinates */
post_crop_frame_drop = "0";
/* Convert Gain to unit of dB (decibel) befor passing to kernel driver */
use_decibel_gain = "true";
/* enable CID_SENSOR_MODE_ID for sensor modes selection */
use_sensor_mode_id = "true";
mode0 {/*mode AR0234_MODE_1280X720_CROP_30FPS*/
vc_id = "0";
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
dynamic_pixel_bit_depth = "16";// 16 12
csi_pixel_bit_depth = "16";// 16 12
mode_type = "yuv";
pixel_phase = "uyvy"; //yuyv uyvy
readout_orientation = "0";
inherent_gain = "1";
active_w = "3840";
active_h = "2160";
line_length = "4440"; //3840 4000 4440
pix_clk_hz = "74250000";
serdes_pix_clk_hz = "200000000";
// mclk_multiplier = "24";
// deskew_initial_enable = "true";
gain_factor = "10";
min_gain_val = "0"; /* dB */
max_gain_val = "300"; /* dB */
step_gain_val = "3"; /* 0.3 */
default_gain = "0";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "30000000";
max_framerate = "30000000";
step_framerate = "1";
default_framerate = "30000000";
exposure_factor = "1000000";
min_exp_time = "59"; /*us, 2 lines*/
max_exp_time = "33333";
step_exp_time = "1";
default_exp_time = "33333";/* us */
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ar0234b_ar0234_out0: endpoint {
vc-id = <0>;
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ar0234b_csi_in0>;
};
};
};
gmsl-link {
src-csi-port = "b";
dst-csi-port = "a";
serdes-csi-link = "a";
csi-mode = "1x4";
st-vc = <0>;
vc-id = <0>;
num-lanes = <4>;
streams = "ued-u1", "raw12";
};
};
};
};
/ {
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <8>;
max_lane_speed = <15000000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
modules {
module0 {
badge = "ar0234_bottomleft";
position = "rear";
orientation = "1";
drivernode0 {
/* Declare PCL support driver (classically known as guid) */
pcl_id = "v4l2_sensor";
/* Driver v4l2 device name */
devname = "ar0234 30-0018";
/* Declare the device-tree hierarchy to driver instance */
proc-device-tree = "/proc/device-tree/i2c@c250000/ar0234_a@11";
};
};
module1 {
badge = "ar0234b_topleft";
position = "front";
orientation = "1";
drivernode0 {
/* Declare PCL support driver (classically known as guid) */
pcl_id = "v4l2_sensor";
/* Driver v4l2 device name */
devname = "ar0234b 30-0018";
/* Declare the device-tree hierarchy to driver instance */
proc-device-tree = "/proc/device-tree/i2c@3180000/ar0234b_a@11";
};
};
};
};
};
log:
[ 1019.799741] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 512
[ 1019.866161] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[ 1019.899668] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 512
[ 1019.966504] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
tracer: nop
entries-in-buffer/entries-written: 15291/15291 #P:8
_-----=> irqs-off
/ _----=> need-resched
| / _—=> hardirq/softirq
|| / _–=> preempt-depth
||| / delay
TASK-PID CPU# |||| TIMESTAMP FUNCTION
| | | |||| | |
kworker/0:1-15 [000] .... 1009.563046: rtcpu_string: tstamp:32146407102 id:0x04010000 str:"VM0 deactivating."
kworker/0:1-15 [000] .... 1018.835059: rtcpu_string: tstamp:32436244495 id:0x04010000 str:"VM0 activating."
kworker/0:1-15 [000] .... 1018.835065: rtcpu_string: tstamp:32436355279 id:0x04010000 str:"NVCSILP clock rate = 408000000 Hz.
"
kworker/0:1-15 [000] … 1019.067085: rtcpu_isp_falcon_task_start: tstamp:2378364799 ch:0 task:HANDLE_EVENT
kworker/0:1-15 [000] … 1019.067089: rtcpu_isp_falcon_task_end: tstamp:2378364840 task:HANDLE_EVENT
kworker/0:1-15 [000] … 1019.743051: rtcpu_string: tstamp:32464357853 id:0x04010000 str:“tegra_nvcsi_stream_set_config(vm0, stream=0, csi”
kworker/0:1-15 [000] … 1019.743054: rtcpu_string: tstamp:32464357953 id:0x04010000 str:"=0)
"
kworker/0:1-15 [000] … 1019.746879: rtcpu_string: tstamp:32464358324 id:0x04010000 str:“MIPI clock = 400000 kHz, tHS-SETTLE = 0, tCLK-SE”
kworker/0:1-15 [000] … 1019.746880: rtcpu_string: tstamp:32464358425 id:0x04010000 str:“TTLE = 0
"
kworker/0:1-15 [000] … 1019.746884: rtcpu_string: tstamp:32464358636 id:0x04010000 str:”===== NVCSI Stream Configuration =====
"
kworker/0:1-15 [000] … 1019.746886: rtcpu_string: tstamp:32464358881 id:0x04010000 str:"stream_id: PP 0, csi_port: PORT A
"
kworker/0:1-15 [000] … 1019.746888: rtcpu_string: tstamp:32464359135 id:0x04010000 str:"Brick: PHY 0, Mode: D-PHY
"
kworker/0:1-15 [000] … 1019.746890: rtcpu_string: tstamp:32464359422 id:0x04010000 str:"Partition: CIL A, LP bypass: Enabled, Lanes: 4
"
kworker/0:1-15 [000] … 1019.746891: rtcpu_string: tstamp:32464359601 id:0x04010000 str:"Clock information:
"
kworker/0:1-15 [000] … 1019.746893: rtcpu_string: tstamp:32464359897 id:0x04010000 str:"MIPI clock rate: 400.00 MHz
"
kworker/0:1-15 [000] … 1019.746895: rtcpu_string: tstamp:32464360140 id:0x04010000 str:“T_HS settle: 0, T_CLK settle: 0
"
kworker/0:1-15 [000] … 1019.746897: rtcpu_string: tstamp:32464360362 id:0x04010000 str:”======================================
"
kworker/0:1-15 [000] … 1019.746900: rtcpu_string: tstamp:32464362098 id:0x04010000 str:"tegra_nvcsi_stream_open(vm0, stream=0, csi=0)
"
kworker/0:1-15 [000] … 1019.746901: rtcpu_string: tstamp:32464369120 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746903: rtcpu_string: tstamp:32464369379 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746904: rtcpu_string: tstamp:32464369636 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746906: rtcpu_string: tstamp:32464369894 id:0x04010000 str:"nvcsi_calc_tclk_settle tclk_settle 75
"
kworker/0:1-15 [000] … 1019.746908: rtcpu_string: tstamp:32464370717 id:0x04010000 str:"ISR PHY 0 CIL_A 0x110
"
kworker/0:1-15 [000] … 1019.746911: rtcpu_nvcsi_intr: tstamp:32464370423 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000110
kworker/0:1-15 [000] … 1019.746911: rtcpu_string: tstamp:32464371144 id:0x04010000 str:"ISR PHY 0 CIL_B 0x110
"
kworker/0:1-15 [000] … 1019.746912: rtcpu_nvcsi_intr: tstamp:32464370423 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000110
kworker/0:1-15 [000] … 1019.746913: rtcpu_nvcsi_intr: tstamp:32464370423 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
kworker/0:1-15 [000] … 1019.746913: rtcpu_nvcsi_intr: tstamp:32464371703 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
kworker/0:1-15 [000] … 1019.746913: rtcpu_nvcsi_intr: tstamp:32464373814 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
kworker/0:1-15 [000] … 1019.746913: rtcpu_nvcsi_intr: tstamp:32464373814 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
kworker/0:1-15 [000] … 1019.746914: rtcpu_string: tstamp:32464376090 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746926: rtcpu_string: tstamp:32464376352 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746928: rtcpu_string: tstamp:32464376611 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746929: rtcpu_string: tstamp:32464376866 id:0x04010000 str:"nvcsi_calc_tclk_settle tclk_settle 75
"
kworker/0:1-15 [000] … 1019.746931: rtcpu_string: tstamp:32464377662 id:0x04010000 str:"ISR PHY 0 CIL_A 0x110
"
kworker/0:1-15 [000] … 1019.746939: rtcpu_nvcsi_intr: tstamp:32464377372 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000110
kworker/0:1-15 [000] … 1019.746939: rtcpu_string: tstamp:32464378089 id:0x04010000 str:"ISR PHY 0 CIL_B 0x110
"
kworker/0:1-15 [000] … 1019.746941: rtcpu_nvcsi_intr: tstamp:32464377372 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000110
kworker/0:1-15 [000] … 1019.746941: rtcpu_nvcsi_intr: tstamp:32464377372 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
kworker/0:1-15 [000] … 1019.746941: rtcpu_nvcsi_intr: tstamp:32464378631 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
kworker/0:1-15 [000] … 1019.746943: rtcpu_vinotify_error: tstamp:32464380279 cch:-1 vi:0 tag:CSIMUX_STREAM channel:0x00 frame:0 vi_tstamp:1038859851136 data:0x0000000000000001
kworker/0:1-15 [000] … 1019.746943: rtcpu_string: tstamp:32464382307 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746944: rtcpu_string: tstamp:32464382573 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746946: rtcpu_string: tstamp:32464382831 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746947: rtcpu_string: tstamp:32464383089 id:0x04010000 str:"nvcsi_calc_tclk_settle tclk_settle 75
"
kworker/0:1-15 [000] … 1019.746949: rtcpu_string: tstamp:32464383648 id:0x04010000 str:"ISR PHY 0 CIL_A 0x110
"
kworker/0:1-15 [000] … 1019.746950: rtcpu_nvcsi_intr: tstamp:32464383369 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000110
kworker/0:1-15 [000] … 1019.746950: rtcpu_string: tstamp:32464384272 id:0x04010000 str:"ISR PHY 0 CIL_B 0x10
"
kworker/0:1-15 [000] … 1019.746954: rtcpu_nvcsi_intr: tstamp:32464383994 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000010
kworker/0:1-15 [000] … 1019.746954: rtcpu_string: tstamp:32464386472 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746956: rtcpu_string: tstamp:32464386730 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746957: rtcpu_string: tstamp:32464386988 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746959: rtcpu_string: tstamp:32464387245 id:0x04010000 str:"nvcsi_calc_tclk_settle tclk_settle 75
"
kworker/0:1-15 [000] … 1019.746960: rtcpu_string: tstamp:32464387832 id:0x04010000 str:"ISR PHY 0 CIL_A 0x110
"
kworker/0:1-15 [000] … 1019.746962: rtcpu_nvcsi_intr: tstamp:32464387556 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000110
kworker/0:1-15 [000] … 1019.746962: rtcpu_string: tstamp:32464388456 id:0x04010000 str:"ISR PHY 0 CIL_B 0x10
"
kworker/0:1-15 [000] … 1019.746963: rtcpu_nvcsi_intr: tstamp:32464388179 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000010
kworker/0:1-15 [000] … 1019.746964: rtcpu_string: tstamp:32464390623 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61
"
kworker/0:1-15 [000] … 1019.746965: rtcpu_string: tstamp:32464390886 id:0x04010000 str:"nvcsi_calc_ths_settle ths_settle 61