GERBEN'S BLOG

Compile ScummVM for an Old Android Tablet

I don’t like getting rid of my old equipment if it still works. However, after a few years, software updates become increasingly scarce and sometimes even the available software becomes unavailable.

I have a specific case in mind : my old Android Acer Iconia A500 tablet.

Acer Iconia A500

It has served me (and the children for watching cartoons in the car 😊) many times, but is no longer maintained and it has become difficult to find software that runs on it. The time for a makeover has therefore arrived.

I initially thought about removing the screen to use it with a Raspberry Pi, but in the end, it still works, so why disassemble it?

This tablet has several advantages :

  • A large screen offering excellent readability
  • a USB On-The-Go (OTG) support that allows connecting peripherals such as keyboard, mouse, USB drive …
  • a Micro HDMI output for video output
  • a microSD card slot to expand storage capacity

A new life, why/how?

Among the things I would like to run on it, two applications are in sight:

  • ScummVM (in the current post)
  • Retroarch (in a future post)

However, several issues arise due to the obsolescence of the platform. Indeed :

  1. The tablet is stuck on Android’s Ice Cream Sandwich (ICS) version 4.0.3 firmware
  2. Applications using Android’s Native Development Kit (NDK) no longer support the processor of the tablet (Tegra 2) unless explicitly compiled for it.

For the first point, I followed an online tutorial to install Android 4.4.4 KitKat on the tablet (Note that there is always a risk of bricking the device during such operations).

Cortex-A9, Neon extensions and VFP

ARM CPU icon This processor is the 2nd generation of the SoC Tegra. It features a 32-bit ARM Cortex-A9 dual-core CPU that does not support SIMD NEON extensions. These extensions are precisely what cause problems, as all recents NDKs integrate these extensions into compiled binaries to propose full support for recent processors. Fortunately, there are solutions through the modification of compilation flags.

ScummVM

I was quite disappointed when I noticed that the latest versions of ScummVM crashed at launch, so I decided to recompile it myself.

Here are the different steps I applied.

Checkout

To get prepared for the Android build, I performed a checkout of the branch branch-2-2-1-android from the source code repository.

git clone https://github.com/scummvm/scummvm
cd scummvm
git checkout branch-2-2-1-android

I also downloaded precompiled dependencies used by the code: http://sourceforge.net/projects/scummvm/files/build/3rd-android-4.tar.bz2/download

Build configuration

By following the instructions on the website (https://wiki.scummvm.org/index.php/Compiling_ScummVM/Android), I configured the Android build with the command below, pointing to the downloaded dependencies as well:

./configure --host=android-arm-v7a --with-jpeg-prefix=/Users/gerben/src/AndroidLibs/jpeg8d-build --with-png-prefix=/Users/gerben/src/AndroidLibs/3rd-android-4-armeabi-v7a-release --with-tremor-prefix=/Users/gerben/src/AndroidLibs/3rd-android-4-armeabi-v7a-release --with-mad-prefix=/Users/gerben/src/AndroidLibs/3rd-android-4-armeabi-v7a-release

Note that the android-arm-v7a host corresponds to an Android ARM 32-bit build.

Considering the specificities of the CPU Cortex-A9

The subtlety of the configuration now occurs: The generated configuration file allows for producing an Android build containing floating-point instruction incompatible with the Cortex-A9 CPU.

These “Vector Floating Point” extensions of ARM CPUs are described here: https://en.wikipedia.org/wiki/ARM_architecture#Floating-point_(VFP)

In this case, to work with our CPU, we need to use the instructions referenced under the name VFPv3-D16.

To use them, you need to modify the generated file config.mk by modifying the line CXXFLAGS replacing:

-mfpu=vfp

with:

-mfpu=vfpv3-d16

We just have to run the compilation:

make

Wait a bit… install the obtained .apk file on the tablet and enjoy !!!

Secret of the Monkey Island on Acer Iconia A500

… Secret of the Monkey Island … So many good memories 🙂.