Files
benilla-octo/crates/benilla-app/examples
gromandClaude Opus 5 510dda3d3c sound: the glue-music crackle never happened — a meter that summed frame deltas
`StreamWatch` asked "did this stream play as much audio as wall time passed?" by summing each
frame's `Time<Real>` delta into `expected` and comparing it against the stream's own advanced
position. But a Bevy clock delta describes the interval *ending* where the frame began, while
`window_start` is stamped with `Instant::now()` part-way *through* a frame. So a window opened
inside the 4 s world-entry frame was handed that entire 4 s by the next frame, as audible time
that should have played — while the position, which tracks the speaker honestly, had advanced
only by the window's real span. The difference was logged as injected silence.

The tell was in the log all along: `position advanced` equalled the window `span` to the
centisecond. When those two agree the audio was perfect, whatever `counted` says.

All 101 "glue music stream starved" lines in every log to date are this artifact, plus 104 of
395 zone-music ones. Replaying the new formula over those logs silences all 205 and keeps all
291 real events — streams genuinely frozen with `position advanced 0.00 s`.

Fixed by taking both ends of the window off one clock (`now - window_start`) and deleting the
`dt` parameter outright, so the counted interval and the reported span are the same number by
construction and no caller can supply an inconsistent delta. The old test
`stream_watch_spans_the_window_it_counted` asserted exactly this invariant and passed, because
its fixture fed a delta that agreed with its own wall clock — a fixture that supplies both sides
of a relationship cannot test it. Replaced with the regression that matters: a stream which keeps
up across a 4.1 s main-thread stall must not be reported, and one genuinely frozen through the
same stall must still be named, or the fix has just deleted the meter.

The warn now reports what it measured; "this is what a crackle sounds like" was read as evidence
of a crackle and written into the defect backlog as one.

`examples/stream_probe.rs` decodes a track through the chain exactly as kira's decoder does and
compares the container's declared frame count against frames actually decoded — it killed the
first hypothesis for the real dropout: 43 of 43 zone tracks are clean.

The real dropout is still open and is not a crackle: one `alsa::poll()` POLLERR, which
`output/cpal.rs` classifies as non-fatal and reports as "stream kept", and no sound advances
again for the rest of the session.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-11-01 11:27:18 -07:00
..