We wrote the following content under the tegra234-p3767-camera-p3768-ovx3c-isx031.dtbo device tree.
i2c@1 {
status = "okay";
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
rbpcv2_ovx3c_c@10 {
status = "disabled";
};
rbpcv3_isx031_c@1a {
reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
compatible = "sony,isx031";
/* I2C device address */
reg = <0x1a>;
/* V4L2 device node location */
devnode = "video1";
/* Physical dimensions of sensor */
physical_w = "3.680";
physical_h = "2.760";
sensor_model = "isx031";
use_sensor_mode_id = "true";
mode0 { /* ISX031_MODE_1920x1080_raw12_30FPS */
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
lane_polarity = "0";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1920";
active_h = "1300";
mode_type = "yuv";
pixel_phase = "uyvy";
csi_pixel_bit_depth = "16";
readout_orientation = "90";
line_length = "3448";
inherent_gain = "1";
mclk_multiplier = "9.33";
pix_clk_hz = "150000000";
gain_factor = "16";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "16"; /* 1.00x */
max_gain_val = "248"; /* 15.5x */
step_gain_val = "1";
default_gain = "16"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "2000000"; /* 2.0 fps */
max_framerate = "30000000"; /* 30.0 fps */
step_framerate = "1";
default_framerate = "30000000"; /* 30.0 fps */
min_exp_time = "13"; /* us */
max_exp_time = "33000"; /* us */
step_exp_time = "1";
default_exp_time = "11000"; /* us */
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
rbpcv3_isx031_out1: endpoint {
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&rbpcv3_isx031_csi_in1>;
};
};
};
};
};
And the resolution displayed in the device tree inside the device is also 1920x1300, with only one mode0.
root@ubuntu:/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/rbpcv3_isx031_c@1a# ls compatible devnode mode0 name physical_h physical_w ports reg reset-gpios sensor_model use_sensor_mode_id root@ubuntu:/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/rbpcv3_isx031_c@1a# cat mode0/active_h 1300 root@ubuntu:/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/rbpcv3_isx031_c@1a# cat mode0/active_w 1920 root@ubuntu:/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/rbpcv3_isx031_c@1a#
However, using the v4l2-ctl command is abnormal: there are three modes, and the resolution is 1920x1080.
/dev/video0 is the device of the same device tree file, which matches the device tree.
`
root@ubuntu:/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/rbpcv3_isx031_c@1a# v4l2-ctl --list-formats-ext -d /dev/video1
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
[1]: 'NV16' (Y/CbCr 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
[2]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
root@ubuntu:/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/rbpcv3_isx031_c@1a# v4l2-ctl --list-formats-ext -d /dev/video0
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'RG12' (12-bit Bayer RGRG/GBGB)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
`
When we use the v4l2 command to capture images, we are unable to get any images and receive the following error.
v4l2-ctl -d /dev/video1 --set-fmt-video=width=1920,height=1300,pixelformat=UYVY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1
[ 2089.999930] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.033299] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.066604] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.099951] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.133287] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.166620] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.199932] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.233279] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.266612] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.300149] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.333280] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.366801] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.399918] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.433455] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.466610] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[ 2090.499935] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
We also suspect that the device tree was registered incorrectly, but after checking the driver, it is consistent with the device tree configuration.
Could you please provide a solution? Thank you.