Skip to content

[fix] audio: lock the mic during a meeting so a device switch can't break transcription - #51

Merged
YJack0000 merged 1 commit into
mainfrom
fix/lock-mic-device
Jun 25, 2026
Merged

YJack0000 merged 1 commit into
mainfrom
fix/lock-mic-device

Conversation

@YJack0000

Copy link
Copy Markdown
Contributor

Reported: switching the mic input mid-meeting killed the whole transcription.

Root cause: the Settings "Test mic" (start_mic_test) — fired by the device picker or the Test button — opens a second input stream with no guard against an active meeting. On macOS that makes CoreAudio renegotiate the device and silently kills the meeting's capture; audio stops, transcription dies, and the stream's error callback only logs, so nothing recovers.

Fix (the meeting already pins its device at start and holds it — just stop anything from grabbing the mic mid-meeting):

  • start_mic_test no-ops while a meeting is recording (reliable backstop).
  • start_meeting tears down any running test stream so it can't contend.
  • new meeting_active command; Settings queries it + follows the broadcast meeting://status to disable the device picker + Test button while recording, with a hint.

So once a meeting starts, the input device is fixed for its duration. tsc + cargo check + tests green.

…reak transcription

Reported: switching the mic input mid-meeting killed the whole transcription.
Root cause: the Settings 'Test mic' (start_mic_test), fired by the device picker
or the Test button, opens a SECOND input stream with no guard against an active
meeting. On macOS that makes CoreAudio renegotiate the device and silently kills
the meeting's capture — audio stops flowing, transcription dies, nothing recovers.

The meeting already pins its device at start and holds it; the fix is to stop
anything from grabbing the mic mid-meeting:
- start_mic_test no-ops while a meeting is recording (reliable backstop).
- start_meeting tears down any running test stream so it can't contend.
- new meeting_active command; Settings queries it + follows meeting://status to
  disable the device picker + Test button while recording, with a hint.

So once a meeting starts the input device is fixed for its duration — most users
are on the system default and nothing should switch it mid-call.
@YJack0000
YJack0000 merged commit eec0a24 into main Jun 25, 2026
@YJack0000
YJack0000 deleted the fix/lock-mic-device branch June 25, 2026 07:16
@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant