Skip to content

fix: detect actual channel count to prevent Mickey Mouse with mono USB devices#67

Merged
pasrom merged 2 commits intomainfrom
fix/mono-usb-mickey-mouse-test
Mar 23, 2026
Merged

fix: detect actual channel count to prevent Mickey Mouse with mono USB devices#67
pasrom merged 2 commits intomainfrom
fix/mono-usb-mickey-mouse-test

Conversation

@pasrom
Copy link
Copy Markdown
Owner

@pasrom pasrom commented Mar 23, 2026

Summary

  • Detect actual channel count from IOProc AudioBufferList.mNumberChannels on first callback
  • Propagate actualChannels through AudioCaptureResultAudioCaptureSessionDualSourceRecorder
  • Use detected channel count instead of hardcoded appChannels=2 for stereo→mono conversion

Root cause: Jabra PRO 930 USB headset has 1 output channel (mono). The aggregate device delivers mono audio, but the code always assumed stereo interleaved — averaging consecutive mono samples as L/R pairs, halving the sample count, producing double-speed Mickey Mouse voice.

Test Plan

  • Lint: 0 serious violations
  • Build passes
  • Manual test with Jabra PRO 930 to verify correct mono passthrough

@github-actions github-actions bot added the bug Something isn't working label Mar 23, 2026
…B devices

Mono USB headsets (e.g. Jabra PRO 930) deliver 1-channel audio through
the CATapDescription aggregate device. The code assumed stereo (2ch),
treating consecutive mono samples as L/R pairs and averaging them —
halving the sample count and producing double-speed Mickey Mouse audio.

Fix: read mNumberChannels from AudioBufferList on first IOProc callback,
propagate through AudioCaptureResult, and use for channel conversion.
@pasrom pasrom force-pushed the fix/mono-usb-mickey-mouse-test branch from e859ad6 to 065dc60 Compare March 23, 2026 17:30
Tests verify: mono passthrough (no halving), stereo averaging,
sample count preservation, empty input, and incomplete frames.
@pasrom pasrom merged commit 016b50d into main Mar 23, 2026
6 checks passed
@pasrom pasrom deleted the fix/mono-usb-mickey-mouse-test branch March 23, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant