rhasspy / wyoming-satellite

Remote voice satellite using Wyoming protocol
MIT License
734 stars 107 forks source link

Stop recording/streaming when disabled #4

Open chatziko opened 11 months ago

chatziko commented 11 months ago

wyoming-satellite continuous recording and streaming, even when it is disabled by the satellite_enabled HA switch (it seems to me that the satellite is not even aware of the flag, although I only had a quick look at the code). It would be preferable to stop recording and remain completely idle, to save network/CPU resources, but also free the sound devices for other uses (in case of ALSA).

A simple solution could be to just disconnect from the satellite. But it might be useful to always maintain a connection for other features, in which case we could add a StopSatellite event or something like that.

PS. wyoming-satellite seems awesome, I like the modular design.

synesthesiam commented 11 months ago

Thanks! HA should disconnect now, but I have to test this more. I agree that streaming satellites could conserve resources when no server is connected, but I'd expect most people to use VAD or local wake word detection so it may not get used much.

One option is to do for microphone services what I already do for sound services: send AudioStart and AudioStop messages. So for mic services, AudioStop would tell the service to stop recording but keep the connection alive. And AudioStart would resume it.

P.S. Thanks again for all the great work you did on HA satellite! I think we could move a lot of the pulseaudio code into a combined mic/snd service that does ducking and echo cancellation. What do you think?