OpenAL problem - channel limitations
BlitzMax Forums/BlitzMax Programming/OpenAL problem - channel limitations
| ||
I've just started using OpenAL for audio in my game since it seems to be the only thing that works in Vista (i'm coding under XP as I don't have my own copy of Vista). There seems to be a limit of 14 (0-13) active channels when using OpenAL. Try this code. You'll see I'm using a bank of 24 allocated channels over and over. Using the example below, nothing plays on channel 14 or beyond. Why?: Graphics 800,600 result = SetAudioDriver("OpenAL") If Not result Then RuntimeError("Could not open OpenAL driver!") Global MaxChans% = 24 Global chan:TChannel[MaxChans] Global chanPtr:Int = 0 initchannels() Global snd = LoadSound("C:\Program Files\BlitzMax\samples\hitoro\sounds\fall.ogg") While Not KeyDown(key_escape) Cls playSnd(snd) DrawText "Attempting to play channel " + chanPtr,10,10 Flip Delay 500 Wend Function initChannels() For N = 0 To maxChans-1 chan[N] = AllocChannel() Next End Function Function playSnd(hnd:TSound,rate:Float = 1,Pan:Float = 0) chanPtr:+1 If chanPtr>maxChans-1 chanPtr = 0 EndIf CueSound(hnd,chan[chanPtr]) SetChannelRate chan[chanPtr],rate SetChannelPan chan[chanPtr],Pan SetChannelVolume chan[chanPtr],1 ResumeChannel chan[chanPtr] End Function This code works perfectly when using FreeAudio. Is there a way to fix this limitation? Is it a bug with Blitzmax? |
| ||
I hate to tell you this, but that code actually works on my Vista set-up. When I get a chance I'll test under XP and let you know the results. |
| ||
Hmm... Just tried using "OpenAL Generic Software" instead of "OpenAL" - works fine. "OpenAL", "OpenAL Generic Hardware", and "OpenAL Default" all stop at channel 13, though. |
| ||
Works fine for me too. |
| ||
I'm hoping more people with onboard sound are going to test this. I think this is a potential time bomb. If there are going to be channel limits on certain setups, then it needs checking out. My PC uses AC97 onboard audio, which is not uncommon. |
| ||
I'm using AC97 sound (forgot my sig didn't state that). |
| ||
Yes, channels are limit by hardware. In have read, that 32 or more channels are standard. On software mixers there is normaly no limits, but 256 I think was the range. Bye the way: I have created for my own OpenAL Module a Ogg Vorbis Class that plays streamed music. So you don't have loading times of 20 or more seconds, and memory ressources of more than 20 MByte. The stream is buffered up to 3 seconds and using only a CPU time of 0 - 2% cu olli |
| ||
Why is blitz's normal sound not working in vista? is this something were all goan have to do ? are we all gona have to start using OpenAL? if so I hope Mark codes it into the default command set to save people a lot of extra work. |
| ||
the osund is broken on vista because of MS new ethos, if something is broken then remove it...dont fix it. |
| ||
Why is blitz's normal sound not working in vista? As I've said elsewhere on this forum recently - I get an unacceptable one-second "lag" when playing sounds via FreeAudio under Vista.Using DirectSound I hear nothing at all. The only solution at this time, appears to be OpenAL. |
| ||
In my Vista Setup, I got no significant delay with my AC97, but do happen on Sound Blaster Live, I think there's something to do with Creative. BTW, I used an OpenAL DLL from Torque, and everything works very fine, you can try to carry your project with that DLL. |
| ||
Works fine for me and I tried up to 128 channels. |
| ||
No problem for me using onboard sound, but I'm running it under XP. |
| ||
It's worth pointing out that with my Hi-Def toshiba laptop, I get these sound delays in *XP* too. |