Camera Core: relation between camera index and device tree

Hi,

Taking a look at the dtsi files that describe the camera setup for IMX390 sensors in AGX Xavier evalkit (tegra194-camera-imx390-a00.dtsi and tegra194-p2822-0000-camera-imx390-a00.dtsi files)… Do you know how to get the camera index used by nvarguscamerasrc from these dtsi files?

gst-launch-1.0 nvarguscamerasrc <b>sensor-id=0</b> ! 'video/x-raw(memory:NVMM), width=(int)1928, height=(int)1208' ! nvvidconv flip-method=0 ! 'video/x-raw,format=(string)I420' ! xvimagesink -e &

Which JetPack version are you using? Nvidia fixed an issue very recently that made it difficult to predict the sensor-id value. I believe the fix is in 4.2.1 (I’m not sure).

Hi D3_growe,

we are using JetPack 4.2 (L4T 32.1)… Do you remember if this fix was done in some user-space library or in the kernel? My concern is that as we had to do some small changes to the camera drivers and dtsi files we might face some conflicts if we now move to JetPack 4.2.1 (L4T 32.2)…

Actually, the issue that I have is that we have a custom board with 8 camera ports, and even though we managed to edit a couple of dtsi files that supports 6 cameras working (taking as example the IMX390 dtsi files, and using also virtual-channel support), when adding the 2 extra cameras some funny things start to happen like: reading from sensor-id=3 and sensor-id=4 gives the same camera stream… This doesn’t happen when using the V4L2 API (so /dev/video0-7 are always separated streams)…

I thought that the issue may be in the “tegra_sinterface” property of the sensor modules, but I checked it several times and it should be ok…The same for the properties “vc-id” and “port-index” of the same nodes. The properties are coherent with the CSI mapping.

I’m copying here content from the tegra-camera-platform node:

modules {
			module0 {
				badge = "ar0231_rear_liar0231";
				position = "rear";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0231 2-001b"; // The "2" refers to i2c@3180000 bus
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0231_a@1b";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ar0231@A6V26/";
				};
			};

			module1 {
				badge = "ar0231_front_liar0231";
				position = "front";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0231 2-001c"; // The "2" refers to i2c@3180000 bus
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0231_b@1c";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ar0231@A6V26/";
				};
			};

			module2 {
				badge = "ar0231_topright_liar0231";
				position = "topright";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0231 2-001d"; // The "2" refers to i2c@3180000 bus
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0231_c@1d";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ar0231@A6V26/";
				};
			};

			module3 {
				badge = "ar0231_bottomright_liar0231";
				position = "bottomright";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0231 2-001e"; // The "2" refers to i2c@3180000 bus
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0231_d@1e";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ar0231@A6V26/";
				};
			};

			module4 {
				badge = "ar0231_topleft_liar0231";
				position = "topleft";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0231 2-002b"; // The "2" refers to i2c@3180000 bus
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0231_e@2b";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ar0231@A6V26/";
				};
			};
			module5 {
				badge = "ar0231_centerright_liar0231";
				position = "centerright";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0231 2-002c"; // The "2" refers to i2c@3180000 bus
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0231_f@2c";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ar0231@A6V26/";
				};
			};

			module6 {
				badge = "ar0231_centerleft_liar0231";
				position = "centerleft";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0231 2-002d"; // The "2" refers to i2c@3180000 bus
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0231_g@2d";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ar0231@A6V26/";
				};
			};

			module7 {
				badge = "ar0231_bottomleft_liar0231";
				position = "bottomleft";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0231 2-002e"; // The "2" refers to i2c@3180000 bus
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0231_h@2e";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ar0231@A6V26/";
				};
			};

The fix exists in /usr/lib/aarch64-linux-gnu/tegra/libnvodm_imager.so and the problem definitely exists in JP 4.2 (as that is what I’m working with primarily).

You’ve stumbled across another issue that is also patched in userspace. There was an issue with having more than 6 cameras. This issue was also fixed in libnvodm_imager.so.

Hi Greg,

We recently moved to JP 4.2.2 and it definitely solved our issue. Thanks for your support.