Dictamic
July 18, 2026 · View on GitHub
dicta·mic — an adaptive microphone pipeline for dictation.
Fix terrible voice-recognition / dictation accuracy from your laptop's internal microphone on Linux (PipeWire).
Many laptops — especially those with Realtek HDA codecs like the ALC257 —
have a nasty trap: the desktop microphone volume slider maps directly onto
analog gain stages (Capture up to +30 dB plus Internal Mic Boost
up to +30 dB). Anywhere near the top of the slider, speech saturates the
ADC. The result is clipped, crackling audio that no app, filter, or
software AGC can repair — because the damage happens before the digital
domain. Speech-to-text accuracy collapses while the mic still "works."
Two more common aggravators:
- HDA power-save wake-up pop: with
snd_hda_intel power_save=1the codec suspends after ~1 s idle, and on resume some ADCs rail at full scale for ~0.5 s — every recording starts with a deafening pop that confuses recognizers. - Aggressive VAD/gating filters (e.g. Speex voice-activity detection) that chop word onsets.
What this package does
mic (fixed, conservative analog gain — slider stays ~35%)
│
▼
PipeWire module-echo-cancel (WebRTC audio processing)
• adaptive gain control — adapts to room, distance, mic
• noise suppression • high-pass filter • echo cancellation
│
▼
virtual source "ASR Mic (AGC + noise suppression)" → set as default input
The analog stage keeps generous headroom so speech can never clip; the WebRTC AGC (the same engine browsers and Zoom use) levels speech digitally per environment. Works identically for any plugged-in mic — keep its raw device volume low and the AGC does the rest.
Measured on the reference laptop (30 s speech test, internal mic):
| Metric | Before | After |
|---|---|---|
| Clipped samples | hundreds–thousands | 0 |
| Noise floor | −34 dB | −54 dB |
| Speech level | rail-to-rail | ~−10 dB, AGC-held |
| Startup pop | 0.5 s full-scale rail | none |
Also included: Dictamic, a small GTK app showing pipeline status, a live level meter of what apps actually hear, a bypass toggle, and an autostart-at-login option.
Install
From the latest release:
sudo apt install ./dictamic_*.deb
systemctl --user restart pipewire pipewire-pulse wireplumber
pactl set-default-source asr_mic
Then set the raw mic's volume to ~35% (once):
pactl set-source-volume alsa_input.<your-device> 35%
Launch Dictamic from your app menu to verify: it shows whether the pipeline is running, warns if the raw volume is dangerously high, and lets you bypass/re-enable processing or enable autostart.
The wake-up-pop fix (
power_save=0) fully applies after the next reboot; the postinst applies it to the running kernel immediately.
Uninstall
sudo apt remove dictamic
systemctl --user restart pipewire pipewire-pulse wireplumber
Files installed
| Path | Purpose |
|---|---|
/etc/pipewire/pipewire.conf.d/99-asr-mic.conf | WebRTC AGC virtual source |
/etc/wireplumber/wireplumber.conf.d/99-mic-no-suspend.conf | keep ADC powered (no wake pop) |
/etc/modprobe.d/50-audio-no-powersave.conf | disable HDA power save |
/usr/bin/dictamic | GTK monitor/toggle GUI |
/usr/share/applications/dictamic.desktop | app menu entry |
Building the package
./build-deb.sh 1.1.0 # → build/dictamic_1.1.0_all.deb
Tuning
- Never push the raw device volume past ~50% — that's where the slider starts engaging analog boost and clipping returns. ~35% is the sweet spot on the reference hardware (speech peaks ≈ −10…−6 dBFS pre-AGC).
- If a recognizer prefers rawer audio, disable noise suppression by setting
webrtc.noise_suppression = falsein99-asr-mic.conf(AGC alone is usually the win). - ASR/dictation apps should record from the default source (
asr_mic).