Fix macOS VoiceProcessingIO input setup for screenpipe AEC.#3
Merged
louis030195 merged 4 commits intoMay 23, 2026
Merged
Conversation
Disable the VPIO output bus, apply AEC properties on both IO elements, stop forcing sample rate before unit creation, and add screenpipe_aec() defaults for callers.
2ebf1b3 to
9fb6ce2
Compare
…port - configure_voice_processing_stream_format: widen sample rate match from f64::EPSILON to < 1.0 Hz; log actual vs requested rates on mismatch - set_sample_rate: use containment check (mMinimum <= rate <= mMaximum) instead of point equality so USB/virtual devices with continuous ranges (Focusrite, BlackHole, Loopback) no longer get StreamConfigNotSupported - AudioObjectSetPropertyData: pass target rate as bare f64 with sizeof(f64) instead of AudioValueRange struct (was correct by accident for discrete-point devices only) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
88f30d8 to
bf174e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change corrects how
cpalbuilds macOS input streams whenMacosVoiceProcessingInputConfigrequests VoiceProcessingIO (used for acoustic echo cancellation on the default microphone). The previous setup enabled both input and output IO on the unit, applied some properties only on the output element, and forced the device nominal sample rate before creating the unit.What changed
configure_voice_processing_io,apply_voice_processing_property, andapply_voice_processing_flagsso bypass, AGC, mute-output, and ducking properties are applied on both Input and Output unit elements (matching how Apple’s VoiceProcessingIO properties are scoped).K_AU_VOICE_IO_MUTE_OUTPUTand set mute output to off as part of the default flag application.set_sample_rate()on the device before creating the VoiceProcessingIO unit; let the unit use the hardware rate.