Enable IMX219 single sensor module

Hello.

I am checking “IMX219 single sensor module” at NANO devkit.
L4T is 32.5.
As you know, Devkit is providing IMX219 dual sensor module.
The reason to check “IMX219 single sensor module” is for reference to connect CSI_C(CSI_4) on custom board. (Figure red box)
And I want to use “tegra210-porg-plugin-manager.dtsi”


[Figure. Jetson_Nano_Product_Design_Guide. page 60)

So I removed “IMX219 dual sensor module” and connected “IMX219 single sensor module”, but IMX219 sensor doesn’t load.

The operation to connect “IMX219 single sensor module” is as follows.

  1. file tegra210-porg-p3448-common.dtsi to “dual dtsi” file comments.
#include <t210-common-platforms/tegra210-common.dtsi>
....
....
#include "porg-platforms/tegra210-porg-pwm-fan.dtsi"
#include "porg-platforms/tegra210-porg-camera.dtsi"
#include "porg-platforms/tegra210-porg-camera-rbpcv2-imx219.dtsi"
// #include "porg-platforms/tegra210-porg-camera-rbpcv2-dual-imx219.dtsi"
....
....
#include "porg-platforms/tegra210-porg-powermon-p3448-0000-a00.dtsi"
#include "porg-plugin-manager/tegra210-porg-eeprom-manager.dtsi"
#include "porg-plugin-manager/tegra210-porg-plugin-manager.dtsi"
#include <tegra210-soc/mods-simple-bus.dtsi>
#include "porg-platforms/tegra210-porg-extcon-p3448-0000-a00.dtsi"
#include "porg-platforms/tegra210-porg-p3448-emc-a00.dtsi"
#include "porg-platforms/tegra210-porg-pcie.dtsi"
#include "porg-platforms/tegra210-porg-prods.dtsi"
#include "porg-platforms/tegra210-porg-super-module-e2614.dtsi"
  1. “tegra210-porg-plugin-manager.dtsi” to “IMX219 dual sensor module” range commenting
		fragement@10 {
			ids = ">=3448-0000-300", ">=3448-0002-300";

			/* IMX219 dual sensor module */
			// override@4 {
			// 	target = <&imx219_cam0>;
			// 	_overlay_ {
			// 		status = "okay";
			// 	};
                        ....
                        ....
			// override@31 {
			// 	target = <&i2c_1>;
			// 	_overlay_ {
			// 		status = "okay";
			// 	};
			// };
		};
  1. Add related content from “file tegra210-camera-rbpcv2-imx219.dtsi” to CAM_I2C_MUX.
    (
#define CAM1_PWDN		TEGRA_GPIO(S, 7)
#define CAM_I2C_MUX TEGRA_GPIO(I, 0) // NFC_EN GPIO

/ {
    host1x {
		i2c@546c0000 {
			compatible = "i2c-mux-gpio";
			#address-cells = <1>;
			#size-cells = <0>;
			mux-gpios = <&gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
			i2c-parent = <&i2c7>;
			status = "disabled";
			rbpcv2_imx219_a@10 {
				status = "disabled";
				reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
			};
		};
	};

/dev/video0 creation was confirmed with the above modification.
However, Dmesg has nothing to do with IMX219.
dmesg_single_sensor.log (58.1 KB)

What modifications do I need to activate IMX219 single module?
First of all, thank you.

Remove the plugin manager to use your device tree.
BTW, you can use dual camera device tree for single camera due to the second camera will failed to probe without connected.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.html#wwpID0E0XF0HA

Thank you for answer. ShaneCCC.

What is mean BTW?

As you said, the following items have been deleted from tegra210-porg-p3448-common.dtsi.

// #include "porg-platforms/tegra210-porg-camera-rbpcv2-dual-imx219.dtsi"
// #include "porg-plugin-manager/tegra210-porg-plugin-manager.dtsi"

Additionally, the status of “rbpcv2_imx219_a@10” has been changed.

    host1x {
		i2c@546c0000 {
			rbpcv2_imx219_a@10 {
				status = "ok";
				reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
			};
		};
	};

With the above modification, it was confirmed that the device node and sensor were registered.
dmesgSingleDts.log (56.8 KB)

But the camera doesn’t work.
The log looks like this:

nvidia@linux:~$ gst-launch-1.0 nvarguscamerasrc ! nvoverlaysink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:645 No cameras available

(gst-launch-1.0:12426): GStreamer-CRITICAL **: 06:29:20.356: gst_mini_object_set_qdata: assertion 'object != NULL' failed
Got EOS from element "pipeline0".
Execution ended after 0:00:00.237977730
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Anything else to edit?
Thank you for your interest

BTW → By The Way

Does it working with original dual imx219 dtb?

Yes in dual imx219 it works.

That could be the port-index or tegra_sinterface incorrect.

Thank you for answer.

The “port-index” and “tegra_sinterface” you mentioned are as follows.
(in file tegra210-camera-rbpcv2-imx219.dtsi)

port-index = <0>;
...
tegra_sinterface = "serial_a";

I think it’s set correctly.
Are you talking about anything other than this?

Yes, it’s.
Could you print the port-index for different dtb to confirm it.

What other dtb to check are you talking about?
Can you point me?

Please check if v4l2-ctl working without problem. If v4l2-ctl working well please get the daemon log for checking.

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100

https://elinux.org/Jetson/l4t/Camera_BringUp

Thank you for your interest. ShaneCCC.

Here’s what you said:
trace.log (13.8 KB)
dmesg_1.log (58.0 KB)

I mean the log from nvargus-daemon instead of trace log.
Did you verify the v4l2-ctl working well?

It exists in the attached trace.log.
v4l2-ctl seems to work fine.

root@linux:/sys/kernel/debug/dynamic_debug# v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
<<<<<<<<<<<<<<<<<<<<<<< 21.35 fps
<<<<<<<<<<<<<<<<<<<<< 21.18 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<

Need additional nvargus-daemon logs?
Which command should I check?

sudo su
kill the process of argus_daemon/nvargus-daemon or nvcamera-daemon 
export enableCamPclLogs=5
export enableCamScfLogs=5
/usr/sbin/argus_daemon(nvargus-daemon)      option for argus
/usr/sbin/nvcamera-daemon   option for gst-launch
 
launch camera from another console

This is an additional confirmation.

When entering a command

nvidia@linux:~$ gst-launch-1.0 nvarguscamerasrc ! nvoverlaysink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:645 No cameras available

(gst-launch-1.0:9270): GStreamer-CRITICAL **: 08:28:30.396: gst_mini_object_set_qdata: assertion 'object != NULL' failed
Got EOS from element "pipeline0".
Execution ended after 0:00:00.252055838
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

tarce log

root@linux:/home/nvidia# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 22/22   #P:4
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
  nvargus-daemon-9280  [001] ....  1316.423577: tegra_channel_open: vi-output, imx219 6-0010
  nvargus-daemon-9280  [001] ....  1316.424712: camera_common_s_power: status : 0x1
  nvargus-daemon-9280  [000] ....  1316.528669: camera_common_s_power: status : 0x0
  nvargus-daemon-9280  [000] ....  1316.528845: tegra_channel_set_power: imx219 6-0010 : 0x1
  nvargus-daemon-9280  [000] ....  1316.528880: camera_common_s_power: status : 0x1
  nvargus-daemon-9280  [000] ....  1316.552416: tegra_channel_set_power: nvcsi--1 : 0x1
  nvargus-daemon-9280  [000] ....  1316.552424: csi_s_power: enable : 0x1
  nvargus-daemon-9280  [000] ....  1316.552889: tegra_channel_close: vi-output, imx219 6-0010
  nvargus-daemon-9280  [000] ....  1316.552906: tegra_channel_set_power: imx219 6-0010 : 0x0
  nvargus-daemon-9280  [000] ....  1316.552976: camera_common_s_power: status : 0x0
  nvargus-daemon-9280  [000] ....  1316.553298: tegra_channel_set_power: nvcsi--1 : 0x0
  nvargus-daemon-9280  [000] ....  1316.553307: csi_s_power: enable : 0x0
  nvargus-daemon-9280  [000] ....  1316.565268: tegra_channel_open: vi-output, imx219 6-0010
  nvargus-daemon-9280  [000] ....  1316.565284: tegra_channel_set_power: imx219 6-0010 : 0x1
  nvargus-daemon-9280  [000] ....  1316.565322: camera_common_s_power: status : 0x1
  nvargus-daemon-9280  [001] ....  1316.588821: tegra_channel_set_power: nvcsi--1 : 0x1
  nvargus-daemon-9280  [001] ....  1316.588828: csi_s_power: enable : 0x1
  nvargus-daemon-9280  [001] ....  1316.589290: tegra_channel_close: vi-output, imx219 6-0010
  nvargus-daemon-9280  [001] ....  1316.589306: tegra_channel_set_power: imx219 6-0010 : 0x0
  nvargus-daemon-9280  [001] ....  1316.589376: camera_common_s_power: status : 0x0
  nvargus-daemon-9280  [001] ....  1316.589611: tegra_channel_set_power: nvcsi--1 : 0x0
  nvargus-daemon-9280  [001] ....  1316.589618: csi_s_power: enable : 0x0
root@linux:/home/nvidia# 

What is the problem?

Looks like the devname is incorrect in dts.

The log for nvargus-daemon.

root@linux:/usr/sbin# service nvargus-daemon stop
root@linux:/usr/sbin# 
root@linux:/usr/sbin# 
root@linux:/usr/sbin# 
root@linux:/usr/sbin# 
root@linux:/usr/sbin# 
root@linux:/usr/sbin# enableCamScfLogs=5
root@linux:/usr/sbin# enableCamPclLogs=5
root@linux:/usr/sbin# 
root@linux:/usr/sbin# 
root@linux:/usr/sbin# 
root@linux:/usr/sbin# ./nvargus-daemon 
=== NVIDIA Libargus Camera Service (0.97.3)=== Listening for connections...




=== gst-launch-1.0[10608]: Connection established (7FA1E641D0)Thread 1 getting next capture
Thread 1 is waiting
Thread 2 getting next capture
Thread 2 is waiting
Thread 3 getting next capture
Thread 3 is waiting
Thread 4 getting next capture
Thread 4 is waiting
Thread 5 getting next capture
Thread 5 is waiting
Thread 6 getting next capture
Thread 6 is waiting
Thread 7 getting next capture
Thread 7 is waiting
Thread 8 getting next capture
Thread 8 is waiting
Thread 9 getting next capture
Thread 9 is waiting
Thread 10 getting next capture
Thread 10 is waiting
Thread 11 getting next capture
Thread 11 is waiting
Thread 12 getting next capture
Thread 12 is waiting
Starting services...
Worker thread IspHw statsComplete start
Worker thread IspHw frameComplete start
Worker thread IspHw statsComplete start
Worker thread IspHw frameComplete start
Worker thread CaptureScheduler checkFramePending start
Worker thread CaptureScheduler frameStart start
Worker thread V4L2CaptureScheduler checkCaptureComplete start
Worker thread V4L2CaptureScheduler issueCaptures start
Worker thread PS handleRequests start
getInstance: s_instance(0x7f9c8c7940)
getInstance: s_instance(0x7f9c8c7940)
subscribe: SensorType(gyroscope)
subscribe: create SensorType(gyroscope) sensor(0x7f9c8c9f40)
subscribe: SensorType(accelerometer)
subscribe: create SensorType(accelerometer) sensor(0x7f9c8cf4a0)
AC plugin not present: dlopen "acplugin.so", acplugin.so: cannot open shared object file: No such file or directory
Services are started
NvPclSetHotplugCallback: ++++++++++++++++++++++
---- Imager: Calibration blob file handling supported in this build ----
NvPclHwGetModuleList: OFParserListModules Succeeded
NvPclModuleListInitialize: no built in modules on platform
NvPclHwScanExternalCameras -- adding video0 to discover list
NvPclHwScanExternalCameras -- adding video0 to discover list
NvPclHwScanExternalCameras -- adding video0 to discover list
getHotplugMonitor: Getting hotplug monitor instance
 initializeHotplug++
 hotPlugfunc ++ 
 addWatch: Watch added wd='1'
CheckProcDTExists: INFO: accessing /proc/device-tree/tegra-virtual-camera-platform/modules; No such file or directory
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
setHotplugCallback: Registered new callback client
NvPclSetHotplugCallback: ----------------------
=== gst-launch-1.0[10608]: CameraProvider initialized (0x7f9c91c130) hotPlugfunc: reading from inotify FD, Thread waiting 
=== gst-launch-1.0[10608]: CameraProvider destroyed (0x7f9c91c130)Stopping services...
Worker thread CaptureScheduler frameStart stop
Worker thread CaptureScheduler checkFramePending stop
Worker thread IspHw statsComplete stop
Worker thread IspHw frameComplete stop
Worker thread IspHw statsComplete stop
Worker thread IspHw frameComplete stop
Worker thread V4L2CaptureScheduler issueCaptures stop
Worker thread V4L2CaptureScheduler checkCaptureComplete stop
NvPclShutdown: ++++++++++++++++++++++
NvPclModuleListShutdown: Client still conntected, skipping shutdown
NvPclShutdown: ----------------------
Worker thread PS handleRequests stop
unsubscribe: SensorType(gyroscope)
unsubscribe: gyroscope sensor(0x7f9c8c9f40)
unsubscribe: SensorType(accelerometer)
unsubscribe: accelerometer sensor(0x7f9c8cf4a0)
Services are stopped
closeInstance: ms_instance((nil))
NvPclRemoveHotplugCallback: ++++++++++++++++++++++
getHotplugMonitor: Getting hotplug monitor instance
 shutdownHotplug: Requesting thread exit
 hotPlugfunc: Read 16 bytes from inotify FD
 hotPlugfunc: A File was Modified 00008000 NAME :  CREATE : 00000100, DELETE : 00000200 IGNORED : 00008000 CLOSE_WRITE : 00000008
 hotPlugfunc: Exit thread
 hotPlugfunc: close failure error: 'Bad file descriptor' (9)
 hotPlugfunc -- 
 shutdownHotplug -- : shutdown of hotplug is complete 
Removed callback client
NvPclRemoveHotplugCallback: ----------------------
FiberScheduler: shutting down; 0 fibers still in map

FiberScheduler: thread 1 exiting
FiberScheduler: thread 2 exiting
FiberScheduler: thread 3 exiting
FiberScheduler: thread 5 exiting
FiberScheduler: thread 7 exiting
FiberScheduler: thread 9 exiting
FiberScheduler: thread 11 exiting
FiberScheduler: thread 4 exiting
FiberScheduler: thread 8 exiting
FiberScheduler: thread 12 exiting
FiberScheduler: thread 10 exiting
FiberScheduler: thread 6 exiting
FiberScheduler: thread 12 has been joined
FiberScheduler: thread 11 has been joined
FiberScheduler: thread 10 has been joined
FiberScheduler: thread 8 has been joined
FiberScheduler: thread 7 has been joined
FiberScheduler: thread 6 has been joined
FiberScheduler: thread 5 has been joined
FiberScheduler: thread 4 has been joined
FiberScheduler: thread 3 has been joined
FiberScheduler: thread 2 has been joined
FiberScheduler: thread 9 has been joined
FiberScheduler: thread 1 has been joined
=== gst-launch-1.0[10608]: Connection closed (7FA1E641D0)=== gst-launch-1.0[10608]: Connection cleaned up (7FA1E641D0)

Is there a problem?

devname is the same as dual dts. (/dev/video0)
single dts is the original provided by nVIDIA.
Should I define it differently for single dts?

What’s the context of the tegra-camera-platform {}

A definition for reference in tegra210-porg-plugin-manager.dtsi .
I tested it by removing it because I don’t use “plugin”, but the situation is the same.