Hello Everyone,
I am working on bringing up a new camera by writing a custom camera driver. I know there may be some issues in my implementation, but I have encountered a strange problem: I am only able to “collect” data once, then it crashes and to make any other attempt i have to reboot.
The first attempt:
tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 16384
Any subsequent attempt results in the following error:
[ 240.994327] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 240.994349] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 240.995788] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
Is there any way to restart the VI “engine” or the camera “engine”? I’m not exactly sure what I should be looking for. It seems like the system only attempts to collect frames once before the error occurs (maybe something is crashing inside), but I might be missing something.
This issue makes debugging really frustrating because I have to reboot the system after every attempt.
Any suggestions or insights would be greatly appreciated!
DMESG, after the error occurs
[ 319.087524] pstate: 20400009 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 319.087526] pc : vb2_start_streaming+0xe4/0x160 [videobuf2_common]
[ 319.087532] lr : vb2_start_streaming+0x74/0x160 [videobuf2_common]
[ 319.087537] sp : ffff800010c43b00
[ 319.087538] x29: ffff800010c43b00 x28: ffff000104163600 x27: 0000000040045612
[ 319.087540] x26: ffffbcbcd17cb088 x25: 0000000000000000 x24: ffff800010c43cd8
[ 319.087543] x23: ffff00008ac2f1f8 x22: ffff800010c43cd8 x21: ffff00008ac2f858
[ 319.087545] x20: ffff00008ac2f870 x19: 00000000ffffffea x18: 0000000000000000
[ 319.087548] x17: 0000000000000000 x16: ffffbcbce532d580 x15: 0000ffff86fde7a0
[ 319.087550] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
[ 319.087552] x11: 0000000000000040 x10: ffffbcbce6505ff8 x9 : ffff434ac2ca8000
[ 319.087554] x8 : 000000000000014b x7 : 0000000000000500 x6 : 0000000000000400
[ 319.087557] x5 : ffff0007a8b66ea0 x4 : 0000000000000006 x3 : 0000000000000000
[ 319.087559] x2 : ffffbcbce4021bf8 x1 : ffff0000ec948f80 x0 : ffff0000ec4a71f0
[ 319.087562] Call trace:
[ 319.087564] vb2_start_streaming+0xe4/0x160 [videobuf2_common]
[ 319.087569] vb2_core_streamon+0xa4/0x1b0 [videobuf2_common]
[ 319.087574] vb2_ioctl_streamon+0x6c/0xc0 [videobuf2_v4l2]
[ 319.087579] v4l_streamon+0x44/0x60 [videodev]
[ 319.087596] __video_do_ioctl+0x190/0x400 [videodev]
[ 319.087608] video_usercopy+0x278/0x660 [videodev]
[ 319.087620] video_ioctl2+0x44/0x80 [videodev]
[ 319.087632] v4l2_ioctl+0x6c/0xa0 [videodev]
[ 319.087643] __arm64_sys_ioctl+0xb4/0x100
[ 319.087652] invoke_syscall+0x5c/0x130
[ 319.087658] el0_svc_common.constprop.0+0xf0/0x110
[ 319.087661] do_el0_svc+0x74/0xa0
[ 319.087664] el0_svc+0x28/0x80
[ 319.087670] el0t_64_sync_handler+0xa4/0x130
[ 319.087672] el0t_64_sync+0x1a4/0x1a8
[ 319.087675] ---[ end trace 18708124a5a8e581 ]---
At first traces i am getting
vi-output, mipi-6416 [001] ....... 190.973333: tegra_channel_capture_frame: sof:0.0
vi-output, mipi-6416 [001] ....... 190.973335: tegra_channel_capture_frame: eof:218.28587712
kworker/6:0-45 [006] ....... 191.017751: rtcpu_vinotify_event: tstamp:6813357993 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:218016998848 data:0x359d580010000000
kworker/6:0-45 [006] ....... 191.017754: rtcpu_vinotify_event: tstamp:6813358160 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:218017005248 data:0x0000000031000001
kworker/6:0-45 [006] ....... 191.017755: rtcpu_vinotify_event: tstamp:6813358317 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:218017008256 data:0x0000000007020001
kworker/6:0-45 [006] ....... 191.017756: rtcpu_vinotify_event: tstamp:6813358448 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:218017050528 data:0x359d550010000000
kworker/6:0-45 [006] ....... 191.017757: rtcpu_vinotify_event: tstamp:6813358602 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:218017057024 data:0x0000000031000002
kworker/6:0-45 [006] ....... 191.017758: rtcpu_vinotify_error: tstamp:6813429256 cch:-1 vi:0 tag:CSIMUX_FRAME channel:0x00 frame:1497 vi_tstamp:218028912160 data:0x0000000000000124
kworker/6:0-45 [006] ....... 191.017759: rtcpu_vinotify_event: tstamp:6813696030 cch:-1 vi:0 tag:FS channel:0x00 frame:1497 vi_tstamp:218028531936 data:0x000005d900000014
kworker/6:0-45 [006] ....... 191.017759: rtcpu_vinotify_event: tstamp:6813696189 cch:-1 vi:0 tag:ATOMP_FS channel:0x00 frame:1497 vi_tstamp:218028531968 data:0x0000000800000000
kworker/6:0-45 [006] ....... 191.017760: rtcpu_vinotify_event: tstamp:6813696324 cch:-1 vi:0 tag:CHANSEL_FAULT channel:0x23 frame:1497 vi_tstamp:218028582432 data:0x0000000000004004
kworker/6:0-45 [006] ....... 191.017761: rtcpu_vinotify_event: tstamp:6813696473 cch:-1 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:1497 vi_tstamp:218028587968 data:0x0000000001020001
kworker/6:0-45 [006] ....... 191.017761: rtcpu_vinotify_event: tstamp:6813696604 cch:-1 vi:0 tag:CHANSEL_FAULT channel:0x23 frame:1497 vi_tstamp:218028641696 data:0x0000000000004001
kworker/6:0-45 [006] ....... 191.017762: rtcpu_vinotify_event: tstamp:6813696753 cch:-1 vi:0 tag:CSIMUX_FRAME channel:0x00 frame:1497 vi_tstamp:218028912160 data:0x0000000000000124
kworker/6:0-45 [006] ....... 191.017762: rtcpu_vinotify_event: tstamp:6813696888 cch:-1 vi:0 tag:CHANSEL_SHORT_FRAME channel:0x10 frame:1497 vi_tstamp:218028912160 data:0x0005200001000000
kworker/6:0-45 [006] ....... 191.017763: rtcpu_vinotify_event: tstamp:6813697037 cch:-1 vi:0 tag:CHANSEL_SHORT_FRAME channel:0x10 frame:1497 vi_tstamp:218028912160 data:0x0001200000000000
kworker/6:0-45 [006] ....... 191.017764: rtcpu_vinotify_event: tstamp:6813697171 cch:-1 vi:0 tag:ATOMP_FE channel:0x00 frame:1497 vi_tstamp:218028912160 data:0x0000000800000000
After error occurs there is only:
kworker/0:3-184 [000] ....... 243.543562: rtcpu_string: tstamp:8454996087 id:0x04010000 str:"VM0 activating."
kworker/0:3-184 [000] ....... 243.543567: rtcpu_vinotify_event: tstamp:8455525005 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:270566326656 data:0x359d580010000000
kworker/0:3-184 [000] ....... 243.543568: rtcpu_vinotify_event: tstamp:8455525143 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:270566333056 data:0x0000000031000001
kworker/0:3-184 [000] ....... 243.543569: rtcpu_vinotify_event: tstamp:8455525298 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:270566336032 data:0x0000000007020001
kworker/0:3-184 [000] ....... 243.543569: rtcpu_vinotify_event: tstamp:8455525433 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:270566383168 data:0x359d550010000000
kworker/0:3-184 [000] ....... 243.543570: rtcpu_vinotify_event: tstamp:8455525586 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:270566389696 data:0x0000000031000002