Cancel speaker echo in the packaged audio client #671
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 548 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.377
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #671"
general
weight: 0.35
jackboyla
Summary
The packaged mic/speaker client can hear its own replies on laptop speakers, interrupt playback and start another turn. This enables echo cancellation by default in
talkandlocal, so users can speak during assistant playback without headphones. Related: #151 and #668.Physical Windows laptop, using the Python client with its built-in microphone and speakers:
Implementation
pywebrtc-audioin the default installation. WebRTC AEC3 removes echo; noise suppression and gain control stay off. Its high-pass filter remains on.--no-echo-cancellationto opt out; microphone blocking also disables cancellation. Native processing failures log once and fall back to raw microphone audio.Try it
Python scripts that call the client directly must guard their entry point with
if __name__ == "__main__":because audio uses a spawned process.Behavior and cost
On a physical MacBook Air M2 at the default 16 kHz / 1024 settings, controlled Python load in the same process made the previous adapter leave nearly all echo intact in three trials, without audio warnings. The normal speech detector accepted speaker playback as speech. Batching the native calls alone restored cancellation in two matched trials.
Ten physical checks of the isolated worker under parent-process load cover default, large and automatic buffers, playback clear/resume, microphone transport and separate recorded speech during playback. Echo-only cleaned audio produced no speech detections; the separate voice still passed the normal detector. These are short physical audio checks with controlled load, not an end-to-end MLX model-pipeline test. Automatic-buffer suppression varied between runs.
Three paired Linux workstation trials, including the client and audio worker, measured:
| Mode | Idle, percent of one core | Fixed playback, percent of one core | Idle private memory |
| --- | ---: | ---: | ---: |
| Off | 1.61% | 1.92% | 79.9 MiB |
| On | 2.67% | 3.14% | 139.5 MiB |
Default 1024-sample blocks, twelve-second windows, Ryzen 9950X simulated room. Excludes model inference, fake-server and shared audio-service CPU; these are not Mac cost estimates.
Cancellation can attenuate speech during overlap, and separate devices can drift. The reported M3 Pro/MLX setup still needs a retest before treating that exact failure as resolved. Requirements, limits and processing benchmark.
Validation