How to chagne camera w/h

Hi all,

I met short_frame error while developed camera driver.

so I changed active_h option on dtsi file

Then I check v4l2-ctl -d /dev/video0 --list-formats-ext but it’s not change and I used --set-fmt-video option too it’s not change

how to change camera resolution?

Do I need to edit camera_mode_table to change camera resolution?

hello rlatae123,

it’s device tree settings, active_w, and active_h to report active regions to camera stack.
however, it’s driver mode table to use camera_common_frmfmt to report the sensor supported format by v4l pipeline.
for example,
$public_sources/kernel_src/kernel/nvidia/drivers/media/i2c/imx274_mode_tbls.h

static const struct camera_common_frmfmt imx274_frmfmt[] = {
        {{3840, 2160}, imx274_60_fr, 1, 0, IMX274_MODE_3840X2160},
        {{1920, 1080}, imx274_60_fr, 1, 0, IMX274_MODE_1920X1080},

hello @JerryChang

Thankyou for your reply

In other posts, when you change the camera resolution, you say to change active option but it’s not work

So I found senseor_common.c

But it was just an option to read the value

follow the code flow, as you said, The camera resolution seems to be determined by camera_common_frmfmt in mode_table

So when to use this option(active_w, active_h)?

According to guide documentation, Device Tree seems to be used for nvarguscamerasrc

is it right?

Sorry to bother you but I’m curious

hello rlatae123,

that’s correct, it depends on the application you used.
while you’re using direct v4l2 interface, such as v4l2src, most of the v4l2 related code are done in the framework. so, you don’t bother sensor specific settings.

furthermore,
please visit Tutorials page, you may see-also V4L2 Sensor Driver Development Tutorial for deep dive of writing a complete V4L2 compliant driver.
thanks

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