This will work on the Zega Mame Gear, Mame Boy+ and Mame Boy Advance SP Kits
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.
Reboot once installation has completed
sudo reboot
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