@@ -130,7 +130,7 @@ protected override void OnExit()
130130 /// </summary>
131131 private readonly Bindable < int ? > globalMixerHandle = new Bindable < int ? > ( ) ;
132132
133- internal bool InitDevice ( int deviceId )
133+ internal bool InitDevice ( int deviceId , bool useExperimentalWasapi )
134134 {
135135 Debug . Assert ( ThreadSafety . IsAudioThread ) ;
136136 Trace . Assert ( deviceId != - 1 ) ; // The real device ID should always be used, as the -1 device has special cases which are hard to work with.
@@ -139,9 +139,7 @@ internal bool InitDevice(int deviceId)
139139 if ( ! Bass . Init ( deviceId , Flags : ( DeviceInitFlags ) 128 ) ) // 128 == BASS_DEVICE_REINIT
140140 return false ;
141141
142- // That this has not been mass-tested since https://github.com/ppy/osu-framework/pull/6651 and probably needs to be.
143- // Currently envvar gated for users to test at their own discretion.
144- if ( FrameworkEnvironment . UseWasapi )
142+ if ( useExperimentalWasapi )
145143 attemptWasapiInitialisation ( ) ;
146144
147145 initialised_devices . Add ( deviceId ) ;
@@ -182,10 +180,10 @@ internal static void PreloadBass()
182180 }
183181 }
184182
185- private void attemptWasapiInitialisation ( )
183+ private bool attemptWasapiInitialisation ( )
186184 {
187185 if ( RuntimeInfo . OS != RuntimeInfo . Platform . Windows )
188- return ;
186+ return false ;
189187
190188 Logger . Log ( "Attempting local BassWasapi initialisation" ) ;
191189
@@ -219,10 +217,10 @@ private void attemptWasapiInitialisation()
219217
220218 // To keep things in a sane state let's only keep one device initialised via wasapi.
221219 freeWasapi ( ) ;
222- initWasapi ( wasapiDevice ) ;
220+ return initWasapi ( wasapiDevice ) ;
223221 }
224222
225- private void initWasapi ( int wasapiDevice )
223+ private bool initWasapi ( int wasapiDevice )
226224 {
227225 // This is intentionally initialised inline and stored to a field.
228226 // If we don't do this, it gets GC'd away.
@@ -246,13 +244,14 @@ private void initWasapi(int wasapiDevice)
246244 Logger . Log ( $ "Initialising BassWasapi for device { wasapiDevice } ...{ ( initialised ? "success!" : "FAILED" ) } ") ;
247245
248246 if ( ! initialised )
249- return ;
247+ return false ;
250248
251249 BassWasapi . GetInfo ( out var wasapiInfo ) ;
252250 globalMixerHandle . Value = BassMix . CreateMixerStream ( wasapiInfo . Frequency , wasapiInfo . Channels , BassFlags . MixerNonStop | BassFlags . Decode | BassFlags . Float ) ;
253251 BassWasapi . Start ( ) ;
254252
255253 BassWasapi . SetNotify ( wasapiNotifyProcedure ) ;
254+ return true ;
256255 }
257256
258257 private void freeWasapi ( )
0 commit comments