Skip to content

Fix AirPlay PIN pairing on tvOS 27 - #2894

Open
JaviSoto wants to merge 1 commit into
postlund:masterfrom
JaviSoto:agent/fix-tvos-27-airplay-pin-pairing
Open

Fix AirPlay PIN pairing on tvOS 27#2894
JaviSoto wants to merge 1 commit into
postlund:masterfrom
JaviSoto:agent/fix-tvos-27-airplay-pin-pairing

Conversation

@JaviSoto

@JaviSoto JaviSoto commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • Send the configured remote name as X-Apple-Client-Name during AirPlay HAP pairing.
  • Use a per-pairing header copy for /pair-pin-start and all /pair-setup requests.
  • Add a fake-receiver regression test covering the complete four-request HAP pairing exchange.

Addresses the no-PIN AirPlay HAP pairing path reported in #2866.

This does not address the separate post-PIN HTTP 470 or Companion pairing failures discussed in that issue.

Background

On an AppleTV11,1 running tvOS 27.0 (24J5325d), AirPlay pairing returned HTTP 200 and tvOS generated a four-digit passcode, but the receiver suppressed the PIN UI because the request had no client name:

passcodeString is empty or clientName is nil. Bailing.
{passcodeLength=4, clientNameIsNil=YES}

pyatv already carries the configured display name inside encrypted M5, but that arrives after tvOS needs the name to present the PIN. Adding X-Apple-Client-Name to the initial HAP pairing requests caused the PIN to appear immediately and the normal pairing flow completed successfully.

This is intentionally scoped to HAP/AirPlay 2 pairing. Legacy pairing, transient authentication, verification, and module-global headers are unchanged.

Testing

  • Added a receiver-boundary functional regression that checks the configured name on /pair-pin-start and all three /pair-setup requests.
  • Ran the complete chickn validation pipeline successfully.

AI-use disclaimer

Codex with GPT 5.6-Sol were used in the creation of this PR, but everything was reviewed by me.

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.

1 participant