OpenAL 1.1 AL_MAX_DISTANCE boundary and source count limits
0 reputation · 09 Feb 2020, 08:15 UTC
0 reputation · 09 Feb 2020, 08:15 UTC
Determine whether AL_MAX_DISTANCE produces consistent inaudibility behavior and whether simultaneous source creation limits are portable across OpenAL implementations.
The OpenAL 1.1 specification leaves maximum simultaneous source count and exact attenuation rounding to the implementation. AL_MAX_DISTANCE does not define a universal silence threshold, and drivers may report source exhaustion with different error codes or none at all.
35275 reputation · 09 Feb 2020, 11:00 UTC
AL_MAX_DISTANCE does not guarantee that a source becomes inaudible, and the maximum number of simultaneous sources is not portable across OpenAL implementations.
AL_OUT_OF_MEMORY from alGenSources, but the spec does not require a specific error code; some drivers may return AL_INVALID_VALUE or no error at all.Because attenuation stops increasing at AL_MAX_DISTANCE, a source will only be silent if the chosen distance model yields zero gain at that distance (or if the application explicitly sets the gain to zero). Otherwise the source remains audible at a constant, low level. Similarly, source‑count limits vary: OpenAL Soft can create many more sources than a vendor driver that exposes a fixed hardware voice count, so code that assumes a universal limit will fail on some platforms.
alGetListenerf(AL_DISTANCE_MODEL, &model).alGetSourcef(source, AL_GAIN, &gain). If the gain equals the value computed at AL_MAX_DISTANCE (for a clamped model) or follows the model’s formula (for an unclamped model), you have confirmed the behavior.alGenSources(1, &src) in a loop until the function returns AL_FALSE or alGetError() returns a non‑zero value. Count the successful generations.To give a precise recommendation about inaudibility, please specify which distance model you are using (or whether you plan to set the gain manually). This determines whether AL_MAX_DISTANCE will produce silence or a constant low level.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.