macOS dual-source call capture: remote-audio stem lost 5 different ways (zero-stuffing, 7936-byte finalization, 0.25.1 regressions)
Summary
On macOS, dual-source call capture loses the remote-audio (system) stem in several distinct ways. Across five recordings on two app versions, not one produced a usable remote-audio track, while the microphone stem was fine every time.
Environment:
- macOS 26.6.1 (25G76), Apple Silicon
- Minutes.app 0.24.0 and 0.25.1
- CLI 0.18.2 and 0.25.1
capture_backend = "core-audio-tap",[recording.sources] call = "auto",allow_degraded_call_capture = false
Positive note first: core-audio-tap itself works well. I verified it captures on built-in
speakers, an HDMI display, and a virtual device, and it keeps capturing across a mid-recording
Bluetooth headphone connection. It also correctly taps pre-hardware-volume on built-in output.
The problems are all downstream of capture.
Bug 1: system stem written as 7,936 bytes at finalization (native call path)
The remote stem is captured correctly for the entire session, then discarded on stop.
Repro: start a recording with call intent while a Teams call is active, run ~30 min, stop.
During recording, ~/.minutes/native-captures/<id>.system.wav (pcm_f32le, 48 kHz, mono)
grows normally. I sampled the trailing 30 s every ~100 s for 32 min, decoding to s16le/16 kHz:
| Elapsed | rms | nonzero | distinct 16-bit values |
|---|---|---|---|
| 241 s | 0.07316 | 99.7% | 22,431 |
| 843 s | 0.06751 | 99.7% | 21,677 |
| 1345 s | 0.06858 | 99.7% | 21,594 |
| 1784 s | 0.07019 | — | 21,403 |
15 consecutive healthy samples. The paired .voice.wav was 48 kHz in one run and 24 kHz in
another (following the input device), and Pearson correlation between the two stems was
-0.0000 / -0.0013 / +0.0010, confirming two independent sources.
After stop:
jobs/<id>.system.wav 7,936 bytes = 0.020 s
jobs/<id>.voice.wav 180,342,016 bytes (intact)
The native-captures/ source is deleted, so the audio is unrecoverable. job.json sets
audio_path to .voice.wav, so only the microphone is transcribed.
Minutes detects this itself and downgrades it to an inferred warning:
"recording_health": {"capture_warnings":[{
"kind":{"other":{"code":"native-call-system-stem-recovery"}},
"source":"voice",
"message":"Call/remote audio was missing or silent. This transcript contains local microphone audio only.",
"diagnostic_confidence":"inferred"}]}
Reproducible on demand. I predicted the exact 7,936-byte outcome before a later
recording stopped, and it landed. A 10-week-old file on the same machine has the identical
7,936-byte signature next to a 63 MB / 34-minute .mov.
Asks:
- Don't delete the
native-captures/source until thejobs/copy is validated for plausible duration. - Treat a 0.02 s system stem after a preflight reporting
system_audio_ready: trueas a hard error, not an inferred "missing or silent" fallback.
Bug 2: system stem is zero-stuffed (current.* path)
On the non-call path the stem survives finalization but the samples are ~90% zeros.
Measured across three recordings, sampling 20 s windows:
nonzero samples: 7.9% - 10.7% (expected ~99.7%)
distinct values: 5,140 - 13,063 (plausible, so real audio is present)
1 / 0.106 ≈ 9.4, which matches the duration inflation in Bug 3. Extracting only the nonzero
samples and replaying at 16 kHz reconstructs intelligible speech: one 202 s recording yielded
3,051,184 nonzero samples → 190.7 s at rms 0.103, and transcribed cleanly. Decoded as
written, the same file transcribes as [tapping] / [MUSIC PLAYING].
So the audio is being captured and then written with roughly 9 zero samples inserted per real sample. This looks like an upsample/rate-convert path that stuffs zeros instead of interpolating, or a buffer stride mismatch.
Bug 3: duration inflation, intermittent and decoupled from Bug 2
Headers declare 16 kHz mono while the payload implies a much higher rate:
| Real duration | Header claims | Inflation | Implied rate |
|---|---|---|---|
| 343 s | 1,672 s | 4.9x | ~78,000 Hz |
| 3,198 s | 19,285 s | 6.0x | ~96,485 Hz |
| 202 s | 1,796 s | 8.9x | ~142,000 Hz |
| 3,540 s | 3,636 s | 1.03x | correct |
The last row matters: a recording can have a correct duration header and still be zero-stuffed (7.9–10.7% nonzero). So duration is not a reliable health signal.
Practical impact: a 53-minute recording produced a 617 MB file that Whisper transcribed as
5.4 hours, taking ~75 minutes of CPU and generating ~145 fabricated lines
(PLEASE SUBSCRIBE!, Thanks for watching, [barking]) after the first ~13 minutes of
genuine content.
Bug 4: v0.25.1 does not start recording at all
After updating to 0.25.1, the UI showed a recording in progress while nothing was captured:
- no
recording.pid,recording-start.txt, orrecording-meta.json - no audio file created anywhere in
$HOMEin 6 minutes lsofon the app pid showed no audio file openminutes statusagreed:recording: false
Call detection was armed (call_detect started, then mic_gate_active {mic_live: true}), but
capture never began. Same bundle id and Team ID as 0.24.0, so this doesn't look like a TCC reset.
Bug 5: v0.25.1 app terminates CLI recordings via stop sentinel
With app 0.25.1 running and CLI 0.18.2, a working CLI recording was killed after 202 s:
INFO stop sentinel detected — stopping dual-source recording
The app captures nothing itself but still writes stop sentinels into shared ~/.minutes state,
terminating recordings started by the CLI. Quitting the app resolved it. Version skew between
app and CLI sharing one state directory looks under-guarded.
Bug 6: mic stem dies on mid-recording input-device change
Start a recording with the built-in mic as default input, then connect Bluetooth headphones so the default input changes.
~3 minutes after the change, current.voice.wav went to exact digital zero: over a
320,000-sample window, 0 nonzero samples, 1 distinct value. The same stem 170 s earlier had
99.9% nonzero and 21,946 distinct values. It never recovered.
Ruled out by direct measurement at the time, while the stem read exact zero:
- built-in mic (
avfoundation :2): rms 0.002839, 97.7% nonzero - Bluetooth mic (
avfoundation :0): rms 0.000242
Both input devices were delivering audio. Teams was muted, but app-level mute doesn't gate other consumers and there was no system-wide input mute. Built-in mic is 48 kHz, the Bluetooth input 24 kHz, so a format change on re-bind is a plausible trigger.
The system stem, which uses the Core Audio tap, followed the output device change fine. Only the
cpal mic leg broke.
Ask: follow the default input across changes, or fail loudly rather than writing zeros.
Suggested triage order
- Bug 2 (zero-stuffing) — root cause of unusable transcripts, and Bug 3 looks like a symptom.
- Bug 1 (7,936-byte finalization) — total data loss, deterministic repro, and the source file is deleted.
- Bug 4 / Bug 5 — 0.25.1 regressions; 4 blocks all capture, 5 breaks the CLI fallback.
- Bug 6 — narrower trigger, silent failure mode.
A cheap general safeguard for 1, 2 and 6: validate each stem at finalization for plausible duration and nonzero-sample ratio, and surface a hard error when a stem is empty, all-zero, or mostly zeros. Every failure here was silent, and in two cases the only signal was a transcript full of hallucinated sound effects.
Happy to run further diagnostics or test patches; I have scripted repros for all of these.
This is the most useful bug report this project has received. The nonzero-sample ratios, the Pearson correlation to prove the two stems are independent sources, and predicting the 7,936-byte outcome before the recording stopped are what made bug 1 solvable in one pass instead of ten. Thank you.
Bug 1 is root-caused and fixed in #793.
stop() closes the stem files and only then awaits stopCapture(). ScreenCaptureKit keeps delivering until that call returns, and both stream outputs are registered on the same queue the close runs on, so buffers arrive after it. Both stems are created lazily on first sample, so a late buffer finds its file nil and reopens it with AVAudioFile(forWriting:), which truncates. Your entire session is replaced by the few milliseconds that arrived during shutdown, and native-captures/ is then deleted, so it is gone.
Measured rather than assumed. Writing and closing a 30 second mono float32 WAV the way the helper writes stems, then reopening it with AVAudioFile(forWriting:) and writing one buffer:
after full 30s recording, closed: 5764096 bytes
after one late buffer reopened it: 12032 bytes
data survived: 0%
That also lands on your exact number. AVAudioFile writes a 4,096 byte header, so 7,936 bytes is 4096 + 960 frames x 4 bytes, and 960 frames at 48 kHz is 0.020 s. That matches the duration you measured exactly, which is what convinced me this is the actual cause rather than a plausible-looking one.
The fix is a latch set where the stems are closed and checked before any stem write, both on the sample queue, so a late buffer either sees it or ran entirely before it was set. Worst case we lose the few milliseconds between the close and stopCapture() returning.
What I have verified is the mechanism and that it compiles with the exact invocation the build uses. What I have not verified is a live dual-source capture with remote audio still playing at stop, which is the condition that triggers it. You offered to test patches, and that is the fastest way to close the loop if you are still up for it:
git clone https://github.com/silverstein/minutes.git
cd minutes
git checkout fix/792-stem-truncation
./scripts/install-dev-app.sh
That installs to ~/Applications/Minutes Dev.app, alongside your existing install rather than replacing it. A single Teams call with audio still playing when you hit stop should be enough, and the check is that jobs/<id>.system.wav comes out proportional to the session instead of 7,936 bytes. If you would rather wait for a release build, that is completely fine too, and it will ship either way.
On the rest:
Bugs 2 and 3 are next. Your read that 3 is a symptom of 2 matches mine, and the row where duration was correct while the file was still zero-stuffed is the detail that will keep me honest about it. Neither is in the code path I just fixed, since that one downmixes multi-channel correctly, so this is a separate write path and I do not want to guess at it in public before I have read it.
Bug 4 is the one I most want to narrow. Recording works normally on our own macOS machines on 0.25.1, so it is not universal, and the difference is most likely in your config. Could you attach ~/.config/minutes/config.toml with anything sensitive removed, plus ~/.minutes/logs/minutes.log from a run where the UI showed recording but nothing was captured? capture_backend = "core-audio-tap" with call = "auto" and allow_degraded_call_capture = false is the combination I would start from.
Bug 5 I checked before replying: the stop sentinel mechanism dates to the original dual-source capture work, not to 0.25.x, so that one looks like weak version-skew guarding that your app-0.25.1-against-CLI-0.18.2 setup exposed rather than something we broke in the last release. Still ours to fix, just not a regression.
Bug 6 and your general safeguard, validating each stem at finalization for plausible duration and nonzero ratio, are both on the list. You are right that every failure here was silent, and in two cases the only signal reaching you was a transcript full of hallucinated sound effects. That is the part I find least acceptable, independent of the individual bugs.
Merged. Thank you, genuinely.
For anyone reading this later, what landed here is not just a zero-stuffing fix. It removes the duplicate constant that made the bug possible, gives producers a shared ChunkAccumulator instead of a rule to remember, refactors the existing microphone path onto it so the hand-rolled version nobody copied correctly no longer exists, and adds the CI step that runs the core unit tests with streaming enabled.
That last part is the one I keep coming back to. default = ["whisper"] plus --no-default-features meant that configuration had never executed in CI, so every test inside a streaming-gated module was compiling and never running. That is why a chunking invariant could break without a red build, and it is worth more than the fix it came attached to.
It also immediately earned its keep by exposing #800 on Windows, which turned out to be intermittent rather than feature-dependent, and #802 collects the four timing-sensitive tests that blocked merges today.
Both of your reports were measured rather than described, which is what made them solvable in hours instead of weeks. The reciprocal relationship you spotted between the nonzero ratio and the duration inflation is what confirmed the diagnosis, and your header dump independently confirmed the 7,936 bytes arithmetic from the other direction.
Remaining on #792: bugs 4 and 6 are still waiting on your config.toml and ~/.minutes/logs/minutes.log from a session where the UI showed recording but nothing was captured. Deliberately not guessing at those two, since a wrong fix in capture silently loses recordings, which is the whole class of problem we have been cleaning up today.
Follow-up: the zero-stuffing in Bug 2 causes hard processing failures, not just bad transcripts
Since filing this I ran more recordings on 0.25.1 (macOS 26.6.1, Apple Silicon). The zero-stuffed system stem doesn't only produce hallucinated transcripts. It makes processing fail outright for any recording longer than roughly 15-20 minutes:
I/O error: decoded audio exceeds the resource budget
Four recordings in one day, same machine, same config:
| Recording window | Real length | Result |
|---|---|---|
| 08:36 - 08:51 | 15 min | complete |
| 09:04 - 09:59 | 55 min | failed: decoded audio exceeds the resource budget |
| 11:32 - 12:35 | 63 min | failed: decoded audio exceeds the resource budget |
| 13:02 - 13:35 | 32 min | failed: decoded audio exceeds the resource budget |
The mechanism looks straightforward: the stem is ~10% nonzero samples and the WAV header declares 16 kHz mono while the payload implies ~150 kHz, so decoded audio is inflated roughly 5-10x. A 32-minute meeting decodes as ~5 hours and trips the budget. Measured inflation on individual files ranged from 4.9x to 9.35x.
So the practical severity is higher than "transcripts are poor": meetings over ~20 minutes produce no transcript at all, and the failure arrives after the recording is over, when the meeting can't be redone. Three of four recordings that day were lost this way. The 15-minute one survived only because it stayed under the budget.
Two observations that might help:
nonzero-sample ratio is a reliable health signal; duration is not. One recording had a correct 1.03x duration header while still being ~10% nonzero. Checking duration alone would pass it.- The
decoded audio exceeds the resource budgeterror surfaces far from the cause. Even with the root cause fixed, it may be worth validating stem sanity (nonzero ratio, plausible duration) at finalization and failing there with a specific message, so a corrupted stem is caught while the audio still exists rather than at decode time.
I expect #797 (chunk system-audio tap output to whole mixer slots) fixes the root cause here, since
it addresses exactly the alignment/stuffing behaviour. Flagging the budget failure because it's the
user-visible consequence and it's worth a regression test: record 30+ minutes of system audio and
assert the job completes.
Happy to verify against a build from main and report back.
Verified: #797 fixes it, and the budget arithmetic confirms the mechanism exactly
I built the CLI from main (which includes #797, #798, and fix(capture): stop a late sample buffer from truncating a finished stem) and re-ran a capture on the same machine and config.
Before (0.25.1 release) vs after (built from main):
| Measurement | 0.25.1 | built from main |
|---|---|---|
| system stem nonzero samples | 10.0% | 98.3% |
| voice stem nonzero samples | ~92% then 0% | 98.9% |
| duration ratio vs real length | 4.9x - 9.35x | 0.92x |
| system stem rms | 0.0121 - 0.0360 | 0.1186 |
So the zero-stuffing is gone and the duration header is correct.
The budget failures explain themselves once you plug in the numbers. audio_budget.rs sets
MAX_AUDIO_SECONDS = 4 * 60 * 60. With ~9x inflation:
| Real length | Inflated decode | vs 4 h cap | Observed |
|---|---|---|---|
| 15 min | ~2.25 h | under | complete |
| 32 min | ~4.8 h | over | failed |
| 55 min | ~8.2 h | over | failed |
| 63 min | ~9.5 h | over | failed |
That matches the observed pass/fail boundary precisely: the 15-minute recording was the only one that
stayed under the cap. So decoded audio exceeds the resource budget was purely a downstream symptom
of the stuffing, and the 4-hour cap itself looks like a reasonable guard. No change needed there.
One optional hardening suggestion, offered only because every failure mode in this issue was silent until after the meeting ended: validate stems at finalization on nonzero-sample ratio, not just duration. One of my recordings had a correct 1.03x duration header while still being ~10% nonzero, so a duration-only check would have passed it. Failing loudly at finalization would have caught this while the audio still existed, instead of surfacing hours later as a decode error.
A regression test that records 30+ minutes of system audio and asserts the job completes would also have caught this class directly.
Thanks for the quick turnaround on #797. Happy to close this out or split the remaining items (mic stem dying mid-recording, and the 0.25.1 no-record / stop-sentinel regressions) into separate issues if that's easier to track.
This reframes bug 2 and you are right to flag it. "Transcripts are poor" and "meetings over twenty minutes produce no transcript at all, discovered after the meeting is over" are different bugs with different urgency, and the second one is data loss. Three of four recordings in a day is not a quality issue.
The mechanism you describe holds up against the fix that landed: the mixer padded every short chunk out to a full 100 ms slot, so the file grew by a full slot per chunk regardless of how much audio was in it. That is the same inflation hitting the decode budget from the other end. Your 4.9x to 9.35x matches the ratio between a tap callback and a slot.
What is on main now
Your #797 is merged, along with four others from yesterday:
- #797, yours: whole-slot chunking, the shared
CHUNK_SAMPLESconstant, and the CI step that actually runs the streaming tests - #798, yours: a truncated native-call stem reported rather than inferred
- #793: the Swift stop path no longer reopens and truncates a finished stem, which was bug 1
- #795: a source that stops delivering mid-recording is now named on stderr and in the log instead of being written as silence
- #799 and #796: the flaky test and the CI hangs that were blocking all of the above
So yes, please do verify against main. The specific thing worth checking is exactly the case you name: 30 or more minutes of system audio, and the job reaching complete rather than decoded audio exceeds the resource budget.
On your two observations
Nonzero ratio over duration. Agreed, and your correct-duration-but-still-stuffed recording is the reason. #795 deliberately counts whether a source delivered a chunk at all, rather than measuring the resulting file, for the same reason: a stem can be the right length and still be silence. What it does not yet cover is your case, a source that delivers steadily but whose content is mostly zeros. A nonzero-ratio check at finalization would catch that, and it is worth adding on top rather than instead.
Failing at finalization rather than at decode. Also agreed, and this is the part I care most about. The budget error arrives hours later, in a different subsystem, phrased in terms of a resource limit, about a recording that no longer has a source file to recover from. Catching a corrupted stem while the audio still exists, with a message that says the stem is corrupted, is worth doing even once the root cause is fixed, because the root cause can regress and the next corruption will have a different origin.
The regression test you suggest is the right shape. Recording 30 minutes of real system audio in CI is not practical, but the invariant is: a stem whose declared duration and sample count disagree by more than a small margin should fail loudly at finalization. That is testable with a synthesized stem and does not need a live capture.
Still open
Bugs 4 and 6 are unchanged and still need your config.toml and a ~/.minutes/logs/minutes.log from a session where the UI showed recording but nothing was captured. I have deliberately not guessed at those two: both are in capture, and a wrong fix there loses recordings silently, which is the failure mode this whole issue is about.
Coming back to close this one properly. Your report actually covered six bugs, and here's where each landed. Bugs 1, 2, 3 and 5 are fixed and have shipped since v0.25.2: the late-buffer truncation (#793), the zero-stuffing and duration inflation (your #797), a warning for stems that finalize mostly silent (#806), and the app no longer stops a recording it doesn't own (#807). You confirmed 2 and 3 yourself on main, which I appreciated.
Bug 4 never reproduced for us and we never got logs, so I'm leaving it. If a current release ever shows "recording" without capturing anything, please open a fresh issue with the log. Bug 6, the mic stem going to zeros after an input change, is still real. Today we only warn about it at the end, so I've split it into #1222. Thanks again. This report shaped a lot of the capture hardening that came after.
Thanks again for the careful measurements and for testing #797 on your machine. I checked the follow-ups against current main. Your test confirmed the fix for the zero-stuffed system stem and the inflated duration. The shutdown truncation fix and the safeguard against the desktop app stopping a recording it doesn't own have also shipped.
The microphone going silent after an input-device change is still open in #1222. #1376 now preserves samples already buffered during a restart, but it doesn't establish that the reopened input keeps delivering usable audio. I'm picking that up and will verify it with an actual input switch before marking it fixed.
If you've seen either the silent input or the UI showing “recording” without capturing on a recent build, the Minutes and macOS versions and the devices you switched between would help narrow it down. No need to share recordings or calendar or meeting details.