OpenAL - no distance attenuation on Vista?

Started by
28 comments, last by BS-er 15 years, 5 months ago
Hey all, For some unknown reason, when I play my game on my new computer (vista) there is no distance attentuation. By this I mean sounds SHOULD be quieter the further away they are from the listener object.. however, on my new computer they are not - they play at maximum volume no matter what the distance. I know this isn't a problem with my game logic, because when I play the game on my older computer (xp) there IS distance attenuation, which means that I've set up the listener and source objects correctly. So I don't know if it's a Vista thing.. or just this specific computer.. but something is going wrong. Because running the exact same executable on these 2 computers is producing different results. Furthermore, when I ran it on both computers, I was including these 3 necessary files in the same folder as the .exe: alut.dll OpenAL32.dll wrap_oal.dll So it should be using the same .dll files as well! I tested that it actually was using each of these files by removing each one of them separately and trying to the run the program, and it wouldn't work. So I know that it's not using some version in system32 or something. Anyway, same executable, same .dlls.. different computer, different result. It's weird I say.. DAMN WEIRD!! Any ideas? Thanks, Ben.
--------------------------Check out my free, top-down multiplayer shooter: Subvein
Advertisement
What OpenAL device is it using? It's nice that manufacturers can write their own OpenAL drivers, but I've had some problems with buggy ones in the past. Try forcing DirectSound by renaming wrap_oal.dll to OpenAL32.dll, or do away with those DLLs and install the redist.
What do you mean by OpenAL device?

I just got my friend who also has Vista to test this distance attenuation, and he had the same problem.

I went to the openAL website and found this link regarding Vista and OpenAL:

http://connect.creativelabs.com/openal/OpenAL%20Wiki/OpenAL%C2%AE%20and%20Windows%20Vista%E2%84%A2.aspx

It didn't really provide any solutions.. but had this to say:

"
OpenAL on Windows Vista
As already stated above, Microsoft® will be removing DirectSound 3D Hardware support from Direct X with the launch of Windows Vista. DirectSound and DirectSound3D will still function; however, they will no longer use hardware acceleration.

The native OpenAL devices on Sound Blaster Audigy and Sound Blaster X-Fi™ soundcards do not use DirectSound or DirectSound 3D and so they will be completely unaffected. For games that use these devices, nothing will change. The game will continue to enjoy hardware based 3D audio and effects.

The Generic Hardware device will no longer be available, as it requires the use of hardware DirectSound 3D Buffers. Instead, this device will gracefully, and automatically, fallback to using the Generic Software device, which will continue to work as before.
"


I'm not entirely sure what to make of this.. but would this suggest that I'm using "The Generic Hardware" device, which is why I'm not getting the nice 3D sound that I require?


--------------------------Check out my free, top-down multiplayer shooter: Subvein
This page talks about the different OpenAL devices.

I must admit that I've never really played with "Generic Software" (aka DirectSound non-3D), so I don't know if OpenAL does implement positional audio with it. I may have to do some tests.
Moving to Alternative Game Libraries.
I suggest to use OpenAL Soft implementation of OpenAL. It is pure software library, that does not depened on hardware features to caluclate how your sound should sound (it does not use DirectSound3D). If I remember correctly Creative OpenAL depends on DirectSound3D for 3D positional sound.
Ok, cool.

I looked into that a bit but there were a few things I'm unsure about.

1) Is it portable (windows, unix, mac).

2) Does it have any annoying licensing issues (or at least.. more annoying than OpenAL)

3) How do I install it on windows? All I found were those tarball things..


Thanks,
Ben.
--------------------------Check out my free, top-down multiplayer shooter: Subvein
1) I know that it can be build on Windows and Linux. MacOSX have their own standart OpenAL implementation (it is present in any MacOSX installation). And I think you should use that one.
2) It is LGPL licensed. So shared library is ok with whatever license you are using with your code. Static library will force LGPL (or GPL) on your code.
3) Just build dll using CMake & MSVC. Read Installing section on its page. And put OpenAL32.dll file beside your exe file. No need to install it.
Ok, well I think I figured out how to build it with CMake and Visual C++.. I configured it to Release and it successfully compiled.

I replaced the existing openal32.lib in C:\Program Files\Microsoft Visual Studio 9.0\VC\lib with the new openal32.lib. I also replaced the existing openal32.dll with the new one, and have it sitting next to my exe.

I recompiled my game with the new lib, and that worked. I double clicked on the game with the new dll, and that worked too. Everything was going fine until I started playing and there was no sound.. and now I don't know what to do.

I still have wrap_oal.dll and alut.dll sitting alongside my exe and openal32.dll, and I haven't changed any of my code. Could these be the problems? Do I have to change any of my code, or remove/updated either of the other 2 dlls?

Thx,
Ben.
--------------------------Check out my free, top-down multiplayer shooter: Subvein
You don't need wrap_oal.dll anymore. OpenAL32.dll build from OpenAL-Soft is all you need.
alut.dll will probably work with it (but I don't know, I have never used alut).
What are you using from alut? Device opening or context creation? Maybe try to get rid of it and open device/create context directly with alc functions.

Also try checking alGetError() result after some functions (after creating source/buffer objects, after starting playback).

This topic is closed to new replies.

Advertisement