From c0da41a18aeb8b2fc911618a136f8b5cdb3e561a Mon Sep 17 00:00:00 2001 From: Gustas Date: Mon, 30 Oct 2023 17:34:28 +0200 Subject: [PATCH] Increase sound source pool size to the maximum --- OpenRA.Platforms.Default/OpenAlSoundEngine.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs index 7291dc6d99..fd40e5be71 100644 --- a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs +++ b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs @@ -49,7 +49,10 @@ namespace OpenRA.Platforms.Default const int MaxInstancesPerFrame = 3; const int GroupDistance = 2730; const int GroupDistanceSqr = GroupDistance * GroupDistance; - const int PoolSize = 32; + + // https://github.com/kcat/openal-soft/issues/580 + // https://github.com/kcat/openal-soft/blob/b6aa73b26004afe63d83097f2f91ecda9bc25cb9/alc/alc.cpp#L3191-L3203 + const int PoolSize = 256; readonly Dictionary sourcePool = new(PoolSize); float volume = 1f;