2

I have setup a pi-zero with digital mems mics from Adafruit, and also the digital DAC. I can use arecord to record stereo audio, and then aplay to playback the audio over the DAC. Interestingly, the DAC just worked out of the box after following the MEMS mic pi setup instructions.

My problem comes with full duplex operation. I wrote a C++ JUCE application to test some of the capabilities. If I initialise the inputs only, I can monitor the input device levels. If I initialise the outputs only, I can output synthesised audio. However, when I initialise both inputs an outputs, I cannot even hear synthesised audio playback (the device fails at initialisation with a resource-busy error).

Where should I begin looking into debugging this? I'm an i2s noob. Is full duplex even possible?

Just for reference, the ALSA device list looks like this . .

**** List of PLAYBACK Hardware Devices ****
card 0: sndrpisimplecar [snd_rpi_simple_card], device 0: simple-card_codec_link snd-soc-dummy-dai-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0


**** List of CAPTURE Hardware Devices ****
card 0: sndrpisimplecar [snd_rpi_simple_card], device 0: simple-card_codec_link snd-soc-dummy-dai-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The tail of the output of alsa-conf might also be revealing. I set up the mems mics first, then followed the Adafruit instructions for setting up the DAC (hence the references to hifiberry_dac).

!!ALSA/HDA dmesg
!!--------------

[    9.197591] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 20203000.i2s not registered - will retry
[    9.360780] asoc-simple-card asoc-simple-card.0: snd-soc-dummy-dai <-> 20203000.i2s mapping ok
[    9.661734] bcm2835-i2s 20203000.i2s: Trying to bind component to card "snd_rpi_hifiberry_dac" but is already bound to card "snd_rpi_simple_card"
[    9.661759] snd-hifiberry-dac soc:sound: ASoC: failed to instantiate card -19
[    9.661923] snd-hifiberry-dac soc:sound: snd_soc_register_card() failed: -19
[   15.728423] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SSFS
1

2 Answers 2

1

On the datasheet it does say they should work on full duplex mode because they have different FIFO buffers. One 64x32 bits RX FIFO for input, another 64x32 bits TX FIFO for output. Page 120 of the BCM2835 ARM SOC.

1
  • Could you elaborate how to achieve this, when there seems to be a conflict with the two devices.
    – Besi
    Commented Nov 6, 2018 at 21:16
0

I don't have this microphone, but I'm likely to buy one if it works with a DAC. So, here's my understanding of the problem.

Evidently, there can be only one sound card driver bound to i2s. As we can see in my_loader.c, drivers use codecs and these can support either capture, playback, or both. In this case, dmic codec is capture-only, and pcm5102a (from hifiberry_dac) is playback-only. So theoretically, changing the codec to a duplex one in my_loader.c (here's the list: https://github.com/raspberrypi/linux/tree/rpi-4.14.y/sound/soc/codecs) should do the trick.

1
  • Hy qduaty1: I am facing the same problem. Could you elaborate which steps would be involved to replace the codec of my_loader.c
    – Besi
    Commented Nov 6, 2018 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.