I2S amp script will continuously prompt for reboot until dtoverlay is manually added
Script Command
sudo -E env PATH=$PATH python3 i2samp.py
Operating System
64-bit Raspberry Pi OS - Debian Bookworm - 2025-05-13 release - Full desktop
Hardware
Raspberry Pi 5
Behavior
I am following the instructions in the MAX98357 learn guide.
When running the script, I ran it a second time after rebooting to do the test but it kept going in a loop thinking it was installing it for the first time. I then followed the manual instructions and the dtoverlay step was not taking effect. I had to manually comment out dtparam=audio=on and add dtoverlay=max98357a
After rebooting and running the script again it did prompt me for a test, but I am getting this error:
We can now test your I2S Amplifier
Set your speakers at a low volume if possible!
Do you wish to test your system now? [y/n] y
Testing...
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
ALSA lib pcm_direct.c:1258:(snd1_pcm_direct_initialize_slave) requested or auto-format is not available
ALSA lib pcm_dmix.c:1011:(snd_pcm_dmix_open) unable to initialize slave
speaker-test 1.2.8
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Playback open error: -22,Invalid argument
All done!
Description
I'm following these steps to document the new E-Ink Bonnet, which has the MAX98357 onboard.
Additional information
I did see this issue, but I'm not sure if it's related.
i tested with a raspberry pi 4 running bookworm and had the same result
Ok, thanks. I can take a look.
i did a clean install and tried the script again. i do get that same error when doing an audio test in the terminal and unless i manually add the dtoverlay to the config the script will loop (continuously prompting to reboot) but i was able to set the audio output to the dtoverlay on the OS level after adding it (both the google and previous max98357) and was able to get sound out of the speaker.
Ok, cool. Maybe the script isn't adding it correctly then.