Cannot get CSI camera devices using Argus

Previously, I’ve implemented the CSI camera device load function under the following conditions.

And here is my code to load CSI camera devices.

Argus::ICameraProvider * i_camera_provider_;
std::vector<Argus::CameraDevice *> camera_devices;
i_camera_provider_->getCameraDevices(&camera_devices);

if (camera_devices.size() == 0) {
  get_spd_logger()->error("device number is out of range!");
  return false;
}

Using the above code, I could get 3 camera devices successfully. However, when I changed CSI cameras to the following product, I couldn’t get any camera devices.

I’ve used the same conditions that I’ve described above, excepts camera device, and the same code for camera device load. And I’ve checked camera device connections using Cheese, GStreamer, and following commands on a terminal.

ls /dev/video*
dmesg | grep -i "Detected ar0233 sensor"

NileCAM21_CUXVR is also CSI camera. Why the getCameraDevices() function can’t get my new CSI cameras? I cannot understand this situation.

Do you mean the new device working without problem with gstreamer?

Yes.

Maybe the failed cause by different sensor size.
Could you check argus_camera multiple session.

When I’ve run argus_camera, I’ve got following error logs. I just run argus_camera only one session first.

Executing Argus Sample Application (argus_camera)
Argus Version: 0.97.3 (multi-process)
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:881 No cameras available
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, Dispatcher:834 (propagating)
(NvCameraUtils) Error InvalidState: Mutex already initialized (in Mutex.cpp, function initialize(), line 41)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function open(), line 54)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 258)
(Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:873 Failed to create CameraProvider
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:857 Initalization failed
Argus Version: 0.97.3 (multi-process)
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:881 No cameras available
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:857 Initalization failed
(NvCameraUtils) Error InvalidState: Mutex already initialized (in Mutex.cpp, function initialize(), line 41)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function open(), line 54)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 258)
(Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:873 Failed to create CameraProvider
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:857 Initalization failed
Argus Version: 0.97.3 (multi-process)
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:881 No cameras available
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:857 Initalization failed
(NvCameraUtils) Error InvalidState: Mutex already initialized (in Mutex.cpp, function initialize(), line 41)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function open(), line 54)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 258)
(Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:873 Failed to create CameraProvider
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:857 Initalization failed
Argus Version: 0.97.3 (multi-process)
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:881 No cameras available
Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:857 Initalization failed
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
Aborted (core dumped)

Additionally, I’ve checked a sensor of two CSI cameras.

The previous camera(SONY Starvis IMX290 Synchronized multi-camera for NVIDIA® Jetson AGX Xavier™) uses a SONY® Starvis IMX290 color CMOS image sensor, and the newer ones(AR0233AT HDR GMSL Camera for Industrial Applications) uses a 1/2.5" AR0233AT CMOS image sensor.

Suppose your device tree have problem. Have a check the devname and i2c bus in the device tree.

Error generated. /home/rc/jetson_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:881 No cameras available

Here is my device tree.
I can show camera displays through the cheese. In this case, I used three devices, ar0233 31-0043, ar0233 31-0044, and ar0233 32-0044.
I think there is no problem with that. Isn’t it?

tegra-camera-platform {
		isp_bw_margin_pct = <0x19>;
		compatible = "nvidia, tegra-camera-platform";
		max_pixel_rate = <0xb71b0>;
		num_csi_lanes = <0x2>;
		vi_peak_byte_per_pixel = <0x2>;
		max_lane_speed = <0x3d0900>;
		phandle = <0x104>;
		tpg_max_iso = <0x3bc400>;
		vi_bw_margin_pct = <0x19>;
		linux,phandle = <0x104>;
		min_bits_per_pixel = <0xa>;
		isp_peak_byte_per_pixel = <0x5>;

		modules {

			module4 {
				badge = "nilecam21_cuxvr";
				status = "disabled";
				phandle = <0x123>;
				position = "topleft";
				linux,phandle = <0x123>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					status = "disabled";
					proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
					phandle = <0x125>;
					linux,phandle = <0x125>;
				};

				drivernode0 {
					devname = "ar0233 32-0043";
					pcl_id = "v4l2_sensor";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@70/i2c@2/ar0233_e@43";
					phandle = <0x124>;
					linux,phandle = <0x124>;
				};
			};

			module2 {
				badge = "nilecam21_cuxvr";
				status = "disabled";
				phandle = <0x111>;
				position = "centerleft";
				linux,phandle = <0x111>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					status = "disabled";
					proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
					phandle = <0x113>;
					linux,phandle = <0x113>;
				};

				drivernode0 {
					devname = "ar0233 31-0043";
					pcl_id = "v4l2_sensor";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@70/i2c@1/ar0233_c@43";
					phandle = <0x112>;
					linux,phandle = <0x112>;
				};
			};

			module0 {
				badge = "nilecam21_cuxvr";
				status = "disabled";
				phandle = <0xf5>;
				position = "bottomleft";
				linux,phandle = <0xf5>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					status = "disabled";
					proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/";
					phandle = <0x108>;
					linux,phandle = <0x108>;
				};

				drivernode0 {
					devname = "ar0233 30-0043";
					pcl_id = "v4l2_sensor";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@70/i2c@0/ar0233_a@43";
					phandle = <0xf6>;
					linux,phandle = <0xf6>;
				};
			};

			module5 {
				badge = "nilecam21_cuxvr";
				status = "disabled";
				phandle = <0x12c>;
				position = "topright";
				linux,phandle = <0x12c>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					status = "disabled";
					proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
					phandle = <0x12e>;
					linux,phandle = <0x12e>;
				};

				drivernode0 {
					devname = "ar0233 32-0044";
					pcl_id = "v4l2_sensor";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@70/i2c@2/ar0233_f@44";
					phandle = <0x12d>;
					linux,phandle = <0x12d>;
				};
			};

			module3 {
				badge = "nilecam21_cuxvr";
				status = "disabled";
				phandle = <0x11a>;
				position = "centerright";
				linux,phandle = <0x11a>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					status = "disabled";
					proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
					phandle = <0x11c>;
					linux,phandle = <0x11c>;
				};

				drivernode0 {
					devname = "ar0233 31-0044";
					pcl_id = "v4l2_sensor";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@70/i2c@1/ar0233_d@44";
					phandle = <0x11b>;
					linux,phandle = <0x11b>;
				};
			};

			module1 {
				badge = "nilecam21_cuxvr";
				status = "disabled";
				phandle = <0xf8>;
				position = "bottomright";
				linux,phandle = <0xf8>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					status = "disabled";
					proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/";
					phandle = <0x10e>;
					linux,phandle = <0x10e>;
				};

				drivernode0 {
					devname = "ar0233 30-0044";
					pcl_id = "v4l2_sensor";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@70/i2c@0/ar0233_b@44";
					phandle = <0xf9>;
					linux,phandle = <0xf9>;
				};
			};
		};
};

And I’ve run the v4l2-compliance test. As you can see below, it seems all the test is passed

v4l2-compliance SHA   : not available

Driver Info:
Driver name   : tegra-video
Card type     : vi-output, ar0233 31-0043
Bus info      : platform:15c10000.vi:2
Driver version: 4.9.140
Capabilities  : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x04200001
Video Capture
Streaming
Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 24 Private Controls: 11

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK

Test input 0:


Total: 43, Succeeded: 43, Failed: 0, Warnings: 0

Why those status is disable?
You may need to remove the plugin manager. https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.47.2.html#wwpID0E0XF0HA

			module3 {
				badge = "nilecam21_cuxvr";
				status = "disabled";
				phandle = <0x11a>;
				position = "centerright";
				linux,phandle = <0x11a>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					status = "disabled";
					proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
					phandle = <0x11c>;
					linux,phandle = <0x11c>;
				};

				drivernode0 {
					devname = "ar0233 31-0044";
					pcl_id = "v4l2_sensor";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@70/i2c@1/ar0233_d@44";
					phandle = <0x11b>;