feat(power): low-power idle + self-recording run-duration log #9

Merged
troed merged 1 commit from devel into main 2026-09-10 18:07:34 +02:00
Owner

Summary

Fixes the follow-up-after-reply failures reported on the live voice assistant:

  • Per-response playback-ack accounting (client): the desktop client acked playback instantly (lifetime-cumulative played bytes vs per-connection received bytes), so the server's wake-word-free grace window opened while the answer was still playing and expired mid-playback. The client now tracks bytes per response (same contract as the esp32 firmware player), acking at true playback end.
  • Zoom into stale grace windows (client): a leftover grace deadline from a previous reply could expire during the next reply's playback and re-gate the mic. New responses now cancel any stale window; a wedged response still arms one.
  • VAD re-arm on playback end (server): the shared Silero model's recurrent state degraded across the long near-silence + playback stream, underscoring the next utterance into discarded fragments (dump + offline analysis). VAD state is now reset when response playback ends.
  • VAD tuning (runtime config): --min_speech_ms 256 so short utterances survive.

Test plan

  • pytest: 983 passed, 2 skipped; ruff check+format clean.
  • TDD regression tests for each fix (per-response ack, stale-grace cancel, VAD re-arm live on server).
  • Verified on the live server across repeated wake → question → follow-up rounds; user-confirmed working ("this seems to work perfectly").

Release notes

Session code proportional to instrumentation probes was added and fully removed afterwards; COMPUTER_INPUT_DUMP env diagnostic included only in diagnostic commits that cancel out within this PR.

## Summary Fixes the follow-up-after-reply failures reported on the live voice assistant: - **Per-response playback-ack accounting (client)**: the desktop client acked playback instantly (lifetime-cumulative played bytes vs per-connection received bytes), so the server's wake-word-free grace window opened while the answer was still playing and expired mid-playback. The client now tracks bytes per response (same contract as the esp32 firmware player), acking at true playback end. - **Zoom into stale grace windows (client)**: a leftover grace deadline from a previous reply could expire during the next reply's playback and re-gate the mic. New responses now cancel any stale window; a wedged response still arms one. - **VAD re-arm on playback end (server)**: the shared Silero model's recurrent state degraded across the long near-silence + playback stream, underscoring the next utterance into discarded fragments (dump + offline analysis). VAD state is now reset when response playback ends. - **VAD tuning (runtime config)**: `--min_speech_ms 256` so short utterances survive. ## Test plan - `pytest`: 983 passed, 2 skipped; ruff check+format clean. - TDD regression tests for each fix (per-response ack, stale-grace cancel, VAD re-arm live on server). - Verified on the live server across repeated wake → question → follow-up rounds; user-confirmed working ("this seems to work perfectly"). ## Release notes Session code proportional to instrumentation probes was added and fully removed afterwards; `COMPUTER_INPUT_DUMP` env diagnostic included only in diagnostic commits that cancel out within this PR.
While IDLE, gate the speaker amp and LED ring off and slow the key poll
to 2 Hz (CONFIG_IDLE_LOW_POWER, default on); everything restores on
wake. Wake-word detection (mic + AEC + mww) stays live.

A power_hb task persists a virtual run clock to NVS every 60 s, so each
boot logs the previous run's duration + reset reason (power: prev run
...); with the brownout detector enabled a battery discharge
self-reports how long it lasted.
troed merged commit 16fab2a566 into main 2026-09-10 18:07:34 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starfleet/communicator-esp32!9
No description provided.