Skip to content

Commit

Permalink
Always try a VoiceProcessingIO AudioUnit
Browse files Browse the repository at this point in the history
The drift correction provided by aggregate devices has proven unreliable
as a usb input paired with builtin or connected analog speakers often
underruns within a few minutes, depending on clock drift.

The VoiceProcessingIO AudioUnit handles drift properly.
This patch will try to set up the VoiceProcessingIO AudioUnit whenever
we're in duplex. This patch also sets up a failover path so that if setting up
the VoiceProcessingIO AudioUnit fails, we try an aggregate device or a plain
AudioUnit, in that order.

For now, always in bypass mode, as we don't yet have an api to toggle
audio processing features dynamically. Note that the VoiceProcessingIO
AudioUnit will implicitly enable audio ducking in the platform.
  • Loading branch information
Pehrsons committed Oct 24, 2023
1 parent 4ff71d8 commit 04a5bdb
Show file tree
Hide file tree
Showing 2 changed files with 289 additions and 100 deletions.
5 changes: 4 additions & 1 deletion run_device_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ cargo test test_plug_and_unplug_device -- --ignored --nocapture

cargo test test_register_device_changed_callback_to_check_default_device_changed_input -- --ignored --nocapture
cargo test test_register_device_changed_callback_to_check_default_device_changed_output -- --ignored --nocapture
cargo test test_register_device_changed_callback_to_check_default_device_changed_duplex -- --ignored --nocapture

# FIXME: The test will hang if the default input or output is an aggregate device (and VoiceProcessingIO is)
# cargo test test_register_device_changed_callback_to_check_default_device_changed_duplex -- --ignored --nocapture

cargo test test_register_device_changed_callback_to_check_input_alive_changed_input -- --ignored --nocapture
cargo test test_register_device_changed_callback_to_check_input_alive_changed_duplex -- --ignored --nocapture

Expand Down
Loading

0 comments on commit 04a5bdb

Please sign in to comment.