openAL determining max-sources

9e8e9afb595cf6ad18ad67d255796f1c
0
kitt3n 101 Jan 06, 2005 at 18:09

I’d like to know how I can find the number of sources which are
available for openAL

In alSource.c they do sth like
{
ALCdevice *Device;
if ((Context->SourceCount + n) <= Device->MaxNoOfSources)

}

which is exactly what I want… unfortunately in the ‘al.h/alc.h/alctypes.h/…
the structure ‘ALCDevice’ is not defined (empty struct)! After searching I
found it in another include-dir which apparently is not meant for public use
(in the file alMain.h).
I guess this is done to not expose the data for future updates…

Obviously I can just continue creating sources in a loop untill it fails
and then destroy them all again, but that’s not really elegant either,
is it…

So is there a normal way to determine how many sources openAL
can handle?

tia
Roger

4 Replies

Please log in or register to post a reply.

8e14457388f62214007474121fa0ff8a
0
hh10k 101 Jan 07, 2005 at 12:29

You are actually meant to allocate all the sources you need at the start, and free them all at the end. It’s a bad idea to create and destroy sources over and over because some versions of OpenAL have ‘issues’ with that. If you need all the sources you can get, then make sure you add a limit like 32 or 64, because the NVIDIA OpenAL version will let you keep allocating until it BSODs, and I’ve heard some software implementations also have no limit. A real method to find the number of hardware sources will probably be in the next version (last I heard).

9e8e9afb595cf6ad18ad67d255796f1c
0
kitt3n 101 Jan 07, 2005 at 14:47

@hh10k

You are actually meant to allocate all the sources you need at the start, and free them all at the end. 

I know - actually the problem started when I used ‘32’ as max-sources for
voices (and adding 1 or 2 for music/video-sound). My comp at work
(SB-Audigy apparently doesn’t have a problemwith that), but at home it
was (sometimes) failing (SB-Live!) - maybe depending on if
I had winamp running or sth.

After putting the maxsources for voice down to 16 it all works…
So that was why I’d like to know if there is a function or sth to determine
how many I’m allowed to take (instead of doing crazy things to figure that
out) - so apparently there is not.

There is work-in-progress on a next version of openAL? Cool, I thought work
on openAL was more or less frozen…

8e14457388f62214007474121fa0ff8a
0
hh10k 101 Jan 07, 2005 at 15:06

@kitt3n

There is work-in-progress on a next version of openAL? Cool, I thought work
on openAL was more or less frozen…

I wouldn’t say it’s frozen, but they aren’t exactly jumping onto it :) I’m still waiting for a non-beta Ogg wrap_oal.dll…

F3ff2088fe22d64396b949f149628107
0
SpreeTree 101 Jan 07, 2005 at 16:27

@hh10k

I’m still waiting for a non-beta Ogg wrap_oal.dll… [snapback]14972[/snapback]

Isnt that meant to be arriving this summer on Windows platforms (I know nothign about Linux…).

Hopefully the version they release will tighten up a few things, make it less twitchy to totally breaking down sometimes… I would prefer not to use FMod for the rest of my live, in case I ever realse any shareware stuff in the future…

Spree