Raspberry Pi Setup
Cooling Fan
Peel the protective backing off of the cooling plate then press it into place on the Raspberry Pi. Then, plug in the fan connector as shown.
Riser
Place the 40x2 header pin riser onto the Raspberry Pi header. This will give the Stereo Bonnet clearance.
Optional Standoffs
To keep the Speaker Bonnet from wiggling around you can optionally add a couple of nylon M2.5 standoffs and screws to hold it steady.
Install OS on SD Card
There are lots of ways to Retro game on Raspberry Pi -- for this we'll use Batocera Linux, but there are other popular gaming distros that will work, such as RetroPie, Recalbox, and Lakka to name a few.
To follow the same methods as this guide, head to the Batocera install page and follow those instructions for downloading, prepping your SD card (32GB or 64GB are a good size to include a nice collection of games as well as the OS), and getting up and running.
You can set up a temporary keyboard, mouse, and monitor or SSH into the Pi to adjust settings.
Pi Settings
The Adafruit Stereo Bonnet uses two MAX98357A I2S amplifier chips (one per channel). The Linux kernel includes the max98357a device tree overlay, and Batocera's kernel image includes the max98357a.dtbo file, so no driver compilation is needed.
Step 1: SSH
From a terminal, ssh into the Raspberry Pi:
Default password is linux. If the hostname doesn't resolve, use the Pi's IP address.
Step 2: Remount /boot as Writeable
By default /boot is read-only. Remount it writable for this session:
mount -o remount,rw /boot
Verify it worked:
echo $?
Should return 0. Note: /boot returns to read-only after each reboot, but file edits written to the vfat partition persist permanently.
Step 3: Confirm Overlay
ls /boot/overlays/ | grep max
You should see max98357a.dtbo in the output.
Step 4: Add the Device Tree Overlay to config.txt
echo "" >> /boot/config.txtecho "# Adafruit Stereo Bonnet" >> /boot/config.txtecho "dtparam=i2s=on" >> /boot/config.txtecho "dtoverlay=max98357a" >> /boot/config.txt
Verify the lines were appended correctly:
tail -5 /boot/config.txt
You should see:
Adafruit Stereo Bonnetdtparam=i2s=ondtoverlay=max98357a
Step 5: Set the Audio Device in batocera.conf
echo "audio.device=hw:MAX98357A" >> /userdata/system/batocera.conf
Step 6: Reboot the Pi
reboot
Step 7: Verify the Card is Detected
After the Pi restarts, ssh back in and run:
aplay -l
You should see output like:
card 0: MAX98357A [MAX98357A], device 0: 1f000a0000.i2s-HiFi HiFi-0 [...]
HDMI audio cards (vc4hdmi0, vc4hdmi1) will also appear — that's normal.
Step 8: Test Audio Output
Plug in your speakers, then play white noise to confirm the speakers are working:
aplay -D hw:MAX98357A -r 44100 -f S16_LE -c 2 /dev/urandom
You should hear static from both speakers. Press ctrl+c to stop.
Step 9: Set Audio Output in Batocera UI
(We'll do this step later when the full machine is built, but I put it here just for completeness or in case you have temporary controls and monitor hooked up)
- In EmulationStation press the START button to open the main menu
- Go to System Settings > Audio Output > Built-In Audio Stereo
- Got to System Settings > Audio Profile > MAX98357A Stereo Output
This ensures EmulationStation and all emulators route audio to the Stereo Speaker Bonnet.
Troubleshooting Audio
aplay -l doesn't show MAX98357A after reboot
- Confirm the overlay lines are at the bottom of
/boot/config.txtwithtail -5/boot/config.txt - Confirm max98357a.dtbo exists in /boot/overlays/
- Make sure the bonnet is fully seated on the GPIO header
No sound from speakers
- Confirm
audio.device=hw:MAX98357Ais in /userdata/system/batocera.conf - Check the EmulationStation audio settings and confirm MAX98357A is selected
- Check ALSA volume:
amixer -c MAX98357A— if Master is at 0, set it withamixer -c MAX98357A sset Master 90%
/boot is read-only when trying to edit
- Run
mount -o remount,rw /bootbefore editing — this is required after every reboot
Additional Notes
- /boot remounts read-only after every reboot but file changes persist on the vfat partition
- batocera.conf and all files under /userdata survive Batocera system updates
- The MAX98357A has no hardware volume register — volume is controlled via ALSA software mixing
Mounting Plate
Add three M2.5 x 6mm threaded standoffs and screws from the underside of the mounting plate as shown.
Fasten to Lid
Fasten the mounting plate to the underside of the lid using the remaining two original short flanged sheet metal screws as shown here.
Pi Mount
Fasten the Raspberry Pi to the mounting plate with three M2.5 x 4mm nylon screws ash shown.
Insert the prepared MicroSD card.
Ethernet Pass-Through
Connect the short Ethernet cable to the panel mount adapter and the Raspberry Pi's Ethernet port.
USB C Power
Plug in the USB C power cable into the USB C power port on the Rasbperry Pi. Later it will be plugged into one of the two USB C panel mount adapters on the back panel of the case.
Controller USB Connection
Plug in a short USB C to USB A cable from the KB2040 to a USB A port on the Raspberry Pi.
Page last edited August 17, 2026
Text editor powered by tinymce.