Orin Nano, nvarguscamerasrc with tear down effect

Hello all,
my hardware setup:

  • Jetson Orin Nano with Jetson Orin Nano DevKit
  • L4T 35.3.1
  • Camera module IMX568 connected to CAM0

I have implemented a driver for the IMX568. To make it run it was necessary to set pixel_clk_hz to 215000000.

	cam_i2cmux {
		i2c@1 {
			vc_mipi_cam0: vc_mipi@1a {
				reg                     = <0x1a>;
				compatible              = "nvidia,vc_mipi";
				devnode                 = "video0";
				use_sensor_mode_id      = "false";
				sensor_model            = "vc_mipi";

				num_lanes               = 2;
				trigger_mode            = "0";
				io_mode                 = "0";		
				physical_w              = "6.773";
				physical_h              = "5.655";
			
				mode0 {
					num_lanes                = 2;
					tegra_sinterface         = "serial_c";
					embedded_metadata_height = 1;
					readout_orientation      = "0";
					lane_polarity            = "6";

					active_w                 = "2496";
					active_h                 = "2048";
					mode_type                = "bayer";
					pixel_phase              = "rggb";
					csi_pixel_bit_depth      = "10";

					min_gain_val             = "0";         // mdB
					max_gain_val             = "48000";     // mdB
					step_gain_val            = "100";       // mdB
					default_gain             = "0";         // mdB

					min_exp_time             = "1";         // us
					max_exp_time             = "1000000";   // us
					step_exp_time            = "1";         // us
					default_exp_time         = "10000";     // us

					min_framerate            = "100";       // mHz
					max_framerate            = "41300";     // mHz
					step_framerate           = "100";       // mHz
					default_framerate        = "41300";     // mHz

					gain_factor              = "1000";
					exposure_factor          = "1000000";
					framerate_factor         = "1000";
					inherent_gain            = "1";
					min_hdr_ratio            = "1";
					max_hdr_ratio            = "1";

					line_length              = "0";
					phy_mode                 = "DPHY";
					discontinuous_clk        = "no";
					mclk_khz                 = "24000";
					pix_clk_hz               = "215000000";
					mclk_multiplier          = "0.0";  	// deprecated
					cil_settletime           = "0";
					dpcm_enable              = "false";
				};

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

After system boot I set system clocks to max_rate

path=/sys/kernel/debug/bpmp/debug/clk
echo 1 > ${path}/vi/mrq_rate_locked
echo 1 > ${path}/isp/mrq_rate_locked
echo 1 > ${path}/nvcsi/mrq_rate_locked
echo 1 > ${path}/emc/mrq_rate_locked
cat ${path}/vi/max_rate | tee ${path}/vi/rate
cat ${path}/isp/max_rate | tee  ${path}/isp/rate
cat ${path}/nvcsi/max_rate | tee ${path}/nvcsi/rate
cat ${path}/emc/max_rate | tee ${path}/emc/rate

With this GStreamer pipeline I have created a series of images.

gst-launch-1.0 -e nvarguscamerasrc sensor-id=0 num-buffers=20 aelock=true aeantibanding=0 ! 'video/x-raw(memory:NVMM), width=2496, height=2048, format=NV12' ! nvvidconv ! pngenc ! multifilesink location=~/$(date +%s)-%d.png

The first images are only partially filled with a block wise structure. Later images are filled completely but also show this tear down effect.



I also have created a series of images with this command.

v4l2-ctl -c exposure=10000 -c gain=0 -c black_level=0
v4l2-ctl --set-fmt-video=width=2496,height=2048,pixelformat=RG10
v4l2-ctl --stream-mmap --stream-count=20 --stream-to=test_2496x2048x20.raw

This images are totally fine and don’t show any bad effects.

I have checked that all images provide a timestamp.
In my opinion there is a sync problem in the ISP pipeline.

Any help appreciated.

Does there’s any error message?

sudo journalctl -b -u nvargus-daemon

-- Logs begin at Thu 2022-09-08 09:58:15 UTC, end at Thu 2023-09-21 06:14:36 UTC. --
Sep 21 06:12:55 nvidia systemd[1]: Started Argus daemon.
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: === NVIDIA Libargus Camera Service (0.99.33)=== Listening for connections...=== gst-launch-1.0[2617]: Connection established (FFFFBA821900)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclHwGetModuleList: No module data found
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclHwGetModuleList: No module data found
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: ---- imager: No override file found. ----
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: (NvCamV4l2) Error ModuleNotPresent: V4L2Device not available (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function findDevice(), line 256)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: (NvCamV4l2) Error ModuleNotPresent:  (propagating from /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function initialize(), line 60)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: (NvOdmDevice) Error ModuleNotPresent:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 107)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclStartPlatformDrivers: Failed to start module drivers
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclDriver_V4L2_Focuser_Stub_Close: Invalid NULL input pPclDriver
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclStateControllerOpen: Failed ImagerGUID 1. (error 0xA000E)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: NvPclOpen: PCL Open Failed. Error: 0xf
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 689)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 453)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 333)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 505)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: ---- imager: No override file found. ----
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: LSC: LSC surface is not based on full res!
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: E/ libnvphs:socket: Error[2]: socket connection /var/lib/nvphs/nvphsd.ctl to PHS failed: No such file or directory
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: D/ libnvphs:socket: Warning: connecting to Power Hinting Service failed. Is PHS running?
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: === gst-launch-1.0[2617]: CameraProvider initialized (0xffffb46b1d00)SCF: Error BadValue: NvPHSSendThroughputHints (in src/common/CameraPowerHint.cpp, function sendCameraPowerHint(), line 56)
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: E/ libnvphs:socket: Error[2]: socket connection /var/lib/nvphs/nvphsd.ctl to PHS failed: No such file or directory
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: D/ libnvphs:socket: Warning: connecting to Power Hinting Service failed. Is PHS running?
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: E/ libnvphs: Error: NvPHSSendThroughputHints[usecase=camera, hint=MinCPU, value=4294967295, timeout_ms=1000]: queue_or_send() failed
Sep 21 06:13:19 nvidia nvargus-daemon[1002]: LSC: LSC surface is not based on full res!

Doesn’t see any error relative to it.
Could you check the trace log.
And what if run argus_camera to check the preview on HDMI monitor.

Thanks

I do get this message

[  479.476574] bwmgr API not supported

That can be ignore. It’s harmless message.

What to do next?

Did you boost the clocks to try.

sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

Hi Shane,

yes, as I mentioned above I set the clocks to max_rate. What can I do now?

Does the frame rate correct?
Can you try lower like 30fps

I’m having the same issue.
Has there been any resolution to this?

Changing the framerate does not seem to affect the issue.

Without locked rates, the pattern of the block structure changes:

Only the isp rate needs to be locked and set to max to reproduce the pattern @peter.martienssen described.
Setting the locked isp rate to different values changes the pattern.

Any other sensor mode to try?
Could you check the trace log?
Also upgrade to r35.4.1

Thanks

I managed to resolve the issue.
We had the active_w/h in the device tree set to 2488/2048 (number of recording pixles) instead of 2472/2064, which includes the margin for color processing.
With the new values, the crop effect dissapears

Hi Kull,

Are you enabled ROI mode for 2448*2048 in IMX568 ?

I am facing the same issue when I try to get stream in ROI cropping.

We’re running it in all-pixel mode exclusively right now.

But as far as i understand, that shouldn’t impact the device tree, so maybe try

active_w = "2472";
active_h = "2064";

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.