Manually Installing I2S Digital Audio

 This will work on the Zega Mame Gear, Mame Boy+ and Mame Boy Advance SP Kits

Step 1.

Run the following from your Raspberry Pi with Internet connectivity

curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash

There is an extra helper systemd script that will play quiet audio when the I2S peripheral isn't in use. This removes popping when playback starts or stops. It uses a tiny amount of CPU time (on a Pi Zero, 5%, on a Pi 2 or 3 its negligible). You don't need this on RetroPie.

Step 2.

Reboot once installation has completed

sudo reboot

Step 3.

After rebooting, log back in and run the script again ... It will ask you if you want to test the speaker. Say yes and listen for audio to come through your speaker