Koala Sampler on postmarketOS
Published on 7/26/2026
This article walks through how to setup koala sampler on a msm8916 device like samsung a3 or xiaomi redmi 2.
The kernel that postmarketOS ships with v25.12 does not support usb midi signal handling, so we’ll need to re compile the kernel with the following modules enabled:
CONFIG_SND_SEQUENCER=y (Core ALSA sequencer infrastructure)
CONFIG_SND_SEQ_MIDI=y (ALSA MIDI support for the sequencer)
CONFIG_SND_RAWMIDI=y (Ensures raw byte streaming via USB-OTG is active) to edit kernel config, run these command:
pmbootstrap checksum linux-postmarketos-qcom-msm8916
pmbootstrap kconfig edit linux-postmarketos-qcom-msm8916 After the kernel source fetched, and you can change the configuration, you can search by pressing /.
Then you can compile the kernel with this command:
pmbootstrap build linux-postmarketos-qcom-msm8916 --force Then you can went with the regular flashing process, like flashing lk2nd, pmbootstrap install and pmbootstrap flasher flash_rootfs --partion=userdata, following guide on wiki( my markdown parser has bugs when parsing link with parentheses): https://wiki.postmarketos.org/wiki/Qualcomm_Snapdragon_410/412_(MSM8916)
With your device boot into postmarketOS, now let’s setup dependencies.
Step 1: Prepare the Host Environment (postmarketOS)
Open your main host phone terminal to install the underlying container infrastructure and allocate your user profile to the required hardware device nodes.
# Update repositories and install the container environment stack
sudo apk update
sudo apk add distrobox podman shadow-uidmap alsa-utils 1. Set Up User Namespace Maps (Crucial for Rootless Podman)
Alpine Linux requires explicit sub-user and sub-group ID boundaries defined so rootless containers can spin up isolation boundaries without running as system root:
sudo touch /etc/subuid /etc/subgid
sudo usermod --add-subuid 100000-165535 --add-subgid 100000-165535 $USER
then set correct permission for the newly created files
sudo chmod +s /usr/bin/newuidmap
sudo chmod +s /usr/bin/newgidmap 2. Grant Physical Hardware Access
Allow your user account to communicate directly with the audio layers and your phone’s Snapdragon 410 GPU:
sudo addgroup $USER video
sudo addgroup $USER render
sudo addgroup $USER audio
and reboot
Step 2: Spin Up and Provision the Container
Once the phone boots back up, open a terminal to create your lightweight Debian environment box.
# Instantiate the container image
distrobox create --name koala-box --image debian:stable
# Jump inside the container environment
distrobox enter koala-box
Inside the Container Terminal:
Install the essential graphics translation dependencies and synchronize user access profiles:
sudo apt update
sudo apt install libgl1-mesa-dri libgles2 libegl-mesa0 mesa-utils alsa-utils wget nano libjack0 -y
sudo usermod -aG video,render,audio $USER
Verify the Hardware Path
Run a check to confirm your container can interact natively with the Adreno graphics pipeline:
export DISPLAY=:0
glxinfo | grep "OpenGL renderer"
It should return your physical chip profile: OpenGL renderer string: FD307 (or similar Freedreno driver confirmation).
Step 3: Install Koala and Deploy the Launcher Script
Still inside the container terminal environment, fetch your software binary package and build the launch overrides.
# Pull down the sampler binary application and extract it
wget https://www.koalasampler.com/download/go.php?p=raspbian The downloaded file should be something like koala-raspbian-[version]-[commit-hash].zip, unzip it with unzip command, then rename the extracted folder to koala-linux.
cd koala-linux
# Create your execution layout wrapper
nano launch-koala.sh
Paste the required OpenGL ES profile translation arguments into the script file:
#!/bin/bash
# We must enter the bin folder
cd /home/[user name]/koala-linux/bin
# Re-map core engine profiling flags to align with legacy mobile drivers
MESA_GL_VERSION_OVERRIDE=3.2Core MESA_GLSL_VERSION_OVERRIDE=150 ./Koala
Save your edits and close the file (Ctrl+O, Enter, Ctrl+X), then unlock execution permissions:
chmod +x launch-koala.sh
Type exit to drop out of the container back to the safe postmarketOS host environment.
Step 4: Add a shortcut script entry
To protect your configuration entries from getting rewritten when package systems or kernels undergo system upgrades, we add a shortcut command to start koala sampler.
# Create a local automation bin
mkdir -p ~/scripts
nano ~/scripts/koala_launch.sh
Paste the direct Distrobox bypass script inside:
#!/bin/sh
# we need set the DISPLAY environment variable when running koala sampler from a ssh session.
export DISPLAY=:0
distrobox enter koala-box -- /home/[user name]/koala-linux/launch-koala.sh
(Double-check that /home/[user name]/koala-linux/ maps to the absolute destination folder path inside your container).
Save, exit, and modify the execution permissions:
chmod +x ~/scripts/koala_launch.sh
Then we can create a symlink to that script
mkdir -p ~/.local/bin
ln -s ~/scripts/koala_launch.sh ~/.local/bin Then we can just type koala, the app should appear, you can add your samples folder from thesamples button at the bottom and then tap ADD LOCATION.
Audio latency
If you use a midi controller via otg, you may find the latency was not tolerable, so my solution was to use a usb sound card, that will bypass the complicated onboard audio stack and have a managable latency.