Add MPRIS support on Linux via a new fin-mpris crate - #2
Merged
Conversation
Register org.mpris.MediaPlayer2.fin on the session bus so media keys, desktop applets and playerctl can drive whatever renderer the TUI holds (local, Chromecast or UPnP). A poll task diffs Renderer::state() snapshots into PropertiesChanged/Seeked signals, mirroring the GENA notify loop in fin-mediarenderer. The crate body is #![cfg(target_os = "linux")] and its dependencies are target-gated, so macOS and BSD builds never pull in zbus. No dbus dev package is needed anywhere: zbus is a pure-Rust D-Bus implementation.
MPRIS is a D-Bus spec, not a Linux one — BSD desktops (KDE, GNOME, wlroots compositors) run a session bus and playerctl ships in ports/pkgsrc. zbus is pure Rust, so no dbus dev package is needed and the release VM package lists stay untouched. Headless boxes without a session bus keep the existing non-fatal warn-and-continue path.
async_trait's boxed renderer futures are Send but not Sync, while mpris-server's trait_variant::make(Send + Sync) bound requires interface futures to be both — every method that awaited a renderer call directly failed to compile on Linux. Route renderer calls through tokio::spawn: the JoinHandle is Sync, so the interface future never holds the boxed future. The helper is deliberately not an async fn — async fn arguments live in the generated future's state, which would re-poison Sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Register org.mpris.MediaPlayer2.fin on the session bus so media keys, desktop applets and playerctl can drive whatever renderer the TUI holds (local, Chromecast or UPnP). A poll task diffs Renderer::state() snapshots into PropertiesChanged/Seeked signals, mirroring the GENA notify loop in fin-mediarenderer.
The crate body is #![cfg(target_os = "linux")] and its dependencies are target-gated, so macOS and BSD builds never pull in zbus. No dbus dev package is needed anywhere: zbus is a pure-Rust D-Bus implementation.