OpenAL in Windows 7

BlitzMax Forums/BlitzMax Programming/OpenAL in Windows 7

Grey Alien(Posted 2011) [#1]
Has anyone else had trouble with OpenAL and BlitzMax 1.41 on Windows 7? I've done a big forum search but not come up with anything conclusive.

Some Fairway Solitaire customers have complained about the sound dropping out intermittently and I have got the same. It seems that if I play a few rounds, some sounds stop playing, but others are fine. Probably ones where I'm destroying and remaking the channels or something. I tested OpenAL a ton on Vista back in the day and I'm sure BFG tested it on Windows 7 too. So something is up (could be my Realtek on-board sound or my 64-bit Windows 7 I guess)

If I flip to FreeAudio it's fine. However, I haven't been using FreeAudio in non-XP systems since back in the day when it was discovered that FreeAudio could have up to 1 second lag on Vista machines. ***Does anyone know if that still happens and if it affects Windows 7 too?*** If it was fixed, then I guess I can switch back to FreeAudio and ignore OpenAl (yay!)

More info: I've used two different version of OpenAL. One from 2007 that worked fine in Vista back then, and a newer one from 2010. The OpenAL32.dll and wrap_oal.dll are in the exe folder. There was some debate in another thread http://www.blitzmax.com/Community/posts.php?topic=88180 about if the exe would use those dlls instead of ones installed in the system folder, but I believe the conclusion was that it would work fine, except some doubt was thrown up at then end. Gah!

Thanks for any insights you can offer.

Last edited 2011


GfK(Posted 2011) [#2]
I used OpenAL for Magicville:

OpenAL32.DLL - v6.14.0357.22
wrap_oal.dll - v2.1.8.1

Six-figure downloads and not a single person reported any sound problems.

On the other hand - I had the exact problem you describe with OpenAL on the OSX version and ended up using FreeAudio instead.

[edit] Just noticed OpenAL has not been updated (according to the OpenAL site) since summer 2009? Does that mean the whole project is stone dead?

Last edited 2011


Tachyon(Posted 2011) [#3]
I have complained about OpenAL in Windows before. If the end user has a outdated or misconfigured OpenAL driver, EnableOpenALAudio() will crash the system without any error. I have dealt with this problem with at least 15 customers.

The problem seems to arise when the user switches sound cards, or adds a sound card after using on-board audio. I guess the OpenAL drivers get borked then, and it caused problems.

I will not use OpenAL in future games.

Last edited 2011


GfK(Posted 2011) [#4]
I will not use OpenAL in future games.
FreeAudio, then? Is it safe on Vista/7 now?


Tachyon(Posted 2011) [#5]
DirectX is what Vista/7 defaults to. It works fine. Last time I checked FreeAudio was okay as well.


GfK(Posted 2011) [#6]
After the way DirectSound and FreeAudio used to be, I'd have to see some large scale testing before I put faith in either.


Grey Alien(Posted 2011) [#7]
Tanks for the info guys. So TMK, it's possible to screw up OpenAL due to installing a different sound card even with the dlls in the exe folder? The issue on my PC is it works, but then the sounds start to disappear, most odd.

Yeah those other drivers used to be crap. Freeaudio had a really bad lag and DX was noisy and sometimes choppy on some systems, which is why I was using OpenAL Perhaps that has changed...


GaryV(Posted 2011) [#8]
Freeaudio had a really bad lag and DX was noisy and sometimes choppy on some systems, which is why I was using OpenAL Perhaps that has changed...
Vista had some serious issues with the new audio stack. MS fixed most of these with Windows 7. Have you had the issues on 7 too or just Vista?


Grey Alien(Posted 2011) [#9]
I never tested FreaAudio on 7 back in the day as it wasn't available, so I've only seen the FreeAudio lag on Vista.


CGV(Posted 2011) [#10]
I play Fairway Solitaire on Win7 64bit quite a bit and have always had sound problems with it. I always chalked it up to the price of going 64bit and didn't complain.

I tried switching my game to FreeAudio but when I relaunched it, it switched back to the OpenAL Generic Software driver.

In fact when I hit the H key it just toggles between FreeAudio and none with silence either way. Then when I relaunch it reverts back to OpenAl.


Grey Alien(Posted 2011) [#11]
@CGV: OK interesting to know you also have sound problems on 64-bit too, thanks. On board Realtek by any chance?

Yep my framework detects non-XP and always uses OpenAl. Flipping to FreeAudio mid-game doesn't work as all the sounds need to be reloaded - the flip just stores the chosen driver for the next time it's loaded.


CGV(Posted 2011) [#12]
Yep, Realtek.

I flipped the driver using the debug keys, then shut down the game and reloaded it but it went back to OpenAL all by itself.

Is that what's supposed to happen?

I even tried editing the .ini file itself but it again restored itself to OpenAL.


Grey Alien(Posted 2011) [#13]
Yes it forces OpenAL on Win7. XP let's you rotate them.


Grey Alien(Posted 2011) [#14]
So did we conclude anything here? Is OpenAL is flawed on Win 7 64-bit but OK on Win 7 32-bit and Vista? Should I use FreeAudio or maybe DirectX on Win 7 64-bit? (need to figure out how to detect that particular OS). Or should I just change to DirectX for all OSes despite it being less than stellar in the past? Maybe we should let users choose a sound driver in options (not very "casual")?

Us devs that are making commercial games need to get a handle on this otherwise we are losing sales, and will lose more in the future as people shift away from XP.


Richard Betson(Posted 2011) [#15]
I can add that OpenAL is 'Not' included in Win7 64bit for sure. You will have to install it. I ran across this when using MS VS 2010 Express, since the free version is 32bit. Once I installed all was well.

You can get it here:
http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx
http://connect.creativelabs.com/openal/Downloads/oalinst.zip

L8r,

Last edited 2011


Muttley(Posted 2011) [#16]
OpenAL has never been included with any version of Windows.

It may very well have been installed as part of Creative sound card drivers occasionally, as they were the original driving force behind OpenAL. It may also be installed alongside various commercial games that use it.


Grey Alien(Posted 2011) [#17]
Yes that's true.


SLotman(Posted 2011) [#18]
I just use Direct Sound on Windows, and OpenAl (or FreeAudio if OpanAl not available) on Linux - never had a complaint, or heard any problem about it.


CGV(Posted 2011) [#19]
So did we conclude anything here? Is OpenAL is flawed on Win 7 64-bit but OK on Win 7 32-bit and Vista?

I don't have any sound problems with Gumball Roundup on Win7 64bit using the OPenAl driver or with therevills' "The Bloobles" or his two freeware games Uno and Spitfire Attack, so I would venture it's not the driver itself that's causing the problem but your destroying and remaking the channels.

I'm just loading and playing the sounds in the normal framework fashion and I guess therevills is too.


Grey Alien(Posted 2011) [#20]
I'll see if I experience sound issues on other games. I know that with freeaudio the same bug doesn't occur, so there must be a difference between the way the drivers are handling the destroy/remake, which ideally there shouldn't be...


therevills(Posted 2011) [#21]
Yeah CGV is right. I havent heard of any issues with my GAF games... also I havent heard the problem either.


Grey Alien(Posted 2011) [#22]
Ok thanks.


Grey Alien(Posted 2011) [#23]
Bringing this thread back alive because there is definitely a problem with OpenAL on my Win 7 64-bit PC. If I create and destroy >256 channels, the new ones won't work.

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

If I use Freeaudio it's fine. This means it's an OpenAL bug or 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?

When I have time, I should write a simple test app.

Last edited 2011


Grey Alien(Posted 2011) [#24]
Bumping this in case anyone knows of any OpenAL fixes that have been made in the last few versions of BlitzMax. It's a definite problem with >256 channels being created/destroyed (see above), and in the absence of any new info I'm going to alter the Fairway Solitaire code to keep the channels alive the whole time instead of cleaning them up.


xlsior(Posted 2011) [#25]
Bumping this in case anyone knows of any OpenAL fixes that have been made in the last few versions of BlitzMax. It's a definite problem with >256 channels being created/destroyed (see above), and in the absence of any new info I'm going to alter the Fairway Solitaire code to keep the channels alive the whole time instead of cleaning them up.


from version.txt:


1.44
* Turned off OpenAL debug logging!

1.38
* Fixed OpenALAudio ResumeChannel bug where an already playing channel was being rewound.

1.36
* Removed hacks from dsound and openal audio drivers to deal with resurrected objects.

1.35
* Added some ugly temporary retain/release code to directsound and openal audio drivers to handle problems with threaded GC and finalizers that 'resurrect' objects. Need a more general purpose solution...

1.34
* Fixed OpenAL delete buffer leak




Grey Alien(Posted 2011) [#26]
Thanks xlsior. It's still bugged in 1.41 and as the only change is in 1.44 it doesn't seem it's been fixed yet.

I've fixed/recompiled all my games and am submitting them to portals again due to large number of Win7 machines in use.

Posting in bug forum.


GfK(Posted 2011) [#27]
Ditched OpenAL. I'm just using whatever the default is (I forget) for Crime Solitaire. Not a single problem has been reported on Mac or PC, and you can probably estimate how many downloads/sales Crime solitaire has had.


Grey Alien(Posted 2011) [#28]
Here's the bug report: http://www.blitzbasic.com/Community/posts.php?topic=96082


Grey Alien(Posted 2011) [#29]
GfK: It's just that Direct Sound used to be really crappy (crunchy, loud etc) and unreliable, and FreeAudio had that massive lag on Vista, so OpenAL was the solution I chose, and it was great. Thing is back then, I probably didn't test for long enough on Vista to spot the 256 channel issue. I'm guessing the default is now DirectSound?


GfK(Posted 2011) [#30]
Just checked (here) and yeah the windows default is DirectSound, and FreeAudio for Mac.


Grey Alien(Posted 2011) [#31]
Thanks. I think my DirectSound woes may have been when testing on 98 back when my framework was new actually. In that thread Slotman said FreeAudio had lag in XP, I've never heard of that before though, so I've challenged it.