Can't open IMX219 camera

Hi,
My platform is Orin NX 8GB devkit, Jetpack 6.0.
After connected two IMX219 module, the devices are found, but gst-launch-1.0 can’t open camera.

Details are bleow:
I’ve enabled imx219 dual by the tool /opt/nvidia/jetson-io/jetson-io.py.
The dmesg shows the two imx 219 bound.

em3@tegra-ubuntu:~/Downloads$ sudo dmesg | grep imx219
[sudo] password for em3:
[    8.734428] imx219 9-0010: tegracam sensor driver:imx219_v2.0.6
[    8.750500] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx219 9-0010 bound
[    8.904782] imx219 10-0010: tegracam sensor driver:imx219_v2.0.6
[    8.921135] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx219 10-0010 bound

And list devices below:

em3@tegra-ubuntu:~/Downloads$ v4l2-ctl --list-devices
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
        /dev/media0

vi-output, imx219 10-0010 (platform:tegra-capture-vi:1):
        /dev/video1

vi-output, imx219 9-0010 (platform:tegra-capture-vi:2):
        /dev/video0

em3@tegra-ubuntu:~/Downloads$ v4l2-ctl --device=/dev/video0 --list-formats-ext
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)
em3@tegra-ubuntu:~/Downloads$ v4l2-ctl --device=/dev/video1 --list-formats-ext
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)
em3@tegra-ubuntu:~/Downloads$

Stream test. the /dev/video0 has output, the /dev/video1 has no output.

em3@tegra-ubuntu:~$ v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video0
<<<<<<<<<<<<<<<<<<<<<< 21.19 fps, dropped buffers: 1
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<< 21.19 fps, dropped buffers: 1
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<< 21.19 fps, dropped buffers: 2
<<<<<<<<<<<<<<<<<<< 21.19 fps, dropped buffers: 3
<<<<<<<<<<<<<<^C
em3@tegra-ubuntu:~$ v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video1
^C^C^C^Z^C^C
em3@tegra-ubuntu:~$ ^C

gst-launch-1.0 test:

em3@tegra-ubuntu:~$ gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! \
   'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1' ! \
   nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=540' ! \
   nvvidconv ! nvegltransform ! nveglglessink -e
Setting pipeline to PAUSED ...

Using winsys: x11
Pipeline is live and does not need PREROLL ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3280 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3280 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0
   Camera mode  = 2
   Output Stream W = 1920 H = 1080
   seconds to Run    = 0
   Frame Rate = 29.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: CANCELLED
Additional debug info:
Argus Error Status
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:732 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:243 (propagating)
Execution ended after 0:00:02.927123399
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
Freeing pipeline ...
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
(Argus) Error InvalidState: Argus client is exiting with 2 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 366)
em3@tegra-ubuntu:~$

The screen will pop up a black gui window, and will disappear after several seconds.

Any suggestions to help open camera?
Many thanks!

It’s could be cable connection problem.
Please reconnect to try it.

Thanks

Hi ShaneCCC,
Thanks for the reminder.
After unplug and plug FPC, the /dev/video0 can open now, but /dev/video1 can’t.
The camera module and FPC are all good as I did swap experiment.

Stream test. the /dev/video0 has output, the /dev/video1 has no output.

em3@tegra-ubuntu:~/Downloads$ v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video0
<<<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<^C
em3@tegra-ubuntu:~/Downloads$ v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video1
^C^C^C^C^C^C
em3@tegra-ubuntu:~/Downloads$ ^C

I’ve enabled imx219 dual by the tool /opt/nvidia/jetson-io/jetson-io.py.

Could you suggest how to fix? Thanks!

Hello,

Can you share the current topology (run media-ctl -d /dev/media0 -p)

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

Hi,
Here is the output of media-ctl -d /dev/media0 -p. Thanks for your reply.

Media controller API version 5.15.136

Media device information
------------------------
driver          tegra-camrtc-ca
model           NVIDIA Tegra Video Input Device
serial          
bus info        
hw revision     0x3
driver version  5.15.136

Device topology
- entity 1: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "imx219 10-0010":0 [ENABLED]
	pad1: Source
		-> "vi-output, imx219 10-0010":0 [ENABLED]

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

- entity 7: imx219 9-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
	pad0: Source
		[fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb]
		-> "13e00000.host1x:nvcsi@15a00000-":0 [ENABLED]

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

- entity 23: imx219 10-0010 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev3
	pad0: Source
		[fmt:SRGGB10_1X10/1280x720 field:none colorspace:srgb]
		-> "13e00000.host1x:nvcsi@15a00000-":0 [ENABLED]

- entity 25: vi-output, imx219 10-0010 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video1
	pad0: Sink
		<- "13e00000.host1x:nvcsi@15a00000-":1 [ENABLED]


  1. Does argus_camera working?
  2. Add -c bypass_mode=0 to the v4l2-ctl command line.

Base on the output the connection seems correct, I just wondering why the cameras are reporting a different resolution.

imx219 9-0010:  fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb
imx219 10-0010: fmt:SRGGB10_1X10/1280x720 field:none colorspace:srgb

But checking you capture command line you are requesting the same resolution (--set-fmt-video=width=1920,height=1080,) for both cameras, so i am not sure why it reports a diferent resolution.

If you try

v4l2-ctl --set-fmt-video=width=3280,height=2464,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video0
v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video0

Does these resolutions work?

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

Do you have any other Orin NX to confirm or others sensor like imx477?

Hi ManuelLeiva,
The parameters 3280x2464, 1920x1080, 1280x720 all works good for /dev/video0. But /dev/video1 all can’t work.

1, how to use argus_camera. I’ve installed full jetpack by sudo apt install nvidia-jetpack. Can’t find argus_camera.

em3@tegra-ubuntu:~$ argus_camera
-bash: argus_camera: command not found
em3@tegra-ubuntu:~$ dpkg -l | grep nvidia-l4t-jetson-multimedia-api
ii  nvidia-l4t-jetson-multimedia-api             36.3.0-20240506102626                       arm64        NVIDIA Jetson Multimedia API is a collection of lower-level APIs that support flexible application development.
em3@tegra-ubuntu:~$ sudo find /usr -name "argus_camera" 

2, Add -c bypass_mode=0 is no help.

I tried another Orin NX board, the results is same.
I don’t have imx477.
Is there any error on my system or dts? Although I’ve enabled imx219 dual by the tool /opt/nvidia/jetson-io/jetson-io.py.

Get MMAPI to build the argus_camera.

sudo apt list -a nvidia-l4t-jetson-multimedia-api
sudo apt install nvidia-l4t-jetson-multimedia-api=xxx

Many thanks to ShaneCCC and ManuelLeiva!
Sorry the problem is caused by the carrier board. I changed the board, it works good now.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.