Feature: Airplay - Add play/pause/next/prev controls
Shairport-sync controls are available via the dbus interface and documented here
The most useful option appears to be using the standardized MPRIS (Media Player Remote Interfacing Specification) support built in to shairport-sync
# MPRIS interface commands.
# For MPRIS support, Shairport Sync must be built with the MPRIS interface support. Add the '--with-mpris-interface' flag at the ./configure stage.
# There is a simple test client that you can have built -- add the '--with-mpris-test-client' flag at the ./configure stage. You'll get an executable called shairport-sync-mpris-test-client.
# This is mostly compatible with the MPRIS standard, except that Volume is read-only, with a separate SetVolume method.
# Set Volume, which must be between 0.0 and 1.0 and maps linearly onto the slider.
dbus-send --system --print-reply --type=method_call --dest=org.mpris.MediaPlayer2.ShairportSync '/org/mpris/MediaPlayer2' org.mpris.MediaPlayer2.Player.SetVolume double:0.3
MPRIS is documented here
A secondary option is using the Remote Control interface:
# Play using regular Remote Control
dbus-send --system --print-reply --type=method_call --dest=org.gnome.ShairportSync '/org/gnome/ShairportSync' org.gnome.ShairportSync.RemoteControl.Play
#Remote Control commands include: Play, Pause, PlayPause, Resume, Stop, Next, Previous, VolumeUp, VolumeDown, ToggleMute, FastForward, Rewind, ShuffleSongs
- [ ] Rebuild shairport-sync to enable MPRIS
- [ ] Test dbus commands on a running shairport instance. What common use cases do they work for?
- [ ] How do we determine which commands are available? We may need to add way to report the available commands in the api...
- [ ] Find python mpris client library, implementing our own only if needed
- [ ] Add dbus command translator in the Airplay stream in amplipi/streams.py
Updated this issue in case anyone from the community wanted to do some preliminary investigative work on this before we can get to it. One goal would be to make a simple airplay command line demo that could send play/pause/next commands to the shairport-sync instance and also query what commands were available.
Also (as a side note) adding MPRIS support could be potentially useful for other integrations assuming other stream interfaces support that standard. Do other things we already use support this interface? This is the first time we've heard of MPRIS...
First step recompile shairport to add MPRIS support, it does not appear to be available in the build we use from raspberry-pi-OS packages.
closed by #437