After modifying the device tree to enable 120 FPS on the IMX219 camera, the top part of the image appears to be cropped

Hi,

Orin nano version :Jetpack 6.1 ( L4T 36.4.0)

after i modified device tree of imx219 to add mode that enabling 120 fps, the resulting image is cropped

this is part of my device tree that i add on

mode4 {
								mclk_khz = "24000";
								num_lanes = "2";
								tegra_sinterface = "serial_b";
								lane_polarity = "6";
								phy_mode = "DPHY";
								discontinuous_clk = "yes";
								dpcm_enable = "false";
								cil_settletime = "0";
								active_w = "1280";
								active_h = "720";
								mode_type = "bayer";
								pixel_phase = "rggb";
								csi_pixel_bit_depth = "10";
								readout_orientation = "90";
								line_length = "3560";
								inherent_gain = "1";
								mclk_multiplier = "9.33";
								pix_clk_hz = "169600000";
								gain_factor = "16";
								framerate_factor = "1000000";
								exposure_factor = "1000000";
								min_gain_val = "16";
								max_gain_val = "170";
								step_gain_val = "1";
								default_gain = "16";
								min_hdr_ratio = "1";
								max_hdr_ratio = "1";
								min_framerate = "2000000";
								max_framerate = "120000000";
								step_framerate = "1";
								default_framerate = "120000000";
								min_exp_time = "13";
								max_exp_time = "683709";
								step_exp_time = "1";
								default_exp_time = "2495";
								embedded_metadata_height = "2";
							};

"nvarguscamerasrc silent=true ! "
            "video/x-raw(memory:NVMM), width=1280, height=640, framerate=120/1 ! "
            "nvvidconv flip-method=%d ! "
            "video/x-raw, width=640, height=320, format=(string)GRAY8 ! "
            "videoconvert ! "
            "video/x-raw, format=(string)GRAY8 ! appsink name=sink emit-signals=true "

and this is the cropped image get from gstreamer

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 = 120.000005 fps Duration = 8333333 ; 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 = 4
Output Stream W = 1280 H = 720
seconds to Run = 0
Frame Rate = 120.000005
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
We are seeking assistance in resolving this issue. Thank you very much for your help!

hello taber.kingpeace,

may I have the details of your modification to enable 120-fps?

for instance,
please see-also Sensor Pixel Clock, sensor data rate changes once the frame-rate has increased.
in the sensor driver side, it shall also having different frame-length settings.
or.. did you simply modify the output frame-rate?

1 Like

yes, i just simply modify the output frame-rate by changing this part of the device tree min_framerate = "2000000"; max_framerate = "120000000"; step_framerate = "1"; default_framerate = "120000000";
and i didn’t modify the driver of imx219.
Should i do something on the driver to make it work?
Thank you for replying

hello taber.kingpeace,

here’s frame-rate calculation formula per sensor settings.
i.e. frame-rate (fps) = 1 / (time-per-line (in sec) * frame-length)

according to public release sources package,
for instance, $public_sources/r36.4.3/Linux_for_Tegra/source/kernel_oot_modules_src/nvidia-oot/drivers/media/i2c/imx219_mode_tbls.h

as you can see.. it’s sensor mode table for 1280x720@60-fps.
since you’re trying to stream the same resolution with higher frame-rate. you’ll also need to revise those settings, (especially the frame-length, line-length).
furthermore, it sometimes using pixel binning (i.e. x2 or x4) to achieve higher frame-rates.

static const struct camera_common_frmfmt imx219_frmfmt[] = {
...
        {{1280, 720},   imx219_60fps, 1, 0, IMX219_MODE_1280x720_60FPS},
static imx219_reg imx219_mode_1280x720_60fps[] = {
        /* capture settings */
    {0x0157, 0x00}, /* ANALOG_GAIN_GLOBAL[7:0] */
        {0x015A, 0x03}, /* COARSE_INTEG_TIME[15:8] */
        {0x015B, 0x6c}, /* COARSE_INTEG_TIME[7:0] */
        /* format settings */
    {0x0160, 0x03}, /* FRM_LENGTH[15:8] */
    {0x0161, 0x70}, /* FRM_LENGTH[7:0] */
    {0x0162, 0x0D}, /* LINE_LENGTH[15:8] */
    {0x0163, 0x78}, /* LINE_LENGTH[7:0] */
...

anyways,
there’s no 120-fps support by default, please contact with sensor vendor for further supports.

Thank you for replying.
In this file imx219_mode_tbls.h i found static imx219_reg imx219_mode_1280x720_120fps[] being commented. Is it possible to uncomment it and rebuild it so maybe the problem can be solved

and I would appreciate it if you could teach me how to rebuild it and apply it

thank you for helping

hello taber.kingpeace,

just an FYI, that 120-fps has been disabled due to it failed in certain scenario. mostly related to sensor timing sensitive.

please see-also developer guide, Building the NVIDIA Out-of-Tree Modules.