Color artifacts in stream from imx412 CSI camera

Hi all,
We are trying to make working video stream from imx412 CSI camera on xavier nx. Everything seems to work OK, but there are some color artifacts in the video stream. Do you think it is caused by bad camera setup or there is something wrong with my gstreamer pipeline ?

Gstreamer command:

gst-launch-1.0 nvarguscamerasrc sensor-mode=1 sensor-id=0 ! 'video/x-raw(memory:NVMM),width=2024,height=1144,framerate=60/1' ! nvoverlaysink

Screenshot of display:

hello tomfreakk,

could you please share the device tree properties of your badge settings.
thanks

Hi, I’m enclosing device tree properties:

			i2c@2 {
				status = "okay";
				reg = <0x2>;
				i2c-mux,deselect-on-exit;
				#address-cells = <0x1>;
				#size-cells = <0x0>;
				linux,phandle = <0x11a>;
				phandle = <0x11a>;

				cam_imx412_d@10 {
					status = "okay";
					compatible = "nvidia,imx412";
					reg = <0x10>;
					devnode = "video2";
					physical_w = "15.0";
					physical_h = "12.5";
					sensor_model = "imx412";
					use_sensor_mode_id = "true";
					reset-gpios = <0x28 0x3 0x1>;
					linux,phandle = <0x11b>;
					phandle = <0x11b>;

					mode0 {
						mclk_khz = "24000";
						num_lanes = [32 00];
						tegra_sinterface = "serial_d";
						phy_mode = "DPHY";
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = [30 00];
						active_w = "4056";
						active_h = "3040";
						mode_type = "bayer";
						pixel_phase = "rggb";
						csi_pixel_bit_depth = "10";
						readout_orientation = "90";
						line_length = "9024";
						inherent_gain = [31 00];
						mclk_multiplier = "40";
						pix_clk_hz = "840000000";
						gain_factor = "16";
						framerate_factor = "1000000";
						exposure_factor = "1000000";
						min_gain_val = "16";
						max_gain_val = "356";
						step_gain_val = [31 00];
						default_gain = "16";
						min_hdr_ratio = [31 00];
						max_hdr_ratio = [31 00];
						min_framerate = "2000000";
						max_framerate = "30000000";
						step_framerate = [31 00];
						default_framerate = "30000000";
						min_exp_time = "13";
						max_exp_time = "683709";
						step_exp_time = [31 00];
						default_exp_time = "2495";
						embedded_metadata_height = [32 00];
					};

					mode1 {
						mclk_khz = "24000";
						num_lanes = [32 00];
						tegra_sinterface = "serial_d";
						phy_mode = "DPHY";
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = [30 00];
						active_w = "2024";
						active_h = "1144";
						mode_type = "bayer";
						pixel_phase = "rggb";
						csi_pixel_bit_depth = "10";
						readout_orientation = "90";
						line_length = "4512";
						inherent_gain = [31 00];
						mclk_multiplier = "40";
						pix_clk_hz = "840000000";
						gain_factor = "16";
						framerate_factor = "1000000";
						exposure_factor = "1000000";
						min_gain_val = "16";
						max_gain_val = "356";
						step_gain_val = [31 00];
						default_gain = "16";
						min_hdr_ratio = [31 00];
						max_hdr_ratio = [31 00];
						min_framerate = "2000000";
						max_framerate = "60000000";
						step_framerate = [31 00];
						default_framerate = "60000000";
						min_exp_time = "13";
						max_exp_time = "683709";
						step_exp_time = [31 00];
						default_exp_time = "2495";
						embedded_metadata_height = [32 00];
					};

					mode2 {
						mclk_khz = "24000";
						num_lanes = [32 00];
						tegra_sinterface = "serial_d";
						phy_mode = "DPHY";
						discontinuous_clk = "no";
						dpcm_enable = "false";
						cil_settletime = [30 00];
						active_w = "1352";
						active_h = "762";
						mode_type = "bayer";
						pixel_phase = "rggb";
						csi_pixel_bit_depth = "10";
						readout_orientation = "90";
						line_length = "4512";
						inherent_gain = [31 00];
						mclk_multiplier = "40";
						pix_clk_hz = "840000000";
						gain_factor = "16";
						framerate_factor = "1000000";
						exposure_factor = "1000000";
						min_gain_val = "16";
						max_gain_val = "356";
						step_gain_val = [31 00];
						default_gain = "16";
						min_hdr_ratio = [31 00];
						max_hdr_ratio = [31 00];
						min_framerate = "2000000";
						max_framerate = "60000000";
						step_framerate = [31 00];
						default_framerate = "60000000";
						min_exp_time = "13";
						max_exp_time = "683709";
						step_exp_time = [31 00];
						default_exp_time = "2495";
						embedded_metadata_height = [32 00];
					};

					ports {
						status = "okay";
						#address-cells = <0x1>;
						#size-cells = <0x0>;

						port@0 {
							status = "okay";
							reg = <0x0>;

							endpoint {
								status = "okay";
								port-index = <0x3>;
								bus-width = <0x2>;
								remote-endpoint = <0x2b>;
								linux,phandle = <0x80>;
								phandle = <0x80>;
							};
						};
					};
				};
			};

.
.
.

	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <0xc>;
		max_lane_speed = <0x16e360>;
		min_bits_per_pixel = <0xa>;
		vi_peak_byte_per_pixel = <0x2>;
		vi_bw_margin_pct = <0x19>;
		max_pixel_rate = <0x7270e0>;
		isp_peak_byte_per_pixel = <0x5>;
		isp_bw_margin_pct = <0x19>;
		linux,phandle = <0x1a3>;
		phandle = <0x1a3>;

.
.
.


		module2 {
				badge = "jakku_bottomleft_RBP194";
				position = "bottomleft";
				orientation = [31 00];
				status = "okay";
				linux,phandle = <0x1aa>;
				phandle = <0x1aa>;

				drivernode0 {
					status = "okay";
					pcl_id = "v4l2_sensor";
					devname = "imx412 32-0010";
					proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@70/i2c@2/cam_imx412_d@10";
					linux,phandle = <0x1ab>;
					phandle = <0x1ab>;
				};
			};

hello tomfreakk,

could you please modify this badge property as something else.
you should at least remove RBP194 since you’re having IMX412 camera sensor.

Hello, thank you for an answer.
I changed badge to some unique 6 characters as recommended in “Sensor Software Driver Programming” guide, but this did not make any change with image.

hello tomfreakk,

is there any ISP override files applied? please also delete /var/nvidia/nvcam/settings/*.bin and reboot the system to verify,
besides, is this abnormal contour also seen in the dark scene?

Hello,

We have no custom ISP overrides applied. I tried to delete these files as you suggested and image now looks like this:

I can confirm too that this abnormal color contours are only present in brighter scenes or around more brighter parts of image.

hello tomfreakk,

could you please confirm you’re assign min_hdr_ratio = max_hdr_ratio =1 in your sensor modes.

please also enable preview stream with argus_camera application,
you may enable ae_lock functionality to check the capture results.

Hi,
I can confirm that min/max hdr ratio are set to 1 in device tree source:

min_hdr_ratio = “1”;
max_hdr_ratio = “1”;

I tried to use argus_camera application but there are many build errors when trying to compile it with current version of jetson_multimedia_api. It seems that the libraries are incompatible.

hello tomfreakk,

could you please check /usr/src/jetson_multimedia_api/argus/README.TXT for the instructions to build the app.
thanks

Hi, thank you for a tip.

I successfully open video stream in argus_camera application. I tried to play with camera parameters and it seems that there is something wrong with gain setting.

I`m enclosing screenshots from application:


hello tomfreakk,

you should consult with your sensor vendor, please dig into sensor driver to review the gain read/write functionality.