synesthesiam/homeassistant-satellite

Add MPD control support

Opened this issue · 4 comments

As I understand it, when sending TTS audio from Home Assistant to an MPD client, MPD is either paused, or it's output is quieted. This allows for clear hearing of the TTS message.

For many of us, we will likely want to run Satellite on a device also acting as a streaming receiver. Though there are many options out there, MPD is a very common client from what I've seen. I think it would be ideal if Satellite could be pointed to use the locally installed MPD for playback, instead of connecting directly via Alsa/Pulse/Pipewire. It also would want to support either pausing or muting any existing stream in order to properly capture voice commands and make responses easier to hear. This would result in it behaving similarly to the way Alexa devices work.

I may try to figure some of this out on my own, though I'm not a strong developer and figured getting an issue logged might result in someone with stronger skills being able to implement this sooner.

That feels a bit like scope creep, when ducking via pulse/pipewire already gets you half way. Solving the play/pause use case via MPRIS support sounds like something worth looking into though.

But at some point exposing hooks likely makes more sense, than adding support for arbitrary things.

I can completely appreciate the scope creep concerns, and have no strong worries about this in the short term. I'm currently attempting to create a functional plugin for Volumio that will run HA Satellite, and it is mostly working. However current Volumio builds use ALSA only, no Pulse/Pipewire. So I can't take advantage of the ducking feature at the moment, thus the thought for direct MPD support. I may still try to get the Volumio OS and backend to work with Pulse/Pipewire, just not sure I have the time to dig much farther beyond porting it to Bullseye (done).

Happy to help with this kind of thing as much as I can. Just know that others might be much faster in getting things working. :)

Both pipewire and pulseaudio can provide an ALSA interface, so I'd recommend looking into that.

I actually was looking into pipewire or pulseaudio based on the native support already built. Unfortunately what I've ultimately been trying to do is get HA Satellite running on VolumioOS. I already forked their repositories and managed to get Volumio running on Debian Bullseye (required for newer python versions), but for the life of me I can't get pulseaudio or pipewire working successfully while still maintaining the Volumio volume control. Unfortunately that defeats my goal and I'm back to spinning up my own configuration on a clean RaspberryPiOS. So I'm using pipewire now, or trying to. I do still think it could be nice if this had native support for MPD at some point, as then it could run on any OS with MPD as a core component regardless of the audio system present.

If anyone sees this and is also interested in a Volumio based HA Satellite, please feel free to look at my forks and see if you can assist with porting the Volumio backend to using pipewire or pulse for audio controls.