[Openal] GetMaxSources
dpeacock at creativelabs.com
dpeacock at creativelabs.com
Thu Oct 16 09:21:02 PDT 2003
Hi Tristan,
In the 'DirectSound3D' device the maximum number of sources is calculated
by actually trying to create as many HARDWARE Direct Sound 3D buffers as
possible. Note - there is a call in DirectSound to get the capabilities
of a device (which includes how many 3D buffers the hardware can play
simultaneously ... but this is so often wrong (due to drivers that
incorrectly report their caps) that it is never a good idea to trust it !
The 'DirectSound' device and 'MMSYSTEM' devices are artificially capped at
some number (I think it's 32 of the top of my head). Theoretically they
could play as many sources as you wanted - but there will of course be some
performance penalty for doing that.
Regarding WinAmp --- this application probably does not create a hardware
buffer (and it definitely isn't a 3D buffer) - so it doesn't matter if an
Open AL (or a Direct Sound) application has grabbed all the available
hardware 3D voices. WinAmp can still run (and produce audio !).
Dan
Tristan <tri at telus.net>
Sent by: To: openal at opensource.creative.com
openal-admin at opensource.c cc:
reative.com Subject: Re: [Openal] GetMaxSources
10/16/03 12:35 AM
Hi,
I also do something similar. However, I'm curious how OpenAL in win32
(or dsound underneath?) decides what the maximum is. On my system I get 30
available sources... but I noticed that other applications (winamp say)
still work even if started after my app grabs the sources.
I suppose I'm asking if it's always safe to grab as many voices (sources)
as possible, or is it wiser to figure out the maximum, free the sources,
and then grab slightly fewer, so that other apps are guaranteed to have a
few available.
thx
--tristan
At 09:24 AM 14/10/2003 -0700, you wrote:
>Hi,
>
>There is no single function call to accomplish this I'm afraid. You need
>to do something like this :-
>
>#define MAX_SOURCES 256
>
>ALuint MySources[MAX_SOURCES] = { 0 };
>ALuint NumSources = 0;
>
>alGetError();
>for (uint loop = 0; loop < MAX_SOURCES; loop++)
>{
> alGenSources(1, &MySources[loop];
> if (alGetError() != AL_NO_ERROR)
> break;
> NumSources++;
>}
>
>Dan
>
>
>
>
>
> "Èáryfuk"
>
> <sim22um at axpsu.fpf.slu.cz To:
> <openal at opensource.creative.com>
> > cc:
>
> Sent by: Subject: [Openal]
> GetMaxSources
> openal-admin at opensource.c
>
> reative.com
>
>
>
>
>
> 10/14/03 07:22
> AM
>
>
>
>
>
>
>
>
>
>
>
>Hi.
>
>Is there any elegant way in OpenAL to get max hardware sources, that is
>supported by particular sound card?
>
>Thanx
> Michael
>
>
>
>_______________________________________________
>openal mailing list
>openal at opensource.creative.com
>http://opensource.creative.com/mailman/listinfo/openal
_______________________________________________
openal mailing list
openal at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal
More information about the Openal
mailing list