Multi audio streams simultaneusly on MIC+

Hello to the Community :slight_smile:

I have two Mic+ hats on two Rpi zero W, and very happy about them.
The only work they have to do is to run raspotify (a Spotify service) and rhasspy (a custom/offline voice assistant).
I have installed the necessary software for the hats and I’m experiencing the following problem.
When spotify is playing, rhasspy couldn’t output a wav ( an anouncement to say… ) and the same goes around for when rhasspy plays a wav and spotify tries to play an audio.
Is there any reason why the two streams can’t get mixed?
Is it a hardware limitation?

Thank you in advance for your time!

Hi Chreece and welcome!

Well this is more an Alsa thing for 2 applications to access to a same audio output device.
There is a workaround by using DMIX see https://alsa.opensrc.org/DmixPlugin

First thing will be to try to play multiple streams as described in the documentation :slight_smile:


2. Test basic dmix on alsa with:

``

alsaplayer -o alsa -d plug:dmix some.mp3 &
aplay -D plug:dmix some.wav &
alsaplayer -o alsa -d plug:dmix some.mp3 &

This should work everywhere with ALSA 0.9.7. (It works also with ALSA 0.9.8 on a snd-intel8x0, eg. on nForce2 audio). If the second and/or third audiostream stutters, it might be the buffers-problem mentioned below 7). Don’t give up yet.


If not working you will have to modify your asound.rc configuration according to the documentation, let us know what you find

Thank you very much for your answer.

I tried installing the packages from the guide and change .asourdrc and /etc/asound.conf with the templates but it didn’t do anything :frowning:

First did you tried this? What is the result, any log?