AirPlay 2 audio: can Glassworks be a multi-room AirPlay 2 speaker without FairPlay code or GPL?
On this page
Status (2026-12-05): untested. The desk research says yes. AirPlay 2 audio needs no FairPlay
decryption, and every piece of the usual open stack except the PTP daemon is MIT or Apache-2.0. One
handshake, POST /fp-setup, still has to be answered with bytes that came from a real FairPlay
server. The maintainer chose to record those bytes ourselves from an Apple receiver rather than copy
the ones open receivers carry. That recording is blocked so far: no receiver on our network answers
/fp-setup to a sender it hasn't paired with (see attempts 3–6).
Devices tried: a MacBook Pro (macOS 27.2, build 26B118, AirPlay Receiver on as it was set, AirPlay
sourceVersion 1005.13.1), two Sonos speakers (firmware 20.98, Apple's AirPlay SDK, srcvers
366.0) and a 2025 Samsung OLED TV (Apple's AirPlay SDK, srcvers 377.40). Tools: dns-sd (macOS),
Python 3.11, pyatv 0.18.0 (MIT) for transient pairing.
Sources pinned at 2026-12-05: shairport-sync 7ce90d8952, nqptp ab8fb67483, goplay2
eb779df7d2, playfair 96c232ed7e.
Question
Glassworks panels are AirPlay 1 speakers today (libs/raop,
AirPlay). AirPlay 1 speakers still show up in iOS's AirPlay menu, but iOS can't
group them with HomePods or other AirPlay 2 speakers, and the Home app doesn't list them. We wanted
to know:
- What an AirPlay 2 audio receiver has to implement, step by step.
- Whether any of it needs FairPlay, Apple's DRM, whose open implementation (playfair) is GPL-3.0 and which hard rule 4 keeps out of our APKs.
- Which open projects we may port from, by licence.
- What Android and our frames allow, mainly for PTP timing on UDP 319/320.
How we got here
The obvious references are shairport-sync and nqptp, which together are the AirPlay 2 receiver most people run. They looked like a dead end at first for two reasons. nqptp is GPL-2.0. And every receiver that iPhones play to carries a FairPlay handshake whose oldest copy traces back to playfair. If AirPlay 2 needed FairPlay the way mirroring does, we couldn't ship it.
So the first question was where FairPlay actually sits in the flow. Mirroring receivers (UxPlay,
RPiPlay) need playfair's white-box decrypt because the video key arrives FairPlay-wrapped (a 72-byte
ekey in SETUP). We followed the audio key through shairport-sync and goplay2 instead. In AirPlay 2
it arrives as a plain 32-byte shk inside the SETUP bplist, protected only by the HomeKit-style
pairing that encrypts the RTSP channel, and it goes straight into ChaCha20-Poly1305. Nothing
decrypts FairPlay data on the audio path. That turned the question from "can we do FairPlay?" into
"what does the receiver have to say during /fp-setup?"
The answer is: four fixed 142-byte replies, picked by a mode byte, and a 32-byte second reply that is a fixed header plus the last 20 bytes of the request. None of the open receivers computes anything. They replay bytes that were recorded from an Apple device at some point. The open receivers agree that the handshake can't be skipped. Without feature bit 14, iOS stops after pairing, and the only other auth bit, MFi, needs Apple's auth chip.
That left a licensing question about the bytes, not the code. shairport-sync (MIT) and goplay2 (Apache-2.0) carry them today, but the earliest copy we found is in playfair (GPL-3.0). The maintainer chose (2026-12-05) to record our own replies from an Apple receiver, so their provenance is a capture we made and documented here, not a copy. If our recording matches the published bytes, that also shows the published bytes are protocol data any Apple receiver produces.
PTP was the other constraint. iOS sends PTP only to UDP 319/320, which an unrooted Android app can't
bind. Rooted frames can redirect those ports with iptables, as two Android AirPlay 2 projects
already do. The generic app keeps AirPlay 1.
What an AirPlay 2 audio receiver implements
Order as observed from iOS (read: emanuelecozzi.net's AirPlay 2 internals, checked against
shairport-sync's RTSP dispatch and goplay2's handlers/).
| Step | What happens | Evidence |
|---|---|---|
| Discovery | Advertise _airplay._tcp (AirPlay 2) and _raop._tcp. TXT carries a made-up deviceid, a 64-bit features mask, flags, srcvers ≥ 366 (below that, iOS uses neither PTP nor buffered audio), pi/pk (pairing id and Ed25519 key), and the group fields gid, gcgl, igl |
read: shairport-sync shairport.c:1993-2040; read: owntone airplay.c:455 |
GET /info |
A bplist with features, device id, pi, pk, model, audioLatencies, status flags |
read: shairport-sync rtsp.c |
POST /pair-setup |
Transient HAP pairing (feature bit 48): SRP-6a, 3072-bit RFC 5054 group, SHA-512, user Pair-Setup, PIN 3939, M1–M4 only. Keys from HKDF-SHA-512 over the SRP key, salt Control-Salt, info Control-Read/Write-Encryption-Key |
read: pair_ap pair_homekit.c:52,97-118; pyatv server_auth.py |
| Encrypted RTSP | From here on, frames of up to 1024 bytes: 2-byte little-endian length (the AAD), ChaCha20-Poly1305 ciphertext, 16-byte tag; nonce = 4 zero bytes + 64-bit little-endian counter | read: pyatv hap_session.py, pair_ap |
POST /fp-setup ×2 |
Only when feature bit 14 is advertised. See the fp-setup handshake | read: shairport-sync rtsp.c:1895-1998 |
| SETUP, phase 1 | Request has timingProtocol: PTP, timingPeerInfo, groupUUID. We open a TCP event port and reply {eventPort, timingPort: 0, timingPeerInfo} |
read: shairport-sync rtsp.c:2613, goplay2 setup.go |
| SETUP, phase 2 | streams: type 103 = buffered (TCP), type 96 = realtime (UDP). Carries shk (32-byte audio key), ct (2 = ALAC, 4 = AAC, …), audioFormat, spf |
read: shairport-sync rtsp.c:2759 |
RECORD, SETPEERS(X) |
The group's addresses: the PTP peers to listen to | read: shairport-sync rtsp.c |
SETRATEANCHORTIME |
"RTP frame rtpTime plays at PTP time T on clock networkTimeTimelineID"; rate 0/1 = pause/play |
read: shairport-sync rtsp.c:1505-1522 |
| While playing | /feedback every ~2 s, volume via SET_PARAMETER, metadata via /command (bit 50), FLUSHBUFFERED on seek, TEARDOWN with or without streams |
read: shairport-sync rtsp.c |
Feature bits. shairport-sync advertises 0x1C340401C4A00: bits 9 (audio), 11, 14 (FairPlay
auth), 18–20 (PCM, ALAC, AAC-LC), 30, 38 (CoreUtils pairing), 40–41 (buffered audio, PTP: what makes
iOS offer grouping), 46–48 (HomeKit pairing, peer management, transient pairing) (read:
shairport.c:1999-2004). goplay2 sets the same minus 48. Bit 51 (MFi pair-setup) must stay off; iOS
fails at pair-setup without a chip (read: airplay2-receiver ap2/bitflags.py:149).
Audio. Buffered audio (type 103) is what iOS uses for music and multi-room. Each TCP packet is a
2-byte big-endian length, a 12-byte RTP-like header, ciphertext, a 16-byte tag and an 8-byte nonce.
It decrypts with ChaCha20-Poly1305 under shk, with AAD = header bytes 4–11. The payload is raw
AAC-LC (1024 samples) or ALAC (read: shairport-sync ap2_buffered_audio_processor.c:247-336).
Realtime audio (type 96) is RTP ALAC over UDP with the same cipher (read: rtp.c:1629-1660).
The fp-setup handshake
What a receiver must answer (read: shairport-sync rtsp.c:1895-1998, goplay2
handlers/fairplay.go; both pinned above):
| Message | Request | Reply |
|---|---|---|
| 1 | 16 bytes: 46 50 4c 59 03 01 01 00 00 00 00 04 02 00 <mode> 0b. A 12-byte FPLY header (version 3, type 1, sequence 1, payload length 4) and a 4-byte payload whose third byte is the mode, 0–3 |
142 bytes, one fixed reply per mode |
| 2 | 164 bytes: header with sequence 3 and length 0x98, then 152 bytes the sender's FairPlay client computes |
32 bytes: 46 50 4c 59 03 01 04 00 00 00 00 14, then the request's last 20 bytes |
Neither shairport-sync nor goplay2 checks the request beyond the version, type and sequence bytes.
The four published replies (hashed, not copied, from shairport-sync's rtsp.c at 7ce90d8952):
| Mode | SHA-256 of the 142-byte reply |
|---|---|
| 0 | 8e1a11ea61e4c397f30480910786893aaebb5bff59bf2074db9d7e84fda49dbc |
| 1 | e3730ce34481b93312c97ecbebe5b2128ee16a8e4d0140e89904ac9ff7509df3 |
| 2 | c6ab6f9488d29f4c7ec395981cdd12f14a5fa5c51ce61ae6ce43c570f7eae989 |
| 3 | 8c53e03e2a08e23558e48287851d1cf39297039a7a60bf906a582e22c92f826b |
All four share their first 13 bytes and differ from byte 13 on (verified, 2026-12-05). These hashes are what our own recordings get compared against.
Can the handshake be skipped? Not as far as anyone has published (read). airplay2-receiver's
notes from trying feature masks (ap2/bitflags.py:1-33): without an auth bit, iOS "stops after
pairing … with no supported auth error"; with bit 26 (MFi) instead of 14 it asks for
/auth-setup, which needs the chip. Music on iPhones needs bit 14 (bitflags.py:82). A build
without bit 14 is a cheap experiment for the first proof of concept; the evidence predicts it fails.
iOS versions. Canned replies have worked from about iOS 11.4 through iOS 26: shairport-sync users on iOS and iPadOS 26 report working AirPlay 2, and the open bugs there are unrelated (read: shairport-sync issues #2077, #2238). We found no report of iOS rejecting the canned replies.
Where the published bytes come from. The earliest copy we found is playfair's
mirror_http.c:153 (reply_message[4][142], GPL-3.0; read, and compared by hash on 2026-12-05). It was copied into
juhovh/shairplay (LGPL-2.1+, 2018-08-01; read), and is now byte for byte in shairport-sync (MIT)
and goplay2 (Apache-2.0). The bytes are almost certainly responses recorded from an Apple device:
data with no creative choices, fixed by what a sender accepts. Whether that makes them free of
playfair's licence is a legal question we don't answer here. The maintainer's choice (2026-12-05)
sidesteps it: we record our own, and copy none.
Licence map
| Project | Licence (from its LICENSE file or headers) | What we may take |
|---|---|---|
| shairport-sync | MIT (pair_ap MIT, ALAC BSD-style, tinysvcmdns BSD) | Read and port: RTSP flow, SETUP fields, buffered framing, anchor maths. The best reference |
| pair_ap | MIT | HAP pair-setup and pair-verify: port |
| goplay2 | Apache-2.0 | Port, with NOTICE lines: a compact receiver including a PTP client with Delay_Req |
| pyatv | MIT | Its HAP client and AirPlay 2 sender; already our interop test client for AirPlay 1 |
| Bouncy Castle 1.80 | MIT, already in libs/esphome-api |
X25519, Ed25519, ChaCha20-Poly1305, HKDF-SHA-512 |
| Apple ALAC | Apache-2.0, already ported in libs/raop |
Buffered ALAC |
| nqptp | GPL-2.0 | Nothing. Read for behavior only; our PTP follower is written from IEEE 1588-2008 / 802.1AS |
| openairplay/airplay2-receiver | No licence (all rights reserved); fairplay3.py says GPLv2 |
Nothing; read only |
| openairplay airplay-spec, emanuelecozzi.net | No licence stated | Facts only; no prose or tables copied |
| playfair | GPL-3.0 | Nothing, including the canned replies |
| shairplay (juhovh) | LGPL-2.1+ / MIT | Nothing |
| UxPlay, RPiPlay, ks-airplay-receiver, rairplay, airplay2-rs | GPL-3.0 | Nothing |
| shairplay-rust | LGPL-3.0+ | Nothing |
| owntone | GPL-2.0 | Read only; fine as a test sender, never shipped |
Only PTP needs a strict clean room, and only because its obvious reference, nqptp, is GPL.
PTP and ports
- iOS (or a HomePod or Apple TV in the group) is the PTP grandmaster. The receiver only follows:
it listens for Announce, Sync and Follow_Up from the peers named in SETUP and
SETPEERS, keeps a record per clock ID, and follows the clock named by the anchor'snetworkTimeTimelineID. The grandmaster can change mid-session (read: nqptp's README; goplay2ptp/server.go:58-87). - nqptp sends no Delay_Req; it only sends an "awakening" Announce to restart a silent clock (read
for behavior,
nqptp.c:455-540). goplay2 sends Delay_Req. - iOS sends PTP only to UDP 319/320 (read: airplay2-receiver issue #49; every receiver binds
them).
SupportsClockPortMatchingOverridehasn't been shown to move a receiver's ports (untested). - Rooted frames can redirect 319→10319 and 320→10320 with
iptables -t nat ... REDIRECTwhile AirPlay 2 is on, and remove the rules when it's off. Two Android projects do exactly this and report grouping with a HomePod within about 2 ms (read: kiosk-satellite-plugin-airplay2's README, ks-airplay-receiver). They force IPv4 because without IPv6 NAT an iPhone may send its timing over IPv6 and nothing plays. Our frame agent already auto-detectsip6tables -t natfor the hotspot portal (frame-agent/glassworks_agent_lib.sh), so the S1 likely has IPv6 NAT (untested for UDP REDIRECT). Check that nothing on the frame uses 319/320 first. - The generic, unrooted app can't bind ports below 1024, so it can't do PTP or multi-room AirPlay 2. It stays on AirPlay 1.
- Java timestamps packets after
receive()returns. On the A133 that likely adds 0.1–1 ms of jitter, which min-filtering should absorb (untested).
What we tried
-
Find Apple receivers on the LAN (2026-12-05, verified)
$ dns-sd -B _airplay._tcp local. # then dns-sd -L <name> _airplay._tcp local. for TXT <this Mac> model=MacBookPro18,1 srcvers=1005.13.1 features=0x4A7FCFD5,0x38174FDE flags=0x204 <speaker 1> manufacturer=Sonos srcvers=366.0 features=0x445F8A00,0x801C340 flags=0x4 <speaker 2> manufacturer=Sonos srcvers=366.0 features=0x445F8A00,0x801C340 flags=0x4 <TV> manufacturer=Samsung srcvers=377.40.00 features=0x7F8AD0,0x38BCF46 flags=0x244Names, ids, keys and addresses redacted. The Mac is the only Apple-made receiver; there's no Apple TV or HomePod on this network. The Mac sets bit 14 (FairPlay). The Sonos speakers set bit 26 (MFi) and not 14. The TV sets neither.
-
Write a recorder (2026-12-05). A Python script outside the repo that opens one RTSP connection, optionally does a transient pair-setup (M1–M4 with PIN 3939, through pyatv's MIT SRP and HAP session code, and without
/pair-pin-start, so the receiver never shows a PIN), then sends fp-setup message 1 for one mode and, if that succeeds, message 2 with a synthetic 152-byte body. It records status, length, bytes and SHA-256. Requests are built from the framing in the table above. No bytes come from any project's canned replies. -
This Mac, no pairing (2026-12-05, verified)
$ python3 fp_record.py 127.0.0.1 --mode 0 --out mac-m0.json msg1 mode 0: RTSP/1.0 403 Forbidden len=0 -
This Mac, transient pairing first (2026-12-05, verified), over loopback and over its LAN address:
$ python3 fp_record.py <mac> --transient --mode 0 --out mac-m0.json pair-setup M1: RTSP/1.0 403 ForbiddenA read-only
GET /infoexplains it:statusFlagsis 516 =0x204, which sets bit 9, OneTimePairingRequired (openairplay's status-flag table). The Mac accepts only senders that have done a full pairing, or, as set here, devices on the same Apple account. Changing the Mac's "Allow AirPlay for" setting is the maintainer's call, so we stopped. -
A Sonos speaker, no pairing (2026-12-05, verified)
msg1 mode 0: RTSP/1.0 404 Not Found len=0The Sonos firmware has no
/fp-setupat all, which fits its features: it authenticates with MFi (bit 26), not FairPlay. Licensed AirPlay 2 speakers on the MFi path can't give us replies. We didn't try the second, identical speaker. -
The Samsung TV, no pairing (2026-12-05, verified)
msg1 mode 0: RTSP/1.0 403 Forbidden len=0Its
flags(0x244) also set bit 9, OneTimePairingRequired. We didn't try pairing: on a TV that may put a code on screen. -
This Mac again, open to anyone on the network (2026-12-05, verified). The maintainer set AirPlay Receiver's "Allow AirPlay for" to "Anyone on the Same Network" with no password, and set it back afterwards. The status flags dropped bit 9 (
flags=0x4), andfeaturesstill sets bit 14 (0x4A7FCFD5,0x38174FDE, macOS 27.2,srcvers1005.13.1). Two fixes in our recorder came first: message 1 now ends in0xBB, as the protocol write-ups give it (we had0x0B), and pyatv 0.18's SRP needssrptools1.0.1 (2.0 breaksSRPClientSession).loopback, no pairing: msg1 mode 0: RTSP/1.0 403 Forbidden len=0 loopback, transient pairing: pair-setup M1: 200 OK, M3: 200 OK (M4 keys 4, 6) msg1 mode 0: RTSP/1.0 403 Forbidden len=0 LAN address, both ways: the sameSo transient pairing (PIN 3939, M1–M4) works against a real Apple receiver with pyatv's client, and macOS still refuses
/fp-setup, paired or not, although it advertises bit 14. We stopped there, after six attempts.
That was ten /fp-setup requests, four transient pair-setups, two /pair-setup M1s and one
GET /info in all. Nothing was stored on any device: transient pairing keeps no keys.
What this leaves. No Apple receiver on this network answers /fp-setup, so we can't record our
own replies here. The proof of concept's side build without bit 14 now matters most: if iPhones
accept a receiver that does transient pairing and doesn't advertise FairPlay, no replies are
needed at all. If they don't, the choice is between an Apple TV or HomePod to record from, or the
published bytes as protocol data (option a).
Result
| Question | Answer | Evidence |
|---|---|---|
| Does AirPlay 2 audio need FairPlay crypto? | No. The audio key shk arrives in the pairing-encrypted SETUP |
read: shairport-sync rtsp.c:2759, rtp.c:1650; goplay2 setup.go |
Can /fp-setup be skipped? |
Not as far as anyone has published | read: airplay2-receiver bitflags.py |
| Does the handshake need FairPlay math? | No. Four fixed replies and a header-plus-echo | read: shairport-sync, goplay2 |
| Is any GPL code needed? | No. Only nqptp is GPL; we write our own PTP follower | read: licence files |
| Can the generic app do AirPlay 2 multi-room? | No. It can't bind 319/320 | read |
| Have we recorded our own fp-setup replies? | Not yet. The only Apple receiver here requires a one-time pairing; the Sonos speakers have no fp-setup; the TV requires pairing | attempts 3–6 |
| Do Apple devices return the published bytes? | Unknown until we record | — |
How to reproduce
The recorder lands in tools/airplay2/ together with the recorded replies, once a recording passes
the checks below. Until then, the requests are fully described in the fp-setup
handshake: one RTSP POST /fp-setup with Content-Type: application/octet-stream and X-Apple-ProtocolVersion: 1, on a connection that has done
transient pair-setup if the receiver asks for it. It touches only the receiver's RTSP port, pairs
nothing that persists, plays nothing and changes nothing. There's nothing to undo.
What unblocks the recording, from least to most effort:
- An Apple TV or HomePod on the network. These normally allow transient pairing for "everyone on the same network".
- This Mac's AirPlay Receiver → Allow AirPlay for set to Anyone on the Same Network with no password, for the few minutes of the recording, then set back. That's a system setting, so it's the maintainer's decision.
Then, for each device: modes 0–3 in fresh sessions, each twice, and message 2 with two different synthetic bodies. The checks before anything is committed:
- Do the message 1 replies match across sessions and across devices for each mode? If any byte varies by device, the replies may be device-unique and stay out of the repo (hard rule 2).
- Is the message 2 reply the 12-byte header plus the request's last 20 bytes, or does the receiver reject a body that no FairPlay client produced?
- Do the SHA-256 hashes match the table above?
Open questions
- The recording itself, and the three checks above.
- Whether a receiver accepts our recorded replies on an iPhone (it should, if they match).
- Whether the S1 kernel has UDP
REDIRECTand IPv6 NAT for 319/320, and whether anything already listens there (ss -ulpnon the shared panel, per hard rule 7). - PTP precision on the A133 without kernel timestamps, measured against a HomePod.
- Whether a smaller
audioBufferSizethan shairport-sync's 8 MB keeps iOS happy within the Music pane's RAM budget.
What the groundwork found
Building steps 2 and 3 (2026-12-05, verified on loopback with pyatv 0.18.0 and srptools 1.0.1 as the client, and in unit tests):
- pyatv's transient client doesn't follow RTSP.
AirPlayHapTransientPairVerifyProcedureposts/pair-pin-startfirst, then sends both/pair-setupmessages asHTTP/1.1request lines with noCSeq, on the same TCP connection as the RTSP session (read: pyatvprotocols/airplay/auth/hap_transient.py,support/http.py). A receiver that takes onlyRTSP/1.0drops it as malformed, so ours takesHTTP/1.1too and answers in the request's protocol./pair-pin-startgets a plain 200: a transient pairing's PIN is fixed, so there's nothing to show. - pyatv never checks the M4 proof. It reads M4's HTTP status and nothing else:
send_and_receiveraisesAuthenticationErroron a 401 or 403 andHttpErroron any other non-2xx (read: pyatv 0.18.0support/http.py,send_and_receive), andverify_credentialsdrops the response body (read:hap_transient.py, the last/pair-setuppost). So it never checks the receiver's proof (itsstep2callsverify_proofon its own value), and it doesn't see a HAP error either: a receiver refuses M3 with a 200 and an error TLV, as HAP has it and ours does, so pyatv's pairing "succeeds" with the wrong PIN, turns on encryption with keys the receiver doesn't have, and fails only at the next request (verified 2026-12-05, the run below). A wrong M2 would still fail, because the keys wouldn't match, but a wrong M4 proof wouldn't. Our interop client checks M4 itself with srptools, the SRP library pyatv uses. - The SRP conventions agree. srptools hashes the salt as sent, pads
kanduto the length of N, and putsA,B,S,H(I)andH(N) xor H(g)into the proofs without padding (read: srptools 1.0.1context.py). It turnsH(I)andH(N) xor H(g)into numbers first, which would drop a leading zero byte, but forPair-Setupand the 3072-bit group both start with a non-zero byte (cd3f…andb3d6…), so a writer that hashes the full digests gives the same bytes. Two srptools vectors, one with a salt that starts with zero bytes, pin it. - srptools 2.0 breaks pyatv 0.18. 2.0 makes
SRPClientSession's private key keyword-only, and pyatv passes it positionally:TypeErrorat the first M3.libs/raop/test-requirements.txtpins 1.0.1. - Transient pairing needs no pair-verify. pyatv runs M1 to M4 and then encrypts with keys from the SRP session
key;
/pair-verifyis only for paired controllers with stored keys (step 4). - The loopback run (2026-12-05, verified, macOS on Apple silicon, Python 3.12).
PyatvInteropTeststarts the receiver on127.0.0.1with the groundwork on, then runssrc/test/resources/hap/pyatv-transient-client.pywith the venv's Python: pyatv's ownverify_connectionwith transient credentials, the M4 check in srptools, thenGET /infoon the encrypted connection. It prints the client's JSON line, once with PIN 3939 and once with 1234:uv venv /tmp/pyatv && VIRTUAL_ENV=/tmp/pyatv uv pip install pyatv==0.18.0 srptools==1.0.1 RAOP_ATVREMOTE=/tmp/pyatv/bin/atvremote ./gradlew --max-workers=2 :raop:test :raop:apiCheck
The first line is the receiver's proof checked andPyatvInteropTest tests 3 skipped 0 failures 0 aHungClientTimesOutInsteadOfBlocking 1.026 s pyatvStreamsAWavSampleForSample 2.662 s pyatvPairsTransientlyAndReadsInfoEncrypted 0.834 s {"m4": "verified", "info": {"name": "Interop", "deviceID": "02:11:22:33:44:55", "model": "Glassworks", "manufacturer": "Glassworks", "protocolVersion": "1.1"}, "error": null} {"m4": "error 2", "info": null, "error": null}/inforead through ChaCha20-Poly1305. The second is the wrong PIN: M4 carries error 2 (authentication), pyatv itself raised nothing ("error": null), and the client didn't ask for/info. The device ID is the test's made-up one. The other 59 tests in:raoppassed in the same run, andapiChecktoo. - Android has no ChaCha20-Poly1305 or X25519 at API 23, so
libs/raopnow depends on Bouncy Castle 1.80, the artifactlibs/esphome-apialready ships. SRP stays onBigIntegerand SHA-512 onMessageDigest.
The plan
Each step is its own PR, in this order:
-
This note.
-
A binary plist codec, inside
libs/raop, with golden tests against Python'splistlib. -
HAP transient pairing: TLV8, an SRP-6a 3072/SHA-512 server on
BigInteger(Bouncy Castle'sSRP6Servercomputes M1 differently), HKDF-SHA-512 and the encrypted RTSP framing. Interop tests with pyatv as the client.Steps 2 and 3 landed together, switched off (what the groundwork found).
-
Full HomeKit pairing (M5/M6, pair-verify, stored controllers), for the Home app and Macs.
-
A PTP follower written from IEEE 1588-2008 / 802.1AS, without opening nqptp, with configurable ports and a
StreamClockforsynced-audio. -
The AirPlay 2 receiver in
libs/raop:/info, SETUP 1/2, the event channel, buffered and realtime audio, anchors, flushes, peers, feedback, metadata, volume. It answers/fp-setupwith our recorded replies, with their provenance in NOTICE. AirPlay 1 stays for older senders. -
The frame agent's 319/320 redirect on rooted frames, with the undo path and a real S1 run before merge (hard rule 5).
-
Music pane wiring: AirPlay 2 when the frame agent reports the redirect, AirPlay 1 otherwise, with a
frame.jsoncapability, docs and a changelog line.
Risks: Apple could tighten auth (MFi only, or a FairPlay change), which would break every open receiver at once, so AirPlay 1 stays as the fallback. PTP precision, port conflicts on 319/320, IPv6 timing on frames without IPv6 NAT, and RAM for the buffered stream all need measuring on a panel.