Skip to content

Add opt-in AirPlay 2 playback relay control - like iOS Control Center - #2919

Open
DerPicknicker wants to merge 1 commit into
postlund:masterfrom
DerPicknicker:airplay/control-relay
Open

DerPicknicker wants to merge 1 commit into
postlund:masterfrom
DerPicknicker:airplay/control-relay

Conversation

@DerPicknicker

@DerPicknicker DerPicknicker commented Oct 6, 2026 •

Copy link
Copy Markdown

Hey,

I figured out how the Observer role works in AP2. Like on iOS so you're able to control your AP2 Speaker which is not paired in Apple HomeKit + not streaming from MA or from pyATV.

I've tested it locally - code is written by Codex.

Here is the fully description:
Adds an experimental MrpTunnel.Relay mode for observing and controlling existing playback through an AirPlay 2 receiver using pyatv’s standard APIs.

Supported functionality:

  • Live track metadata, playback state, and position.
  • Album-cover retrieval through metadata.artwork(), using existing artwork retrieval and caching.
  • Play, pause, toggle, next/previous track, and seeking.
  • Absolute volume control for the selected receiver or an explicitly selected group member.
  • Playback commands addressed to the active sender/player, with sender rejection errors surfaced to callers.
  • Volume changes confirmed by receiver updates.
    The implementation uses an authenticated, encrypted AirPlay control-only session and reuses existing message and player-state handling. Includes a discovery/control example and protocol documentation. Existing connection defaults remain unchanged.
    Validation: Live receiver testing confirmed metadata, album-cover retrieval, pause/resume, seeking, and volume. Next/previous and command failures are covered by protocol tests. Full suite: 1,271 passed, 6 skipped; lint, typing, and generated-file checks passed.
    Current scope: Transient AirPlay pairing. HomeKit authentication and broader receiver compatibility remain future work.

@DerPicknicker

Copy link
Copy Markdown
Author

@postlund open for any feedback, I've built a debugging toolkit as well. If'youre interested, I can add you privately. DM me on Discord.

@DerPicknicker
DerPicknicker force-pushed the airplay/control-relay branch from 5c956cd to ee24ebd Compare October 8, 2026 16:52
@DerPicknicker

Copy link
Copy Markdown
Author

Artwork should now also work - tested locally - Code written by Codex.

Any chances this could be merged quickly so Music Assistant and Home Assistant can benefit from it @postlund ?

@postlund

postlund commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Artwork should now also work - tested locally - Code written by Codex.

Any chances this could be merged quickly so Music Assistant and Home Assistant can benefit from it @postlund ?

I'll try to find some time within the next few days!

@DerPicknicker

Copy link
Copy Markdown
Author

Thank you :)

This branch has not been deployed

No deployments
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