fix: chirp stock path uses runtime .snd extension; log every chirp attempt - #13
Merged
Conversation
Root cause, confirmed by operator ear-testing plus device storage
forensics: the firmware build pipeline converts .wav SOURCE files to
.snd at packaging time -- runtime filenames under
/ext/apps_assets/shared/sounds/ are .snd, never .wav. Neither the
source tree nor the OpenAPI spec reveals this; only a live
GET /api/storage/list against the actual device does. Compounding it,
POST /api/audio/play returns 200 BEFORE the deferred file open --
playback queues behind a ~100ms amp holdoff, and an open failure at
holdoff-fire is logged device-side only and otherwise swallowed. A
True from play_audio therefore does NOT prove audible playback: a
wrong filename (the original ".wav" CHIRP_STOCK_PATH) was
indistinguishable from a correct one at every layer this codebase
could observe, including the v1.5.2 on-device report's own "chirp
fired" evidence. Operator ear-test matrix: stock .wav -> silent, an
uploaded .wav asset -> audible, stock .snd -> audible.
Fixes:
- CHIRP_STOCK_PATH corrected to "shared/calendar_event_starts.snd",
with an extensive comment so a future reader doesn't "fix" it back
to .wav by reading the source tree or the API docs without
re-checking a live storage listing.
- calendar_countdown/main.py's chirp call site now logs at INFO on
EVERY attempt, success or failure ("chirp played (%s) -> %s") --
previously only failures were logged (in client.py), so a
"successful" (True-returning) attempt left no trace at all; the
original bug was doubly silent (no sound AND no log line), part of
why it took storage forensics rather than a log check to find.
- BusyBarClient.play_audio's docstring documents both the .wav->.snd
conversion and the deferred/swallowed-200 caveat explicitly, with an
instruction to verify stock filenames against a live storage listing
before shipping them.
- Spec doc: a "Correction" subsection appended to the v1.5.2 section,
flagging that its own earlier "chirp's real playback timestamp"
claim was wrong, with the full root-cause writeup and ear-test
matrix. calendar_countdown/README.md's chirp note updated to match,
operator-facing.
Tests: CHIRP_STOCK_PATH.endswith(".snd") pinned directly as a
regression test against this exact bug; caplog-based loop tests
confirm the INFO log fires on both successful and failed chirp
attempts.
TZ=UTC uv run pytest -q: 323 passed (319 before this fix).
Device cleanup: removed the chirp_test app's leftover uploaded test
asset (tone5s.wav, 480044 bytes, under /ext/user_assets/chirp_test)
via DELETE /api/assets/upload?application_name=chirp_test, verified
removed via a fresh /api/storage/list (the app's directory no longer
appears in the listing, and a direct list of that path now returns
400 "directory does not exist" rather than a stale 200). No on-device
verification round performed for the fix itself, per instruction --
the operator's own ear-test of the corrected .snd path is the
authoritative confirmation; a scripted probe could only re-confirm
the same HTTP 200 already shown not to prove audibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v1.5.2 event-start chirp was silently broken: the firmware build converts .wav sound sources to .snd at packaging, so
shared/calendar_event_starts.wavnever existed at runtime — and /api/audio/play returns 200 before the deferred file-open, swallowing the failure at every layer. Confirmed by operator ear-test matrix (stock .wav silent / uploaded .wav audible / stock .snd audible) plus device storage listings and firmware source audit..snd(regression test pins the extension)Tests: 323.
🤖 Generated with Claude Code