v0.57.0: repeat button; AirPlay compatibility handshake for third-party speakers

- Transport: a repeat button (off / all / one) between shuffle and the
  visualizer. Repeat-all wraps the walk (a shuffled one is reshuffled per
  lap); repeat-one replays a song that finishes, Next/Previous still move.
  BPM button and the now-playing minimum shrink to make room.
- Clicking the streaming tile to stop casting/AirPlay no longer also opens
  the big visualizer (the release after the stop counted as a click).
- AirPlay: pyatv's AirPlay 2 session is silent on a WiiM, and its AirPlay 1
  pairs then talks plaintext, which the WiiM hangs up on. Non-Apple
  speakers now get cliraop's handshake: auth-setup, no pairing, ALAC
  (uncompressed frames). airplay_protocol "2" keeps pyatv's AirPlay 2.
This commit is contained in:
2026-10-15 18:01:20 -07:00
parent c2a566bf57
commit bdeacd9793
11 changed files with 545 additions and 31 deletions
+21 -5
View File
@@ -169,6 +169,12 @@ persistence) → GUI (Qt widgets that read the manager and connect to its signal
implementation. `set_sink()` carries the current track, position and
playing-state across a swap and deliberately does *not* re-emit
`track_changed` (that would double-scrobble the same song).
**Repeat** (Round 88, the transport's button, off → all → one) lives in
`Player`: repeat-all wraps `_step_index` both ways (a shuffled walk is
reshuffled for each lap, never starting with the song that ended the last),
repeat-one replays only a song that *finished* (`_after_finish`) — Next and
Previous still move — and `_load_current`'s unplayable-skip loop gives up
after one lap, since a wrapping walk would otherwise never end.
Player is also deliberately **context-agnostic**: playback *context*
("library" / "playlist:<pid>") is tracked in `MainWindow`, not the player.
@@ -839,11 +845,21 @@ persistence) → GUI (Qt widgets that read the manager and connect to its signal
tile shows the sink's `glyph`. Testing streams against **pyatv's own fake
receiver** (`tests/fake_device/raop.py` in its sdist, bound to 127.0.0.1) —
never a real speaker unless trav says so.
pyatv picks AirPlay **2** for any receiver advertising its features (the
WiiM does) and the fake only exercises v1, so `config.json` takes
`airplay_protocol` ("auto"/"1"/"2") and `airplay_debug` (pyatv's logger
at DEBUG); every stream's start, first audio and outcome are logged at
INFO under `lintunes.airplay`, and the chosen protocol in the control log.
**pyatv's own handshakes play nothing on a WiiM** (Round 88): its AirPlay 2
session (picked for any receiver advertising AirPlay 2 features) gets 200
OK for everything, timing included, and stays silent; its AirPlay 1 runs a
transient pairing and then sends the ANNOUNCE unencrypted, and the WiiM
hangs up. Third-party speakers take what cliraop/owntones send, so
`stream.install_shim` also hooks pyatv for hosts marked by `set_compat`:
auth-setup whatever the model, no pairing, and ALAC — `AppleLossless` in
the SDP, each packet an uncompressed ALAC frame (`support.alac_verbatim`,
byte-identical to ffmpeg's encoder on incompressible input). The handshake
was verified silently (all-zero audio) against tiat.place. `use_compat`:
config.json's `airplay_protocol` "auto" = compat for everything but
Apple's own hardware (a HomePod is AirPlay 2 only), "1" = compat
everywhere, "2" = pyatv's AirPlay 2. `airplay_debug` puts pyatv's logger at
DEBUG; every stream's start, first audio and outcome are logged at INFO
under `lintunes.airplay`, and the chosen protocol in the control log.
## Conventions & gotchas