Arducam IMX-219, not giving 4k video

Hello.
Greetings all.
I have an IMX-219 camera attached in the following link:

Unfortunately when even though the website suggests 30FPS on 4k, but my camera crashes when I try to access it via video-viewer or Gstreamer.

Please help me in the manner.

Output for formats:

v4l2-ctl -d /dev/video0 --list-formats-ext

ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RG10’
Name : 10-bit Bayer RGRG/GBGB
Size: Discrete 3264x2464
Interval: Discrete 0.048s (21.000 fps)
Size: Discrete 3264x1848
Interval: Discrete 0.036s (28.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)

video-viewer --input-width=2560 --input-height=1440
[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstCamera – attempting to create device csi://0
[gstreamer] gstCamera pipeline string:
[gstreamer] nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)2560, height=(int)1440, framerate=30/1, format=(string)NV12 ! nvvidconv flip-method=2 ! video/x-raw(memory:NVMM) ! appsink name=mysink
[gstreamer] gstCamera successfully created device csi://0
[video] created gstCamera from csi://0

gstCamera video options:

– URI: csi://0
- protocol: csi
- location: 0
– deviceType: csi
– ioType: input
– codec: raw
– width: 2560
– height: 1440
– frameRate: 30.000000
– bitRate: 0
– numBuffers: 4
– zeroCopy: true
– flipMethod: rotate-180
– loop: 0
– rtspLatency 2000

[OpenGL] glDisplay – X screen 0 resolution: 1920x1080
[OpenGL] glDisplay – X window resolution: 1920x1080
[OpenGL] glDisplay – display device initialized (1920x1080)
[video] created glDisplay from display://0

glDisplay video options:

– URI: display://0
- protocol: display
- location: 0
– deviceType: display
– ioType: output
– codec: raw
– width: 1920
– height: 1080
– frameRate: 0.000000
– bitRate: 0
– numBuffers: 4
– zeroCopy: true
– flipMethod: none
– loop: 0
– rtspLatency 2000

[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter1
[gstreamer] gstreamer changed state from NULL to READY ==> nvvconv0
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0
[gstreamer] gstreamer changed state from NULL to READY ==> nvarguscamerasrc0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter1
[gstreamer] gstreamer changed state from READY to PAUSED ==> nvvconv0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> nvarguscamerasrc0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer message new-clock ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> nvvconv0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0
[gstreamer] gstreamer message stream-start ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> nvarguscamerasrc0
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: 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: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

ARGUS_ERROR: Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute: 679 Frame Rate specified is greater than supported
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 3280 H = 2464
seconds to Run = 0
Frame Rate = 21.000000
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
ARGUS_ERROR: Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute: 899 InvalidState.
GST_ARGUS: Cleaning up
[gstreamer] gstCamera – end of stream (EOS)
[gstreamer] gstDecoder – failed to retrieve next image buffer
video-viewer: failed to capture video frame
[gstreamer] gstDecoder – failed to retrieve next image buffer
video-viewer: failed to capture video frame
[gstreamer] gstDecoder – failed to retrieve next image buffer
video-viewer: failed to capture video frame
[gstreamer] gstDecoder – failed to retrieve next image buffer
video-viewer: failed to capture video frame
^Creceived SIGINT
[gstreamer] gstDecoder – failed to retrieve next image buffer
video-viewer: failed to capture video frame
video-viewer: shutting down…
[gstreamer] gstCamera – stopping pipeline, transitioning to GST_STATE_NULL
^Creceived SIGINT
[gstreamer] gstCamera – pipeline stopped
video-viewer: shutdown complete

Where as
video-viewer --input-width=3280 --input-height=2464
Causes a reboot.

This sensor doesn’t support 30fps@4k, for 4k(3280x2464) is 21fps only.

Yes, I know.
But I am not able to get video from it, not even at 21 FPS, the camera just crashes and my board reboots.

Did you try modify the width=(int)2560, height=(int)1440, framerate=30/1 to 1080p or 720p to verify?

Yes, I did and it worked fine.

Below error tell need to modify the framerate=28/1

This is causing my jetson nano to get stuck and then reboot, so I can’t show you an output.

I managed to take a picture of the screen before it rebooted.

What resolution will hang and reboot?
Could you check with v4l2-ctl

Anything greater than 1920x1080 p.

Update: I have tried other IMX-219 cameras too, all of them are having this issue of rebooting while trying to geta 4k video.

Could you try below command.

v4l2-ctl -d /dev/video0 --set-fmt-video=width=3264,height=2464,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap

v4l2-ctl -d /dev/video0 --set-fmt-video=width=3264,height=2464,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap
<<<<<<<<<<<<<<<<<<<<<<< 21.35 fps
<<<<<<<<<<<<<<<<<<<<< 21.28 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.20 fps
<<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<< 21.07 fps
<<<<<<<<<<<<<<<<<<<<< 21.08 fps
<<<<<<<<<<<<<<<<<<<<< 21.10 fps
<<<<<<<<<<<<<<<<<<<<<< 21.10 fps
<<<<<<<<<<<<<<<<<<<<< 21.11 fps
<<<<<<<<<<<<<<<<<<<<< 21.12 fps
<<<<<<<<<<<<<<<<<<<<< 21.12 fps

My monitor is not 4k can that be an issue?

OK, could you try below command.

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=3264,height=2464,format=NV12' ! nvvidconv ! fpsdisplaysink video-sink=fakesink --verbose

This again caused a reboot.

What’s your BSP version?

cat /etc/nv_tegra_release

cat /etc/nv_tegra_release

R32 (release), REVISION: 4.4, GCID: 23942405, BOARD: t210ref, EABI: aarch64, DATE: Fri Oct 16 19:44:43 UTC 2020

Could you try move the {IMX219_TABLE_WAIT_MS, 10} after {0x0103, 0x01}

static imx219_reg imx219_mode_common[] = {
	{IMX219_TABLE_WAIT_MS, 10},
	/* software reset */
	{0x0103, 0x01},
	/* sensor config */

In what file should I make these changes?