Base image for Raspberry Pi 3 B+, speaker bonnet, I2S microphone and camera

I am moving a Raspberry Pi project to BalenaOS. A Raspberry Pi connects to a camera, a screen, an Adafruit speaker bonnet (Adafruit I2S 3W Stereo Speaker Bonnet for Raspberry Pi [Mini Kit] : ID 3346 : $12.95 : Adafruit Industries, Unique & fun DIY electronics and kits). All this works on a Raspberry Pi 3 B+, and used to work on balenablocks/audio until it moved to Alpine Linux. So I am looking for another base image that supports this hardware.

If possible, I would also like to include an I2S microphone (Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H : ID 3421 : $6.95 : Adafruit Industries, Unique & fun DIY electronics and kits), which I did not include in the Raspberry Pi because it used the same pins as the speaker and I could not find in the code of either the microphone or the speaker how to change the pin numbers.

I would also like to remove the popping sound present at the beginning and end of playing an audio file, which this tutorial solves with

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.

I tried those instructions on the balenablocks/audio image and still had the popping sound.

Finally I would also like to control the volume of the speaker bonnet. The tutorial suggests rebooting twice, which I did, but alsamixer does not show a volume control when launching it from a shell on Balena Cloud.

I appreciate any suggestions of base images, projects, or hacks!

Hi @bulgy, sorry to hear about your troubles after the recent update to balenablocks/audio. Just to clarify, the whole setup did in fact work properly with previous versions of the audio block? If so, could you pin to a previous version?

Also, simply thinking out loud, instead of using the block, perhaps rolling your own container with the same functionality as the block - but using a balenalib/ubuntu or balenalib/debian base image would do the trick? Hope that helps get you started!

Thanks! Yes, I confirm that the setup did work with a previous version of the block, though now I can’t find which. Yes, pinning to a previous version or starting with balenalib/debian would give me again the ability to update the device. In either case, how could I include a microphone, remove the popping sound or control volume? Should I post each of these as its own topic?

Hi @bulgy, balenablocks/audio developer here :wave:

There is quite a lot to unpack here, I suggest we first tackle the issue of the audio block not working anymore for you. The move to alpine should obviously not break previous stuff so I’m interested in details. Can you expand on what you mean with it stopped working? Do you get any errors in the logs?

I can definitely build old versions of the audioblock for you to try (or you can even build them from GH repo) so we can also try and narrow down which version prompted this changes on your app, would that be useful?

Once we figure this out we can look at the rest, I think it would greatly change depending on wether or not you are using the audio block image.