Dear all,
Now I’m facing problem when terminate application converting frames from UYVY to YUV420 on 2 or 3 cameras. More details:
-
If I use only v4l2 to capture frame (memory buff type : V4L2_MEMORY_MMAP) and convert to RGB to display with OpenCV everything would work well even 2 or 3 cameras, there is no warning message on debug terminal.
-
If I use v4l2 to capture frame (memory buff type: V4L2_MEMORY_DMABUF) and feed to Video converter to convert to YUV420:
a. Run only one camera, it will show below warning when start
nvmap_alloc_handle: PID 1775: HX500: WARNING: All NvMap Allocations must have a tag to identify the subsystem allocating memory.Please pass the tag to the API call NvRmMemHanldeAllocAttr() or relevant.
and when stop
[ 78.792273] tegra-vi4 15700000.vi: Status: 5 channel:00 frame:0000
[ 78.798654] tegra-vi4 15700000.vi: timestamp sof 88469448320 eof 88469628512 data 0x00000001
[ 78.808015] tegra-vi4 15700000.vi: capture_id 210 stream 0 vchan 0
b. If run 2 or 3 cameras same time then OS easily would be hang/stuck once application has been terminated. I create each thread for each camera capturing and converting.
Hang/stuck log
[20701.927991] [VuNguyen] ov10635_power_off 1918
[20739.188519] [VuNguyen] ov10635_power_on 1881
[20739.223924] nvmap_alloc_handle: PID 4761: HX500: WARNING: All NvMap Allocations must have a tag to identify the subsystem allocating memory.Please pass the tag to the API call NvRmMemHanldeAllocAttr() or relevant.
[20739.244232] [VuNguyen] ov10635_power_on 1881
[20739.270743] [vunguyen] ov10635_s_stream [+] 1
[20739.275235] [vunguyen] ov10635_s_stream, i2c addr: 0x48
[20739.280183] [vunguyen] ov10635_s_stream [+] 1
[20739.280185] [vunguyen] ov10635_s_stream, i2c addr: 0x48
[20742.253805] tegra-vi4 15700000.vi: Status: 5 channel:00 frame:0000
[20742.253809] [vunguyen] ov10635_s_stream [+] 0
[20742.264527] tegra-vi4 15700000.vi: timestamp sof 20751904736992 eof 20751904870656 data 0x00000001
[20742.274322] tegra-vi4 15700000.vi: capture_id 1835 stream 0 vchan 0
[20742.281615] tegra-vi4 15700000.vi: Status: 5 channel:01 frame:0000
[20742.287922] tegra-vi4 15700000.vi: timestamp sof 20751896158208 eof 20751906639072 data 0x00000002
[20742.297707] tegra-vi4 15700000.vi: capture_id 3552 stream 2 vchan 0
[20742.304981] Unable to handle kernel paging request at virtual address ffffffbe429f0f40
[20742.304993] [vunguyen] ov10635_s_stream [+] 0
[20742.305823] [VuNguyen] ov10635_power_off 1918
[20742.306180] [VuNguyen] ov10635_power_off 1918
[20742.326057] pgd = ffffffc19efab000
[20742.329487] [ffffffbe429f0f40] *pgd=0000000000000000, *pud=0000000000000000
[20742.336519] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[20742.342084] Modules linked in:
[20742.345150] CPU: 5 PID: 3161 Comm: kworker/5:1 Not tainted 4.4.38 #135
[20742.351666] Hardware name: quill (DT)
[20742.355329] Workqueue: events tegra_channel_status_worker
[20742.360730] task: ffffffc1ec637080 ti: ffffffc1a2834000 task.ti: ffffffc1a2834000
[20742.368205] PC is at osq_lock+0x54/0x18c
[20742.372124] LR is at mutex_optimistic_spin+0x94/0x1c8
[20742.377166] pc : [<ffffffc0000ea578>] lr : [<ffffffc0000e9c28>] pstate: 60000045
[20742.384547] sp : ffffffc1a2837c00
[20742.387855] x29: ffffffc1a2837c00 x28: 0000000000000000
[20742.393183] x27: 0000000000000000 x26: ffffffc1aebcf038
[20742.398507] x25: ffffffc1ec637080 x24: 0000000000000000
[20742.403830] x23: 0000000000000000 x22: 0000000000000000
[20742.409154] x21: 0000000000000000 x20: 00000000c82f5f60
[20742.414477] x19: ffffffc1aebcf018 x18: ffffffc000bc7e38
[20742.419800] x17: ffffffc000b54a60 x16: ffffffc000b54a60
[20742.425123] x15: ffffffc000b54a60 x14: 0000000000000001
[20742.430446] x13: 00000026e42decd9 x12: 000000000000bb4a
[20742.435770] x11: 000000000000c36a x10: 0000000000000400
[20742.441093] x9 : 0000000000000000 x8 : ffffffc1f5daf570
[20742.446416] x7 : 0000000000000018 x6 : ffffffc001443510
[20742.451739] x5 : ffffffc001214000 x4 : 0000000000000000
[20742.457062] x3 : 00000000c82f5fbf x2 : ffffffc1f5dc1000
[20742.462386] x1 : ffffffc001241148 x0 : ffffffc1aebcf038
[20742.467708]
[20742.469196] Process kworker/5:1 (pid: 3161, stack limit = 0xffffffc1a2834020)
[20742.476318] Call trace:
[20742.478762] [<ffffffc0000ea578>] osq_lock+0x54/0x18c
[20742.483722] [<ffffffc000b46694>] __mutex_lock_interruptible_slowpath+0x3c/0x1d8
[20742.491020] [<ffffffc000b46878>] mutex_lock_interruptible+0x48/0x4c
[20742.497280] [<ffffffc00090a104>] vi_notify_channel_reset+0x38/0x88
[20742.503451] [<ffffffc0007a06a0>] tegra_channel_handle_error+0x5c/0xa0
[20742.509883] [<ffffffc0007a06f4>] tegra_channel_status_worker+0x10/0x18
[20742.516403] [<ffffffc0000bbca0>] process_one_work+0x150/0x448
[20742.522140] [<ffffffc0000bc0cc>] worker_thread+0x134/0x40c
[20742.527619] [<ffffffc0000c1968>] kthread+0xe0/0xf4
[20742.532403] [<ffffffc000084f90>] ret_from_fork+0x10/0x40
[20742.537707] ---[ end trace 2f108655eea162ba ]---
[20742.544975] note: kworker/5:1[3161] exited with preempt_count 1
[20742.550978] Unable to handle kernel paging request at virtual address ffffffffffffffd8
[20742.558882] pgd = ffffffc19efab000
[20742.562276] [ffffffffffffffd8] *pgd=0000000000000000, *pud=0000000000000000
[20742.569250] Internal error: Oops: 96000005 [#2] PREEMPT SMP
[20742.574811] Modules linked in:
[20742.577871] CPU: 5 PID: 3161 Comm: kworker/5:1 Tainted: G D 4.4.38 #135
[20742.585600] Hardware name: quill (DT)
[20742.589260] task: ffffffc1ec637080 ti: ffffffc1a2834000 task.ti: ffffffc1a2834000
[20742.596732] PC is at kthread_data+0x4/0xc
[20742.600734] LR is at wq_worker_sleeping+0x10/0xc4
[20742.605428] pc : [<ffffffc0000c2038>] lr : [<ffffffc0000bcb78>] pstate: 600000c5
[20742.612807] sp : ffffffc1a2837860
[20742.616113] x29: ffffffc1a2837860 x28: ffffffc1a2834000
[20742.621435] x27: 0000000000000000 x26: ffffffc001241000
[20742.626756] x25: 0000000000000005 x24: ffffffc000b458d0
[20742.632077] x23: 0000000000000000 x22: ffffffc1ec637610
[20742.637398] x21: ffffffc001213000 x20: ffffffc1ec637080
[20742.642719] x19: ffffffc1f5dc0500 x18: ffffffc000bc7e38
[20742.648041] x17: 000000000000000e x16: 0000000000000007
[20742.653364] x15: 0000000000000001 x14: 0000000000000007
[20742.658686] x13: 000000000000000e x12: 0000000000000013
[20742.664008] x11: 000000000000001a x10: 000000000023b282
[20742.669330] x9 : 000000000023b282 x8 : 0000000000000230
[20742.674651] x7 : 0000000000000000 x6 : 00000000018e0ec4
[20742.679974] x5 : ffffffc1f5dc0500 x4 : ffffffc1f5dc0ee0
[20742.685298] x3 : 000000000001af3b x2 : ffffffc1ecc03000
[20742.690620] x1 : 0000000000000005 x0 : 0000000000000000
[20742.695939]
[20742.697426] Process kworker/5:1 (pid: 3161, stack limit = 0xffffffc1a2834020)
[20742.704546] Call trace:
[20742.706988] [<ffffffc0000c2038>] kthread_data+0x4/0xc
[20742.712032] [<ffffffc000b454f8>] __schedule+0x348/0x6dc
[20742.717246] [<ffffffc000b458d0>] schedule+0x44/0xa8
[20742.722115] [<ffffffc0000a6c60>] do_exit+0x5b0/0x9a0
[20742.727073] [<ffffffc000089c08>] bug_handler.part.3+0x0/0x7c
[20742.732725] [<ffffffc00009c7c0>] __do_kernel_fault.part.7+0x74/0x84
[20742.738981] [<ffffffc00009ab10>] cpu_enable_pan+0x0/0x48
[20742.744282] [<ffffffc0000813a0>] do_mem_abort+0x40/0xa0
[20742.749496] [<ffffffc000084540>] el1_da+0x18/0x78
[20742.754191] [<ffffffc000b46694>] __mutex_lock_interruptible_slowpath+0x3c/0x1d8
[20742.761486] [<ffffffc000b46878>] mutex_lock_interruptible+0x48/0x4c
[20742.767743] [<ffffffc00090a104>] vi_notify_channel_reset+0x38/0x88
[20742.773913] [<ffffffc0007a06a0>] tegra_channel_handle_error+0x5c/0xa0
[20742.780342] [<ffffffc0007a06f4>] tegra_channel_status_worker+0x10/0x18
[20742.786859] [<ffffffc0000bbca0>] process_one_work+0x150/0x448
[20742.792594] [<ffffffc0000bc0cc>] worker_thread+0x134/0x40c
[20742.798070] [<ffffffc0000c1968>] kthread+0xe0/0xf4
[20742.802852] [<ffffffc000084f90>] ret_from_fork+0x10/0x40
[20742.808154] ---[ end trace 2f108655eea162bb ]---
[20742.814923] Fixing recursive fault but reboot is needed!
- I also tried to run samples 12_camera_v4l2_cuda when I terminated application by “ctrl +c” errors would flush on terminal as below
[ 2851.779072] [VuNguyen] ov10635_power_on 1881
[ 2851.865184] [vunguyen] ov10635_s_stream [+] 1
[ 2851.869550] [vunguyen] ov10635_s_stream, i2c addr: 0x48
[ 2854.740915] [vunguyen] ov10635_s_stream [+] 0
[ 2854.747412] [VuNguyen] ov10635_power_off 1918
[ 2854.765714] camera_v4l2_cud[4549]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006
[ 2854.775475] pgd = ffffffc1944bc000
[ 2854.778926] [00000000] *pgd=00000002144bb003, *pud=00000002144bb003, *pmd=0000000000000000
[ 2854.787476]
[ 2854.788982] CPU: 3 PID: 4549 Comm: camera_v4l2_cud Not tainted 4.4.38 #135
[ 2854.796037] Hardware name: quill (DT)
[ 2854.799745] task: ffffffc06c95be80 ti: ffffffc194498000 task.ti: ffffffc194498000
[ 2854.807339] PC is at 0x7f7a9b94e0
[ 2854.810678] LR is at 0x7f7a9b9490
[ 2854.814043] pc : [<0000007f7a9b94e0>] lr : [<0000007f7a9b9490>] pstate: 60000000
[ 2854.821563] sp : 0000007fd57dddf0
[ 2854.824898] x29: 0000007fd57dde40 x28: 0000007fd57de348
[ 2854.830361] x27: 00000000c0145608 x26: 0000000000000006
[ 2854.835792] x25: 000000007d000000 x24: 0000000000000004
[ 2854.841171] x23: 0000000000478540 x22: 0000000000000000
[ 2854.846597] x21: 0000000000000000 x20: 0000000000000000
[ 2854.852053] x19: 0000000000000000 x18: 0000000000000000
[ 2854.857439] x17: 0000007f7a988fb0 x16: 0000007f7926b7d8
[ 2854.862911] x15: 001b27029a80f646 x14: 0000000000000000
[ 2854.868302] x13: 00000001f4000000 x12: 0000000000000017
[ 2854.873731] x11: 00000000000de6ea x10: 000000005a5c56c0
[ 2854.879154] x9 : 00000000000af270 x8 : 00000000000af270
[ 2854.884531] x7 : 0000000000000000 x6 : 0000000000000001
[ 2854.890008] x5 : 0000000000000000 x4 : 0000000000478428
[ 2854.895427] x3 : 0000000000000000 x2 : 0000000000000000
[ 2854.900848] x1 : 0000000000000000 x0 : 0000000000478540
[ 2854.906235]
[ 2854.907763] Library at 0x7f7a9b94e0: 0x7f7a9b5000 /usr/lib/aarch64-linux-gnu/libv4l/plugins/libv4l2_nvvidconv.so
[ 2854.918014] Library at 0x7f7a9b9490: 0x7f7a9b5000 /usr/lib/aarch64-linux-gnu/libv4l/plugins/libv4l2_nvvidconv.so
[ 2854.928223] vdso base = 0x7f7a9f7000
I was wondering is there any differences between V4L2_MEMORY_MMAP and V4L2_MEMORY_DMABUF could cause that problem. Or because of the other reason.
Thanks
Vu Nguyen