Skip to content

Prevent Atom audio faults after delayed Stop cleanup - #46

Merged
eirabie merged 1 commit into
mainfrom
codex/atom-stop-recovery
Oct 14, 2026
Merged

eirabie merged 1 commit into
mainfrom
codex/atom-stop-recovery

Conversation

@eirabie

@eirabie eirabie commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stopping Atom audio can leave the I2S channel transmitting after its worker exits. Delayed main-loop cleanup can then overflow the completion queue and latch the volume fence failed, blocking automatic playback until restart. The opted-in worker now disables the channel before publishing its exit; the main loop retains task/channel deletion and bus release. Genuine overflow and disable failures remain fail-closed.

Hardware impact

  • No new required hardware

Scoped to the calibrated Atom/Voice Pyramid standard speaker. Gain, saved settings, prayer history, partitions and shared audio are unchanged by the implementation.

Standalone impact

Stop returns to a healthy idle speaker and permits subsequent playback without a reboot. Offline scheduling and Home Assistant independence remain intact.

Testing

Automated: the delayed-cleanup regression failed on the original driver in production and isolated modes, then passed with the fix. All 20 UBSan CTests, 135 Python tests, calibrated schemas, forward/reverse pinned-source provenance and production Quran/volume integration checks passed. All 13 exact-head CI checks passed.

Seven matched Atom build pairs passed capacity checks using the same pinned toolchain and dependencies. The official-profile OTA grew from 1,305,952 to 1,306,048 bytes (+96), leaving 266,816 application-budget bytes. Static RAM delta is zero across the matched pairs; both application slots and shared audio remain intact.

Hardware: the exact official candidate was installed through one preserving application-only write. Independent full-flash readback verified every byte outside its erase extent unchanged. Bottom-only startup retained 70%, settings, prayer history and preferences. Three attended 70% Play/Stop/replay cycles passed without a restart, fault or read error; the owner confirmed clear audio, effective Stop and successful replay.

The earlier 90% Stop fault motivated this investigation, but its underlying physical fault bit was not exposed, so exact attribution remains unconfirmed. Runtime heap, fragmentation, PSRAM and worker-stack headroom remain unmeasured. Full scheduled playback on this new source has not been observed; this is bounded development validation.

Licensing/media

  • No new third-party media or dependency licensing concerns

Pinned ESPHome GPLv3 notices and maintained patch provenance are preserved; no media is added.

@eirabie
eirabie marked this pull request as ready for review October 14, 2026 01:16
@eirabie
eirabie merged commit 2786ef7 into main Oct 14, 2026
13 checks passed
@eirabie
eirabie deleted the codex/atom-stop-recovery branch October 14, 2026 01:16
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