From d0cad5f63fe2aee5f6de496009716283a548b75b Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Thu, 14 Nov 2024 08:40:54 +0100 Subject: [PATCH] Don't use VPIO forcelist by default This makes it so clients have to opt into the VPIO forcelist. It is currently mainly needed by gecko, since sites may create multiple streams to a builtin device with different prefs and processing params, and HAL audio units to builtin device are not working properly when there is a VPIO audio unit to the same builtin device on (anywhere) on the system. With the cfg flag vpio-forcelist a client can avoid VPIO altogether, by not compiling with the flag, and by never creating input streams with the VOICE pref. Should a client need to mix VOICE and non-VOICE input streams to a single device, it should enable vpio-forcelist. Fixes #242. --- Cargo.toml | 1 + src/backend/mod.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 7c7ca582..b663156d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ itertools = "0.11" [features] audio-dump = [] +vpio-forcelist = [] # Workaround for https://github.com/rust-lang/cargo/issues/6745 to allow this # Cargo.toml file to appear under a subdirectory of a workspace without being in diff --git a/src/backend/mod.rs b/src/backend/mod.rs index e320d020..b5bdd8e7 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -3266,6 +3266,7 @@ impl<'ctx> CoreStreamData<'ctx> { } #[allow(non_upper_case_globals)] + #[cfg(feature = "vpio-forcelist")] fn should_force_vpio_for_input_device(id: AudioDeviceID) -> bool { assert!(id != kAudioObjectUnknown); debug_assert_running_serially(); @@ -3283,6 +3284,11 @@ impl<'ctx> CoreStreamData<'ctx> { } } + #[cfg(not(feature = "vpio-forcelist"))] + fn should_force_vpio_for_input_device(_id: AudioDeviceID) -> bool { + false + } + fn should_block_vpio_for_device_pair( &self, in_device: &device_info,