NX with spi sensor v4l2-ctl gat raw image succeed but argus fails

Hi all, I have encountered a tough problem. Below are the details.

NX use SPI protocal communicate with sensor

  1. I can use “v4l2-ctl -d /dev/video0 --set-fmt-video=width=2448,height=2048,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw” get raw image.
  2. When I use “gst-launch-1.0 nvarguscamerasrc ! autovideosink” or “gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=2448, height=2048, format=(string)NV12, framerate=(fraction)30/1’ ! nvoverlaysink -e” I get the nvargus-daemon log list below:
=== NVIDIA Libargus Camera Service (0.97.3)=== Listening for connections...

=== gst-launch-1.0[10602]: Connection established (7FB2FB11D0)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: No override file found. ----
SCF: Error BadParameter: Unknown sensor pixel type (in src/common/Utils.cpp, function translateColorFormat(), line 340)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureServiceDeviceSensor.cpp, function open(), line 149)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 579)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 303)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 466)
Acquiring SCF Camera device source via index 0 has failed. === gst-launch-1.0[10602]: CameraProvider initialized (0x7fac843290)=== gst-launch-1.0[10602]: CameraProvider destroyed (0x7fac843290)=== gst-launch-1.0[10602]: Connection closed (7FB2FB11D0)=== gst-launch-1.0[10602]: Connection cleaned up (7FB2FB11D0)^Ce]0;

the result of v4l2-ctl -D as wll as part of my device-tree are listed down below:

v4l2-ctl -D results:

Driver Info (not using libv4l2):
 Driver name   : tegra-video
 Card type     : vi-output, imx250_spi
 Bus info      : platform:15c10000.vi:0 
 Driver version: 4.9.201 
 Capabilities  : 0x84200001
  Video Capture
  Streaming
  Extended Pix Format
  Device Capabilities
 Device Caps   : 0x04200001
  Video Capture
  Streaming
  Extended Pix Format

part of the dtsi file:

.....
spi@3230000 {
		status = "okay";
		spi-max-frequency = <10000000>;
		imx250@0 {
			compatible = "nvidia,imx250-spi";
			reg = <0>;
			status = "okay";
			spi-max-frequency = <10000000>;

			devnode = "video0";
			/* Physical dimensions of sensor */
			physical_w = "4.713";
                        physical_h = "3.494";

                        /* enable delay gain due to no hardware group hold support */
                        delayed_gain = "true";

                        /* Define any required hw resources needed by driver */
                        /* ie, clocks, io pins, power sources */                               
                        /* mclk = "cam_mclk1"; Not in use. */
			devname = "imx250-spi";

			/* Sensor Model */
			sensor_model = "imx250";
				
                        /* use_sensor_mode_id = "true"; */
			
			mode0 { /* IMX250_MODE_2448x2048_30FPS */
                                mclk_khz = "24000";
                                num_lanes = "2";
                                tegra_sinterface = "serial_a";
                                phy_mode = "DPHY";
                                discontinuous_clk = "no";
                                dpcm_enable = "false";
                                cil_settletime = "20";

                                active_w = "2448";
                                active_h = "2048";
                                pixel_t = "bayer_rggb10";
                                readout_orientation = "0";
                                line_length = "2500";
                                inherent_gain = "1";
                                mclk_multiplier = "25";
			        pix_clk_hz = "582400000"; //582400000
				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16"; /* 1.00x */
				max_gain_val = "170"; /* 10.66x */
				step_gain_val = "1";
				default_gain = "16"; /* 1.00x */
				min_framerate = "1000000"; /* 1.0 fps */
				max_framerate = "30000000"; /* 30.0 fps */
				step_framerate = "1";
				default_framerate = "30000000"; /* 30.0 fps */
				min_exp_time = "13"; /* us */
				max_exp_time = "683709"; /* us */
				step_exp_time = "1";
				default_exp_time = "2495"; /* us */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";


			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx250_out0: endpoint {
						status = "okay";
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&imx250_csi_in0>;
					};
				};
			};
		};

	};
.......
/ {
	tcp: tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <2>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <240000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;
		modules {
			cam_module0: module0 {
				badge = "imx250_rear_IMX250";
				position = "rear";
				orientation = "1";
				cam_module0_drivernode0: drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "imx250_spi";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/spi@3230000/imx250@0";
				};
			};
		};
	};
};

Any advice is welcome!

Have a check the device tree for the pixel report due to below error.
Also follow the programing to implement the dts.
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.47.1.html#wwpID0E0B60HA

SCF: Error BadParameter: Unknown sensor pixel type (in src/common/Utils.cpp, function translateColorFormat(), line 340)

Hi ShaneCCC,

Thank you for your help.

I change the device tree mode properties from “pixel_t” to " csi_pixel_bit_depth, mode_type and pixel_phas" After which I can get the preview。

I use the BSP R32.5.1 and I see these attributes updated in R32.6.1. So now the problem has been solved.

Thank you very much!