I have a Raspberry Pi Zero and I am using the Adafruit I2S MEMS Microphone together with the ADAFRUIT I2S 3W CLASS D AMPLIFIER BREAKOUT - MAX98357A.
I did follow the two respective tutorials and I got both the mic and the speaker working. However, I do need to disable the microphone or the amp + speaker won't work.
There seems to be a conflict regarding the I2S bus.
According to this forum post it can be done.
Update:
I have the following /etc/modules
:
i2c-dev
snd-bcm2835
my_loader
The /boot/config.txt
looks like so:
# ...
dtparam=i2s=on
# ...
dtparam=audio=on
dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap
This is what I see in dmesg
when I have both the mic and the amplifier enabled:
[ 13.039895] asoc-simple-card asoc-simple-card.0: snd-soc-dummy-dai <-> 20203000.i2s mapping ok
[ 13.660674] bcm2835-i2s 20203000.i2s: Trying to bind component to card "snd_rpi_hifiberry_dac" but is already bound to card "snd_rpi_simple_card"
[ 13.660700] snd-hifiberry-dac soc:sound: ASoC: failed to instantiate card -19
[13.661278] snd-hifiberry-dac soc:sound: snd_soc_register_card() failed: -19
Contradictings instructions
The two adafruit tutorials for the mic and the amp are conflicting. The mic tutorial tells me to enable the snd-bcm2835 module:
Add
snd-bcm2835
on its own line, to the modules file as shown below
While the amp tutorial tells me to disable the module:
However, if you see the following line:
snd_bcm2835
Put a
#
in front of it
Please note the different typing using both a dash and an underscore snd_bcm2835
vs. snd-bcm2835
.