Test camera with "gst-launch-1.0" results in "execute:725 No cameras available"

We are bringing up a new carrier board for Xavier NX. We use the imx29 camera for testing. We can see the imx219 is configured and /dev/video0 is created. But when test the camera for video streaming, we result in the following error:

procerus-desktop$ gst-launch-1.0 nvarguscamerasrc sensor-id=$device ! "video/x-raw(memory:NVMM),width=1280,height=720" ! nvvidconv ! nvv4l2h264enc ! rtph264pay pt=96 ! udpsink host=$host port=$port
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE 
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:725 No cameras available
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
Got EOS from element "pipeline0".
Execution ended after 0:00:00.011889824
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

In syslog, we see those errors:

Jul 21 12:54:42 procerus-desktop kernel: [  198.552935] [RCE] WARNING: t194/isp5.c:901 [config_channel] "All error notifications not enabled: correctable=0x00 uncorrectable=0x00"
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: === NVIDIA Libargus Camera Service (0.98.3)=== Listening for connections...=== gst-launch-1.0[8742]: Connection established (7FAF5591D0)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: OFParserEnumerateDriverNode: v4l2_sensor: failed to parse device-tree to driver node
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: NvPclHwGetModuleList: No module data found
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: ---- imager: No override file found. ----
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: (NvOdmDevice) Error NotInitialized: hDev Table not initialized (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 97)
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: NvPclStartPlatformDrivers: Failed to start module drivers
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: NvPclStateControllerOpen: Failed ImagerGUID 0. (error 0x3)
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: NvPclOpen: PCL Open Failed. Error: 0xf
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 582)
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 305)
Jul 21 12:54:42 procerus-desktop nvargus-daemon[5862]: SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 471)

It looks like the problem is in the device tree. But I just don’t know which node I should check. I dumped the device tree from target and upload it here.
dtc-fromRunning (241.5 KB)
I did not see any error message from kernel log. The mediactrl output is as following:

procerus-desktop:~$ sudo media-ctl -p -d /dev/media0 
[sudo] password for procerus: 
Sorry, try again.
[sudo] password for procerus: 
Media controller API version 0.1.0

Media device information
------------------------
driver          tegra194-vi5
model           NVIDIA Tegra Video Input Device
serial          
bus info        
hw revision     0x3
driver version  0.0.0

Device topology
- entity 1: imx219 30-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev0
	pad0: Source
		[fmt:SRGGB10_1X10/3264x2464 field:none colorspace:srgb]
		-> "15a00000.nvcsi--1":0 [ENABLED]

- entity 3: 15a00000.nvcsi--1 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "imx219 30-0010":0 [ENABLED]
	pad1: Source
		-> "vi-output, imx219 30-0010":0 [ENABLED]

- entity 6: vi-output, imx219 30-0010 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "15a00000.nvcsi--1":1 [ENABLED]

Any help is greatly appreciated.

Hi @stuart.xu ,
Please try the following pipeline and share your results.

gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! xvimagesink

Also check if you are able to get raw frames using the below command

v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw --stream-count=30 --set-ctrl bypass_mode=0

@varun_pandithurai thanks for the prompt response. The target device does not have HDMI port and no monitor is connected to it. Do I need to modify the command you advised?

Hi @stuart.xu ,
Try the V4l2 command that won’t require monitor.

v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw --stream-count=30 --set-ctrl bypass_mode=0

I tried both of the commands. Here are the output and syslog:

procerus@procerus-desktop:~$ v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw --stream-count=30 --set-ctrl bypass_mode=0
<<<<<<<<<<<<<<<<<<<<<<< 21.35 fps
<<<<<<<
procerus@procerus-desktop:~$

===syslog====
Jul 21 12:58:33 procerus-desktop [8820]: LMPT test v4l2-ctrl : ## Starting ##
Jul 21 12:58:33 procerus-desktop kernel: [  428.780584] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
Jul 21 12:58:39 procerus-desktop [8825]: LMPT test v4l2-ctrl : ## Ending ##

procerus@procerus-desktop:~$ gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! xvimagesink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Could not initialise Xv output
Additional debug info:
xvimagesink.c(1773): gst_xv_image_sink_open (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Could not open display (null)
Setting pipeline to NULL ...
Freeing pipeline ...


====fron syslog
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: === NVIDIA Libargus Camera Service (0.98.3)=== Listening for connections...=== gst-launch-1.0[8898]: Connection established (7F788601D0)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: OFParserEnumerateDriverNode: v4l2_sensor: failed to parse device-tree to driver node
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: NvPclHwGetModuleList: No module data found
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: ---- imager: No override file found. ----
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: (NvOdmDevice) Error NotInitialized: hDev Table not initialized (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 97)
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: NvPclStartPlatformDrivers: Failed to start module drivers
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: NvPclStateControllerOpen: Failed ImagerGUID 0. (error 0x3)
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: NvPclOpen: PCL Open Failed. Error: 0xf
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 582)
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 305)
Jul 21 13:07:04 procerus-desktop nvargus-daemon[6028]: SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 471)
Jul 21 13:08:02 procerus-desktop ubuntu-report[6739]: level=error msg="data were not delivered successfully to metrics server, retrying in 960s"

~                                                                                                                            

I verified the camera works fine when attached it to NX DevKit.

Hi @stuart.xu ,
The camera works fine as you can get output through v4l2-ctl.
I assume you are connected to the device through.
The streamer is not working maybe due to there is no x-server running on your kit, or you can try connect a display to it to work properly and view the output

On NX Devkit, I did the same test. The syslog showed camera “power on” ,… “power off” lines. But I did not see those lines in my case.

The following command should work without a display connected, I got “not camera available error”:

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! "video/x-raw(memory:NVMM),width=1280,height=720" ! nvvidconv ! nvv4l2h264enc ! rtph264pay pt=96 ! udpsink host=$hostIP port=$portNumb

Sorry for the late response, have you managed to get issue resolved or still need the support? Thanks

Checking the string of the devname under the tegra-camera-platform{} in device tree.

We have solved this problem. We changed multiple entries in the device tree, The proc path could be the cause. Thanks.