TX2 argus_camera can't find camera device

Hi all,
I have a problem on debugging imx577 sensor driver, when I run argus_camera application with “argus_camera --device=0” to get imx577 video images, it reports an error like “No camera available” and core dumped. I’m sure the “/dev/video0” exists and the sensor v4l2 driver works well because I can get raw image data from imx577 with v4l2 application, How can I solve the argus_camera “No camera available” issue? Thanks a lot!

hello jollen_wang,

may I know which JetPack release you’re working with?
if you’re based-on l4t-r32.4.3 to compile from sources, please refer to Topic 141432 and apply the patches to fix known issues.
thanks

Thanks for your reply, the Jetpack release version I use is 4.4, I install it to TX2 by sdkmanager, not compiled from sources, should I use compile sources method? Thanks.

Hi Jerry, where can I get the patches?

hello jollen_wang,

  1. you can enable argus_camera binary directly; please check post #9 in Topic 141432 for the patches if you would like to have your implementation included.
  2. may I know who’s your sensor vendor, you might contact with them for sensor driver updates. thanks

Hi Jerry,
The sensor imx577’s vendor is Sony. I’m sorry that I still havn’t found patch files in post #9 in Topic 141432, maybe is there any attachment missed in the page, or I havn’t got your meaning? My jetson_multimedia_api source has no git repository in the directory, so I can’t use “diff --git” command, how can I fix it? thanks

hello jollen_wang,

there’s code snippet in post #9, Topic 141432;
you may manually apply those changes to update header file “CameraDevice.h” and “Settings.h" to make user compile argus_camera works on r32.4.3

BTW,
could you please have an alternative way to access camera sensor with gstreamer pipelines,
for example,
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvoverlaysink -ev

I have manual updated “CameraDevice.h” and “Settings.h", but the issue still exists. BTW, the sensor driver is porting
from imx185.c, I found that only power_on()/power_off() of the driver function is called when I run argus_camera or gstreamer pipeline, is this case right? I don’t know whether argus_camera or sensor driver has bugs.

hello jollen_wang,

please refer to Sensor Software Driver Programming Guide, and review the device tree properties settings.
please also refer to Debugging Tips session to examine your sensor drivers.
moreover,
you may also enable VI tracing logs to gather more details.
for example,

echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace

Hi JerryChang,
I have tried setting the VI tracing log, bug it seems no VI log dumped(I use demsg command), how to get the VI log?
besides my device tree is underlying, could you please help to check it for me? thanks!

/ {
host1x {
vi@15700000 {
num-channels = <1>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				liimx577_vi_in0: endpoint {	//sensor1, front right, 2lanes
					port-index = <2>;
					bus-width = <2>;
					remote-endpoint = <&liimx577_csi_out0>;
				};
			};
		};
	};

	nvcsi@150c0000 {
		num-channels = <1>;		//1 sensors
		#address-cells = <1>;
		#size-cells = <0>;

		channel@0 {				//sensor1, front right, 2lanes
			reg = <0>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					liimx577_csi_in0: endpoint@0 {
						port-index = <2>;
						bus-width = <2>;
						remote-endpoint = <&liimx577_imx577_out0>;
					};
				};
				port@1 {
					reg = <1>;
					liimx577_csi_out0: endpoint@1 {
						remote-endpoint = <&liimx577_vi_in0>;
					};
				};
			};
		};
	};
};

i2c@3180000 {
	imx577_sensor@34 {
		compatible = "nvidia,imx577";
		reg = <0x34>;
		devnode = "video0";
		sensor_id =<0>;

		physical_w = "7.564";
		physical_h = "5.476";
		sensor_model = "imx577";

		post_crop_frame_drop = "0";
		use_decibel_gain = "true";
		delayed_gain = "true";
		use_sensor_mode_id = "true";

		mode0 { // IMX577_MODE_3840X2160 8M@30
			mclk_khz = "24000";
			num_lanes = "2";
			tegra_sinterface = "serial_c";
			phy_mode = "DPHY";
			discontinuous_clk = "yes";
			dpcm_enable = "false";
			cil_settletime = "0";
			dynamic_pixel_bit_depth = "10";
			csi_pixel_bit_depth = "10";
			mode_type = "bayer";
			pixel_phase = "rggb";

			active_w = "3840";
			active_h = "2160";
			readout_orientation = "0";
			line_length = "4056";
			inherent_gain = "1";
			mclk_multiplier = "24";
			pix_clk_hz = "576000000";

			gain_factor = "10";
			min_gain_val = "0";
			max_gain_val = "480";
			step_gain_val = "3";
			default_gain = "0";
			min_hdr_ratio = "1";
			max_hdr_ratio = "1";
			framerate_factor = "1000000";
			min_framerate = "1500000";
			max_framerate = "30000000";
			step_framerate = "1";
			default_framerate= "30000000";
			exposure_factor = "1000000";
			min_exp_time = "30";
			max_exp_time = "660000";
			step_exp_time = "1";
			default_exp_time = "33334";/* us */
			embedded_metadata_height = "2";
		};

		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				liimx577_imx577_out0: endpoint {
					port-index = <2>;
					bus-width = <2>;
					remote-endpoint = <&liimx577_csi_in0>;
				};
		  	};
	  	};
 	};
};

};

/ {

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

	num_csi_lanes = <2>;
	max_lane_speed = <2100000>;
	min_bits_per_pixel = <10>;
	vi_peak_byte_per_pixel = <2>;
	vi_bw_margin_pct = <25>;
	max_pixel_rate = <750000>;
	isp_peak_byte_per_pixel = <5>;
	isp_bw_margin_pct = <25>;

	modules {
		module0 {
			badge = "imx577_only";
			position = "frontright";
			orientation = "0";
			drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "imx577 30-0070";
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx577_sensor@34";
			};
		};
	};
};

};

hello jollen_wang,

several action items for you to debug further,

  1. please review Sensor Pixel Clock session to examine your pix_clk_hz property settings.

  2. please review your sensor specification, to confirm sensor signaling actually sending 2-line embedded metadata.
    i.e. embedded_metadata_height = "2";

  3. you may enable camera with commands, and you should found there’s VI tracking logs shown as below.
    $ cat /sys/kernel/debug/tracing/trace

Hi JerryChang,

  1. I have changed pix_clk_hz to 420000000 (2100Mbps/lane * 2lane / 10bits per pixel) according to vendor’s config file, and modified the tegra-camera-platform node to:
    / {

    tegra-camera-platform {
    compatible = “nvidia, tegra-camera-platform”;

     num_csi_lanes = <2>;
     max_lane_speed = <2100000000>; /* 2.1 Gbps */
     min_bits_per_pixel = <10>;
     vi_peak_byte_per_pixel = <2>;
     vi_bw_margin_pct = <25>;
     max_pixel_rate = <420000000>;
     isp_peak_byte_per_pixel = <5>;
     isp_bw_margin_pct = <25>;
    
     modules {
     	module0 {
     		badge = "imx577_rear_liimx577";
     		position = "rear";
     		orientation = "0";
     		drivernode0 {
     			pcl_id = "v4l2_sensor";
     			devname = "imx577 30-0070";
     			proc-device-tree = "/proc/device-tree/i2c@3180000/imx577_sensor@34";
     		};
     	};
     };
    

    };
    };

  2. I get “embedded data lines =2” from the sensor’s specification;

  3. The trace log I got is underlying:
    root@nvidia-desktop:/home/nvidia/nfs# cat /sys/kernel/debug/tracing/trace

tracer: nop

entries-in-buffer/entries-written: 87/87 #P:4

_-----=> irqs-off

/ _----=> need-resched

| / _—=> hardirq/softirq

|| / _–=> preempt-depth

||| / delay

TASK-PID CPU# |||| TIMESTAMP FUNCTION

| | | |||| | |

 kworker/3:2-1169  [003] ....   246.521865: rtos_queue_peek_from_isr_failed: tstamp:7997864010 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   246.689830: rtos_queue_peek_from_isr_failed: tstamp:8002864017 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   246.801795: rtos_queue_peek_from_isr_failed: tstamp:8007864024 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   246.969794: rtos_queue_peek_from_isr_failed: tstamp:8012864037 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   247.137825: rtos_queue_peek_from_isr_failed: tstamp:8017864039 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   247.305911: rtos_queue_peek_from_isr_failed: tstamp:8022864046 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   247.473800: rtos_queue_peek_from_isr_failed: tstamp:8027864052 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   247.641826: rtos_queue_peek_from_isr_failed: tstamp:8032864121 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   247.809805: rtos_queue_peek_from_isr_failed: tstamp:8037864057 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   247.921792: rtos_queue_peek_from_isr_failed: tstamp:8042864034 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   248.089915: rtos_queue_peek_from_isr_failed: tstamp:8047864075 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   248.257888: rtos_queue_peek_from_isr_failed: tstamp:8052864078 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   248.425775: rtos_queue_peek_from_isr_failed: tstamp:8057864084 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   248.593768: rtos_queue_peek_from_isr_failed: tstamp:8062864092 queue:0x0b4b4500
 kworker/3:2-1169  [003] ....   248.761907: rtos_queue_peek_from_isr_failed: tstamp:8067864103 queue:0x0b4b4500

Unfortunately the issue is not solved, can you get anything from the above logs?
By the way, I can get raw image data with V4L2 application, I think maybe the probem is something wrong with the “VI” or “tegra-camera” sub-system, the tegra-camera is not recognized correctly, can you give me some suggestion?
Thanks!

hello jollen_wang,

according to your tracking logs.
it shows VI engine did not receive sensor signaling, such as start-of-frame, end-of-frame…etc

instead of V4L2 standard controls, argus pipeline initial camera streaming with all your device tree properties settings,
please refer to Debugging Tips session to examine your sensor drivers.
suggest you may also refer to Jetson TX2 Camera BringUp to boost the VI/ISP/NVCSI clocks for debug,
thanks

Hi JerryChang,
Thanks for support! I have found the bug in the device tree that causes the issue, the “devname” property “imx577 30-0070” is unmatch with the vi-output name, I run “sudo media-ctl -p -d /dev/media0” get the right value: “imx577 2-0034”, after I fix the device tree and then run argus_camera, it works well!

nvidia@nvidia-desktop:~/nfs$ sudo media-ctl -p -d /dev/media0
[sudo] password for nvidia:
Media controller API version 0.1.0

Media device information

driver tegra-vi4
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 0.0.0

Device topology

  • entity 1: 150c0000.nvcsi–1 (2 pads, 2 links)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev0
    pad0: Sink
    <- “imx577 2-0034”:0 [ENABLED]
    pad1: Source
    -> “vi-output, imx577 2-0034”:0 [ENABLED]

  • entity 4: imx577 2-0034 (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev1
    pad0: Source
    [fmt:SRGGB10_1X10/3840x2160 field:none colorspace:srgb]
    -> “150c0000.nvcsi–1”:0 [ENABLED]

  • entity 6: vi-output, imx577 2-0034 (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    <- “150c0000.nvcsi–1”:1 [ENABLED]