Share the audio output between SNIPS processes and other audio processes?

Hi

Using with success since a while SNIPS with Home Assistant, I’d like to go a little further in integration. Up to now I have used some Raspberry Pi 0W with Respeaker 2 Hat on it for my Snips satellite and so Pi were dedicated at SNIPS. Now I’d like to use the Respeaker Core 2 so I can still run SNIPS on it but also be able to use it to stream locally some audio (mainly internet radio).
Does SNIPS need an exclusive access at speaker output or can it be shared between SNIPS when it needs to “tell” something and an other audio output program (such as VLC or something similar to stream internet radio ? (I still have to figure out how I’ll get HA to stream an internet radio on a remote linux system such as the Respeaker Core 2…)
Will it be a problem for SNIPS detection and understanding to have that radio running aside ? or will he be able to automatically cancel that radio “noise” ?

Thanks for your help,

Vincèn

Interesting matter, please share your finding, looking with interest.
Internet radio or audio streaming is a nice complement to Snips.

Hey !

By default, snips-audio-server is using the ALSA backend through PortAudio. ALSA, by default, is getting an exclusive access to the speaker output. So it means that without further setup, snips-audio-server is getting an exclusive access to the output, preventing you to use any software that need to play sound.

However, you can setup your ALSA to be able to mix multiple sounds. Or, you can go to the PulseAudio route that supports natively multiple process outputing audio. One of our member made a tutorial how to setup it on a PI. If you go this way, PulseAudio seems to be able to achieve some audio cancellation.

My alsa mixes sounds by default. It will pick up ambient noise though.