Skip to content

Commit d3226a7

Browse files
authored
Merge pull request #6655 from peppy/envvar-wasapi-experiment
Allow enabling wasapi experimental initialisation via environment variable
2 parents 2ba1598 + fabadd5 commit d3226a7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

osu.Framework/FrameworkEnvironment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static class FrameworkEnvironment
2121
public static bool NoStructuredBuffers { get; }
2222
public static string? DeferredRendererEventsOutputPath { get; }
2323
public static bool UseSDL3 { get; }
24+
public static bool UseWasapi { get; }
2425

2526
/// <summary>
2627
/// Whether non-SSL requests should be allowed. Debug only. Defaults to disabled.
@@ -55,6 +56,8 @@ static FrameworkEnvironment()
5556

5657
// Desktop has many issues, see https://github.com/ppy/osu-framework/issues/6540.
5758
UseSDL3 = RuntimeInfo.IsMobile || (parseBool(Environment.GetEnvironmentVariable("OSU_SDL3")) ?? false);
59+
60+
UseWasapi = parseBool(Environment.GetEnvironmentVariable("OSU_AUDIO_WASAPI_EXPERIMENTAL")) ?? false;
5861
}
5962

6063
private static bool? parseBool(string? value)

osu.Framework/Threading/AudioThread.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,10 @@ internal bool InitDevice(int deviceId)
138138
if (!Bass.Init(deviceId, Flags: (DeviceInitFlags)128)) // 128 == BASS_DEVICE_REINIT
139139
return false;
140140

141-
// Need to do more testing. Users reporting buffer underruns even with a large (20ms) buffer.
142-
// Also playback latency improvements are not present across all users.
143-
// attemptWasapiInitialisation();
141+
// That this has not been mass-tested since https://github.com/ppy/osu-framework/pull/6651 and probably needs to be.
142+
// Currently envvar gated for users to test at their own discretion.
143+
if (FrameworkEnvironment.UseWasapi)
144+
attemptWasapiInitialisation();
144145

145146
initialised_devices.Add(deviceId);
146147
return true;

0 commit comments

Comments
 (0)