Getting error, vi_capture_setup: control failed, errno 1 in JetPack4.6

I recently Migrated from Jetpack4.4 to Jetpack4.6. Currently all the modules like wifi, ethernet, ptp etc are all working except camera. We are controlling camera via STM and only mipi frames are taken in NX. I can see that in STM side, camera interrupts are coming. But here I am getting this error

[   61.153249] tegra194-vi5 15c10000.vi: vi_capture_setup: control failed, errno 1
[   61.153283] tegra194-vi5 15c10000.vi: vi_capture_setup: control failed, errno 1
[   61.153339] tegra194-vi5 15c10000.vi: vi capture setup failed
[   61.153932] tegra194-vi5 15c10000.vi: vi capture setup failed
[   61.160952] tegra194-vi5 15c10000.vi: vi_capture_setup: control failed, errno 1
[   61.161274] tegra194-vi5 15c10000.vi: vi capture setup failed

I further debugged it, I am getting this error in the xioctl(pHnd->fd, VIDIOC_STREAMON, &type) function call

VIDIOC_STREAMON errno=22, Invalid argument

Get the trace log to check.

https://elinux.org/Jetson/l4t/Camera_BringUp

This is the debug log I am getting


# tracer: nop
#
# entries-in-buffer/entries-written: 55/55   #P:6
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
            cam2-5530  [003] ....  5286.728544: tegra_channel_capture_setup: vnc_id 0 W 1472 H 1080 fmt c4
            cam0-5524  [005] ....  5286.748678: tegra_channel_capture_setup: vnc_id 0 W 1248 H 2048 fmt c4
            cam1-5527  [004] ....  5286.748743: tegra_channel_capture_setup: vnc_id 0 W 1248 H 2048 fmt c4
     kworker/0:0-12418 [000] ....  5286.796781: rtos_queue_peek_from_isr_failed: tstamp:165768357134 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5286.796789: rtcpu_start: tstamp:165768360201
     kworker/0:0-12418 [000] ....  5286.796791: rtos_queue_send_from_isr_failed: tstamp:165768495917 queue:0x0bcb2e38
     kworker/0:0-12418 [000] ....  5286.796792: rtos_queue_send_from_isr_failed: tstamp:165768496420 queue:0x0bcb76a0
     kworker/0:0-12418 [000] ....  5286.796793: rtos_queue_send_from_isr_failed: tstamp:165768496931 queue:0x0bcb9220
     kworker/0:0-12418 [000] ....  5286.796795: rtos_queue_send_from_isr_failed: tstamp:165768497430 queue:0x0bcb9fe0
     kworker/0:0-12418 [000] ....  5286.796796: rtos_queue_send_from_isr_failed: tstamp:165768497928 queue:0x0bcbada0
     kworker/0:0-12418 [000] ....  5286.913926: rtos_queue_peek_from_isr_failed: tstamp:165773357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5287.081701: rtos_queue_peek_from_isr_failed: tstamp:165778357497 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5287.245396: rtos_queue_peek_from_isr_failed: tstamp:165783357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5287.409620: rtos_queue_peek_from_isr_failed: tstamp:165788357499 queue:0x0bcbbbb8
          ingame-5511  [005] ....  5287.569132: tegra_channel_close: vi-output, imx219 11-0010
          ingame-5511  [005] ....  5287.575112: tegra_channel_set_power: imx219 11-0010 : 0x0
          ingame-5511  [005] ....  5287.575128: camera_common_s_power: status : 0x0
          ingame-5511  [005] ....  5287.575253: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x0
          ingame-5511  [005] ....  5287.575256: csi_s_power: enable : 0x0
          ingame-5511  [000] ....  5287.576158: tegra_channel_close: vi-output, imx219 10-0010
     kworker/0:0-12418 [000] ....  5287.581784: rtos_queue_peek_from_isr_failed: tstamp:165793357497 queue:0x0bcbbbb8
          ingame-5511  [000] ....  5287.582863: tegra_channel_set_power: imx219 10-0010 : 0x0
          ingame-5511  [000] ....  5287.582878: camera_common_s_power: status : 0x0
          ingame-5511  [000] ....  5287.582996: tegra_channel_set_power: 15a00000.nvcsi--2 : 0x0
          ingame-5511  [000] ....  5287.582999: csi_s_power: enable : 0x0
          ingame-5511  [000] ....  5287.583821: tegra_channel_close: vi-output, imx219 9-0010
          ingame-5511  [000] ....  5287.589424: tegra_channel_set_power: imx219 9-0010 : 0x0
          ingame-5511  [000] ....  5287.589438: camera_common_s_power: status : 0x0
          ingame-5511  [000] ....  5287.589584: tegra_channel_set_power: 15a00000.nvcsi--3 : 0x0
          ingame-5511  [000] ....  5287.589587: csi_s_power: enable : 0x0
     kworker/0:0-12418 [000] ....  5287.746111: rtos_queue_peek_from_isr_failed: tstamp:165798357505 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5287.922231: rtos_queue_peek_from_isr_failed: tstamp:165803357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5288.031657: rtos_queue_peek_from_isr_failed: tstamp:165808357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5288.207702: rtos_queue_peek_from_isr_failed: tstamp:165813357503 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5288.376317: rtos_queue_peek_from_isr_failed: tstamp:165818357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5288.548881: rtos_queue_peek_from_isr_failed: tstamp:165823357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5288.713649: rtos_queue_peek_from_isr_failed: tstamp:165828357501 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5288.878386: rtos_queue_peek_from_isr_failed: tstamp:165833357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5288.988166: rtos_queue_peek_from_isr_failed: tstamp:165838357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5289.160812: rtos_queue_peek_from_isr_failed: tstamp:165843357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5289.329760: rtos_queue_peek_from_isr_failed: tstamp:165848357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5289.494929: rtos_queue_peek_from_isr_failed: tstamp:165853357500 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5289.660076: rtos_queue_peek_from_isr_failed: tstamp:165858357500 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5289.829145: rtos_queue_peek_from_isr_failed: tstamp:165863357500 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5290.002104: rtos_queue_peek_from_isr_failed: tstamp:165868357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5290.116101: rtos_queue_peek_from_isr_failed: tstamp:165873357497 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5290.285439: rtos_queue_peek_from_isr_failed: tstamp:165878357500 queue:0x0bcbbbb8
     kworker/0:2-11902 [000] ....  5290.454885: rtos_queue_peek_from_isr_failed: tstamp:165883357500 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5290.632152: rtos_queue_peek_from_isr_failed: tstamp:165888357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5290.797613: rtos_queue_peek_from_isr_failed: tstamp:165893357497 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5290.911856: rtos_queue_peek_from_isr_failed: tstamp:165898357499 queue:0x0bcbbbb8
     kworker/0:2-11902 [000] ....  5291.081376: rtos_queue_peek_from_isr_failed: tstamp:165903357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5291.250817: rtos_queue_peek_from_isr_failed: tstamp:165908357499 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5291.416589: rtos_queue_peek_from_isr_failed: tstamp:165913357685 queue:0x0bcbbbb8
     kworker/0:0-12418 [000] ....  5291.582485: rtos_queue_peek_from_isr_failed: tstamp:165918357499 queue:0x0bcbbbb8

The trace log shows NVCSI/VI didn’t receive any validate data.

I agree, But it was working on Jetpack4.4 and I see interrupts form FPGA are coming. Also, I am observing that If i use the old rootfs, I am not seeing any issue. I guess there are some libraries changed that is causing this issue.

Do you check the old kernel Image and driver on J4.6 rootfs?

I tried it. J4.6 rootfs with old kernel not working.

Update:
Old rootfs with new kernel and new dtb file is working.

Did you capture by v4l2-ctl? And old rootfs with new kernel and driver without problem?

I have not tried v4l2-ctl. But I am using v4l2 in our custom application. With the old rootfs with new kernel, I am able to get the frames from v4l2 and stream to remote device via gstreamer.

Please check with v4l2-ctl to confirm it.

Hi, I have not checked v4l2-ctl again. But I observed something weird. From my understanding J4.6 contains changes in kernel, cboot, rootfs, and bsp. I told previously that with new kernel and old rootfs it was working. I tried with new kernel, new cboot, new rootfs and old bsp. I am able to get frames, stream images, all modules are coming up and working.

Contents of bsp are


Few are my custom files and many are from Nvidia. I am not sure what are these used for and where it is used. I did not find anywhere these files are used but not sure how it is affecting the camera.

If you could provide some insight then it will be helpful.

I guess it could be the capture tools in old BSP cause the problem that’s why I suggest using v4l2-ctl to check on new kernel new BSP.
How do you verify the new kernel Image in old BSP? replace the /boot/Image? Does your sensor driver are loadable kernel module or built in kernel Image?

Old BSP works fine. New BSP is not working. Sensor driver is a loadable kernel module

Please clarify how do you verify the kernel with old BSP. Also check with v4l2-ctl with J4.6

Hi, I tried v4l2-ctl with J4.6, I am getting this error

root@INGAME_48b02d15c2b5:~# v4l2-ctl --set-fmt-video=width=1472,height=1080 --stream-mmap --stream-count=4 -d /dev/video0
VIDIOC_STREAMON: failed: Invalid argument

Could you check this command.

v4l2-ctl --stream-mmap -c bypass_mode=0

Still the error is same

rapsodo@INGAME_48b02d15c2b5:~$ v4l2-ctl --stream-mmap -c bypass_mode=0
[ 6611.675004] tegra194-vi5 15c10000.vi: vi_capture_setup: control failed, errno 1
[ 6611.675263] tegra194-vi5 15c10000.vi: vi capture setup failed
VIDIOC_STREAMON: failed: Invalid argument

Could you check the trace log if any clue for it.

This is the trace log, it shows the same error.

# tracer: nop
#
# entries-in-buffer/entries-written: 28/28   #P:6
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
        v4l2-ctl-6549  [004] ....   475.813650: tegra_channel_open: vi-output, imx219 9-0010
        v4l2-ctl-6549  [000] ....   475.815471: tegra_channel_set_power: imx219 9-0010 : 0x1
        v4l2-ctl-6549  [000] ....   475.815487: camera_common_s_power: status : 0x1
        v4l2-ctl-6549  [000] ....   475.838786: tegra_channel_set_power: 15a00000.nvcsi--3 : 0x1
        v4l2-ctl-6549  [000] ....   475.838805: csi_s_power: enable : 0x1
        v4l2-ctl-6549  [000] ....   475.854497: tegra_channel_capture_setup: vnc_id 0 W 1472 H 1080 fmt c4
        v4l2-ctl-6549  [005] ....   475.861552: tegra_channel_close: vi-output, imx219 9-0010
        v4l2-ctl-6549  [005] ....   475.863299: tegra_channel_set_power: imx219 9-0010 : 0x0
        v4l2-ctl-6549  [005] ....   475.863339: camera_common_s_power: status : 0x0
        v4l2-ctl-6549  [005] ....   475.863808: tegra_channel_set_power: 15a00000.nvcsi--3 : 0x0
        v4l2-ctl-6549  [005] ....   475.863817: csi_s_power: enable : 0x0
     kworker/0:2-1151  [000] ....   475.893027: rtos_queue_peek_from_isr_failed: tstamp:15426973223 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   475.893048: rtcpu_start: tstamp:15426975647
     kworker/0:2-1151  [000] ....   475.893054: rtos_queue_send_from_isr_failed: tstamp:15426995536 queue:0x0bcb2e38
     kworker/0:2-1151  [000] ....   475.893057: rtos_queue_send_from_isr_failed: tstamp:15426995686 queue:0x0bcb76a0
     kworker/0:2-1151  [000] ....   475.893058: rtos_queue_send_from_isr_failed: tstamp:15426995835 queue:0x0bcb9220
     kworker/0:2-1151  [000] ....   475.893059: rtos_queue_send_from_isr_failed: tstamp:15426995982 queue:0x0bcb9fe0
     kworker/0:2-1151  [000] ....   475.893060: rtos_queue_send_from_isr_failed: tstamp:15426996127 queue:0x0bcbada0
     kworker/0:2-1151  [000] ....   476.061435: rtos_queue_peek_from_isr_failed: tstamp:15431973761 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   476.229951: rtos_queue_peek_from_isr_failed: tstamp:15436973758 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   476.342278: rtos_queue_peek_from_isr_failed: tstamp:15441973758 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   476.510756: rtos_queue_peek_from_isr_failed: tstamp:15446973757 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   476.679293: rtos_queue_peek_from_isr_failed: tstamp:15451973757 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   476.847859: rtos_queue_peek_from_isr_failed: tstamp:15456973579 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   477.016151: rtos_queue_peek_from_isr_failed: tstamp:15461973753 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   477.184603: rtos_queue_peek_from_isr_failed: tstamp:15466973758 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   477.353035: rtos_queue_peek_from_isr_failed: tstamp:15471973754 queue:0x0bcbbbb8
     kworker/0:2-1151  [000] ....   477.465457: rtos_queue_peek_from_isr_failed: tstamp:15476973753 queue:0x0bcbbbb8

Thanks to confirm. I don’t have idea for it now.
Does it normal sensor?