@@ -2670,14 +2670,60 @@ impl<'ctx> CoreStreamData<'ctx> {
2670
2670
input_domain == output_domain
2671
2671
}
2672
2672
2673
+ fn should_block_vpio_for_device_pair (
2674
+ & self ,
2675
+ in_device : & device_info ,
2676
+ out_device : & device_info ,
2677
+ ) -> bool {
2678
+ self . debug_assert_is_on_stream_queue ( ) ;
2679
+ cubeb_log ! ( "Evaluating device pair against VPIO block list" ) ;
2680
+ let log_device = |id, devtype| -> std:: result:: Result < ( ) , OSStatus > {
2681
+ cubeb_log ! ( "{} uid='{}', model_uid='{}', transport_type={}, source={}, source_name='{}', name='{}', manufacturer='{}'" ,
2682
+ if devtype == DeviceType :: INPUT {
2683
+ "Input"
2684
+ } else {
2685
+ debug_assert_eq!( devtype, DeviceType :: OUTPUT ) ;
2686
+ "Output"
2687
+ } ,
2688
+ get_device_uid( id, devtype) . map( |s| s. into_string( ) ) . unwrap_or_default( ) ,
2689
+ get_device_model_uid( id, devtype) . map( |s| s. into_string( ) ) . unwrap_or_default( ) ,
2690
+ get_device_transport_type( id, devtype) . unwrap_or( 0 ) ,
2691
+ get_device_source( id, devtype) . unwrap_or( 0 ) ,
2692
+ get_device_source_name( id, devtype) . map( |s| s. into_string( ) ) . unwrap_or_default( ) ,
2693
+ get_device_name( id, devtype) . map( |s| s. into_string( ) ) . unwrap_or_default( ) ,
2694
+ get_device_manufacturer( id, devtype) . map( |s| s. into_string( ) ) . unwrap_or_default( ) ) ;
2695
+ Ok ( ( ) )
2696
+ } ;
2697
+ log_device ( in_device. id , DeviceType :: INPUT ) ;
2698
+ log_device ( out_device. id , DeviceType :: OUTPUT ) ;
2699
+ const APPLE_STUDIO_DISPLAY_USB_ID : & str = "05AC:1114" ;
2700
+ match (
2701
+ get_device_model_uid ( in_device. id , DeviceType :: INPUT ) . map ( |s| s. to_string ( ) ) ,
2702
+ get_device_model_uid ( out_device. id , DeviceType :: OUTPUT ) . map ( |s| s. to_string ( ) ) ,
2703
+ ) {
2704
+ ( Ok ( in_model_uid) , Ok ( out_model_uid) )
2705
+ if in_model_uid. contains ( APPLE_STUDIO_DISPLAY_USB_ID )
2706
+ && out_model_uid. contains ( APPLE_STUDIO_DISPLAY_USB_ID ) =>
2707
+ {
2708
+ cubeb_log ! ( "Both input and output device is an Apple Studio Display. BLOCKED" ) ;
2709
+ true
2710
+ }
2711
+ _ => {
2712
+ cubeb_log ! ( "Device pair is not blocked" ) ;
2713
+ false
2714
+ }
2715
+ }
2716
+ }
2717
+
2673
2718
fn create_audiounits ( & mut self ) -> Result < ( device_info , device_info ) > {
2674
2719
self . debug_assert_is_on_stream_queue ( ) ;
2675
2720
let should_use_voice_processing_unit = self . has_input ( )
2676
2721
&& self . has_output ( )
2677
2722
&& self
2678
2723
. input_stream_params
2679
2724
. prefs ( )
2680
- . contains ( StreamPrefs :: VOICE ) ;
2725
+ . contains ( StreamPrefs :: VOICE )
2726
+ && !self . should_block_vpio_for_device_pair ( & self . input_device , & self . output_device ) ;
2681
2727
2682
2728
let should_use_aggregate_device = {
2683
2729
// It's impossible to create an aggregate device from an aggregate device, and it's
0 commit comments