A600 on Raspberry Pi

From Modding Fridays
Jump to: navigation, search

Here are a collection of config tips and hints to run fs-uae with full MIDI support on a Raspberry Pi 3B+. As far as I know, the instructions should be exactly the same for a Raspberry Pi 4.

Note: The purpose of this document is to have a reliable setup for using OctaMED SoundStudio 1.0.3c under AmigaOS 3.1.4.x, it has not been tested with any games/demos/etc.

Which OS for the Raspberry Pi?

At time of writing, and after trying several 32-bit and 64-bit Linux distros, the best performance and the most stable environment is Debian for arm64. It's out of the scope of this doc to go through the whole install. However, here are some quick things to take into account:

  • The images can be found at https://raspi.debian.net
  • The default user is root (without password)
  • Some useful things to get started (like this if you startx it will land in evilwm by default):
apt install xorg evilwm tmux git build-essential sudo alsa-utils mesa-utils ntpdate tzdata
  • Edit /etc/apt/sources.list and enable the backports repos
  • Update the apt index and install linux-image-5.x and upgrade raspi-firmware
  • VC4 acceleration works out of the box but the default memory allocation is not big enough: edit /boot/firmware/cmdline.txt so that cma=192M and add gpu_mem=16 in /boot/firmware/config.txt. Not sure if the later is used/useful when the open source VC4 implementation is available, but just in case, that will prevent the closed source implementation to steal memory from the RAM. Also, I think that when a new kernel is installed these config files are reset (TBC).

fs-uae config

Compiling fs-uae with MIDI support

The stable 3.x branch of fs-uae does not have MIDI support (more precisely it does via serial emulation but it's unable to send a stable/regular stream of data), but the master branch recently received patches to provide the feature via libportmidi. We're going to compile the 3.x branch with these patches.

  • dependencies:
sudo apt install automake libtool gettext zip libglib2.0-dev libmpeg2-4-dev libopenal-dev libsdl2-dev libsdl2-ttf-dev libportmidi-dev libpng-dev
  • fs-uae 3.x compilation with cherry-picked MIDI support
git clone https://github.com/FrodeSolheim/fs-uae.git
cd fs-uae
git checkout fs-uae-3.0
git cherry-pick 57fc25e0b050572c55bae148a0f833f5281f25b6
git cherry-pick 4d928c2e648d5714ef0df4bf535da8ba6a7bdd1a
git add src/pcem/pcemglue.cpp
git cherry-pick --continue
git cherry-pick 94d790f65feb9da599a5381e5b652d209b6fd4cb
CXXFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -ftree-vectorize -O2 -pipe -fomit-frame-pointer" ./configure --disable-jit
make -j2

General config

The easiest way to get started with a working RPi A600 fs-uae environment was to first configure an A600 fs-uae setup via the fs-uae-launcher (including generating the hard disks, using proper Kickstart ROMS, installing and configuring AmigaOS, installing needed software, etc). Once it's ready, merge all your config files into one A600.fs-uae, and you can launch fs-uae without the launcher like this:

cd /path/where/you/compiled/fs-uae
BASE=~/FS-UAE ./fs-uae ~/FS-UAE/Configurations/A600.fs-uae

The main advantage of launching it like this is that you can then call fs-uae from .xinitrc, after autologging etc, so as to directly boot into the emulation.

MIDI config

It's as simple as changing the fs-uae serial port to the ALSA MIDI port name you want to connect connect to (you will find then with aconnect -l). For instance:

serial_port = midi:HDSP MIDI 1

Fine tuning

There are a lot of config options to fine tune fs-uae. On the RPi 3+ the biggest immediate and easy to configure improvement was to drop accuracy (accuracy = -1). For the usage here (Octamed 1.03c + A600 emulation), I could not see any issue and it allowed to correctly playback quite heavy modules without any audio drops and slowdowns. Another potential point of performance improvement would be to tweak the rendering settings (see https://fs-uae.net/video-options). For more information about all the tunables see https://fs-uae.net/docs/options, I've only scratched the surface.