[openal] Increasing limits

Chris Robinson chris.kcat at gmail.com
Wed Feb 22 02:15:23 EST 2017


I've had people ask about increasing the limit on the number of effects 
in OpenAL Soft, and I've managed to handle it in a way that stays within 
the internal design for the mixer. Recent Git commits have increased the 
default number of effect slots from 4 for 64, and the maximum number of 
source sends from 4 to 16.

Note that for the source sends, by default you'll only get 2 per source, 
which is the default value specified in the EFX docs (and it's a nice 
small number for apps that want one while not explicitly requesting any, 
and not wasting much). If you want more than 2 source sends, you need to 
request it using ALC_MAX_AUXILIARY_SENDS with alcCreateContext or 
alcResetDeviceSOFT. You should try to avoid requesting more than you'll 
actually need, since there is some (minimal, but some) cost to having 
them even if they're not sending to anything.

The effect slots will have a much bigger cost, the more you have. Even 
if no sources are feeding them, they'll still run their processing since 
they can generate samples independent of active input (e.g. a long 
reverb tail). Setting a null effect (AL_EFFECT_NULL) on it can alleviate 
much of its processing, but there's still some.


On the topic of limits, if anyone's willing to help I'd like to test 
what happens with a higher source or effect slot limit with as many apps 
as possible. Set something ridiculous in the config file, like

[general]
sources = 1000000
slots = 1000000

and try to find an app that has problems with it (crashes, runs out of 
memory, stutters, or just uses an excessive amount of CPU or memory). 
Ensure apps actually uses those values; set the ALSOFT_LOGLEVEL 
environment variable to 3 and check the trace log output (in stderr by 
default), it is possible for processes to block access to random user 
files so make sure to check each one. It could also take some time while 
running, if apps lazily generate sources. If enough apps can be verified 
to have little to no issue, I may remove the default limits for them.


More information about the openal mailing list