当前位置:首页 > 服务端 > SurfaceFlinger/gralloc Out of Memory error when allocating buffer memory for use with virtual frame

SurfaceFlinger/gralloc Out of Memory error when allocating buffer memory for use with virtual frame


http://howtoprogram.eu/question/n-a,57773


We're customizing a fork of the Android x86 Nougat (Android v7.1) project. Because there is no video display hardware in our system we're trying to setup the virtual frame buffer (VFB) so we can then handle the video display in a custom manner (e.g. route the video display through a VNC server etc).

We when the system boots up SurfaceError tries to initialize it fails when it attempts to allocate memory using gralloc. The following is an extract of logcat:

03-02 18:31:21.757   986   986 E gralloc : #### gralloc_alloc
03-02 18:31:21.757   986   986 E gralloc : #### gralloc_alloc_framebuffer
03-02 18:31:21.757   986   986 E gralloc : #### gralloc_alloc_framebuffer_locked
03-02 18:31:21.757   986   986 E Gralloc1On0Adapter: gralloc0 allocation failed: -12 (Out of memory)
03-02 18:31:21.757   986   986 E GraphicBufferAllocator: Failed to allocate (360 x 480) format 5 usage 6656: 5
03-02 18:31:21.757   986   986 V Gralloc1On0Adapter: Destroying descriptor 3
03-02 18:31:21.757   986   986 V Gralloc1On0Adapter: dump(0 (0xbfe341f4), 0x0
03-02 18:31:21.757   986   986 V Gralloc1On0Adapter: dump(0 (0xbfe341f4), 0x0
03-02 18:31:21.757   986   986 D GraphicBufferAllocator: Allocated buffers:
03-02 18:31:21.757   986   986 D GraphicBufferAllocator: 0xab5f60c0:  675.00 KiB |  360 ( 360) x  480 |        5 | 0x00001a00 | FramebufferSurface
03-02 18:31:21.757   986   986 D GraphicBufferAllocator: 0xab5f60f0:  675.00 KiB |  360 ( 360) x  480 |        5 | 0x00001a00 | FramebufferSurface
03-02 18:31:21.757   986   986 D GraphicBufferAllocator: Total allocated (estimate): 1350.00 KB
03-02 18:31:21.757   986   986 E         : GraphicBufferAlloc::createGraphicBuffer(w=360, h=480) failed (Out of memory), handle=0x0
03-02 18:31:21.757   986   986 E BufferQueueProducer: [FramebufferSurface] allocateBuffers: failed to allocate buffer (0 x 0, format 5, usage 0)

Here's links to the full logs:

Init log (dmesg):http://pastebin.com/sr1rAK43

Logcat:http://pastebin.com/SVYhvgu5

What we've done to get things running:

  1. In kernel/arch/x86/configs/android-x86_defconfig set the option:CONFIG_FB_VIRTUAL to M for VFB module mode 



  2. In kernel/drivers/video/fbdev/vfb.c updated frame buffer size up to 64MB:#define VIDEOMEMSIZE (64*1024*1024)



  3. In device/generic/common/init.sh I start VFB and disable UVESA frame buffer
ing:

function do_init()

#
init_hal_gralloc

modprobe vfb vfb_enable=1



And in the same init.sh at the file end before "return 0":

/system/bin/fbset 360 480 20


I'd like to know:

1) How I can resolve the out of memory error?


2) How you enable vfb from kernel command line?


3) Any configurations/setups I may have missed in getting VFB to work on kernel 4.4 in Android 7.x


Show source


作者:张同光
来源链接:https://www.cnblogs.com/ztguang/p/12644917.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/124630.html

标签: out of memory
分享给朋友:

“SurfaceFlinger/gralloc Out of Memory error when allocating buffer memory for use with virtual frame” 的相关文章