120 fps mode support removed for imx219 sensor

Sharing some details on how to do that for users non familiar with this:

  1. First get kernel sources for your Jetson. You would go to NVIDIA Developer, log in if not yet done, and then download R32.5.1 sources for Nano/TX1 or TX2/Xavier.

  2. Extract kernel_src.tbz2 from public sources.tbz2.

  3. Extract kernel sources from kernel_src.tbz2. In my case I extract to /usr/local/src/l4t_kernel, but YMMV.

  4. Patch the two files mentionned by @DaneLLL. Here are the patches:
    imx219_mode_tbls.h.patch (1.5 KB) tegra194-camera-rbpcv2-imx219.dtsi.patch (5.1 KB)

5 Build a test kernel:

#!/bin/bash

########################################################
# Native Jetson NX L4T kernel build script. 
# Assuming L4T R32.5.1 version with kernel 4.9.201.
########################################################
set -x

# Set L4TK to where you've extracted kernel_src.tbz2 archive. (tar –xjf kernel_src.tbz2)  
# In my case, was in /usr/local/src/l4t_kernel owned by root, thus some sudos below for build directory cleanup and re-creation.
export L4TK=/usr/local/src/l4t_kernel

# define some short cuts 
export SRC=$L4TK/kernel/kernel-4.9
export STAGE=$L4TK/build

# Prepare a clean build directory
sudo rm -rf ${STAGE}
sudo mkdir ${STAGE}
sudo chown -R nvidia $STAGE
sudo chgrp -R nvidia $STAGE

export TEGRA_KERNEL_OUT=${STAGE}/kernel
mkdir $TEGRA_KERNEL_OUT

export TEGRA_MODULES_OUT=${STAGE}/modules
mkdir $TEGRA_MODULES_OUT

# Not mandatory. Boost NX for saving some time. You may adapt for Nano.
# Increase instantaneous OC limit, from 3.6A to 5A on NX, in order to prevent 'soctherm: OC ALARM 0x00000001'
# Should be safe on NX according to: https://forums.developer.nvidia.com/t/system-throttled-due-to-over-current/167029/58
sudo sh -c 'echo 5000 > /sys/devices/c250000.i2c/i2c-7/7-0040/iio:device0/crit_current_limit_0'
# 15W-6cores mode on NX (use -m0 on other Jetsons)
sudo nvpmodel -m2
# Boost clocks
sudo /usr/bin/jetson_clocks

# Ready to build our kernel
cd $SRC

# Configure kernel 
export LOCALVERSION=-test
make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig

# Build 
make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j6 

# Fake modules install
make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=${TEGRA_MODULES_OUT}/

# If ok, actually install
sudo rm -rf /lib/modules/4.9.201-test
sudo cp -R ${TEGRA_MODULES_OUT}/lib/modules/4.9.201-test /lib/modules
sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image /boot/Image-4.9.201-test

# This is default device tree for NX on B01 devkit, you would adapt for other case.
sudo cp ${TEGRA_KERNEL_OUT}/arch/arm64/boot/dts/tegra194-p3668-all-p3509-0000.dtb /boot/test.dtb

So now we have custom kernel image and dtb in /boot and modules for our 4.9.201-test kernel in /lib/modules/

  1. As root, create a new entry in /boot/extlinux/extlinux.conf, first copying your working default entry and in new entry modifying LABEL, MENU, LINUX for the new kernel image, adding FDT line for device tree, keeping INITRD and APPEND unchanged such as:
LABEL test
      MENU LABEL test kernel
      LINUX /boot/Image-4.9.201-test
      FDT /boot/test.dtb
      INITRD /boot/initrd
      APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0
  1. Get a serial console and try to boot your test config at uboot prompt (first boot prompt is cboot, ignore it, uboot is next and you have 3s for selecting your config).

In my case it works fine @120 fps with v4l2 and gstreamer.

The only thing is that v4l2-ctl --list-formats-ext is reporting wrong framerate for last mode:

v4l2-ctl -d0 --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 1640x1232
			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)

@DaneLLL , any idea why the latter doesn’t report 120 fps ?

1 Like