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

E. Wing ewmailing at gmail.com
Wed Jul 22 18:39:10 PDT 2009


>> 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.
>>
>
>> 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.
>>

Chris, thanks for the detailed information. This is very helpful to me.

>> 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);
>>
>
> That query is not in the spec.  It might have been added as an extension
> (you'd probably know that better than me), but it's not a standard
> query.  The only standard way to get the number of available sources is
> to generate them until you get an error.
>
> This might be another good candidate for a 1.2 spec, although I don't
> know the hardware implications of it.  I think DS3D had a query for
> this, though, so it shouldn't be a problem...
>
>
> Since there's no standard query for available sources, most apps will do
> this, although they also typically have their own artificial cap (give
> me as many sources as you can, up to 256).  The old SI didn't have an
> arbitrary limit, so an artificial cap was necessary.

I have seen ALC_MONO_SOURCES and ALC_STEREO_SOURCES with respect to
the attribute list you can pass alcCreateContext. According to the
spec, these are officially recognized values, but it is very unclear
what these actually do.

When sniffing around the Mac OS X source code, I discovered that these
are the only 2 attributes Mac seems to not throw away. But the default
for for ALC_MONO_SOURCES is 0 and the default for ALC_STEREO_SOURCES
is 1. I'm expecting these are just optimization hints for the Mac
implementation and these might change especially if you start throwing
more stereo sources at the system. But I'm only speculating without
actually testing it. I don't know what if any performance advantages
there are to setting this.

But from this implementation and reflecting what Jason says, I don't
think the query will give me the number of available sources.

Thanks for the ideas though. This has been a good discussion for me.

Thanks,
Eric


More information about the Openal mailing list