imx6dq Android Pie - camera capture running out of CMA/gpu memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6dq Android Pie - camera capture running out of CMA/gpu memory

653 Views
keerthi-karanth
Contributor II

Hello

We have Android 9 ,Pie. running on a iMX6dq dual/quad core custom boards.

On stress testing of Android Image capture in Camera2 app (OV5640 sensor,5MP captures) via intent 

adb shell "am start -a android.media.action.IMAGE_CAPTURE"

the device runs out of cma memory and throws error 

cma: cma_alloc: alloc failed, req-size: 1846 pages, ret: -12
mxc_allocate_frame_buf: failed.

We increased the memory in command line argument from 320MiB to 640MiB ,as following

BOARD_KERNEL_CMDLINE := console=ttymxc1,115200 init=/init vmalloc=128M androidboot.console=ttymxc1 consoleblank=0 androidboot.hardware=freescale cma=640M loop.max_part=7 galcore.contiguousSize=67108864 galcore.showArgs=1 gpumem=128M 

But this results in a crash in the kernel after multiple captures,

graphics fb0: MXCFB_WAIT_FOR_VSYNC: timeout 0
fee0: 0000029d f504a030 00000022 00000036 c379ff54 c379ff00 c04d6360 c04cf328
ff00: 00000075 00000030 c379ff1c c379ff18 f57dca10 f26d5110 ea917530 0000030b
ff20: c379ff10 c030b44c 00000000 5b06b3f3 c379ff5c c11a9f58 c11a96d4 9196e5d8
ff40: 00007530 c373a6c0 c379ff7c 5b06b3f3 c04cb870 00000000 c373a6c1 c373a6c0
ff60: 9196e5d8 00007530 00000022 00000036 c379ffa4 c379ff80 c02fe8ec c02fde90
ff80: 00007530 9196e638 00000190 00000036 c0108a24 c379e000 00000000 c379ffa8
ffa0: c0108820 c02fe87c 00007530 9196e638 00000022 00007530 9196e5d8 9196e5c4
ffc0: 00007530 9196e638 00000190 00000036 9196e638 9196e7ec 000000d4 00000001
ffe0: 00000000 9196e5b0 b03b1c35 b03e3f80 600f0010 00000022 00000000 00000000
[<c09c8a08>] (_CMAFSLMapUser) from [<c0997ea4>] (gckOS_LockPages+0x108/0x1b4)
[<c0997ea4>] (gckOS_LockPages) from [<c09b4ad0>] (gckVIDMEM_Lock+0x158/0x48c)
[<c09b4ad0>] (gckVIDMEM_Lock) from [<c09a317c>] (gckKERNEL_LockVideoMemory+0x90/0x1ac)
fg_read_current: Failed to read CURRENT
[<c09a317c>] (gckKERNEL_LockVideoMemory) from [<c09a75a8>] (gckKERNEL_Dispatch+0xa28/0x1734)
[<c09a75a8>] (gckKERNEL_Dispatch) from [<c09a830c>] (gckDEVICE_Dispatch+0x58/0x2bc)
[<c09a830c>] (gckDEVICE_Dispatch) from [<c099ec0c>] (drv_ioctl+0x14c/0x230)
graphics fb0: MXCFB_WAIT_FOR_VSYNC: timeout 0
[<c099ec0c>] (drv_ioctl) from [<c02fdf44>] (do_vfs_ioctl+0xc0/0x9ec)
[<c02fdf44>] (do_vfs_ioctl) from [<c02fe8ec>] (SyS_ioctl+0x7c/0x8c)
[<c02fe8ec>] (SyS_ioctl) from [<c0108820>] (ret_fast_syscall+0x0/0x54)
Code: e1a01601 e5933370 e3530000 0a000001 (e595000c)
imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_10 = 0x00000002
camera_callback
---[ end trace 91c14300375b71cc ]---
camera_callback
mxc_v4l_ioctl
Kernel panic - not syncing: Fatal exception
case VIDIOC_QBUF,index 1179648 length=1
CPU1: stopping
CPU: 1 PID: 362 Comm: MessageThread Tainted: G      D W  O    4.14.98-g7219293-dirty #17
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[<c0112894>] (unwind_backtrace) from [<c010dac8>] (show_stack+0x20/0x24)
[<c010dac8>] (show_stack) from [<c0dbbde0>] (dump_stack+0x88/0x9c)
[<c0dbbde0>] (dump_stack) from [<c01104f8>] (handle_IPI+0x204/0x410)
[<c01104f8>] (handle_IPI) from [<c01015fc>] (gic_handle_irq+0x9c/0xa0)
[<c01015fc>] (gic_handle_irq) from [<c0ddc58c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xc2e49be8 to 0xc2e49c30)
9be0:                   600f0093 34fa9000 00000000 200f0013 00000000 00000000
9c00: c165f188 00000000 c165db90 c165d190 c165f188 c2e49ca4 c2e49c38 c2e49c38
9c20: c01a5608 c01a5610 600f0013 ffffffff
[<c0ddc58c>] (__irq_svc) from [<c01a5610>] (console_unlock.part.5+0x3f8/0x5c0)
[<c01a5610>] (console_unlock.part.5) from [<c01a5804>] (console_unlock+0x2c/0x3c)
[<c01a5804>] (console_unlock) from [<c01a5918>] (vprintk_emit+0x104/0x1dc)
[<c01a5918>] (vprintk_emit) from [<c01a5bd4>] (vprintk_default+0x34/0x3c)
[<c01a5bd4>] (vprintk_default) from [<c01a71d0>] (vprintk_func+0x114/0x1c0)
[<c01a71d0>] (vprintk_func) from [<c01a698c>] (printk+0x40/0x5c)
[<c01a698c>] (printk) from [<c08d7bac>] (mxc_v4l_do_ioctl+0x9f4/0x26b4)
[<c08d7bac>] (mxc_v4l_do_ioctl) from [<c089bf44>] (video_usercopy+0x2a4/0x738)
[<c089bf44>] (video_usercopy) from [<c08d4dec>] (mxc_v4l_ioctl+0x48/0x50)
[<c08d4dec>] (mxc_v4l_ioctl) from [<c0897ca0>] (v4l2_ioctl+0x124/0x15c)
[<c0897ca0>] (v4l2_ioctl) from [<c02fdf44>] (do_vfs_ioctl+0xc0/0x9ec)
[<c02fdf44>] (do_vfs_ioctl) from [<c02fe8ec>] (SyS_ioctl+0x7c/0x8c)
[<c02fe8ec>] (SyS_ioctl) from [<c0108820>] (ret_fast_syscall+0x0/0x54)
Rebooting in 5 seconds..

 

Could anyone ( @Igor  @Yuri ) suggest a way to avoid this error of buffer allocation failure?

Any input is appreciated.

Regards

Keerthi

 

 

Labels (3)
0 Kudos
Reply
1 Reply

613 Views
jimmychan
NXP TechSupport
NXP TechSupport

Which version of BSP are you using?

How many memory on your board?

0 Kudos
Reply