Support remote control on AirPlay receivers
Short feature/function description An AirPlay receiver can have buttons (both physical and software) to for instance play/pause or change volume. These kinds of controls are currently not supported. It seems to require a Zeroconf service to be published by the client, which it then uses to post simple DACP commands to. So it should not be that hard to implement. At least the basic controls.
Documentation can be found here:
https://openairplay.github.io/airplay-spec/audio/remote_control.html
I'm not entirely sure how to deal with commands like next or previous right now. Ideally, this should programmatically be signaled back to the developer which can take action. Current interface doesn't support that in any way, so it will likely be left for later when I add a more flexible interface.
What needs to be done?
- Add Zeroconf service for the remote control
- Add basic web server that handles incoming commands
- Implement support for play, pause, playpause and stop
Is this a breaking change? No
Anything else worth knowing? Relates to #1059
Volume controls can be implemented quite easily after #1069 has been implemented.
Default volume level can be fetched from receiver via /info.
I did some testing yesterday and to summarize... The HomePod seems to find my remote service and call back to the web server I've put up. It continuously reports volume level:
...
"GET /ctrl-int/1/setproperty?dmcp.device-volume=-24.2515 HTTP/1.1" 200 163 "-" "AirPlay/540.31.41"
"GET /ctrl-int/1/setproperty?dmcp.device-volume=-23.1138 HTTP/1.1" 200 163 "-" "AirPlay/540.31.41"
"GET /ctrl-int/1/setproperty?dmcp.device-volume=-19.2814 HTTP/1.1" 200 163 "-" "AirPlay/540.31.41"
"GET /ctrl-int/1/setproperty?dmcp.device-volume=-17.8443 HTTP/1.1" 200 163 "-" "AirPlay/540.31.41"
This is without me doing anything. I guess it's some sort of normalization. Anyhow, this shows that the back-channel works. No other commands seems to work though, like play, pause, next or manually changing volume. Maybe the HomePod uses another channel somehow? Not sure how to proceed from here.
owntone seems to suffer from the same issue, i.e. controls not working from my iPhone. Also, play state seems to be paused when using owntone as well.
I would love to see this get some traction...being able to pause/start, skip and jump back would be great from the physical device and iPhone remote! :)