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.
static const u32 ctrl_cid_list = {
TEGRA_CAMERA_CID_GAIN,
TEGRA_CAMERA_CID_EXPOSURE,
TEGRA_CAMERA_CID_EXPOSURE_SHORT,
TEGRA_CAMERA_CID_FRAME_RATE,
TEGRA_CAMERA_CID_HDR_EN,
TEGRA_CAMERA_CID_SENSOR_MODE_ID,
};
static struct tegracam_ctrl_ops ar0821_ctrl_ops = {
.numctrls = ARRAY_SIZE(ctrl_cid_list),
.ctrl_cid_list = ctrl_cid_list,
.set_gain = ar0821_set_gain,
.set_exposure = ar0821_set_exposure,
.set_exposure_short = ar0821_set_exposure,
.set_frame_rate = ar0821_set_frame_rate,
.set_group_hold = ar0821_set_group_hold,
};
All of the above functions have been implemented.
In tegraccam_ctrls.c.
static int tegracam_set_ctrls(struct tegracam_ctrl_handler *handler,
struct v4l2_ctrl *ctrl)
{
const struct tegracam_ctrl_ops *ops = handler->ctrl_ops;
struct tegracam_device *tc_dev = handler->tc_dev;
struct camera_common_data *s_data = tc_dev->s_data;
int err = 0;
u32 status = 0;
/* For controls that are independent of power state */
switch (ctrl->id) {
case TEGRA_CAMERA_CID_SENSOR_MODE_ID:
s_data->sensor_mode_id = (int) (*ctrl->p_new.p_s64);
return 0;
case TEGRA_CAMERA_CID_HDR_EN:
return 0;
}
if (v4l2_subdev_call(&s_data->subdev, video,
g_input_status, &status)) {
dev_err(s_data->dev, "power status query unsupported\n");
return -ENOTTY;
}
/* power state is turned off, do not program sensor now */
if (!status)
return 0;
/* For controls that require sensor to be on */
switch (ctrl->id) {
case TEGRA_CAMERA_CID_GAIN:
err = ops->set_gain(tc_dev, *ctrl->p_new.p_s64);
break;
case TEGRA_CAMERA_CID_FRAME_RATE:
err = ops->set_frame_rate(tc_dev, *ctrl->p_new.p_s64);
break;
case TEGRA_CAMERA_CID_EXPOSURE:
err = ops->set_exposure(tc_dev, *ctrl->p_new.p_s64);
break;
case TEGRA_CAMERA_CID_EXPOSURE_SHORT:
err = ops->set_exposure_short(tc_dev, *ctrl->p_new.p_s64);
break;
case TEGRA_CAMERA_CID_GROUP_HOLD:
err = ops->set_group_hold(tc_dev, ctrl->val);
break;
default:
pr_err("%s: unknown ctrl id.\n", __func__);
return -EINVAL;
}
return err;
}
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
entries-in-buffer/entries-written: 253544/253544 #P:4
_-----=> irqs-off
/ _----=> need-resched
| / _---=> hardirq/softirq
|| / _--=> preempt-depth
||| / delay
TASK-PID CPU# |||| TIMESTAMP FUNCTION
| | | |||| | |
kworker/2:3-1713 [002] .... 79.917961: rtos_queue_peek_from_isr_failed: tstamp:2896721670 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 80.085987: rtos_queue_peek_from_isr_failed: tstamp:2901721669 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 80.253955: rtos_queue_peek_from_isr_failed: tstamp:2906721675 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 80.421965: rtos_queue_peek_from_isr_failed: tstamp:2911721669 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 80.589960: rtos_queue_peek_from_isr_failed: tstamp:2916721667 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 80.757947: rtos_queue_peek_from_isr_failed: tstamp:2921721669 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 80.869947: rtos_queue_peek_from_isr_failed: tstamp:2926721669 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 81.037955: rtos_queue_peek_from_isr_failed: tstamp:2931721671 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 81.205990: rtos_queue_peek_from_isr_failed: tstamp:2936721671 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 81.261949: rtos_queue_peek_from_isr_failed: tstamp:2937726949 queue:0x0bcbb8b8
v4l2-ctl-6947 [002] .... 100.340605: tegra_channel_open: vi-output, ar0821 2-0010
v4l2-ctl-6947 [000] .... 100.343163: tegra_channel_set_power: ar0821 2-0010 : 0x1
v4l2-ctl-6947 [000] .... 100.343178: camera_common_s_power: status : 0x1
v4l2-ctl-6947 [000] .... 100.353655: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x1
v4l2-ctl-6947 [000] .... 100.353661: csi_s_power: enable : 0x1
v4l2-ctl-6947 [000] .... 100.361499: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt c4
v4l2-ctl-6947 [000] .... 100.368267: tegra_channel_set_stream: enable : 0x1
v4l2-ctl-6947 [000] .... 100.371595: tegra_channel_set_stream: 15a00000.nvcsi--1 : 0x1
v4l2-ctl-6947 [000] .... 100.371600: csi_s_stream: enable : 0x1
v4l2-ctl-6947 [000] .... 100.371607: tegra_channel_set_stream: ar0821 2-0010 : 0x1
kworker/2:3-1713 [002] .... 100.417947: rtos_queue_peek_from_isr_failed: tstamp:3536127947 queue:0x0bcbb8b8
kworker/2:3-1713 [002] .... 100.417952: rtcpu_start: tstamp:3536129804
kworker/2:3-1713 [002] .... 100.417955: rtos_queue_send_from_isr_failed: tstamp:3536145263 queue:0x0bcb2b38
kworker/2:3-1713 [002] .... 100.417956: rtos_queue_send_from_isr_failed: tstamp:3536145407 queue:0x0bcb73a0
kworker/2:3-1713 [002] .... 100.417957: rtos_queue_send_from_isr_failed: tstamp:3536145548 queue:0x0bcb8f20
kworker/2:3-1713 [002] .... 100.417959: rtos_queue_send_from_isr_failed: tstamp:3536145687 queue:0x0bcb9ce0
kworker/2:3-1713 [002] .... 100.417960: rtos_queue_send_from_isr_failed: tstamp:3536145826 queue:0x0bcbaaa0
kworker/2:3-1713 [002] .... 100.417962: rtcpu_string: tstamp:3536146241 id:0x04010000 str:"Configuring VI GoS.
"
kworker/2:3-1713 [002] … 100.417985: rtcpu_string: tstamp:3536146431 id:0x04010000 str:"VM GOS[#0 ] addr=0xc2100000
"
kworker/2:3-1713 [002] … 100.417998: rtcpu_string: tstamp:3536146676 id:0x04010000 str:"VM GOS[#1 ] addr=0xc2101000
"
kworker/2:3-1713 [002] … 100.418008: rtcpu_string: tstamp:3536146910 id:0x04010000 str:"VM GOS[#2 ] addr=0xc2102000
"
kworker/2:3-1713 [002] … 100.418017: rtcpu_string: tstamp:3536147135 id:0x04010000 str:"VM GOS[#3 ] addr=0xc2103000
"
kworker/2:3-1713 [002] … 100.418026: rtcpu_string: tstamp:3536147374 id:0x04010000 str:"VM GOS[#4 ] addr=0xc2104000
"
kworker/2:3-1713 [002] … 100.418035: rtcpu_string: tstamp:3536147596 id:0x04010000 str:"VM GOS[#5 ] addr=0xc2105000
"
kworker/2:3-1713 [002] … 100.418044: rtcpu_string: tstamp:3536156375 id:0x04010000 str:“vi5_hwinit: firmware CL2018101701 protocol vers”
kworker/2:3-1713 [002] … 100.418046: rtcpu_string: tstamp:3536156500 id:0x04010000 str:"on 2.2
"
kworker/2:3-1713 [002] … 100.418056: rtos_queue_send_from_isr_failed: tstamp:3536170849 queue:0x0bcb2b38
kworker/2:3-1713 [002] … 100.418058: rtos_queue_send_from_isr_failed: tstamp:3536171011 queue:0x0bcb73a0
kworker/2:3-1713 [002] … 100.418059: rtos_queue_send_from_isr_failed: tstamp:3536171159 queue:0x0bcb8f20
kworker/2:3-1713 [002] … 100.418060: rtos_queue_send_from_isr_failed: tstamp:3536171298 queue:0x0bcb9ce0
kworker/2:3-1713 [002] … 100.418061: rtos_queue_send_from_isr_failed: tstamp:3536171436 queue:0x0bcbaaa0
kworker/2:3-1713 [002] … 100.418063: rtcpu_string: tstamp:3536172331 id:0x04010000 str:"VI GOS[#0 ] set to VM GOS[4] base 0xc2104000
"
kworker/2:3-1713 [002] … 100.418072: rtos_queue_send_from_isr_failed: tstamp:3536278287 queue:0x0bcb2b38
kworker/2:3-1713 [002] … 100.418074: rtos_queue_send_from_isr_failed: tstamp:3536278428 queue:0x0bcb73a0
kworker/2:3-1713 [002] … 100.418075: rtos_queue_send_from_isr_failed: tstamp:3536278573 queue:0x0bcb8f20
kworker/2:3-1713 [002] … 100.418076: rtos_queue_send_from_isr_failed: tstamp:3536278713 queue:0x0bcb9ce0
kworker/2:3-1713 [002] … 100.418077: rtos_queue_send_from_isr_failed: tstamp:3536278852 queue:0x0bcbaaa0
kworker/2:3-1713 [002] … 100.418079: rtcpu_vinotify_event: tstamp:3536684009 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:1488403488 data:0x10000000
kworker/2:3-1713 [002] … 100.418081: rtcpu_vinotify_event: tstamp:3536684158 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:1488411712 data:0x31000001
kworker/2:3-1713 [002] … 100.418082: rtcpu_vinotify_event: tstamp:3536684311 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:1488413888 data:0x07020001
kworker/2:3-1713 [002] … 100.418083: rtcpu_vinotify_event: tstamp:3536684440 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:1488447232 data:0x10000000
kworker/2:3-1713 [002] … 100.418084: rtcpu_vinotify_event: tstamp:3536684590 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:1488455520 data:0x31000002
kworker/2:3-1713 [002] … 100.529949: rtos_queue_peek_from_isr_failed: tstamp:3541128296 queue:0x0bcbb8b8
kworker/2:3-1713 [002] … 100.697958: rtos_queue_peek_from_isr_failed: tstamp:3546128295 queue:0x0bcbb8b8
kworker/2:3-1713 [002] … 100.865970: rtos_queue_peek_from_isr_failed: tstamp:3551128297 queue:0x0bcbb8b8
kworker/2:3-1713 [002] … 100.865976: rtcpu_nvcsi_intr: tstamp:3551516833 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:8 status:0x00000002
kworker/2:3-1713 [002] … 100.865978: rtcpu_nvcsi_intr: tstamp:3551516833 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:12 status:0x0000000a
kworker/2:3-1713 [002] … 100.865980: rtcpu_nvcsi_intr: tstamp:3551516833 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:8 status:0x0000000a
kworker/2:3-1713 [002] … 100.865981: rtcpu_nvcsi_intr: tstamp:3551516833 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:12 status:0x0000000a
kworker/2:3-1713 [002] … 100.865982: rtcpu_nvcsi_intr: tstamp:3551517847 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:8 status:0x0000000a
kworker/2:3-1713 [002] … 100.865984: rtcpu_vinotify_error: tstamp:3551520749 tag:CSIMUX_STREAM channel:0x30 frame:0 vi_tstamp:3551516755 data:0x00000100
kworker/2:3-1713 [002] … 100.865986: rtcpu_vinotify_error: tstamp:3551521496 tag:CSIMUX_STREAM channel:0x20 frame:0 vi_tstamp:3551516783 data:0x00000100
kworker/2:3-1713 [002] … 100.865987: rtcpu_nvcsi_intr: tstamp:3551523623 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866020: rtcpu_nvcsi_intr: tstamp:3551523623 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866021: rtcpu_nvcsi_intr: tstamp:3551524254 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866022: rtcpu_nvcsi_intr: tstamp:3551524254 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866023: rtcpu_nvcsi_intr: tstamp:3551524879 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866024: rtcpu_nvcsi_intr: tstamp:3551524879 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866025: rtcpu_nvcsi_intr: tstamp:3551525495 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866026: rtcpu_nvcsi_intr: tstamp:3551525495 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866027: rtcpu_nvcsi_intr: tstamp:3551526110 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866028: rtcpu_nvcsi_intr: tstamp:3551526110 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866030: rtcpu_nvcsi_intr: tstamp:3551526728 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866031: rtcpu_nvcsi_intr: tstamp:3551526728 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866053: rtcpu_nvcsi_intr: tstamp:3551527345 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866054: rtcpu_nvcsi_intr: tstamp:3551527345 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866055: rtcpu_nvcsi_intr: tstamp:3551527960 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866056: rtcpu_nvcsi_intr: tstamp:3551527960 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
kworker/2:3-1713 [002] … 100.866057: rtcpu_nvcsi_intr: tstamp:3551528573 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:2 vc:0 status:0x00000001
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
system
Closed
July 27, 2022, 2:14am
13
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.