Skip to content

Commit 3c62ef5

Browse files
committed
Allow enabling wasapi exclusive initialisation via environment variable
`OSU_AUDIO_WASAPI_EXCLUSIVE` can now be set to `1` to test experimental exclusive WASAPI support. Hopefully reduces latency and doesn't cause adverse issues this time around.
1 parent 2ba1598 commit 3c62ef5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

osu.Framework/Threading/AudioThread.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ 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+
bool useWasapiInit = Environment.GetEnvironmentVariable("OSU_AUDIO_WASAPI_EXPERIMENTAL") == "1";
144+
if (useWasapiInit)
145+
attemptWasapiInitialisation();
144146

145147
initialised_devices.Add(deviceId);
146148
return true;

0 commit comments

Comments
 (0)