First to clarify why i would use RockPi for games - i don’t have answer for this. But this guide also can be useful if you trying to convert Ubuntu Server to Ubuntu Desktop with HW acceleration. Also, don’t forget to “overclock” it via https://wiki.radxa.com/Rockpi4/CPU_overclocking
Step One is to get glamor (and mali detection) working. That can be done only by getting rockchip’s xserver and mali libraries (Don’t forget to install it after xserver to overwrite all possible links). There is three ways (all of them require at least some desktop prior installed, like xfce4):
1. Build it yourself
I will just provide command list (the reason why not default branch is because it the moment it can’t be builded because of missing patch 001 and error in code)
sudo su apt-get install nano nano /etc/apt/source.list
From there remove all #
(there is space after #
) to get sources package
safe and exit
apt-get build-dep xserver-common xorg-xserver-core xorg-xserver apt-get install libunwind-dev git cd ~ && mkdir xserver && cd xserver git clone -b rockchip-1.20.4-debian-exa-rga https://github.com/rockchip-linux/xserver cd xserver && ./autogen.sh --prefix=/usr --enable-aiglx --enable-composite --enable-record --enable-xv --enable-xvmc --enable-dga --enable-screensaver --enable-xdmcp --enable-xdm-auth-1 --enable-glx --enable-dri --enable-dri2 --enable-glamor --enable-dri3 --enable-libdrm --enable-present --enable-xinerama --enable-xf86vidmode --enable-xace --enable-xselinux --enable-xfree86-utils --enable-xwayland --enable-systemd-logind --with-systemd-daemon --enable-suid-wrapper --enable-dmx --enable-xvfb --enable-xnest --enable-kdrive --enable-xephyr --enable-xmir --with-sha1=libgcrypt --enable-xcsecurity --with-log-dir=/var/log && dpkg-buildpackage -us -uc && cd .. && dpkg --unpack --force-all *.deb
Then go to the folder with mali deb and do
dpkg --unpack --force-all libmali-rk-midgard-t86x-r14p0_1.7-1_arm64.deb apt-get install apt-mark hold xwayland xvfb xserver-xorg-dev xserver-xorg-legacy xserver-xephyr xserver-xorg-core xorg-server-source xserver-common xdmx xdmx-tools xnest xserver-common
2. Download it from rockchip's rk-root-fs
https://github.com/rockchip-linux/rk-rootfs-build/tree/master/packages/arm64/xserver
I guess just untar in the root, but since there is no package - any upgrade can overwrite it.
3. Download this debs
This ones I builded myself so i can say for sure that they should work
Download them, unzip archive, go to the folder where you unzipped it and do
dpkg --unpack --force-all *.deb apt-get install apt-mark hold xwayland xvfb xserver-xorg-dev xserver-xorg-legacy xserver-xephyr xserver-xorg-core xorg-server-source xserver-common xdmx xdmx-tools xnest xserver-common
Whatever method you used do
cat /var/log/Xorg.0.log | grep glamor
you should see
modeset(0): glamor initialized
Step Two
Now that we got working Xserver and HW we need gl4es to get OpenGL (because no one use OpenGL ES). There is two methods:
1. Build it yourself
git clone https://github.com/ptitSeb/gl4es cd gl4es; mkdir build; cd build; cmake .. -DODROID=1; make
then copy libGL.so.1 from lib to /opt (Just in case i also created link called libGL.so to libGL.so.1 in /opt)
Step three
Now get the game. Heroes 3 for ARM is called VCMI:
Follow this to install it
You will met this bug
vcmiclient: error while loading shared libraries: libvcmi.so: cannot open shared object file: No such file or directory
To fix it do
cp /usr/lib/aarch64-linux-gnu/vcmi/libvcmi.so /usr/lib/libvcmi.so
cp /usr/lib/aarch64-linux-gnu/vcmi/libminizip.so /usr/lib/libminizip.so
To start the game do
LD_LIBRARY_PATH=/opt vcmiclient
There is also Jedi Academy written in OpenGL which working pretty nice on RockPi (to turn on fullscreen you will need to restart Jedi Academy)
Just don’t forget that’s Base and base is not the same folder
Also, to increase stability of fps you may use
taskset -c 4-5
So command to start VCMI will look like
LD_LIBRARY_PATH=/opt taskset -c 4-5 vcmiclient