From d5e7769e480a617bfed01511786bc7a083249bf0 Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Wed, 20 Nov 2024 00:03:30 +0100 Subject: [PATCH] Don't use VPIO forcelist by default (#244) 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 5a02896..93a9ad1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ itertools = "0.11" [features] audio-dump = [] +vpio-forcelist = [] gecko-in-tree = ["cubeb-backend/gecko-in-tree"] # Workaround for https://github.com/rust-lang/cargo/issues/6745 to allow this diff --git a/src/backend/mod.rs b/src/backend/mod.rs index e320d02..b5bdd8e 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,