What drivers to use with Adafruit I2S 3W Stereo Speaker Bonnet for Raspberry Pi

Hi Guys,
I wanted to use Zynthian as a sound module for my AKAI MPK88. I ways tired to turn on the GarageBand all the time and want to create some dedicated space for my piano. I bought a DAC from Adafruit that has 3W output to the speaker (Adafruit I2S 3W Stereo Speaker Bonnet for Raspberry Pi [Mini Kit] : ID 3346 : Adafruit Industries, Unique & fun DIY electronics and kits). It uses I2S 18,19,21. I dont know what audio kit should I choose from the ZYNTH UI. I tried a few. After restart, Zynthian keeps rebooting over and over. I have heard that the HIFIBerry DAC drivers ususally work for this HAT, but dont know which should I choose. What would the correct approach be like if I dont want to test all the 30+ options in ZYNTH UI.

Hi @culfytt
This gear is not (yet) supported by Zynthian, but should work without a lot of hassle.

In Zynthian-webconf, for audio hardware, choose custom and add in “Soundcard Config” area:

dtoverlay=max98357a

save and reboot… Once rebooted (with for sure an error message), use ssh or webconf built in terminal to check if driver is loaded:

lsmod | grep max98

then check if sound device is recognized by alsa

aplay -l

=> you will find maybe (depending on hardware, Pi3/4/5, and some others settngs): HDMI standard audio, RBPi headphone and (hopefully) your adafruit HAT with its paritcular alsa device name.

open webconf → hardware → audio again and add to your custom device, in jackd options:

-P 70 -t 2000 -s -d alsa -d hw:sndrpihifiberry -S -r 44100 -p 256 -n 2 -X raw

Just change sndrpihifiberry with alsa Adafruit Max98357a Hat name (see aplay -l output)

Save and reboot. If everything is ok, jackd and zynthin should run.

Maybe additionnal tweaking is needed (see asound.conf as explained in the link above)

Keep us informed and ask questions here in case you’re stuck.

2 Likes

Checking the thread just now, was deep in, going through the Adafruit`s docu, reading the i2samp.py script that worked (I mean sounds came out) to understand what does it actually do. And came to the same results as you describing, except I had an issue with jackd settings (hw:something) that was causing the UI to keep restarting over and over again. setting to hw:0 worked (I removed the rpi headphones thus making the MAX to be the first in the list.
aplay output is this: **** List of PLAYBACK Hardware Devices ****
card 0: MAX98357A [MAX98357A], device 0: bcm2835-i2s-HiFi HiFi-0 [bcm2835-i2s-HiFi HiFi-0]
Subdevices: 0/1
Subdevice #0: subdevice #0
Dont know what name to choose (hw:MAX98357A maybe?). Other than that it does work, but the output is not quite as loud as I was expecting. I have a 3W 4Ohm speakers and it is quiet. Alsamixer does not seem to change the output levels at all. Whats up with that?

yes. And it’s a good idea so there would’nt be any mess in hw:number if you plug an USB audio sound card for example.

look at asound.conf in adafruit doc. It looks like they declare some controls.

Or USB MIDI.