Skip to content

fix(mpris): send actions in the phone's spelling and seek phones with SetPosition - #49

Merged
bethropolis merged 3 commits into
bethropolis:mainfrom
Rishabh672003:fix/mpris-actions-seek
Oct 4, 2026
Merged

bethropolis merged 3 commits into
bethropolis:mainfrom
Rishabh672003:fix/mpris-actions-seek

Conversation

@Rishabh672003

@Rishabh672003 Rishabh672003 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Two MPRIS commands return ok but do nothing on an Android phone.

Action names. The docs list lowercase actions (playpause, next), but Android only matches PlayPause, Next, etc. Known actions are now mapped to the phone's spelling.

Seek. Android has no Seek handler, only SetPosition, so kcd mpris seek +30s does nothing (checked on kcd 1.22.0). A relative seek is now sent as SetPosition from the tracked position, and the documented setPosition field now works.

Docs updated to match.

Testing: new unit tests and the full suite pass. Checked on a phone: with this branch, setPosition moves playback.

Not changed: protocol Seek is in µs, but kcd uses ms. The fallback (no tracked position) and incoming Seek in playerctl.go still mix the two.

AI assisted

The docs list lowercase actions ("playpause", "next", ...) but the
daemon forwarded them verbatim and KDE Connect Android matches only
Play, Pause, PlayPause, Next, Previous and Stop, so documented requests
returned ok and the phone ignored them. Normalise known names
case-insensitively; anything else passes through unchanged.

AI assisted
KDE Connect Android's MprisReceiverPlugin implements SetPosition but
never reads Seek, so seeking a phone (mpris_action "seek", and
kcd mpris seek) did nothing. A relative seek is now sent as an absolute
SetPosition computed from the tracked position, and mpris_action now
honours the documented setPosition field for absolute seeks. Only one of
the two is ever sent, since a desktop peer would apply both.

AI assisted
Actions are matched case-insensitively, volume uses the volume field
(there is no setVolume in the IPC payload), and a relative seek is sent
to phones as an absolute position.

AI assisted
@bethropolis

Copy link
Copy Markdown
Owner

Thank you for this.

this is a great write up, also great work on solving the seek issue

I'll review this and merge in the next release

@bethropolis
bethropolis merged commit 5dba20e into bethropolis:main Oct 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants