Skip to content

Add MPRIS support on Linux via a new fin-mpris crate - #2

Merged
tsirysndr merged 3 commits into
mainfrom
feat/mpris
Jul 8, 2026
Merged

Add MPRIS support on Linux via a new fin-mpris crate#2
tsirysndr merged 3 commits into
mainfrom
feat/mpris

Conversation

@tsirysndr

Copy link
Copy Markdown
Owner

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.

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.
@tsirysndr tsirysndr self-assigned this Jul 8, 2026
@tsirysndr tsirysndr added the enhancement New feature or request label Jul 8, 2026
tsirysndr added 2 commits July 8, 2026 14:28
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.
@tsirysndr
tsirysndr merged commit 8552bb3 into main Jul 8, 2026
2 checks passed
@tsirysndr
tsirysndr deleted the feat/mpris branch July 8, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant