Hey everyone,
I am running a multiple camera setup on a Nvidia Jetson Orin AGX with a customized deserializer board (provided by the supplier of the Nvidia device).
The imaging sensor is a Sony ISX021, the camera has an integrated MAX9295 serializer.
The deserializer board has 8 GMSL2 ports, always two are connected to one MAX9296A deserializer.
Right now, I’m able to run a single camera on any of the 8 GMSL2 ports by adjusting the device tree accordingly. Everything works as expected, frame rate and image quality looks good.
As soon as I add a second camera to the device tree and connect it to the Nvidia Orin, things start to get weird. After rebooting, both cameras are mounted properly (they show up in /dev/vid*
, v4l2-compliance
output also looks good).
However, when I try to launch one camera via v4l2-ctl
, the camera output seems stuck (seemingly always repeating three frames):
nvidia@nvidia-desktop:~$ v4l2-ctl -d /dev/gmsl/tier4-isx021-cam1 --set-fmt-video=width=1920,height=1280,pixelformat=UYVY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100 --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 1920/1280
Pixel Format : 'UYVY' (UYVY 4:2:2)
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 Limited Range)
Flags :
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 4915200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
The second camera is connected to a GMSL2 port that is not attached to the same deserializer as the first camera. That means, each camera has it’s “own” deserializer in the current two-camera setup.
The dmesg log contains the following:
[ 1715.091522] bwmgr API not supported
[ 1715.454018] tier4_isx021 31-001b: [tier4_isx021_start_one_streaming] : Parameter[enable_auto_exposure] = 1.
[ 1715.575454] tier4_isx021 31-001b: [tier4_isx021_start_one_streaming] : Enabled Auto Exposure.
[ 1715.575464] tier4_isx021 31-001b: [tier4_isx021_start_one_streaming] : fsync-mode in DTB = 0.
[ 1715.597480] tier4_isx021 31-001b: [tier4_isx021_start_one_streaming] : Prameter[enable_distortion_correction] = 1 .
[ 1716.340514] tier4_isx021 31-001b: [tier4_isx021_setup_embedded_data] : Disabling Front Embedded.
[ 1716.344645] tier4_isx021 31-001b: [tier4_isx021_setup_embedded_data] : Disabling Rear Embedded.
[ 1716.572361] tier4_max9296 31-0048: [tier4_max9296_write_reg] : Max9296 I2C write register at 0x0050:[0x02]
[ 1716.572488] tier4_isx021 31-001b: [tier4_isx021_start_one_streaming] : Camera has started streaming.
[ 1717.697994] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 1717.707178] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 1717.717294] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1717.725181] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 1717.735846] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1717.743575] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 1
[ 1717.754344] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 1720.513764] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 1720.522912] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 1720.533194] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1720.541023] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 1720.551690] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1720.559414] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 1
[ 1720.570143] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 1723.105795] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 1723.114961] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 1723.125197] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1723.132940] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 1723.143616] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1723.151343] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 1
[ 1723.162125] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 1723.172232] tier4_max9296 31-0048: [tier4_max9296_write_reg] : Max9296 I2C write register at 0x0050:[0x00]
The same thing happens when I run the other camera that did work previously.
I don’t really get why I can run one camera without any issues + mount a second one without any issues.
But when trying to stream, both camera outputs are broken, somehow stuck.
After reading a lot in the forum, my suspicion is towards the deser_pix_clk_hz value.
It might be okay for the load coming from one camera stream, but is too much for more than two cameras. Does that make sense?
Some sections of my device tree that might help here:
// ----- Camera modules -----
fragment@2 {
target-path = "/";
__overlay__ {
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <8>;
max_lane_speed = <4000000>;
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 {
...
};
};
};
};
mode of the cameras:
mode0 {
/*mode ISX021_MODE_1920X1280_CROP_30FPS*/
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_c";
vc_id = "0";
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";
active_w = "1920";
active_h = "1280";
readout_orientation = "0";
line_length = "2250";
inherent_gain = "1";
pix_clk_hz = "74250000";
serdes_pix_clk_hz = "350000000";// MIPI CSI clock 1400Mhz
gain_factor = "10";
/* min gain value has to start from 1 in L4T R35.4.1
https://forums.developer.nvidia.com/t/uint32-underflow-in-r35-4-1-kernel-tegracam-ctrls-c-min-gain-val/266812
*/
min_gain_val = "1"; /* 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 = "24"; /* us 1 line */
max_exp_time = "33333";
step_exp_time = "1";
default_exp_time = "33333"; /* us */
embedded_metadata_height = "0";
};