Jetson TK1 Repair + Running Minecraft

2016-02-08

I bought a non-working Jetson TK1 few months ago. It costed me ~$40, while it's much cheaper than a brand new one, but that's non-working, there is no gaurantee I could fix it. So let's see if it could be repaired.

Luckily it's possible to get the schematics from the official website. Turned out there were some components being damaged, possibly during transportation.

Then it would boot right into the OS.

Next get to the Minecraft. I was finding some low power device that could log into the MC to keep the chunks ticking, and the TK1 could be a good fit if it works. (I am talking about MC 1.7.10 + mods)

Minecraft was written in Java, so it needs to run within the Java VM. Java VM supports ARM, so Minecraft should work on ARM SBCs as well right? Not really. Most ARM SBCs don't have OpenGL acceleration (only OpenGL ES), so that won't work. TK1 has the Kepler GPU, with OpenGL support, so that should be possible to run Minecraft. What happens if I just launch MC?

The result is failure. It would exit after few seconds. It turns out, MC uses some pre-compiled dynamic libraries. It's mostly likely the compiled code are in x86 or x86_64 code. Luckily they are open-source libraries, and I could compile the ARM version.

Another note, when it comes to JRE, there are 2 choices: OpenJDK JRE and Oracle JRE. On x86_64 PC that doesn't seem to be a big issue. However on TK1, Oracle JRE could provide much better performance. To install:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Now on to compile the static libraries. First is the lwjgl:

sudo apt-get install git ant libxcursor-dev libxxf86vm-dev libxrandr-dev libxt-dev
git clone https://github.com/LWJGL/lwjgl.git

In the platform_build/linux_ant/build.xml, change i386 to arm in the libs32 line. Then compile:

cd lwjgl
ant

OpenAL also needs manual compiling:

sudo apt-get install cmake
wget http://kcat.strangesoft.net/openal-releases/openal-soft-1.15.1.tar.bz2
tar -xvjf openal-soft-1.15.1.tar.bz2
cd openal-soft-1.15.1/build/
cmake ..
make

Now replace the files in the mc with the one just compiled. Copy liblwjgl.so and libjinput-linux.so from lwjgl/libs/linux to .minecraft/versions/1.8/1.8-natives, replacing the files. Copy libopenal.so.1.15.1 from openal-soft-1.15.1/build to the same folder, rename as libopenal.so. Remember to set the priviledge of these files to read-only and the natives folder to be access-only, otherwise they would be automatically replaced.

As a result, 1.8 vanilla should run pretty smoothly. To run 1.7.10 + forge + some mods, allocate RAM to at least 1GB, install lxde (or something lighter) instead of Unity+Gnome. It should also run quite well.