From 7419cde17495914ff77c572887a29b31c17bf980 Mon Sep 17 00:00:00 2001 From: Ben Nicholson Date: Fri, 2 Oct 2026 20:06:22 +1000 Subject: [PATCH] CLAUDE.md: first-connect failure, how to catch it and the suspects Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index dc05d92..9dc7418 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,9 +63,8 @@ Repo: https://gitea.apointless.space/bsncubed/aes67-ESP32-P4 - Audio starts only after PTP lock (~20 s after boot): intended, TX needs PTP. - [ ] cspot (Spotify Connect): login, audio, pause/skip/seek, app volume, live mode switching work; stays connected across track changes and past 6 min (7.5b). Fixed so far: logger NULL crash, Vorbis symbol clash, volume starting at 0, reconnect race (PR #3 patch), 6-minute AP resets (delayed Pong patch), app dropping the device (notifyAudioReachedPlayback). Open: - OTA with a session: now ends the session first; 2 of 2 uploads with a running session were clean since. Flash writes still stall TX > 20 ms during uploads (stream stutters while updating). - - First connects sometimes fail ("Can't connect to spotify servers"), a retry works. + - First connects sometimes fail ("Can't connect to spotify servers"), a retry works. Not reproduced in 5 fresh connects (2026-10-02); seen once that day ~3 min after a boot. `status.spotify_error` now keeps the exception text + uptime: read it when it happens, then fix. Suspects in cspot's connect path: only `ap_list[0]` from apresolve is tried; the `throw` in `PlainConnection::connect` sits inside the address loop (other addresses never tried); a failed `getaddrinfo` is only logged, then the uninitialised `airoot` is walked. - Internal heap with a session: low point while playing was 212 KB (of ~371 KB idle), now ~300 KB with mbedTLS and Tremor (Vorbis) allocations in PSRAM; playback clean, 0 underruns. Left: ~35 KB connected + ~40 KB playing; the session keeps ~35 KB internal / ~190 KB PSRAM after the app disconnects. A status request once took > 2 s at playback start (TLS handshake in PSRAM?), watch. - - Seen once: state `error` before a connect that then worked (the first-connect item below?). - Track display in the app can switch ~3-5 s early. - Consider offering the delayed-Pong fix upstream (philippe44/cspot). - An old, long-idle session can get out of sync with the app: it sends empty Load frames ("No tracks in frame") instead of Pause/Play, so controls do nothing. Quitting and reopening Spotify on the Mac fixes it.