[Openal] Max number of sources (and legit id values) for each OpenAL implementation

Chris Robinson chris.kcat at gmail.com
Wed Jul 22 15:10:27 PDT 2009


On Tuesday 21 July 2009 1:35:34 am E. Wing wrote:
> Hi, I am writing some stuff about OpenAL and I would like to get my
> facts straight. Can people verify my information about the maximum
> number of sources?
>
> Creative Labs:
> I recall seeing this in an old mailing list thread.
> Generic Software: 256
> Generic Hardware: 16-64

Note that the Generic Hardware device depends on the hardware. It uses 
DirectSound3D, so if that reports >64 (or even >256) voices, that's how many 
you can get.

AFAIK, you can get the maximum number of sources by:

ALCint nummono, numstereo;
alcGetIntegerv(device, ALC_MONO_SOURCES, &nummono);
alcGetIntegerv(device, ALC_STEREO_SOURCES, &numstereo);

printf("Max sources: %d\n", nummono+numstereo);

I'm not sure what the values for the mono/stereo sources actually mean (as 
Creative's software driver and openal soft report 1 for stereo sources, which 
is definitely not the maximum they can do, while the rest of the allocated 
sources are given as mono), but adding them together seems to provide the 
number of allocatable sources.

> OpenAL Soft:
> >From the source code, I do see a hard coded value of 256, but there is
>
> other conditional stuff in there so I'm thinking there might be other
> potential values?

OpenAL Soft lets the user pick the maximum number of sources in its config 
file, in case of apps maxing out the number of playing sources on slower 
systems that have trouble keeping up with the mixing. By default it provides 
256.. I could've made it virtually unlimited (ie. up to 2 billion, depending 
on available memory), but I cautioned against that in case there were apps 
that allocate as many sources as the system will provide.


More information about the Openal mailing list