Nvcamerasrc working with 1 module but failing with 2 modules in tegra-camera-platform

Hi,

I’m developing a camera driver for the TX2 using Jetpack 3.2.1.

My board has 2 CSI ports, I’m able to load the driver and capture using v4l2 without problems with both cameras. However, trying to capture with nvcamerasrc I got this behavior:

  1. Setting only 1 module in tegra-camera-platform I am able to capture with nvcamerasrc with sensor-id=0, which tells me the driver and device tree for the camera is working properly. See working tegra-camera-platform below:
tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <4>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <160000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;

		modules {
			module0 {
				badge = "e3322_front_A815P2";
				position = "front";
				status = "okay";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "imx219 1-0010";
					status = "okay";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@c240000/imx219_a@10";
				};
			};
		};
	};

2- If I add the second module for the other camera, I am not able to capture with nvcamerasrc for none of the cameras, and the nvcamera-daemon triggers an error.

This is the second module added to the tegra-camera-platform node:

module1 {
				badge = "e3322_rear_A815P2";
				position = "rear";
				status = "okay";
				orientation = "1";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 1-0012";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@c240000/imx219_b@12";
				};
			};

And this is the error that nvcamerasrc triggers:

nvidia@tegra-ubuntu:~$ GST_DEBUG=*nv*:9 gst-launch-1.0 nvcamerasrc ! fakesink
0:00:00.017594589  2747       0x506a10 INFO             nvcamerasrc gstnvcamerasrc.cpp:3504:set_fps_range:<GstNvCameraSrc@0x50a200> NvCameraSrc: Setting FPSRange : (null)

Setting pipeline to PAUSED ...
0:00:00.019046212  2747       0x506a10 INFO             nvcamerasrc gstnvcamerasrc.cpp:2138:send_request_to_camera_daemon:<nvcamerasrc0> NvCameraSrc: CameraDaemon_REQ GET NUM SENSORS

0:00:00.019071785  2747       0x4c9e30 DEBUG            nvcamerasrc gstnvcamerasrc.cpp:1388:gst_nvcamerasrc_response:<nvcamerasrc0> gst_nvcamerasrc_response thread
Socket read error. Camera Daemon stopped functioning.....
0:00:01.179807545  2747       0x4c9e30 DEBUG            nvcamerasrc gstnvcamerasrc.cpp:1625:gst_nvcamerasrc_response:<nvcamerasrc0> gst_nvcamerasrc_response thread exiting nbytes=0 

0:00:01.179857865  2747       0x506a10 DEBUG            nvcamerasrc gstnvcamerasrc.cpp:2419:gst_nvcamera_socket_connect:<nvcamerasrc0> REQ_NVCAM_GET_NUM_SENSORS to camera_daemon failed

0:00:01.180113906  2747       0x506a10 DEBUG            nvcamerasrc gstnvcamerasrc.cpp:3342:gst_nvcamerasrc_start:<nvcamerasrc0> start
0:00:01.180226317  2747       0x506a10 ERROR            nvcamerasrc gstnvcamerasrc.cpp:2448:gst_nvcamera_open:<nvcamerasrc0> REQ_NVCAM_CREATE_SESSION to camera_daemon failed

gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn't want to pause.
Setting pipeline to NULL ...
0:00:01.180967186  2747       0x506a10 DEBUG            nvcamerasrc gstnvcamerasrc.cpp:2429:gst_nvcamera_socket_disconnect:<nvcamerasrc0> REQ_NVCAM_CLOSE_SOCKET to camera_daemon failed

Freeing pipeline ...

So that, I am able to capture from only 1 camera using nvcamerasrc and both cameras are needed.

My questions are:

  1. It looks like the nvcamera-daemon doesn’t response properly to the num sensors request. Where does this come from? Who tells the deamon the number of sensors connected?

  2. May this problem related to the plugin manager? What is the plugin manager and how it works?

  3. Could be there something in the default device tree causing this problem?

I would appreciate any guidance on this.

Thanks.

  • Carlos
  1. Check if the dev/video0 and dev/video1 node are created.
  2. check if v4l2-ctl can capture data both from these node.

Yes, both nodes are created, and we can capture from both cameras using v4l2-ctl.

The problem is with nvcamerasrc as I exposed above

Follow below link to enable logs from user-space for more details to check.

https://elinux.org/Jetson_TX2/28.1_Camera_BringUp