Argus_camera not working with my new customer camera device

I port one sc0130gs camera driver based on imx274.
It is working fine on v4l2-ctl,But when I use argus_camera to test it, it give following error message:

nvidia@tegra-ubuntu:~$ argus_camera
Executing Argus Sample Application (argus_camera)
Argus Version: UNKNOWN
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, initialize:850 No cameras available
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, Dispatcher:803 (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 205)
(Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 129)
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 214)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 289)
(Argus) Error EndOfFile: Client thread received an error from socket (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 149)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 306)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 317)
(Argus) Error EndOfFile: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 101)
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, initialize:842 Failed to create CameraProvider
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, getInstance:826 Initalization failed
(Argus) Error FileOperationFailed: Connecting to argus_daemon failed: Connection refused (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 190)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 129)
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, initialize:842 Failed to create CameraProvider
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, getInstance:826 Initalization failed
(Argus) Error FileOperationFailed: Connecting to argus_daemon failed: Connection refused (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 190)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 129)
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, initialize:842 Failed to create CameraProvider
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, getInstance:826 Initalization failed
(Argus) Error FileOperationFailed: Connecting to argus_daemon failed: Connection refused (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 190)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 129)
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, initialize:842 Failed to create CameraProvider
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, getInstance:826 Initalization failed
(Argus) Error FileOperationFailed: Connecting to argus_daemon failed: Connection refused (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 190)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 129)
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, initialize:842 Failed to create CameraProvider
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, getInstance:826 Initalization failed
(Argus) Error FileOperationFailed: Connecting to argus_daemon failed: Connection refused (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 190)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 129)
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, initialize:842 Failed to create CameraProvider
Error generated. /home/nvidia/share/argus/argus_R28.2/argus/apps/camera/modules/Dispatcher.cpp, getInstance:826 Initalization failed
terminate called after throwing an instance of ā€˜std::logic_errorā€™
what(): basic_string::_M_construct null not valid
Aborted (core dumped)

Also, The argus_camera is working fine with built-in ov5693 driver.

Can you give me any guide to how to debug the issues?

Thanks,

Martin

Does it bayer sensor? argus didnā€™t support YUV sensor.

Yes, It is bayer sensor.

I capture one frame data with following command:
v4l2-ctl --set-fmt-video=width=1280,height=1024,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=3 --stream-to=sc130gs.raw -d /dev/video0
the content is as following:
ā€¦
3fff 3bbe 3fff 3fff 3ffff ā€¦

Because the sensor is one 10-bit data width,so the maxim value should been less than 0x03ff.

whatā€™s the reason to cause the issues?

The ISP is process the sensor data?
the VI(MIPI receiver) can not been config correctly?

Hi,
There are multiple factors that you might need to take into considerations here inorder to enumerate your camera device in argus.
May I know which L4T version are you using? Can you check the daemon logs to corner this issue?
From the logs I see L4T28.2.

Follow the below command to get the daemon logs.

service argus-daemon stop
export enableCamScfLogs=1
export enableCamPclLogs=1
pkill argus_daemon
/usr/sbin/argus_daemon &

If you are using a later version of L4T replace argus-daemon with nvargus-daemon

Hi Waiss Kharni,

Thanks for your kindly information.

I following your instruction and get following log message:

argus_camera --device=0
Executing Argus Sample Application (argus_camera)
=== Connection 7F9326A1E0 established ===
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
LoadOverridesFile: looking for override file [/Calib/camera_override.isp] 1/16LoadOverridesFile: looking for override file [/data/nvcam/settings/camera_overrides.isp] 2/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/camera_overrides.isp] 3/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/camera_overrides.isp] 4/16LoadOverridesFile: looking for override file [/data/nvcam/camera_overrides.isp] 5/16LoadOverridesFile: looking for override file [/data/nvcam/settings/sc130_center_A6V26.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/sc130_center_A6V26.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/sc130_center_A6V26.isp] 8/16---- imager: No override file found. ----
(NvOdmDevice) Error ModuleNotPresent: V4L2Device not available (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function findDevice(), line 245)
(NvOdmDevice) Error ModuleNotPresent: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function initialize(), line 55)
(NvOdmDevice) Error ModuleNotPresent: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 103)
NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
NvPclStartPlatformDrivers: Failed to start module drivers
NvPclDriver_V4L2_Focuser_Stub_Close: Invalid NULL input pPclDriver
NvPclStateControllerOpen: Failed ImagerGUID 2. (error 0xA000E)
NvPclOpen: PCL Open Failed. Error: 0xf
SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 598)
SCF: Error BadParameter: (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 781)
SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 276)
SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function getSource(), line 439)
(Argus) Error BadParameter: (propagating from src/api/CameraProviderImpl.cpp, function initialize(), line 92)
(Argus) Error BadParameter: (propagating from src/api/GlobalProcessState.cpp, function createCameraProvider(), line 214)
CameraProvider result: provider=(nil), shim=0x7f8cad3c30, status=1, rpc status=2, size=9

It Look like argus is looking for isp file, I donā€™t understand why it need to find isp file.
I just need to show the raw image without any processing by isp.
Can I let the argus disable logic to search isp file?

Argus doesnā€™t need .isp files for bayer cameras but it will search for them in multiple locations with multiple different names. If none are found it uses default settings.

When the v4l2 path works but the argus/isp path does not itā€™s usually due to the device tree parameters for your driver located in tegra-camera-platform/moduleN (where N is a number). Check that proc-device-tree and devname match your image sensor driver exactly. On R28.2.1 if these parameters are not correct argus daemon generally segfaults. On R32.1 it doesnā€™t segfault.

Hi Greg,

Thank you very much your help for me.
Sorry, I still confused how to modify the dts file and driver name on ā€œCheck that proc-device-tree and devname match your image sensor driver exactlyā€ļ¼Œ or can you show me one detail steps?
Can you give me your email? I can send you my device tree file and driver so that you can help me review it.

Thank you very much!

Martin

Start with Nvidiaā€™s Sensor Driver Programming Guide (link below). It does a better job explaining the driver framework than I am.

ā€˜devnameā€™ and ā€˜proc-device-treeā€™ are documented in the guide. Be certain that they are correct in your implementation.

[url]https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-271/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide/l4t_imagers.html[/url]

Hi Greg Rowe,

Thank you for your support, I have fixed the argus_camera segfault issues.
But the argus_camera still not start-up, It block at there. log message is as following:
Executing Argus Sample Application (argus_camera)
=== Connection 7F841CC1E0 established ===
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
LoadOverridesFile: looking for override file [/Calib/camera_override.isp] 1/16LoadOverridesFile: looking for override file [/data/nvcam/settings/camera_overrides.isp] 2/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/camera_overrides.isp] 3/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/camera_overrides.isp] 4/16LoadOverridesFile: looking for override file [/data/nvcam/camera_overrides.isp] 5/16LoadOverridesFile: looking for override file [/data/nvcam/settings/sc130gs_center_A6V26.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/sc130gs_center_A6V26.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/sc130gs_center_A6V26.isp] 8/16---- imager: No override file found. ----
(Argus) Error Timeout: (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 134)
(Argus) Error Timeout: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 101)

Can we enable more debug message to figure out the root cause?

There is more debug information available but, in my experience, itā€™s not terribly helpful in identifying the problems.

A few posters have asked important questions: What release are you using (R28, R32)? What is the format of the sensor output? Is it a bayer camera?

Can you also post your device tree source at least for tegra-camera-platform and all subnodes?

# As root
export enableCamPclLogs=5
export enableCamScfLogs=5
# In R32 it's nvargus-daemon (or nvargus_daemon...can't remember right now and I am not in front of a Jetson)
killall argus_daemon
argus_daemon

Then, in another terminal, launch your stream with your preferred tool (nvgstcapture, argus_camera, etc).

Youā€™ve probably already looked for clues in the kernel output by executing dmesg.

Hi Greg Rowe,

I'm using R28.2.
The sensor device model is SC130GS(By SmartSens) ,the output format is bayer BGGR.
device tree source for tegra-camera-platform is as following: 

/ {

tegra-camera-platform {
	compatible = "nvidia, tegra-camera-platform";
	/**
	* Physical settings to calculate max ISO BW
	*
	* num_csi_lanes = <>;
	* Total number of CSI lanes when all cameras are active
	*
	* max_lane_speed = <>;
	* Max lane speed in Kbit/s
	*
	* min_bits_per_pixel = <>;
	* Min bits per pixel
	*
	* vi_peak_byte_per_pixel = <>;
	* Max byte per pixel for the VI ISO case
	*
	* vi_bw_margin_pct = <>;
	* Vi bandwidth margin in percentage
	*
	* max_pixel_rate = <>;
	* Max pixel rate in Kpixel/s for the ISP ISO case
	*
	* isp_peak_byte_per_pixel = <>;
	* Max byte per pixel for the ISP ISO case
	*
	* isp_bw_margin_pct = <>;
	* Isp bandwidth margin in percentage
	*/
	/*num_csi_lanes = <4>;*/
	num_csi_lanes = <12>;
	max_lane_speed = <1500000>;
	min_bits_per_pixel = <10>;
	vi_peak_byte_per_pixel = <2>;
	vi_bw_margin_pct = <25>;
	max_pixel_rate = <750000>;
	isp_peak_byte_per_pixel = <5>;
	isp_bw_margin_pct = <25>;

	/**
	 * The general guideline for naming badge_info contains 3 parts, and is as follows,
	 * The first part is the camera_board_id for the module; if the module is in a FFD
	 * platform, then use the platform name for this part.
	 * The second part contains the position of the module, ex. "rear" or "front".
	 * The third part contains the last 6 characters of a part number which is found
	 * in the module's specsheet from the vender.
	 */
	modules {
		module2 {
			badge = "sc130gs_center_A6V26";
			position = "center";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "sc130gs 30-0030";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/sc130gs_a@30";
			};
			drivernode1 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/lens_sc130gs@A6V26/";
			};
		};
		module1 {
			badge = "sc130gs_front_A6V26";
			position = "front";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "sc130gs 31-0030";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@1/sc130gs_c@30";
			};
		};
		module0 {
			badge = "sc130gs_bottom_A6V26";
			position = "bottom";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "sc130gs 32-0030";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@2/sc130gs_e@30";
			};
		};
	};
};

};

For our camera design, We enable 3 camera sensor , each one use 4 lanes.

Currently, With v4l2-ctl, I can capture num frame data, But it look like the data is not correctly.

v4l2-ctl --set-fmt-video=width=1280,height=1024,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=3 --stream-to=sc130gs.raw -d /dev/video0

For your reference, I post the sc130gs.raw and device tree to baidu disk:
linkļ¼šē™¾åŗ¦ē½‘ē›˜-é“¾ęŽ„äøå­˜åœØ
codeļ¼š9fai

Use dtc to get the device tree from the device and confirm it.

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

Hi ShaneCCC,

tegra-camera-platform {
compatible = ā€œnvidia, tegra-camera-platformā€;
min_bits_per_pixel = <0xa>;
max_pixel_rate = <0xb71b0>;
num_csi_lanes = <0xc>;
isp_bw_margin_pct = <0x19>;
max_lane_speed = <0x16e360>;
vi_peak_byte_per_pixel = <0x2>;
vi_bw_margin_pct = <0x19>;
isp_peak_byte_per_pixel = <0x5>;

	modules {

		module0 {
			badge = "sc130gs_bottom_A6V26";
			position = "bottom";
			orientation = [31 00];

			drivernode0 {
				devname = "sc130gs 32-0030";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@2/sc130gs_e@30";
				pcl_id = "v4l2_sensor";
			};
		};

		module1 {
			badge = "sc130gs_front_A6V26";
			position = "front";
			orientation = [31 00];

			drivernode0 {
				devname = "sc130gs 31-0030";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@1/sc130gs_c@30";
				pcl_id = "v4l2_sensor";
			};
		};

		module2 {
			badge = "sc130gs_center_A6V26";
			position = "center";
			orientation = [31 00];

			drivernode0 {
				devname = "sc130gs 30-0030";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/sc130gs_a@30";
				pcl_id = "v4l2_sensor";
			};

			drivernode1 {
				proc-device-tree = "/proc/device-tree/lens_sc130gs@A6V26/";
				pcl_id = "v4l2_lens";
			};
		};
	};
};

I also just post the extracted_proc.dts on the following link:
linkļ¼šē™¾åŗ¦ē½‘ē›˜-é“¾ęŽ„äøå­˜åœØ
Codeļ¼š51av

Can you please get it?

Can you show the v4l2-ctl --list-devices
And does the it pass the v4l2-compliance test?

v4l2-compliance also get block.
it block at the do VIDIOC_ENUM_FRAMESIZE ioctl.

Hi ShanneCCC,

Thank you for your great support. I have fixed the issues.
I get another question.
Currently, there is define 'pixel_t = ā€œbayer_bggrā€ for bayer bggr format.
We will use Grey Format version SC130GS, so How to define the foramt in the device tree?
It look like there are the define ā€˜V4L2_PIX_FMT_Y16 kernelā€™ in the kernel source.

Thanks,
Martin

1 Like

Itā€™s bayer format? We not support Grey format now. But if itā€™s bayer format you may just report any rgb format to work around it for argus camera.

Hi ShanneCCC,

There are very strange problem with our driver, It seem like the image is  correctly by argus_camera tools.

But when I use v4l-ctl to capture sensor raw data:
v4l2-ctl --set-fmt-video=width=1280,height=1024,pixelformat=BG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=sc130gs.raw -d /dev/video0

I get simlar following raw sensor data:

060a3d0 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3f3f
060a3e0 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
*
060b700 3fff 3e9f 3fff 3fff 3fff 3fff 3fff 3fff
060b710 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
*
060b770 3fff 3fff 3fff 3fff 3fff 3d9f 3fff 3fff
060b780 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
060b790 3fff 3fff 3fff 3c5f 3fff 3fff 3fff 3fff
060b7a0 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
060b7b0 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3e1f
060b7c0 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
060b7d0 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3f3f
060b7e0 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
060b7f0 3fff 3edf 3fff 3fff 3fff 3bbe 3fff 3fff
060b800 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff

the sensor image output format is 10 bit bayer_bggr
By my understand, the pixel data value should been less than 0x3FF.

Actually, There are many pixel data value is more than 0x3ff(eg. 3fff).

what is the wrong config that cause to the issues?

Thanks,
Martin