port: check-capture refuses a format it cannot read, and accepts the one it nearly rejected
The Decoder is moving to an ALSA `type file` tee, which writes float32. Read as s16 that yields a plausible-looking file whose only tell is per-channel peaks alternating exactly -- the two halves of each float landing in alternate channels. My parser assumed s16 throughout and would have mis-read it confidently. An unreadable format now ends the run at PARTIAL (exit 2) rather than PASS: channels were checked, starvation was not, and the tool says which. A checker that claims a check it skipped is the shape of every failure this file documents. AND THE FIRST VERSION OF THE GUARD WAS TOO STRICT -- it rejected one of this tool's own controls, a six-tone file `ffprobe` correctly calls pcm_s16le, because the file is WAVE_FORMAT_EXTENSIBLE (tag 0xFFFE) rather than plain PCM. A format guard that refuses a legitimate capture is the same defect as one that mis-reads an illegitimate one, pointing the other way. The check turns on wBitsPerSample, which is what decides the layout; a float tee is 32-bit and still caught. Control sweep, now the tool's real specification and all of it runnable here: real music+SFX bed PASS voice track, mono, 53% real pauses PASS six distinct tones, PCM and extensible PASS bed with 350 ms holes punched in FAIL the starved capture FAIL the same tones as float32 PARTIAL Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N7FiFFFwbvG2uxdcEh8HyF
This commit is contained in:
@@ -239,6 +239,36 @@ Rate alone cannot separate rows 2 and 3; silence alone cannot separate rows 1 an
|
||||
*and* there is at least 1 gap per second. Real audio is either mostly not silent,
|
||||
or silent in a few long stretches — not both at once.
|
||||
|
||||
### A format it cannot read is refused, not guessed at
|
||||
|
||||
Everything in the starvation check assumes 16-bit signed. An ALSA `type file` tee
|
||||
writes **float32** (`SND_PCM_FORMAT_FLOAT_LE`), and read as s16 that produces a
|
||||
*plausible-looking* file — the Decoder measured one, and its only tell was
|
||||
per-channel peaks alternating **exactly**, which is the two halves of each float
|
||||
landing in alternate channels.
|
||||
|
||||
So an unreadable format ends the run at **`PARTIAL`** (exit 2), not `PASS`:
|
||||
channels were checked, starvation was not, and the tool says which. A checker
|
||||
that claims a check it skipped is the shape of every failure this file documents.
|
||||
|
||||
⚠️ **`WAVE_FORMAT_EXTENSIBLE` (tag `0xFFFE`) is accepted at 16 bits**, and the
|
||||
first version of the guard was not — it rejected one of this tool's own controls,
|
||||
a file `ffprobe` correctly calls `pcm_s16le`. **A format guard that refuses a
|
||||
legitimate capture is the same defect as one that mis-reads an illegitimate one**,
|
||||
pointing the other way. The check turns on `wBitsPerSample`, which is what
|
||||
actually decides the sample layout; a float tee is 32-bit and is still caught.
|
||||
|
||||
### The control sweep, which is the tool's real specification
|
||||
|
||||
| file | verdict |
|
||||
|---|---|
|
||||
| real music+SFX bed | `PASS` |
|
||||
| voice track, mono, 53 % real pauses | `PASS` |
|
||||
| six distinct tones (PCM and extensible) | `PASS` |
|
||||
| bed with 350 ms holes punched in | **`FAIL`** |
|
||||
| the starved capture | **`FAIL`** |
|
||||
| the same tones as float32 | **`PARTIAL`** |
|
||||
|
||||
### ⚠️ The regime this tool cannot judge, and says so
|
||||
|
||||
**High silence with very few gaps is what a real voice track looks like (53.2 %
|
||||
|
||||
Reference in New Issue
Block a user