Create virtual hardware, kernel, qemu for Android emulator to create OpenGL graphics

I am new to android and want to play with the emulator.

What I want to do is create my own virtual computer that can assemble OpenGL commands and create OpenGL graphics. I was told that for this I would need to write a Linux kernel driver in order to communicate with the hardware. In addition, I will need to write an Android user space library to invoke the kernel driver.

To begin with, I plan to make very simple hardware that only does, say, 1 or 2 commands.

Has anyone here done something like this? If so, do you have any tips or possible links to additional information? Any feedback would be appreciated.

+2
source share
2 answers

Writing hardware emulation is challenging and far from easy. Therefore, if you really want to do this, I would not start from scratch. In your case, I first start with a simpler one (because many of the libraries are already installed on the guest and host side): Implementing OpenGL transit for regular Linux through qemu. What do you need:

First you add a virtual GPU to qemu, which is also related to adding a new graphics output module that uses OpenGL (qemu still uses SDL). Then you create DRI / DRM drivers in the Linux kernel, which will run on the guest (Android uses its own graphics system, but for learning DRI / DRM in order), as well as in Mesa. On the host side, you should translate what comes from qemu in OpenGL calls. Since the host-side GPU does all the hard work, your DRI / DRM part will be minimal and just build a bridge.

+1
source

The emulator that comes with Android SDK 23 already runs OpenGL, you can try this with the official MoreTeapots example: https://github.com/googlesamples/android-ndk/tree/a5fdebebdb27ea29cb8a96e08e1ed8c796fa52db/MoreTeapots

I am sure that this is hardware acceleration, since all these polygons render at 60 FPS.

Studio has a hardware acceleration option in the graphic interface for creating AVD from Studio, which should control such parameters as:

 ==> config.ini <== hw.gpu.enabled=yes hw.gpu.mode=auto ==> hardware-qemu.ini <== hw.gpu.enabled = true hw.gpu.mode = host hw.gpu.blacklisted = no 

at ~/.android/avd/Nexus_One_API_24.a/ .

0
source

All Articles