我们正在定制Android x86 Nougat(Android v7.1)项目的分支。由于我们的系统中没有视频显示硬件,我们正在尝试设置虚拟帧缓冲区(VFB),以便我们可以自定义方式处理视频显示(例如,通过VNC服务器等路由视频显示)。 p>
当系统启动时,SurfaceError尝试使用gralloc尝试分配内存时尝试初始化失败。以下是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)
以下是完整日志的链接:
初始化日志(dmesg): http://pastebin.com/sr1rAK43
logcat的: http://pastebin.com/SVYhvgu5
我们为了让事情顺利而做了什么:
在kernel / arch / x86 / configs / android-x86_defconfig中设置选项: 对于VFB模块模式,CONFIG_FB_VIRTUAL为M
在kernel / drivers / video / fbdev / vfb.c中更新的帧缓冲区大小高达64MB: #define VIDEOMEMSIZE(64 * 1024 * 1024)
在device / generic / common / init.sh中我启动VFB并禁用UVESA帧缓冲:
function do_init()
#init_hal_gralloc
modprobe vfb vfb_enable = 1
在“return 0”之前的文件末尾的同一个init.sh中:
/ system / bin / fbset 360 480 20
我想知道:
1)如何解决内存不足错误?
2)如何从内核命令行启用vfb?
3)在Android 7.x中让VFB在内核4.4上运行时我可能错过的任何配置/设置