I would like to include an I2S microphone (Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H), 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.
Is it possible to include both an I2S speaker and an I2S microphone on a Raspberry Pi?
Hi Bulgy, I did a bit of research and it seems like in theory it’s possible to use both at the same time however the setup is a bit convoluted and might require you adding extra components such as pullup resistors or shorting module pins. Just to be clear, it’s not possible to change the pins as there is only one I2S interface. The “solution” that’s proposed is “hacking” the interface to use one channel for input and the other for output. Results I’ve seen are mixed, presumably it depends on the microphone/speaker modules that you are using. This threads seem like a good start: Adafruit customer service forums • View topic - Two I2S channels for Raspberry Pi Zero and gpio - I2S Recording combined with I2S Playback - Raspberry Pi Stack Exchange
With regards to balenaOS, it shouldn’t be a problem or any different than setting this up on another OS.