Vi_capture_setup: control failed, errno 1

Hi, I am trying to stream AR0821 camera with v4l2-ctl command, but I am seeing error, “tegra194-vi5 15c10000.vi: vi_capture_setup: control failed, errno 1” from kernel. Dmesg log is as below

[ 686.055032] ar0821 2-0010: ar0821_power_on: power on
[ 686.065203] t194-nvcsi 15a00000.nvcsi: csi5_power_on
[ 686.068498] t194-nvcsi 15a00000.nvcsi: settle time reading from props
[ 686.070264] t194-nvcsi 15a00000.nvcsi: settle time reading from props
[ 686.070278] t194-nvcsi 15a00000.nvcsi: csi5_mipi_cal
[ 686.070320] t194-nvcsi 15a00000.nvcsi: csi_port:2
[ 686.083443] tegra194-vi5 15c10000.vi: vi_capture_init++
[ 686.083614] tegra194-vi5 15c10000.vi: chan flags 4163
[ 686.083641] tegra194-vi5 15c10000.vi: chan mask ffffffffffffffff
[ 686.083646] tegra194-vi5 15c10000.vi: queue depth 4
[ 686.083650] tegra194-vi5 15c10000.vi: request size 704
[ 686.086648] tegra194-vi5 15c10000.vi: vi_capture_ivc_send_control: sending chan_id 65 msg_id 16
[ 686.086767] tegra194-vi5 15c10000.vi: vi_capture_ivc_send_control: response chan_id 65 msg_id 17
[ 686.086776] tegra194-vi5 15c10000.vi: vi_capture_setup: control failed, errno 1
[ 686.086994] tegra194-vi5 15c10000.vi: vi capture setup failed
[ 686.087100] tegra194-vi5 15c10000.vi: vi_capture_shutdown–
[ 686.096596] ar0821 2-0010: ar0821_power_off:
[ 686.096795] t194-nvcsi 15a00000.nvcsi: csi5_power_off

Errno 1 means CAPTURE_ERROR_INVALID_PARAMETER from the code. I tried to debug it further to get more information on what parameter is wrong, so I print out more information from TEGRA_CAMERA_CID_GAIN, TEGRA_CAMERA_CID_EXPOSURE, TEGRA_CAMERA_CID_EXPOSURE_SHORT, TEGRA_CAMERA_CID_FRAME_RATE functions. But, none of that got called. Can you let me know where I can find more information about what parameter is wrong? Thank you.

hello judy.wang,

did you have defined tegracam_ctrl_ops{...} in the sensor driver?
you must adding the CID list in the sensor driver also,
for example,

static const u32 ctrl_cid_list[] = {
        TEGRA_CAMERA_CID_GAIN,
        TEGRA_CAMERA_CID_EXPOSURE,
        TEGRA_CAMERA_CID_FRAME_RATE,
        TEGRA_CAMERA_CID_SENSOR_MODE_ID,
};
static struct tegracam_ctrl_ops imx219_ctrl_ops = {
        .numctrls = ARRAY_SIZE(ctrl_cid_list),
        .ctrl_cid_list = ctrl_cid_list,
        .set_gain = imx219_set_gain,
        .set_exposure = imx219_set_exposure,
        .set_frame_rate = imx219_set_frame_rate,
        .set_group_hold = imx219_set_group_hold,
};

there’s generic tegra camera driver (i.e. tegracam_ctrls.c) to handle those control operations,
for example,

static const struct v4l2_ctrl_ops tegracam_ctrl_ops = {
        .s_ctrl = tegracam_s_ctrl,
};
static int tegracam_set_ctrls(struct tegracam_ctrl_handler *handler,
                        struct v4l2_ctrl *ctrl)
{
...
        switch (ctrl->id) {
        case TEGRA_CAMERA_CID_GAIN:
                err = ops->set_gain(tc_dev, *ctrl->p_new.p_s64);
                break;

Yes, We have defined tegracam_ctrl_ops(…) as below.

All of the above functions have been implemented.

In tegraccam_ctrls.c.

hello judy.wang,

may I know which JetPack release version it is.
did you have camera device register to linux kernel as video node? i.e. /dev/video0
is this porting issue? had you enable this AR0821 with previous release version before?

Hi Jerry,

We are using Jetpack4.6.1. This is the first Jetpack that supports Jetson Xavier NX 16GB, so we can’t use previous Jetpack version for Jetson Xavier NX 16GB.

Yes, we have /dev/video0 as video node.

hello judy.wang,

could you please check V4L2 Sensor Driver Development Tutorial and please also review your sensor driver.
thanks

Hi Jerry,

Thank you for the tutorial. I have reviewed it and also reviewed our sensor driver. It looks fine, so that’s why I am wondering if there is any place that I can add more debug messages to debug the error I am seeing as mentioned in this post.

I have verified the port binding as below.

hello judy.wang,

are you able to toggle the ioctl to read the sensor modes? $ v4l2-ctl -d /dev/video0 --list-formats-ext.
please share your pipeline to access the stream, please do remember to assign exactly same width, height, pixel formats into the pipeline to avoid unknown failure.
for example, $ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10

Hi Jerry,

Output from v4l2-ctl -d /dev/video0 --list-formats-ext as below.

We are able to fix the previous error. However, we encounter new error while running, v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=BA12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10.

In dmesg, it shows

We enabled more trace logs, and it shows as below

It shows STREAM_NOVC multi-bit ECC error. Could you let us know how to debug this further? Thank you.

hello judy.wang,

the CRC/ECC checks enabled by default, please review your sensor driver configurations.
BTW, there’s see-also forum topic, Topic 196126, which disable CRC checking on JP-4.6 release.
thanks

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