Snips audio-server disable output hogging

As a preamble: I’ve gone through both automatic and manual setups via raspberry pi. I’ve messed around with alsa settings, attempted pulse as a workaround, and attempted forcing an invalid output to the server.

The setup:
The Peeqo kickstarter recently sent out dev packages to those of us that wanted it badly enough. Peeqo runs an electron app via a raspberry pi 3 and provides both hdmi and external sound card outs for alsa. HDMI, for now, doesn’t actually have an output for audio – we use respeaker (seeed-voicecard) as our devices for some attached speakers. I run a custom hotword with snips and pass this through to Peeqo to do its output as necessary. The hotword results in a wakeup noise that Peeqo controls, intent detection results in other media that Peeqo controls.

The issue:
Snips audio-server tests work fine for both input and output. Using the hotword alert sounds, I can even hear the output post when the server detects the custom hotword. However, Peeqo’s electron app cannot grab the output (nor can things like chromium / firefox) when the server is running because the snips audio-server is hogging that device. In our situation, we really don’t need the output to even attempt to talk to that device. I’ve attempted to disable the output in the .toml, but I don’t see that doing anything at all.

Is this something that can currently be accomplished? If so, how? If not, are there plans to support something like this?

hello @zphensley42,

I see in the doc here : https://github.com/shekit/peeqo-robot , that the alsa configuration is done with the file .asoundrc .

the blocked playback is caused by the snips-audio-server accessing the hardware directly , if you look at your current /etc/asound.conf you will find a direct reference to hw:n,m.

I would rather set the alsa configuration in /etc/asound.conf , the other solution is to create the same alsa conf for the _snips user running the snips-audio-server service.

tl;dr : create a file /etc/asound.conf with the content


pcm.!default{
	type asym
	playback.pcm {
		type plug
		slave.pcm “hw:1,0”  
#this first number is the number of the usb device
	}

	capture.pcm {
		type plug
		slave.pcm “hw:1,0”
 #this is the mic usb number, maybe 2 if camera is included
}
}

add this section to you /etc/snips.toml

[snips-audio-server]
alsa_capture = "default"
alsa_playback = "default"

I’m not actually following that guide, I’ve been somewhat spear-heading this effort and thus have been working less to the guide and more to how snips’ setup works, I don’t have a .asoundrc and my /etc/asound.conf already matches what you have suggested (minus the :1,0 number being :0,0 as I have re-indexed my output cards).

I added the properties to the section in /etc/snips.toml, but starting the audio server and attempting to play via aplay afterwards (as well as attempting to play a sound via chromium) just blocks, unable to get access to the output device.

Is there anything else I can show to help debug?