SurfaceFlinger / gralloc Out of Memory error when allocating buffer memory for use with the virtual frame buffer on Android x86 Nougat

We are setting up the plug for the Android x86 Nougat project (Android v7.1). Since there is no equipment for displaying video in our system, we are trying to configure the virtual frame buffer (VFB) so that we can process the video image in our own way (for example, route video output via a VNC server, etc.).

We, when the system boots, SurfaceError tries to initialize its failure while trying to allocate memory using gralloc. The following is a logcat snippet:

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 are links to full magazines:

Initialization Log (dmesg): http://pastebin.com/sr1rAK43

Logcat: http://pastebin.com/SVYhvgu5

What we did to run everything:

  • In kernel / arch / x86 / configs / android-x86_defconfig, set the parameter: CONFIG_FB_VIRTUAL for M for VFB module mode

  • In updating the kernel frame size /drivers/video/fbdev/vfb.c to 64 MB: #define VIDEOMEMSIZE (64 * 1024 * 1024)

  • In the device /generic/common/init.sh, I started VFB and disabled UVESA frame buffering:

do_init () function

#init_hal_gralloc

modprobe vfb vfb_enable = 1

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

/ system / bin / fbset 360 480 20

I'd like to know:

1) How can I solve the problem of running out of memory?

2) How to enable vfb from the kernel command line?

3) Any configurations / settings that I might have missed when VFB was running on the 4.4 kernel in Android 7.x

+5
source share

Source: https://habr.com/ru/post/1265020/


All Articles