Argus_camera Won't Work with Different Cameras on One MAX96712

Hi Nvidia,

JetPack 7.0

I’m having trouble getting argus_camera to work with two different camera models on the same MAX96712 SerDes chip.

  • It works fine if I connect two of the same camera model.
  • But if I connect one camera that outputs RAW10 and another that outputs RAW12 on the same MAX96712, it fails.
  • If argus_camera opens Camera A first, then v4l2-ctl can still open Camera B just fine.
  • But if v4l2-ctl opens Camera A first, argus_camera fails when trying to open Camera B.
  1. Device tree
cam_6@22 {
	compatible = "sensing,sgx-raw-gmsl2-6";
	def-addr = <0x10>;
	reg = <0x22>;
	eeprom-def = <0x50>;
	eeprom-addr = <0x32>;
	devnode = "video6";

	/* Physical dimensions of sensor */
	physical_w = "15.0";
	physical_h = "12.5";

	sensor_model ="sgx-raw-gmsl2";
	camera_model ="shw5g";

	/* 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 = "false";

	/* enable CID_SENSOR_MODE_ID for sensor modes selection */
	use_sensor_mode_id = "true";

	clocks = <&bpmp TEGRA264_CLK_EXTPERIPH1>,
	<&bpmp TEGRA264_CLK_EXTPERIPH1>;
	clock-names = "extperiph1", "pllp_grtba";
	mclk = "extperiph1";
	der_id = <1>;//
	reset-gpios = <&gpio_main CAM0_PWDN GPIO_ACTIVE_HIGH>;

	mode0 {/*mode SENSOR_MODE_2064X1552_30FPS*/
		mclk_khz = "24000";
		num_lanes = "4";
		tegra_sinterface = "serial_a";
		vc_id = "2";
		phy_mode = "DPHY";
		discontinuous_clk = "no";
		dpcm_enable = "false";
		cil_settletime = "0";
		lane_polarity = "0";
		dynamic_pixel_bit_depth = "10";
		csi_pixel_bit_depth = "10";
		mode_type = "bayer";
		pixel_phase = "gbrg";

		active_w = "2560";
		active_h = "1984";
		readout_orientation = "0";
		line_length = "2800";
		inherent_gain = "1";
		mclk_multiplier = "25";
		pix_clk_hz = "200000000";
		serdes_pix_clk_hz = "600000000";

		gain_factor = "100";
		min_gain_val = "100"; 
		max_gain_val = "400";
		step_gain_val = "1";
		default_gain = "100"; 
		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 = "40"; /* 4 * 8.992μs = 35.968 μs */
		max_exp_time = "30000";
		step_exp_time = "1";
		default_exp_time = "30000"; /* μs */
		embedded_metadata_height = "0";
	};

	ports {
		#address-cells = <1>;
		#size-cells = <0>;
		port@0 {
			reg = <0>;
			cam_csi_out6: endpoint {
				vc-id = <2>;
				port-index = <0>;
				bus-width = <4>;
				remote-endpoint = <&jetson_csi_in6>;
			};
		};
	};
};
cam_5@21 {
	compatible = "sensing,sgx-raw-gmsl2-5";
	def-addr = <0x36>;
	reg = <0x21>;
	eeprom-def = <0x50>;
	eeprom-addr = <0x31>;
	devnode = "video5";

	/* Physical dimensions of sensor */
	physical_w = "15.0";
	physical_h = "12.5";

	sensor_model ="sgx-raw-gmsl2";
	camera_model ="shw3g";

	/* 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";

	clocks = <&bpmp TEGRA264_CLK_EXTPERIPH1>,
	<&bpmp TEGRA264_CLK_EXTPERIPH1>;
	clock-names = "extperiph1", "pllp_grtba";
	mclk = "extperiph1";
	der_id = <1>;//
	reset-gpios = <&gpio_main CAM0_PWDN GPIO_ACTIVE_HIGH>;

	mode0 {/*mode SENSOR_MODE_2064X1552_30FPS*/
		mclk_khz = "24000";
		num_lanes = "4";
		tegra_sinterface = "serial_a";
		vc_id = "1";
		phy_mode = "DPHY";
		discontinuous_clk = "no";
		dpcm_enable = "false";
		cil_settletime = "0";
		lane_polarity = "0";
		dynamic_pixel_bit_depth = "12";
		csi_pixel_bit_depth = "12";
		mode_type = "bayer";
		pixel_phase = "rggb";

		active_w = "2064";
		active_h = "1552";
		readout_orientation = "0";
		line_length = "2800";
		inherent_gain = "1";
		mclk_multiplier = "25";
		pix_clk_hz = "200000000";
		serdes_pix_clk_hz = "600000000";

		gain_factor = "10";
		min_gain_val = "10";
		max_gain_val = "480";
		step_gain_val = "5";
		default_gain = "10";
		min_hdr_ratio = "1";
		max_hdr_ratio = "1";
		framerate_factor = "1000000";
		min_framerate = "51000000";
		max_framerate = "51000000";
		step_framerate = "1";
		default_framerate = "51000000";
		exposure_factor = "1000000";
		min_exp_time = "12"; /*us, 2 lines*/
		max_exp_time = "19000";
		step_exp_time = "1";
		default_exp_time = "19000";/* us */
		embedded_metadata_height = "0";
	};

	ports {
		#address-cells = <1>;
		#size-cells = <0>;
		port@0 {
			reg = <0>;
			cam_csi_out5: endpoint {
				vc-id = <1>;
				port-index = <0>;
				bus-width = <4>;
				remote-endpoint = <&jetson_csi_in5>;
			};
		};
	};
};
  1. v4l2-ctl can see both cameras just fine and shows their frame rates

    • argus_camera can only open one camera. If I try to open the second one while the first is running, it fails.

nvargus-daemon og:

nvargus-daemon_log.txt (5.5 KB)

hello norman_xu,

it should support with heterogeneous camera.
could you please share the settings within tegra-camera-platform for reference.
BTW, did you have other two different camera models they’re both outputting Raw10 for testing?

Hi Jerry,

1.tegra-camera-platform

tegra-camera-platform {
	compatible = "nvidia, tegra-camera-platform";

	modules {
		status = "okay";
        ............................................
		module5 {
			status = "okay";
			badge = "cam_topright";
			position = "topright";
			orientation = "1";
			drivernode0 {
				status = "okay";
				pcl_id = "v4l2_sensor";
				sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@810c6d0000/cam_5@21";
			};
		};
		module6 {
			status = "okay";
			badge = "cam_bottomcenter";
			position = "bottomcenter";
			orientation = "1";
			drivernode0 {
				status = "okay";
				pcl_id = "v4l2_sensor";
				sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@810c6d0000/cam_6@22";
			};
		};
	    ............................................
	};
};
  1. I will test using two different camera models that both output RAW10 or both output RAW12.

hello norman_xu,

since you’ve export NVCAMERA_NITO_PATH=CONFIG, it’s loading ISP override file via file system.
it’s badge property to recognize the files for each camera module. for heterogeneous camera use-case, it should loading different ISP files.
please see-also developer guide, Module Properties, badge property should be an unique name that identifies this module. the name must consist of three parts, separated by underscores.
hence.. please give it a try to update your badge property accordingly.

Hi Jerry,

I attempted to change the badge property, but the problem persists.

hello norman_xu

may I also confirm the test results?

HI Jerry,

I tested with two different camera models, both outputting RAW12, and using argus_camera , they can run simultaneously.

Others have reported this issue before, and it appears to be a problem with argus_camera, argus_camera could not run with 2 different camera (raw10 and raw12) on 1 csi port at the same time.

Please help examine how argus_camera can be modified.

hello norman_xu

thanks for sharing test results. could you please do further tests.
(1) please check accessing heterogeneous cameras (Raw10, Raw12) via v4l2 IOCTL.
for instance,
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
$ v4l2-ctl -d /dev/video1 --set-fmt-video=width=1920,height=1080,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100

(2) please check accessing heterogeneous cameras (Raw10, Raw12) via nvarguscamerasrc.
for instance,
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvvidconv ! fpsdisplaysink text-overlay=0 name=sink_0 video-sink=fakesink sync=0 -v
$ gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvvidconv ! fpsdisplaysink text-overlay=0 name=sink_1 video-sink=fakesink sync=0 -v

Hi Jerry,

  1. It can run simultaneously via v4l2 IOCTL
v4l2-ctl -d /dev/video5 --set-fmt-video=width=2064,height=1552,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10000 -V
v4l2-ctl -d /dev/video6 --set-fmt-video=width=2560,height=1552,pixelformat=GB10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10000 -V

  1. An error occurs even when running a single camera using nvarguscamerasrc
gst-launch-1.0 nvarguscamerasrc sensor-id=5 ! 'video/x-raw(memory:NVMM),width=2064, height=1552, framerate=30/1, format=NV12' ! nvvidconv ! fpsdisplaysink text-overlay=0 name=sink_0 video-sink=fakesink sync=0 -v
gst-launch-1.0 nvarguscamerasrc sensor-id=6 ! 'video/x-raw(memory:NVMM),width=2560, height=1552, framerate=30/1, format=NV12' ! nvvidconv ! fpsdisplaysink text-overlay=0 name=sink_1 video-sink=fakesink sync=0 -v

error log:
erroneous pipeline: no element "nvarguscamerasrc"

  1. using argus_camera, the second camera can’t run

hello norman_xu,

you may install the following utilities,
$ sudo apt-get install nvidia-l4t-gstreamer
$ sudo apt install nvidia-l4t-jetson-multimedia-api

Hi jerry,

using nvarguscamerasrc, the sencod camera can not run.

error log:

nvidia@nvidia:~$ gst-launch-1.0 nvarguscamerasrc sensor-id=6 ! 'video/x-raw(memory:NVMM),width=2560, height=1552, framerate=30/1, format=NV12' ! nvvidconv ! fpsdisplaysink text-overlay=0 name=sink_1 video-sink=fakesink sync=0 -v
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstFPSDisplaySink:sink_1/GstFakeSink:fakesink0: sync = false
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)2560, height=(int)1552, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)2560, height=(int)1552, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)2560, height=(int)1552, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstFPSDisplaySink:sink_1.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/x-raw(memory:NVMM), width=(int)2560, height=(int)1552, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstFPSDisplaySink:sink_1/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)2560, height=(int)1552, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstFPSDisplaySink:sink_1.GstGhostPad:sink: caps = video/x-raw(memory:NVMM), width=(int)2560, height=(int)1552, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)2560, height=(int)1552, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)2560, height=(int)1552, format=(string)NV12, framerate=(fraction)30/1
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:814 Failed to create CaptureSession
Redistribute latency...
/GstPipeline:pipeline0/GstFPSDisplaySink:sink_1/GstFakeSink:fakesink0: sync = false
Got EOS from element "pipeline0".
Execution ended after 0:00:00.006684264
Setting pipeline to NULL ...
Freeing pipeline ...

hello norman_xu,

just double check, you should be able to enable camera stream through nvarguscamerasrc separately.
if yes.. it looks like Argus bug for launching heterogeneous cameras (Raw10, Raw12) simultaneously.

Hi Jerry,

Yes, I can enable camera stream through nvarguscamerasrc separately.
Is there a solution for this Argus issue?

hello norman_xu,

it should be a bug that we did not tested before, since we don’t have heterogeneous cameras with different Raw formats.

let me file NvBug ticket for investigation internally,
please have your heterogeneous camera solution with same pixel formats at the moment.

1 Like

Hi Jerry,

Is there an update on this issue?
We are experiencing the same problem when connecting a YUV camera (UYVY format) and a RAW camera (RAW10 format) on the same CSI. When we first open the YUV camera using gst-launch-1.0 and then try to open the RAW camera using argus_camera , it also fails.

hello norman_xu,

I’ve arranged resources for checking.
BTW, may I also have confirmation, is this reproduced on the same CSI port only?
for instance, this is only happened by having two different camera models on the same MAX96712 SerDes chip.
in other words, can you reproduce this by having camera at different CSI ports, such as 4-lane CAM1@CSI-A, 4-lane CAM2@CSI-C?

Hi Jerry,

Our board has two MAX96712 chips, connected to 4-lane@CSI-A and 4-lane@CSI-C respectively, and both exhibit this issue.

Hi Jerry,

Any updates on this issue?