Skip to content

fix: disable mic AGC by default to stop Windows audio crackle - #933

Open
abdu11ahbaig wants to merge 1 commit into
webadderallorg:mainfrom
abdu11ahbaig:fix/mic-agc-crackle-windows
Open

fix: disable mic AGC by default to stop Windows audio crackle#933
abdu11ahbaig wants to merge 1 commit into
webadderallorg:mainfrom
abdu11ahbaig:fix/mic-agc-crackle-windows

Conversation

@abdu11ahbaig

@abdu11ahbaig abdu11ahbaig commented Sep 12, 2026

Copy link
Copy Markdown

Description

Default microphone recording on Windows to the no-agc browser voice-processing profile instead of processed, so Chromium's real-time Automatic Gain Control is off by default for the built-in mic fallback path.

Motivation

Users recording with the built-in mic on Windows reported audio breaking up repeatedly with a low-pitched, garbled/unclear voice (e.g. saying "hello" comes out warbled and stuttered). Investigation traced this to Chromium's real-time AGC, which the team had already identified in prior beta testing as causing short crackle/dropout bursts on some Realtek and headset mic paths (see the existing comment in electron/ipc/recording/audioFilters.ts). A no-agc mitigation already existed in the code, but it was only reachable via a hidden environment variable (RECORDLY_BROWSER_MIC_PROFILE) that a normal downloaded build never sets — so every real user still hit the buggy processed default. Echo cancellation and noise suppression remain enabled; volume is restored after the fact via the existing offline speechnorm/alimiter filter chain instead of AGC's real-time loop.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

#931

Screenshots / Video

N/A — audio-only backend behavior change, no UI change.

Testing Guide

  1. On Windows, enable the built-in/onboard mic and record a screen capture while speaking.
  2. Confirm the recorded mic audio no longer breaks up, warbles, or drops in pitch.
  3. Run unit tests:
    npx vitest run src/hooks/useScreenRecorder.test.ts electron/ipc/recording/audioFilters.test.ts
  4. Confirm echo cancellation and noise suppression still audibly work (background hum/echo still suppressed), only AGC's real-time pumping is gone.

Checklist

  • I have performed a self-review of my code.

Summary by CodeRabbit

  • Improvements
    • Updated the default browser microphone profile to disable automatic gain control (AGC).
    • Microphone recording now consistently uses the no-AGC profile when no valid profile is selected.

Chromium's realtime AGC crackles on some Realtek/headset mics,
heard as repeated breaking and pitch warble. The no-agc fix
existed but was hidden behind an env var shipped builds never
set. Make it the default; volume is still restored offline via
the existing speechnorm/alimiter chain.
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: bb74c963-c3a7-4571-83cf-ee58baf4d4aa

📥 Commits

Reviewing files that changed from the base of the PR and between 7512ef1 and fa9ddaa.

📒 Files selected for processing (3)
  • electron/ipc/register/settings.ts
  • src/hooks/useScreenRecorder.test.ts
  • src/hooks/useScreenRecorder.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The default browser microphone profile changes from "processed" to "no-agc". Fallback normalization and microphone constraint tests now expect automatic gain control to be disabled.

Changes

Browser microphone profile

Layer / File(s) Summary
Default profile and microphone constraints
electron/ipc/register/settings.ts, src/hooks/useScreenRecorder.ts, src/hooks/useScreenRecorder.test.ts
The default and fallback profile now use "no-agc". Tests verify autoGainControl: false for default and selected microphones, plus "no-agc" normalization for unknown and null profiles.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: webadderall

Merge Risk: ⚪ Minimal · up to fa9dd

The updated default and tests consistently implement the intended no-AGC behavior, with no concrete merge-blocking issue identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: disabling microphone AGC by default to address Windows audio crackle.
Description check ✅ Passed The description covers the change, motivation, bug-fix classification, related issue, testing guidance, and the absence of UI media. It is mostly complete; the checklist does not explicitly address ch…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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