April 01, 2019
It's now possible to run Android applications in the same graphical environment as regular Wayland Linux applications with full 3D acceleration.
Running Android has some advantages compared to native Linux applications, for example with regard to the availability of applications and application developers.
For current non-Android systems, this work enables a path forward to running Android applications in the same graphical environment as traditional non-Android applications are run.
SPURV is our experimental containerized Android environment, and this is a quick overview of what it is.
It's aptly named after the first robotic fish since a common Android naming scheme is fish-themed names. Much like its spiritual ancestor Goldfish, the Android emulator.
This means that Anbox which is LXC based, is different from SPURV in terms of how hardware is accessed. The hardware access that Anbox provides in indirect, and through the Qemu Pipes functionality, which is something it adopted from the Android (goldfish) emulator.
Shashlik and Genimobile are Android on Linux integration layers both based on Qemu, which means even better security properties than Anbox and certainly SPURV, but at the cost of an even larger performance penalty.
SPURV is different from other Linux desktop integrations for Android since it offers direct hardware access to the Android application. This is a choice we made for performance reasons. But has drawbacks, especially when it comes to security.
Using direct hardware access does however grant us increased GPU and CPU performance, which is important since we're targeting embedded platforms which can have very limited resources.
SPURV consists of a few different parts, all living in the same project.
|An overview of the SPURV stack.|
This component integrates SPURV into Android, and it does so by using the
device infrastructure that the Android codebase provides.
Devices are normally used to customize an Android build to the specific needs of a given hardware platform, like a new smartphone SOC. In the case of SPURV, we're targeting being run inside of a
This component bridges the Android Audio Hardware Abtraction Layer (HAL) to the host PulseAudio stack.
Integrates Android windows into Wayland. It does so by implementing a HWC-to-Wayland bridge.
HWC is the Android API for implementing display & buffer management, and what it essentially does in interpret all of the different display buffers that Android applications produce, and organizes them into one cohesive Desktop.
This protocol is conceptually not unlike the Wayland protocol, which allows for the HWC to be translated into Wayland. This is essentially what the SPURV HWComposer does.
Additionally it deals with input, like touch screen events and passes them along from Wayland to Android, this however is unrelated to the HWC API.
The SPURV Android target device behaves as a faux Android device, and tailors the Android build to our requirements.
Functions SPURV performs:
Full build instructions as can be found on our GitLab for the SPURV project.
An overview of setting up:
The next few steps will be adding support for more hardware platforms in our build scripts, but also optimizing the experience.
In no particular order, this is what we would like to look at next:
The way SPURV is implemented means that a full OS is being run in a container, which has implications both positive and negative.
One of the positive effects is increased isolation of Android applications, which means improved security and privacy for potentially untrusted applications.
Additionally, this approach allows for Android applications to be run next to Wayland based applications in a desktop environment.
The downsides relate to hardware access and performance. All hardware access that is needed by Android has to be passed into the container. Besides manually having to configure such access using
systemd-nspawn, there are also performance costs associated with running a container. One part of this is the static cost of having to load an entire OS on top of the base OS, but there are also additional runtime performance penalties for applications in the container.
Visit Robert's blog.
Ongoing work on the reverse-engineered Panfrost OpenGL ES driver for Arm Mali GPUs has turned the RK3399 SoC into a very attractive platform…
As part of its unwavering commitment to open source and open standards, Collabora is proud to be part of bringing the recently-released…
There's been quite a few updates to Zink, an OpenGL implementation on top of Vulkan, since I last wrote about it. Here's an overview of…
A little over a month and a half ago, Collaborans including Aaron Boxer, George Kiagiadakis, Guillaume Desmottes, Stéphane Cerveau and myself…
In my last Panfrost blog post, I announced my internship goal: improve Panfrost to run GNOME3. GNOME is a popular Linux desktop making heavy…
Dummy_hcd which consists of a software-emulated host controller and a UDC chip. In other words, this means you can play with USB gadgets…