OpenAL cannot create/destroy >256 channels

Archives Forums/BlitzMax Bug Reports/OpenAL cannot create/destroy >256 channels

Grey Alien(Posted 2011) [#1]
Summary:
If I create and destroy >256 channels with OpenAL, the new ones won't play sounds.

OS/Driver Details:
This is a problem with with OpenAL on my Win 7 64-bit PC (and on the Vista/Win 7 machines of many of my games' players according to the BFG forums + other forum members here). My game framework uses OpenAL for my Vista/Win 7 games and Freeaudio for XP. I have Realtek onboard audio and expect many others have too. I have tried several different versions of the OpenAL dlls.

Cause:
I'm creating with theChannel = AllocChannel() and then calling StopChannel(theChannel) and then setting theChannel to null.

If I do this >256 times no sound plays on the new channels (but the game doesn't crash). This can occur easily in a game where I say allocate 32 channels to a TLevel object that I kill and recreate (along with the sound channels) every time the player reaches a new level. 8 levels later, the player has no sound.

FreeAudio comparison:
If I use Freeaudio it's fine. This means it's an OpenAL bug or a "Blitz implementation of OpenAL" bug (there have been OpenAL channel bugs that were fixed in the past back when I was making the framework, so it's possible some still exist). Or maybe it's just how OpenAL works with Win 7 and my current sound card, who knows? However, it would be great if this can be investigated more by the code masters at BRL!

Workaround:
I changed my code to have only global sound channels that are not created/destroyed every level.


Armitage 1982(Posted 2012) [#2]
Got the same problem here!

Using global sound channels isn't great for me cause you can choose between PulseAudio and OpenAL :(


Armitage 1982(Posted 2012) [#3]
Please, can you fix this problem ?

FreeAudio is not working correctly, PulseAudio is an interesting alternative but can crash under Linux (like this game for example : http://www.moddb.com/games/little-space-duo ), and OpenAL have Buffer limitation.

So I guess most game out there using BlitzMax have sound issues. Isn't it serious enough to address the problem ?

Thanks


marksibly(Posted 2012) [#4]
Hi,

I think I may have finally found this...

> FreeAudio is not working correctly,

My sample code for the above problem works OK in freeaudio:




Grey Alien(Posted 2012) [#5]
Thanks Mark! Freeaudio has always worked fine for me, except for the delay in Windows Vista/7 which is why I use OpenAL for those OSes.