This is a tutorial that I’ve come up with after tinkering with my RPi Zero 2 W and getting it to run something most people doubted it could do. These steps will also work with newer boards such as the RPi 4 and maybe older ones if some overclocking is done to them.
Video demonstration of the In The Groove 2 theme running at a butter smooth 75fps!
1. Download and flash DietPi for the RPi ⅔/4 (ARMv8/64 bits) to your microSD card of choice, minimum Class 10/U1 speeds but U3 is recommended to avoid random stutters.
2. On your first boot you’ll be asked to login with the default credentials and then configure your network connection, updates will be downloaded soon after. Next it’ll ask you to change credentials, those can be left as is since we will be making it automatically login on boot. It will also ask if you want to disable serial access to the RPi, feel free to disable it as we want to squeeze any bit of performance out of this board.
3. After this initial setup you’ll be dropped into dietpi-software
, an application where you can easily find, mark and install software that will be useful for us. You will want to go in Browse Software and mark X.Org and ALSA for installation, they are package numbers 5 and 6. After marking them you can select Install and they will be installed and pre-configured for your convenience, the distribution should ask you to restart as well.
4. After a restart, login again with the default credentials from earlier (typically as root
and dietpi
as the password) and open dietpi-config
. Here we will go through a few pages to change settings to our liking:
4.1. Enter Display Options and then Display Resolution. Select vc4-kms-v3d as that is our proper GPU driver with OpenGL acceleration supported. In this page you also want to enter GPU/RAM Memory Split and set it to 64 (Desktop).
4.2. Enter Audio Options and configure your sound card, this will highly depend on what method of output you are using. In my case I have an external USB sound card and it shows up at the bottom as hw:0,0
after disabling HDMI sound.
4.3. Enter AutoStart Options and select Automatic login under Desktops. Use root as the user to be logged in. This will automatically login and initialize X.org for us.
4.4. If your Raspberry Pi board is struggling to run the game later on, you might want to tinker with Performance Options. Keep in mind you will be overclocking your board, which will require additional cooling to keep it stable.
5. Afterwards feel free to safely shutdown the Raspberry Pi with shutdown -h now
as we will be now transferring files over to the microSD through your main computer. It is recommended to use Linux to access the filesystem that the Raspberry Pi utilizes as Windows does not natively support it and third party tools for it might cause data loss during the process.
6. After connecting your microSD card to your computer you’ll see two partitions show up - a 134 MB FAT32 boot partition and an ext4 partition with the remaining of the storage available from the microSD, all of our configuration will be done in the latter. You will also require access to the /root
folder which is the user that we will be using - root access from your system might also be required to enter and modify the contents of that folder.
7. Having access to the /root
folder in the ext4 partition, feel free to copy over your OutFox game folder. I recommend utilizing version 0.4.19 LTS ARMv8/64 bits as it has performed the best under my testing, Alpha V is getting up there but needs a few more bug fixes with rendering and sound as of now. The game files are structured on my end as it follows:
└── root
└── OutFox
├── Announcers
├── Appearance
├── BackgroundEffects
├── BackgroundTransitions
├── BGAnimations
├── Characters
├── Courses
├── Data
├── Docs
├── libavcodec.so.58
├── libavformat.so.58
├── libavutil.so.56
├── libswscale.so.5
├── OutFox (the executable)
├── Scripts
└── Songs
You will also want to pre-generate the game’s Save folder and Preferences.ini (available here) as the default settings are too much for the Raspberry Pi to handle and will crash on boot. It should look something like this:
└── root
└── .project-outfox
└── Save
└── Preferences.ini
I would recommend adding things such as themes and songs after we are able to initialize the game and confirm that it works as expected. A lengthy caching process on the first boot of the game can be too much for the board to handle and you might have trouble starting it.
8. To automatically start the game you will need to create an .xinitrc
file in /root
with the following contents:
exec /root/OutFox/OutFox
This will suffice to run the game as soon as an X display becomes available. Keep in mind that if the game is closed or crashes you’ll be dropped back to the terminal, running startx
will boot your game up again.
9. Due to how the VC4 graphics driver and X works, when entering graphical mode the Raspberry Pi will default to attempting to use the highest resolution available. This might result in an incompatible video mode for your screen and if you’re able to display the signal the game will have quite a bit of performance degradation due to fullscreen scaling. Because of this we need to force X to only use the resolution we are targetting, with this tutorial I am going for 640×480 as the Raspberry Pi board is able to perform full speed at 60fps but feel free to experiment with different resolutions.
You want to create a configuration file called xorg.conf
in /etc/X11
and add the following to it:
Section "Device"
Identifier "Configured Video Device"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Modes "640x480"
EndSubSection
EndSection
This will be enough to force X to only use that display mode if available, this resolution is typically available on all displays unless you have something smaller. If for some reason the resolution is not quite filling up the entire screen, the EDID of your display might be reporting another mode that the driver is preferring for some odd reason. In my situation I had to add video=HDMI-A-1:640x480M@60
to the beginning of cmdline.txt
located in that 134 MB FAT32 boot partition.
10. You are now done with the initial configuration from your desktop! Feel free to safely eject the microSD card, reinsert it in your Raspberry Pi and boot it again. You will notice that this time the distribution will automatically login, start up X and attempt to boot OutFox but fail due to lacking requirements for the game. You are able to install those requirements with the following command:
apt install libgl1 libjack0 libpulse0
After the installation is complete, feel free to either startx
or reboot the whole board. The game should now start up and you’ll be greeted with the default theme asking for your gamemode.
11. After checking out that the game is functional and running fine, feel free to transfer over your custom content to the game’s Save folder (.project-outfox) and configure it to your heart’s desire. DietPi has an SSH server enabled by default, the credentials should be the same as the defaults from earlier. If you’re not interested in using SSH I would recommend disabling/uninstalling Dropbear, which can be done from dietpi-software
, alongside disabling networking from dietpi-config
to avoid any extra unnecessary services running in the background which could introduce stutters to your experience.