My board is Jetson Origin Nano, and the sensor module is imx219. If I want to change the supported resolution, what file should I modify? Is it tegra234-camera-rbpcv2-imx219.dtsi. But what files should I replace in the/boot/directory after finishing
you should update two files, (1) sensor device tree, and (2) sensor mode table.
for instance,
(1) $public_sources/kernel_src/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-imx219.dtsi
(2) $public_sources/kernel_src/kernel/nvidia/drivers/media/i2c/imx219_mode_tbls.h
may I have actual use-case to revise the sensor init settings?
please also aware that…
besides modify the pixel active region, (i.e. active_w, and active_h). you should also update… line_length, pix_clk_hz, min_exp_time, max_exp_time…etc (both of the (1) sensor device tree, and (2) sensor mode table.) to avoid potential issues.
May I ask what the function of the file tegra234-camera-rbpcv2-imx219.dtsi is?
Before seeing your reply, I have made modifications tegra234-camera-rbpcv2-imx219.dtsi,and will generate the file kernel_tegra234-p3767-0003-p3768-0000-a0.dtb copy to the/boot/dts directory of the development board.
Then use v4l2 ctl – list formats ext d/dev/video0 to check the supported resolutions, and there has been no significant change.
With your help,modified imx219_mode_tbls.h, then replaced nv_ Imx219.ko, the supported resolution has changed
FYI,
v4l2 standard controls basically parse the sensor driver capability, which checking the sensor kernel mode definition to report the supported formats.
it depends-on your own use-case, please refer to Camera Architecture Stack, you don’t need to bother sensor mode settings in the device tree if you only works with vl42src,
however, if you need camera use-case works with nvarguscamerasrc, you’ll need to have those mode settings as same as your driver definition.
there’s an optional device tree property, use_sensor_mode_id.
you may enable mode selection via v4l pipeline with adding use_sensor_mode_id = "true"; in DT property.
for instance,
here’s sample pipeline, $ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=RG10 --set-ctrl bypass_mode=0 --set-ctrl sensor_mode=4 --stream-mmap --stream-count=100
it’s --set-ctrl sensor_mode=4 to select 4th sensor mode for streaming, please also note that width/height setting must identical with 4th mode definition.