0

I2S recording combined with I2S Playback
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

I2S recording combined with I2S Playback

by besi on Tue Nov 06, 2018 7:32 pm

I am cross-posting my thread here because after hours of searching and debugging I haven't found a solution to my problem https://raspberrypi.stackexchange.com/questions/90647/i2s-recording-combined-with-i2s-playback

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

https://www.adafruit.com/product/3421
https://www.adafruit.com/product/3006

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 https://www.raspberrypi.org/forums/viewtopic.php?t=183617#p1385657 it can be done.
This is my setup:
Image

I have the following `/etc/modules`:

Code: Select all | TOGGLE FULL SIZE
   
i2c-dev
snd-bcm2835
my_loader


The `/boot/config.txt` looks like so:

Code: Select all | TOGGLE FULL SIZE
# ...
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:

Code: Select all | TOGGLE FULL SIZE
[   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:
https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout

Add `snd-bcm2835` on its own line, to the modules file as shown below


While the amp tutorial tells me to disable the module:
https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp

However, if you see the following line:

Code: Select all | TOGGLE FULL SIZE
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`.

So my question, is it possible to combine the mic and the mono amp alongside each other. And if so how can this be configured.
Last edited by besi on Wed Nov 07, 2018 5:29 am, edited 1 time in total.

besi
 
Posts: 7
Joined: Mon Oct 29, 2018 6:06 am

Re: I2S recording combined with I2S Playback

by adafruit_support_mike on Wed Nov 07, 2018 1:25 am

It is possible for the mic and speaker amp to work together, but they have to be on different channels.. one left, one right.

Post a photo showing your actual hardware and connections and we'll take a look. Schematics only show how things are supposed to work, not how things really are. 800x600 images usually work best.

adafruit_support_mike
 
Posts: 59421
Joined: Thu Feb 11, 2010 2:51 pm

Re: I2S recording combined with I2S Playback

by besi on Wed Nov 07, 2018 5:28 am

Hello Mike, thanks for your quick response.

There was in fact an error in the schematics. I did also update the colours of the wires. And you can see that the white and purple are shared between both boards (See updated schematics above, which should now be accurate).

IMG_3421.jpeg
Pi Zero
IMG_3421.jpeg (229.71 KiB) Viewed 173 times

IMG_3419.jpeg
Mic
IMG_3419.jpeg (231.07 KiB) Viewed 173 times

IMG_3418.jpeg
Amp
IMG_3418.jpeg (215.57 KiB) Viewed 173 times


Can you also comment regarding the snd_bcm2835 module. Does this have to be enabled or disabled?
Could it be a problem that the two boards have different voltage levels but the same clock and data signals?

besi
 
Posts: 7
Joined: Mon Oct 29, 2018 6:06 am

Please be positive and constructive with your questions and comments.