Repository navigation
fix(macos): activate native VoiceProcessingIO and make capture callback safe - #6
Merged
Merged
Conversation
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.
Requesting
MacosVoiceProcessingInputConfig::screenpipe_aec()through the public dynamiccpal::Devicesilently opened AUHAL. The wrapper inherited the trait default, which discarded the option. Forwarding it exposed further native setup and lifecycle failures.This forwards the option, builds an uninitialized native VoiceProcessingIO unit, binds microphone/output to the correct buses, keeps duplex output alive with a silent render callback, and verifies required processing properties. The native input callback uses aligned preallocated storage sized after initialization, avoiding the coreaudio-rs format-query/resize callback that deadlocked against
AudioOutputUnitStopduring hardware retesting. Native render errors now reach CPAL's error callback.Validation on Apple Silicon / macOS 26.6.2, built-in microphone and speakers:
AudioUnit(InvalidProperty)when checking VPIO. AudioUnit creation trace confirmsahal.vpio; required bypass/AGC/mute, duplex output, and both device bindings read back correctly.cargo +1.94.0 test --lib: 3 pass, 2 opt-in hardware tests ignored.cargo +1.94.0 check --all-targets: passes.cargo +1.94.0 test --lib live_ -- --ignored --test-threads=1: 2 pass in each of five consecutive runs, covering 20 VPIO start/capture/stop cycles at 16/48/96 kHz and bypass, plus five raw-path checks. Zero callback errors.vpio_probeexample are inVPIO-VALIDATION.md.Draft because activating previously skipped native processing changes actual device behavior. Acoustic leakage was lower in exploratory tests, but ducking affects playback level, so the apparent 25 dB difference is not clean ERLE. A separate unducked native experiment showed about 11 dB lower matched speech in one pair; that SPI is not used in this patch. These figures are not a cross-device quality guarantee. Double-talk, human near-end preservation, Bluetooth/USB/HDMI, route switching, Intel, older macOS, and long meetings still need hardware validation. No private microphone recordings are published.
CI snapshot on the PR head: native macOS, Ubuntu, clippy, rustfmt, Android check, and wasm-bindgen jobs passed. WASI fails before compilation because stable no longer supplies
wasm32-wasi; the Emscripten job fails in unchanged wasm bindings. Both job names also failed on the original e7edfa1 main run: https://github.com/screenpipe/cpal/actions/runs/28710085009. Other jobs remain in progress. This is not an all-green CI claim.Screenpipe integration: screenpipe/screenpipe#7285.