gstnvarguscamerasrc.cpp, execute:521 No cameras available

hi every one,

i’m trying to get sony imx219 working on tx2(R32).and now,i can use the below command to capture stream,it’s ok:

v4l2-ctl --set-fmt-video=width=3280,height=2464,pixelformat=RG10 --stream-mmap --set-ctrl=sensor_mode=0 --stream-count=3 -d /dev/video0

but,when i use gstreamer, it was failed.

root@tek:~# gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)30/1' ! nvoverlaysink -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:521 No cameras available

log:

# tracer: nop
#
# entries-in-buffer/entries-written: 146/146   #P:4
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
  nvargus-daemon-7978  [005] ....   368.293127: tegra_channel_open: vi-output, imx219 2-0010
  nvargus-daemon-7978  [000] ....   368.294164: tegra_channel_set_power: imx219 2-0010 : 0x1
  nvargus-daemon-7978  [000] ....   368.294175: camera_common_s_power: status : 0x1
  nvargus-daemon-7978  [000] ....   368.323346: tegra_channel_set_power: 150c0000.nvcsi--1 : 0x1
  nvargus-daemon-7978  [000] ....   368.323352: csi_s_power: enable : 0x1
  nvargus-daemon-7978  [000] ....   368.325063: tegra_channel_close: vi-output, imx219 2-0010
  nvargus-daemon-7978  [000] ....   368.325069: tegra_channel_set_power: imx219 2-0010 : 0x0
  nvargus-daemon-7978  [000] ....   368.325076: camera_common_s_power: status : 0x0
  nvargus-daemon-7978  [000] ....   368.325533: tegra_channel_set_power: 150c0000.nvcsi--1 : 0x0
  nvargus-daemon-7978  [000] ....   368.325535: csi_s_power: enable : 0x0
  nvargus-daemon-7978  [000] ....   368.330041: tegra_channel_open: vi-output, imx219 2-0010
  nvargus-daemon-7978  [000] ....   368.330054: tegra_channel_set_power: imx219 2-0010 : 0x1
  nvargus-daemon-7978  [000] ....   368.330061: camera_common_s_power: status : 0x1
  nvargus-daemon-7978  [000] ....   368.361808: tegra_channel_set_power: 150c0000.nvcsi--1 : 0x1
  nvargus-daemon-7978  [000] ....   368.361814: csi_s_power: enable : 0x1
  nvargus-daemon-7978  [000] ....   368.362142: tegra_channel_close: vi-output, imx219 2-0010
  nvargus-daemon-7978  [000] ....   368.362148: tegra_channel_set_power: imx219 2-0010 : 0x0
  nvargus-daemon-7978  [000] ....   368.362156: camera_common_s_power: status : 0x0
  nvargus-daemon-7978  [000] ....   368.362696: tegra_channel_set_power: 150c0000.nvcsi--1 : 0x0
  nvargus-daemon-7978  [000] ....   368.362699: csi_s_power: enable : 0x0
  nvargus-daemon-7978  [004] ....   368.399030: tegra_channel_open: vi-output, imx219 2-0010
  nvargus-daemon-7978  [004] ....   368.399039: tegra_channel_set_power: imx219 2-0010 : 0x1
  nvargus-daemon-7978  [004] ....   368.399045: camera_common_s_power: status : 0x1
  nvargus-daemon-7978  [004] ....   368.428290: tegra_channel_set_power: 150c0000.nvcsi--1 : 0x1
  nvargus-daemon-7978  [004] ....   368.428296: csi_s_power: enable : 0x1
  nvargus-daemon-7978  [004] ....   368.428331: tegra_channel_close: vi-output, imx219 2-0010
  nvargus-daemon-7978  [004] ....   368.428336: tegra_channel_set_power: imx219 2-0010 : 0x0
  nvargus-daemon-7978  [004] ....   368.428342: camera_common_s_power: status : 0x0
  nvargus-daemon-7978  [004] ....   368.428792: tegra_channel_set_power: 150c0000.nvcsi--1 : 0x0
  nvargus-daemon-7978  [004] ....   368.428794: csi_s_power: enable : 0x0

That must be the device configure cause this kind of problem.
Confirm you DT with your source. Check the extracted_proc.dts with your dtsi

$ sudo apt-get update
$ sudo apt-get install device-tree-compiler

$ sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree

yes, i did,Same as my modified.

why is v4l2 ok, and gstream is fail. What dose the mean of “execute:521 No cameras available”.

Confirm the devname is the same as kernel driver name.

modules {
 			module0 {
 				badge = "e3326_front_P5V27C";
 				position = "rear";
 				orientation = "1";
 				drivernode0 {
 					/* Declare PCL support driver (classically known as guid)  */
 					pcl_id = "v4l2_sensor";
 					/* Driver v4l2 device name */
 					devname = "ov5693 2-0036";
 					/* Declare the device-tree hierarchy to driver instance */
 					proc-device-tree = "/proc/device-tree/i2c@3180000/ov5693_c@36";
 				};

here is my dts:

modules {

			module0 {
				badge = "e3326_front_P5V27C";
				position = "rear";
				orientation = [31 00];
				status = "disabled";
				linux,phandle = <0x10f>;
				phandle = <0x10f>;

				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 2-0010";
					proc-device-tree = "/proc/device-tree/i2c@3180000/imx219@10";
					status = "disabled";
					linux,phandle = <0x110>;
					phandle = <0x110>;
				};

and the below is copy from proc/device-tree:

module0 {
				badge = "e3326_front_P5V27C";
				status = "okay";
				phandle = <0x10f>;
				position = "rear";
				linux,phandle = <0x10f>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					status = "okay";
					proc-device-tree = "/proc/device-tree/e3326_lens_ov5693@P5V27C/";
					phandle = <0x111>;
					linux,phandle = <0x111>;
				};

				drivernode0 {
					devname = "imx219 32-0010";
					pcl_id = "v4l2_sensor";
					status = "okay";
					proc-device-tree = "/proc/device-tree/i2c@3180000/imx219@10";
					phandle = <0x110>;
					linux,phandle = <0x110>;
				};

and the below is my kernel driver:

static const struct i2c_device_id imx219_id[] = {
	{ "imx219", 0 },
	{ }
};
MODULE_DEVICE_TABLE(i2c, imx219_id);

static struct i2c_driver imx219_i2c_driver = {
	.driver = {
		.name = "imx219",
		.owner = THIS_MODULE,
		.of_match_table = of_match_ptr(imx219_of_match),
	},
	.probe = imx219_probe,
	.remove = imx219_remove,
	.id_table = imx219_id,
};

The status was override to disable by the plugin manager that must be the reason.
You may need to disable the plugin manage.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fcamera_sensor_prog.html%23wwpID0E01F0HA

yes,i have already disabled plugin manager.at the same time,i check them under /proc/device-tree folder.

The devname = “imx219 32-0010” looks not correct? Should it be imx219 2-0010?
Check the bus number by v4l2-ctl --list-devices

good news,it’s the root cause.this issue was resovled.

thanks.