Conversation
The desktop already has now-playing surfaces everywhere - GNOME/KDE media controls and lock screens, playerctl, waybar/polybar modules, KDE Connect phone mirroring - and they all speak MPRIS. Vynull now claims org.mpris.MediaPlayer2.vynull and mirrors the audible deck (the same selection /api/nowplaying makes for the OBS overlay): title, artist, length, playhead position estimated from the beat counter, and cover art via the existing artwork endpoint URL. Vynull observes decks rather than controlling them, so the player is deliberately read-only: every capability is false and the control methods are answered as no-ops, which the spec supports. Metadata is set before PlaybackStatus so clients reacting to the status change never read stale metadata, and the metadata dict always carries the same key set: godbus's prop package merges map properties on store and never deletes keys, so a shrinking dict would leave the previous track's fields behind (found by the integration test against a live bus). On by default, --mpris=false to opt out; a missing session bus (headless) is a debug log line, never a startup failure. First new dependency in a while: godbus/dbus/v5, fetched over Tor. Tested against a private dbus-daemon per test run: name claim, identity, read-only capabilities, the stopped/playing/stopped lifecycle with full metadata assertions, no-op control calls, and the clean no-bus error path.
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.
What & why
The Linux desktop already has now-playing surfaces everywhere - GNOME/KDE media controls and lock screens, playerctl, waybar/polybar modules, KDE Connect's phone mirroring - and they all speak MPRIS. Vynull now claims org.mpris.MediaPlayer2.vynull and mirrors the audible deck: the same deck selection /api/nowplaying already makes for the OBS overlay, exposed in-process through a new NowPlayingSnapshot method and polled once a second. Published: title, artist, track length, playhead position estimated from the deck's beat counter, and cover art via the existing artwork endpoint URL (MPRIS clients fetch artUrl themselves, so external tracks' fetched art works too).
Vynull observes decks rather than controlling them, so the player is deliberately read-only, which the MPRIS spec supports: every capability (CanPlay, CanPause, CanControl, ...) is false and the control methods are answered as no-ops. Well-behaved clients render metadata without transport controls. On by default;
--mpris=falseopts out, and a missing session bus (headless/systemd boxes) is a single debug log line, never a startup failure.Two bugs the integration test caught before any human would have, both now documented in the code. Setting PlaybackStatus before Metadata let clients that react to the status change read the previous track's metadata; metadata now lands first. And godbus's prop package merges map-valued properties on store and never deletes keys (verified in the library source: dbus.Store into the existing map), so a shrinking metadata dict left the old track's title behind after a deck stopped; the dict now always carries the same key set so every update is a full overwrite.
This adds the first new dependency in a while: godbus/dbus/v5, the standard pure-Go D-Bus library, fetched over Tor. The test suite spins a private dbus-daemon per run (never touching the developer's bus) and drives the full surface with a real D-Bus client: name claim, identity, read-only capabilities, the stopped/playing/stopped lifecycle with full metadata assertions, no-op control calls answering without error, and the clean no-bus error path.
Not verified here: the actual desktop rendering (lock screen, playerctl, KDE Connect) needs a real session with a deck playing - a one-time
playerctl -p vynull metadataagainst a live instance covers it.Hardware testing
Checklist
go build ./...,go vet ./..., andgo test ./...passgofmt -l .is cleanGPL-3.0-or-later)