I connected the Dual Mic and the Smol Speaker hats to a single Pi3 using the HAT Hacker HAT.
I can’t seem to get both the speaker and the microphone to be detected at the same time. The installation scripts overwrite the dtoverlay with adau7002-simple for the mic and hifiberry-dac for the speakers. Loading both (adau7002-simple,hifiberry-dac) results in just the mic being detected, and the other way around in just the speaker being detected (by arecord -l and/or aplay -l).
I’m far from being any kind of expert on i2s. It may be doable, you may have to make sure only one device is accessing i2s at a time. It’s above my skill level that’s for sure.
Looks like I can manually load and unload the dtoverlay without a reboot - but it still doesn’t mean that they ‘work’ together.
Can anyone on the support team confirm if that was just a bit of misleading marketing fluff on the product page, or if there is any way to use both via the hacker hat without unloading and loading the dtoverlay between each use of the mic and playback - which makes any sort of voice controlled playback impossible since you can’t listen for a wakeword to interrupt the playback without having the mic available.
I don’t want to spend too much time going down a dead end if I have to get start looking for some other hardware to get it working in the end.
It’s unfortunately a bit more complicated than we’ve made it sound- requiring a separate dtoverlay to setup the adau7002 for input and pcm5102a for output. Device-tree stuff is a bit of a dark art, and while I’m sure it can work I’ve not had much luck finding an overlay which uses “simple-audio-card” to glue two codecs together like this.
I have, however, had a go at writing my own which at least loads and shows some… reasonable?.. devices:
I’ve updated our marketing fluff to hopefully make it clearer that getting two I2S devices working nicely together in Raspberry Pi OS is currently a bit here be dragons - if you need to swap anything drop us an email at support@pimoroni.com with a link to this thread and we’ll get it sorted.
Just for anyone coming after me the steps that worked for me are:
(I think my start state was running both install scripts for the microphone hat and then the speaker hat)
Paste the code above into a file called adau7002-pcm5102a-io-overlay.dts
Run the compile command to make the .dtbo
Move the .dtbo file to /boot/overlays/
In /boot/config.text change the dtoverlay line to be “dtoverlay=adau7002-pcm5102a-io”
Check the speaker works with: speaker-test -c2 -twav -l2
Check the microphone hardware details with: arecord -L
– look for the device that has ‘Hardware device with all software conversions’, mine looked like:
plughw:CARD=adau7002,DEV=1
adau7002, bcm2835-i2s-adau7002-hifi adau7002-hifi-1
Hardware device with all software conversions
Test the mic using the CARD and DEV details shown by arecord:
arecord -D hw:adau7002,1 -c2 -r48000 -fS32_LE -twav -d5 -R10000 -Vstereo test.wav
then play with: aplay test.wav
If all went to plan you should be able to hear someone saying 'Work you &£*@&*@ piece of *$&*£ ’