Issue using camera

Hello,

I am working with Nvidia Jetson Xavier NX (dev board) and connecting to it a CSI-camera (IMX2019- raspberry cam V2.1).
On jetpack 4.6, I was able to use camera easily.
On jetson 5.0.2, I am more struggling. At first /dev/video0 was not existing, after rebooting, it finally appeared.
I tried several different commands like :

gst-launch-1.0 nvarguscamerasrc num-buffers=1 ! 'video/x-raw(memory:NVMM), width=3264, height=2464' ! nvjpegenc ! filesink location=sample.jpg

or even

gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1,format=NV12' ! fakesink

No matter what I tried I get errors like following :


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:751 No cameras available
Got EOS from element "pipeline0".
Execution ended after 0:00:00.009313578
Setting pipeline to NULL ...
Freeing pipeline ...
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 266)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 339)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 355)
(Argus) Error EndOfFile: Client thread received an error from socket (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 145)
(Argus) Error EndOfFile:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 368)

I also tried to get daemon log like explained here : Jetson L4T 35.1 - CSI camera's issue with gstreamer - #13 by shreyas.pa

and got directly in CLI those errors :


=== NVIDIA Libargus Camera Service (0.98.3)=== Listening for connections...=== gst-launch-1.0[13390]: Connection established (FFFFAD9D3900)SCF: Error IoctlFailed:  (propagating from src/services/capture/FusaCaptureIspHw.cpp, function openIspHw(), line 239)
SCF: Error IoctlFailed:  (propagating from src/services/capture/CaptureServiceDeviceIsp.cpp, function open(), line 188)
SCF: Error IoctlFailed:  (propagating from src/services/capture/CaptureServiceDevice.cpp, function initialize(), line 302)
SCF: Error InvalidState: Isp is not opened (in src/services/capture/CaptureServiceDeviceIsp.cpp, function close(), line 201)
SCF: Error IoctlFailed:  (propagating from src/services/capture/CaptureService.cpp, function startService(), line 608)
SCF: Error InvalidState: Queue mutex not initialized (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamerautils/inc/QueueImpl.h, function dequeue(), line 227)
SCF: Error IoctlFailed:  (propagating from src/components/ServiceHost.cpp, function startServices(), line 123)
SCF: Error InvalidState:  (in src/services/capture/CaptureService.cpp, function stopService(), line 645)
SCF: Error InvalidState:  (propagating from src/components/ServiceHost.cpp, function stopServicesInternal(), line 200)
SCF: Error IoctlFailed:  (propagating from src/api/CameraDriver.cpp, function initialize(), line 178)
SCF: Error InvalidState: Services are already stopped (in src/components/ServiceHost.cpp, function stopServicesInternal(), line 193)
SCF: Error IoctlFailed:  (propagating from src/api/CameraDriver.cpp, function getCameraDriver(), line 119)
(Argus) Error IoctlFailed:  (propagating from src/api/GlobalProcessState.cpp, function createCameraProvider(), line 210)
=== gst-launch-1.0[13390]: CameraProvider initialized (0xffffa8039dc0)=== gst-launch-1.0[13390]: CameraProvider destroyed (0xffffa8039dc0)root@total-jetson:/home/total#

hello JordanRJ,

is this a typo? are you actually using IMX219?
is the video node, /dev/video0 generated? could you please also catch the kernel init logs for reference,
thanks

Hello,

Sorry, it is a typo, I am using IMX219.

Yes the /dev/video0 is generated and I will try to catch and send kernel init logs.

Thanks

Here are the logs.

Thanks
kernel.logs (122.9 KB)

hello JordanRJ,

there’s probing failed. I doubt this node video0 is generated faulty.

[   28.512190] imx219 9-0010: imx219_board_setup: error during i2c read probe (-121)
[   28.517783] imx219 9-0010: board setup failed
[   28.518011] imx219: probe of 9-0010 failed with error -121

could you please share the picture of your IMX219 camera modules?
may I also know the camera vendor it is?
thanks

As stated in the first message, it is an official raspberry pi camera module v2.1.

Here is a pic :

hello JordanRJ,

I check your logs again and it looks you have IMX219 camera detected and register to linux video node.
I assume you’ve dual camera slots on carrier board, and you connect single IMX219 camera senor to it.
for example,

[   28.519261] imx219 10-0010: tegracam sensor driver:imx219_v2.0.6
[   28.536157] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx219 10-0010 bound

are you able to execute v4l-utils to check the sensor formats,
for example, $ v4l2-ctl -d /dev/video0 --list-formats-ext

if it reported sensor formats,
please try below commands to access camera stream,
for example, $ gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

Hello,

So I tried first command again (already did it when trying on my own) and got :

ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'RG10' (10-bit Bayer RGRG/GBGB)
		Size: Discrete 3280x2464
			Interval: Discrete 0.048s (21.000 fps)
		Size: Discrete 3280x1848
			Interval: Discrete 0.036s (28.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1640x1232
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)

Second one to access camera stream lead to failure, here are the logs :

Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0: sync = false
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:751 No cameras available
/GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)I420
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)I420
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)I420
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)I420
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)I420
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)I420
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0: sync = false
Got EOS from element "pipeline0".
Execution ended after 0:00:00.005677085
Setting pipeline to NULL ...
Freeing pipeline ...
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 266)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 339)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 355)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 368)
(Argus) Error EndOfFile: Client thread received an error from socket (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 145)
(Argus) Error EndOfFile:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)

I have seen this subject that seems to be similar and is currently also trying to understand.
https://forums.developer.nvidia.com/t/imx219-csi-camera-no-available-on-xavier-nx-board/230374/9

hello JordanRJ,

we’ve test on Xavier NX with eMMC, which has dual camera connector.
we’ve also try the same setup to connect single IMX219 and launch the camera stream for confirmation.
IMX219 works on Xavier NX Jetpack-5.0.2 release version.

could you please…

  1. please shutdown the board, test with other camera connector.
  2. check whether you had camera_overrides.isp file under /var/nvidia/nvcam/settings/, if yes, please try removing that for testing.
  3. please clean your Jetpack release image, re-download the Jetpack-5.0.2 release version, re-flash the target to test again.

Hello,

I tested solution 1 and 2, but first one did not changed anything. And for the second one, the file “camera_overrides.isp” did not exist.

I will try third solution as soon as I can, but I think there is an issue with the module Raspberry Pi V2.1 on Jetpack 5.0.2 as I am not the only one with the issue. (link in previous message).

hello JordanRJ,

is this a typo?
we’ve check and confirmed IMX219 works on JetPack-5.0.2/Xavier NX eMMC.

It was a typo

Hello,

I do not understand, I redownloaded the package and flashed it again, same issue happening.

hello JordanRJ,

can v4l2 standard control works?
please refer to Applications Using V4L2 IOCTL Directly to enable V4L2 IOCTL to verify basic functionality.

as I mentioned previously,
we’ve test on Xavier NX/ IMX219/ JetPack-5.0.2, it’s worked.

It does not seems to work neither.

I do not understand why it works (tried it again) on jetpack 4.6 but does not on 5.0.2

hello JordanRJ,

there’re two camera connectors, J1 (CAM1), and J9 (CAM0).
may I know which you’re used and had you tired switching to other connector for testing?

Hello,

I tested both and restarted also multiple times the jetson with connector already plugged-in, for both connectors.

hello JordanRJ,

may I know how your flash your target.
for example,
are you using native Jetpack-5.0.2 release version through SDKManager,
or, you’ve download sample rootfs and flash the target manually?

I flashed it following official tutoriel for dev kits so using balena etcher

hello JordanRJ,

is this Xavier NX re-flash completely, or you’re just replace the SD card image?