Repository navigation
Capture: stop native call capture before a stem outgrows its WAV header - #1225
Merged
Merged
Conversation
… header Native stems are mono f32 at the device rate, so the 8 h default max_duration_secs cannot stand in for a size cap: the 4 GB RIFF limit arrives after ~6.2 h at 48 kHz and ~3.1 h at 96 kHz, after which the capture needs a manual `minutes recover-stem` (#1219, from #1114). StemSizeGuard checks the larger stem every 5 s in the native capture loop: a warning at 90%, then a normal stop 64 MiB under the limit (about 2.9 min of 96 kHz audio, far more than the check interval plus stop latency), so the usual finalization and processing run. Size, not time, so it holds at any sample rate. Fixes #1219. Co-Authored-By: Claude Opus 5.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.
Summary
Fixes #1219 (from #1114). Native call-capture stems are mono f32 at the device sample rate, so the 8 h default
max_duration_secscan't stand in for a size cap: the 4 GB RIFF limit arrives after ~6.2 h at 48 kHz (the rate both reporters measured, ~192 KB/s) and ~3.1 h at 96 kHz. Past it, the capture needs a manualminutes recover-stem.StemSizeGuardinminutes_core::capture: warns at 90%, then stops 64 MiB underu32::MAX(about 2.9 minutes of 96 kHz audio, far more than the 5 s check interval plus stop latency).session.stem_paths()and routes warnings/stops through the same notices and normal finalization as the time and disk guards, so the capture is still processed.call_capture.rsor the Swift helper (open PR Recover microphone capture after an input disconnect #1210 is editing both).Test plan
cargo fmt --all -- --check,cargo clippy --all --no-default-features -- -D warningscargo test -p minutes-core --no-default-features --lib capture::(81 passed) including a new guard test (warn once, stop below the limit with headroom)cargo test -p minutes-app --no-default-features🤖 Generated with Claude Code