Nvarguscamerasrc Error : “No cameras available"

We have a custom board with an IMX335 image sensor and a Jetson Nano.
We are developing a custom driver for the image sensor(IMX335).
The Image sensor(IMX335) is connected to the i2c-2 (i2c@7000c500) of jetson nano, not in cam-i2c pins and four lanes of MIP/CSI is used to take stream.

The device tree of the image sensor(IMX335) is attached below.

tegra210-camera-rbpcv2-imx335.dtsi (8.3 KB)

After loading the driver, we were able to capture the raw frames using v4l2 application, but our requirement is to record the video using nvarguscamerasrc gstreamer plugin.
While running gstreamer pipeline, we are getting the following error.

gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM),width=2592, height=1944, framerate=30/1, format=NV12’ ! filesink location=test.nv12 -e

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:740 No cameras available
Got EOS from element “pipeline0”.
Execution ended after 0:00:00.001053910
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Image Sensor(IMX335) Parameters are mentioned below
Pixel Formats:

ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RG10’
Name : 10-bit Bayer RGRG/GBGB

Resolution :2592(W)x1944(H)

Could you please let us know how to fix the above issue so that we can proceed further?

Hi @krishnaprasad.k
I was checking your device-tree and is there any reason for the sensor to be located on port index 2?
I didn’t see anything from the device-tree itself that would stand out as being wrong.

vi_base: vi {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				vi_port0: port@0 {
					reg = <0>;
					rbpcv2_imx335_vi_in0: endpoint {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&rbpcv2_imx335_csi_out0>;
					};
				};
			};
		};

The camera being unavailable could also be a problem with the tegra-camera-platform node:

modules {
			cam_module0: module0 {
				badge = "porg_front_RBPCV2";
				position = "front";
				orientation = "1";
				cam_module0_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx335 2-001a";
					proc-device-tree = "/proc/device-tree/host1x/i2c@7000c500/rbpcv2_imx335_c@1a";
				};
			};
		};

The devname should always match the i2c_driver struct and i2c_device_id struct inside the driver source

Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Hi @jafeth.garcia

I was checking your device-tree and is there any reason for the sensor to be located on port index 2?>

Our sensor(IMX335) is connected to the CSI4 port of jetson nano, which is CSI-C in jetson nano pinmux sheet, so port index is 2 starting from zero

The devname should always match the i2c_driver struct and i2c_device_id struct inside the driver source>

The Device node is present when we load the driver, so can we confirm this is due to devname properly matched with the i2c_driver?

The camera being unavailable could also be a problem with the tegra-camera-platform node:>

Could you please confirm where we are wrong on tegra-camera-platform node in the device tree?

Note : We have updated the device tree with i2c-2 address in tegra-camera-platform node, which is i2c@7000c500 for jetson nano

Hi @krishnaprasad.k

The Device node is present when we load the driver, so can we confirm this is due to devname properly matched with the i2c_driver?

It is possible to have a device node without having the working camera driver so it isn’t a good confirmation.

Could you please confirm where we are wrong on tegra-camera-platform node in the device tree

At the moment the error still points to the devname not matching with the struct names in the driver:

modules {
			cam_module0: module0 {
				badge = "porg_front_RBPCV2";
				position = "front";
				orientation = "1";
				cam_module0_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";

					devname = "imx335 2-001a";

					proc-device-tree = "/proc/device-tree/host1x/i2c@7000c500/rbpcv2_imx335_c@1a";
				};
			};
		};

In the driver source (imx335.c) the struct i2c_device_id imx335_id struct should show imx335:

static const struct i2c_device_id imx335_id[] = {
    { "imx335", 0 },
    { }
};

And the .name property in struct i2c_driver imx335_i2c_driver should also be imx335:

MODULE_DEVICE_TABLE(i2c, imx335_id);

static struct i2c_driver imx335_i2c_driver = {
    .driver = {
        .name = "imx335",
        .owner = THIS_MODULE,
        .of_match_table = of_match_ptr(imx335_of_match),
    },
    .probe = imx335_probe,
    .remove = imx335_remove,
    .id_table = imx335_id,
};

Could you confirm this is the case?

Also, are you using a custom board for this?
The jetson nano evm board does not support capture 4-lane, so a last resort would be to test if the capture at 2-lanes is possible

Hi @jafeth.garcia

Thanks for the clarification

Could you confirm this is the case?>

We had the same device ID and name property for i2c node in the imx335 driver, which is attached below

static const struct i2c_device_id imx335_id = {
{ “imx335”, 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, imx335_id);

static struct i2c_driver imx335_i2c_driver = {
.driver = {
.name = “imx335”,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(imx335_of_match),
},
.probe = imx335_probe,
.remove = imx335_remove,
.id_table = imx335_id,
};

It is possible to have a device node without having the working camera driver so it isn’t a good confirmation.>

But our imx335 driver is probed successfully, and we are able to capture frame with v4l2 application as well, so can we confirm that issue is still with camera driver?

Also, are you using a custom board for this?

Yes @jafeth.garcia we have a custom board and can capture 4-lane

We have enabled the debug logs for camera. Here is the syslog

  1. When running v4l2 application

Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.774421] imx335 power on function
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.774431] imx335 2-001a: imx335_power_on: power on
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.803373] imx335 imx335_set mode = 0
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.803384] imx335 imx335_write_table
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.835854] imx335 imx335_set mode writing = 0
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.835866] imx335 imx335_write_table
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.837484] imx335 imx335_set mode writing complete= 0
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.837504] imx335 imx335_start_streaming
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.837512] imx335 imx335_write_table
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.848901] imx335 imx335_stop_streaming
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.848913] imx335 imx335_write_table
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.900803]
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.900803] imx335 power off function
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.900850] imx335 2-001a: imx335_power_off: power off turning off camera
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.909334]
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.909334] imx335 power on function
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.909364] imx335 2-001a: imx335_power_on: power on
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.969628] imx335 imx335_set mode = 0
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.969632] imx335 imx335_write_table
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.993004] imx335 imx335_set mode writing = 0
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.993008] imx335 imx335_write_table
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.994019] imx335 imx335_set mode writing complete= 0
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.994026] imx335 imx335_start_streaming
Jan 18 12:22:53 tegra-ubuntu kernel: [ 578.994028] imx335 imx335_write_table
Jan 18 12:22:54 tegra-ubuntu kernel: [ 579.359524] video4linux video0: tegra_channel_capture_done: MW_ACK_DONE syncpoint time out!0
Jan 18 12:22:54 tegra-ubuntu kernel: [ 579.368566] imx335 imx335_stop_streaming
Jan 18 12:22:54 tegra-ubuntu kernel: [ 579.368575] imx335 imx335_write_table
Jan 18 12:22:54 tegra-ubuntu kernel: [ 579.450204]
Jan 18 12:22:54 tegra-ubuntu kernel: [ 579.450204] imx335 power off function
Jan 18 12:22:54 tegra-ubuntu kernel: [ 579.450213] imx335 2-001a: imx335_power_off: power off turning off camera

  1. When running gstreamer with nvargsucamerasrc pipeline

Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: Acquiring SCF Camera device source via index 0 has failed. === gst-launch-1.0[7689]: CameraProvider initialized (0x7fadbd9ac0)=== gst-launch-1.0[7689]: CameraProvider destroyed (0x7fadbd9ac0)=== gst-launch-1.0[7689]: Connection closed (7FB106B1D0)=== gst-launch-1.0[7689]: Connection cleaned up (7FB106B1D0)=== gst-launch-1.0[7747]: Connection established (7FB106B1D0)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.564575]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.564575] imx335 power on function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.564583] imx335 2-001a: imx335_power_on: power on
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.592828] imx335 imx335_set mode = 0
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.592832] imx335 imx335_write_table
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.617478] imx335 imx335_set mode writing = 0
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.617487] imx335 imx335_write_table
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.618643] imx335 imx335_set mode writing complete= 0
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.618753] imx335 imx335_start_streaming
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.618763] imx335 imx335_write_table
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.629785] vi 54080000.vi: Calibrate csi port 2
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.629953] imx335 imx335_stop_streaming
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.629958] imx335 imx335_write_table
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.681557]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.681557] imx335 power off function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.681580] imx335 2-001a: imx335_power_off: power off turning off camera
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.689155]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.689155] imx335 power on function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.689171] imx335 2-001a: imx335_power_on: power on
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.718559]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.718559] imx335 power off function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.718581] imx335 2-001a: imx335_power_off: power off turning off camera
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.737566]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.737566] imx335 power on function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.737579] imx335 2-001a: imx335_power_on: power on
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.766386]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.766386] imx335 power off function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.766418] imx335 2-001a: imx335_power_off: power off turning off camera
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: ---- imager: No override file found. ----
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.809181]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.809181] imx335 power on function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.809188] imx335 2-001a: imx335_power_on: power on
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.837463]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.837463] imx335 power off function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.837470] imx335 2-001a: imx335_power_off: power off turning off camera
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.845675]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.845675] imx335 power on function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.845679] imx335 2-001a: imx335_power_on: power on
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.874130]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.874130] imx335 power off function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.874137] imx335 2-001a: imx335_power_off: power off turning off camera
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.881284]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.881284] imx335 power on function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.881289] imx335 2-001a: imx335_power_on: power on
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.909644]
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.909644] imx335 power off function
Jan 18 12:48:09 tegra-ubuntu kernel: [ 2094.909652] imx335 2-001a: imx335_power_off: power off turning off camera
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: (NvOdmDevice) Error SymbolNotFound: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function loadModeProperties(), line 780)
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: (NvOdmDevice) Error SymbolNotFound: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function loadModeList(), line 578)
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: (NvOdmDevice) Error SymbolNotFound: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 124)
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: NvPclStartPlatformDrivers: Failed to start module drivers
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: NvPclStateControllerOpen: Failed ImagerGUID 1. (error 0x30009)
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: NvPclOpen: PCL Open Failed. Error: 0xf
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 593)
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: SCF: Error BadParameter: (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 305)
Jan 18 12:48:09 tegra-ubuntu nvargus-daemon[4814]: SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function getSource(), line 471)

Could you please give as some insights about what may be causing the issue in argsus level so that we can proceed further?

Could you test again with the nvargus logs enabled. In a secondary terminal run:

sudo su
service nvargus-daemon stop 
export enableCamPclLogs=1 
export enableCamScfLogs=1
/usr/sbin/nvargus-daemon

Then run your pipeline. This might give some further insight on the issue.

Hi @jafeth.garcia

We have done the same procedure to enable debug logs, and that logs are already shared.
Anyway, we have sorted out the issue, and we are able to capture frames through nvargus. Thanks for your support