LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: EgonOlsen on September 17, 2008, 07:40:18

Title: OpenAL broken in rc2
Post by: EgonOlsen on September 17, 2008, 07:40:18
Another problem with rc2  :'( :

On my home machine, OpenAL works fine. On my work machine (SoundMAX HD Audio solution, Windows XP), this comes up:


    Inable to initialize OpenAL
    ERROR MESSAGE:
        Could not locate OpenAL library.
    STACK TRACE:
        org.lwjgl.openal.AL.create(AL.java:153)
        org.lwjgl.openal.AL.create(AL.java:104)
        org.lwjgl.openal.AL.create(AL.java:191)
        paulscode.sound.LibraryOpenAL.init(LibraryOpenAL.java:72)
        paulscode.sound.SoundSystem.newLibrary(SoundSystem.java:1707)
        paulscode.sound.SoundSystem.init(SoundSystem.java:124)
        paulscode.sound.SoundSystem.<init>(SoundSystem.java:77)
        robombs.game.sound.SoundManager.<init>(SoundManager.java:44)
        robombs.game.sound.SoundManager.getInstance(SoundManager.java:29)
        robombs.game.util.SoundUtils.loadSounds(SoundUtils.java:8)
        robombs.game.BlueThunderClient.loadSounds(BlueThunderClient.java:1418)
        robombs.game.BlueThunderClient.run(BlueThunderClient.java:472)
        robombs.game.BlueThunderClient.selected(BlueThunderClient.java:138)
        robombs.game.startup.ResolutionFrame$1$1.run(ResolutionFrame.java:25)


Replacing the dll with the one from rc1 fixes the problem and sound is playing fine again.
Title: Re: OpenAL broken in rc2
Post by: Matzon on September 17, 2008, 08:09:25
ok - I'll check that tonight
Title: Re: OpenAL broken in rc2
Post by: Matzon on September 17, 2008, 15:59:19
No problems with audio ?

Quotelwjgl-2.0rc2>java -cp jar\jinput.jar;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar; -Djava.library.path=native\win32 org.lwjgl.test.openal.OpenALInfo
Available playback devices:
    DirectSound Software on Realtek HD Audio output
    Wave File Writer
Available capture devices:
    WaveIn on Realtek HD Audio Input
    WaveIn on Realtek HD Digital input
Default device: DirectSound Software
Default capture device: WaveIn on Realtek HD Audio Input
ALC version: 1.1
ALC extensions:
    ALC_ENUMERATE_ALL_EXT
    ALC_ENUMERATION_EXT
    ALC_EXT_CAPTURE
    ALC_EXT_EFX
OpenAL vendor string: OpenAL Community
OpenAL renderer string: OpenAL Soft
OpenAL version string: 1.1
AL extensions:
    AL_EXT_EXPONENT_DISTANCE
    AL_EXT_FLOAT32
    AL_EXT_IMA4
    AL_EXT_LINEAR_DISTANCE
    AL_EXT_MCFORMATS
    AL_EXT_OFFSET
    AL_LOKI_quadriphonic
Title: Re: OpenAL broken in rc2
Post by: EgonOlsen on September 17, 2008, 17:52:07
Quote from: Matzon on September 17, 2008, 15:59:19
No problems with audio ?
On that particular machine? Actually no, albeit i can't try that Info-program ATM, because i'm not at work. I can try it tomorrow, but i doubt that it will work. Sounds work fine with LWJGL 1.x, 2.0rc1 and all other applications that i've tried. Just not with rc2.
I think the problem is, that rc2 relies on an installed version of OpenAL, i.e. on a OpenAL32.dll in the system-directory. If i rename that dll (that is present on my home but not on my work machine), rc1 still plays sound but rc2 fails even on the home machine with the same exception.
And why is the rc2 dll only one third of the size of the rc1 dll?
Title: Re: OpenAL broken in rc2
Post by: Matzon on September 17, 2008, 19:19:57
http://matzon.dk/brian/lwjgl/openal-files.zip

All of them should be renamed to OpenAL32.dll

We have switched to OpenAL Soft because its smaller, self contained (ie. does not rely on wrap_oal and others).

Please try the above. None of the should depend on the system dll afaik ?

Maybe its a compiler issue ... The RC2 has been build with the release switch, which is why its smaller.
Title: Re: OpenAL broken in rc2
Post by: EgonOlsen on September 17, 2008, 19:58:04
Ok...i've renamed the dll in system32 and tried all the dlls from your zip file. Here are the results:

MinSizeRel=fails
rc1-no-upx=works
rc1-upx=works
rc2-no-upx=fails
rc2-upx=fails
RelWithDebInfo=fails, but i don't see any additional debug information printed out!?


Does this help?

Edit: When i don't rename the OpenAL32.dll in system32, all of them work.
Title: Re: OpenAL broken in rc2
Post by: EgonOlsen on September 17, 2008, 20:31:25
Here are some outputs from the OpenALInfo program:

rc1 (no matter if OpenAL32.dll in system32 is present or not):



E:\temp\test\lib\lwjgl-2.0rc2>java -cp jar\jinput.jar;jar\lwjgl.jar;jar\lwjgl_te
st.jar;jar\lwjgl_util.jar; -Djava.library.path=native\win32 org.lwjgl.test.opena
l.OpenALInfo
Available playback devices:
    DirectSound Software on Lautsprecher (2- Realtek High Definition Audio)
    DirectSound Software on Digitales Ausgabegerõt (HDMI) (2- High Definition Au
dio-Gerõt)
    DirectSound Software on Realtek Digital Output (2- Realtek High Definition A
udio)
    Wave File Writer
Available capture devices:
    WaveIn on Realtek Digital Input (2- Realt
Default device: DirectSound Software
Default capture device: WaveIn on Realtek Digital Input (2- Realt
ALC version: 1.1
ALC extensions:
    ALC_ENUMERATE_ALL_EXT
    ALC_ENUMERATION_EXT
    ALC_EXT_CAPTURE
    ALC_EXT_EFX
OpenAL vendor string: OpenAL Community
OpenAL renderer string: OpenAL Soft
OpenAL version string: 1.1
AL extensions:
    AL_EXT_EXPONENT_DISTANCE
    AL_EXT_FLOAT32
    AL_EXT_IMA4
    AL_EXT_LINEAR_DISTANCE
    AL_EXT_MCFORMATS
    AL_EXT_OFFSET
    AL_LOKI_quadriphonic


rc2 with OpenAL32.dll present in system32:


E:\temp\test\lib\lwjgl-2.0rc2>java -cp jar\jinput.jar;jar\lwjgl.jar;jar\lwjgl_te
st.jar;jar\lwjgl_util.jar; -Djava.library.path=native\win32 org.lwjgl.test.opena
l.OpenALInfo
Exception in thread "main" org.lwjgl.openal.OpenALException: Invalid Enum
        at org.lwjgl.openal.Util.checkALCError(Util.java:55)
        at org.lwjgl.openal.ALC10.alcIsExtensionPresent(ALC10.java:398)
        at org.lwjgl.test.openal.OpenALInfo.printALCInfo(OpenALInfo.java:84)
        at org.lwjgl.test.openal.OpenALInfo.execute(OpenALInfo.java:71)
        at org.lwjgl.test.openal.OpenALInfo.main(OpenALInfo.java:170)

(But sounds in my game are playing regardless of this with this combination...)

and finally: rc2 without the dll in system32:


E:\temp\test\lib\lwjgl-2.0rc2>java -cp jar\jinput.jar;jar\lwjgl.jar;jar\lwjgl_te
st.jar;jar\lwjgl_util.jar; -Djava.library.path=native\win32 org.lwjgl.test.opena
l.OpenALInfo
Init error Could not locate OpenAL library. occured
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.lwjgl.openal.ALC1
0.nalcIsExtensionPresent(JLjava/lang/String;)Z
        at org.lwjgl.openal.ALC10.nalcIsExtensionPresent(Native Method)
        at org.lwjgl.openal.ALC10.alcIsExtensionPresent(ALC10.java:397)
        at org.lwjgl.test.openal.OpenALInfo.printALCInfo(OpenALInfo.java:83)
        at org.lwjgl.test.openal.OpenALInfo.execute(OpenALInfo.java:71)
        at org.lwjgl.test.openal.OpenALInfo.main(OpenALInfo.java:170)

Title: Re: OpenAL broken in rc2
Post by: Matzon on September 17, 2008, 20:43:59
please add: -Dorg.lwjgl.util.Debug=true

The 'rc2 with OpenAL32.dll present in system32:' is actually picking up the system oal == bad
The 'rc2 without the dll in system32:' is failing to load any dll at all == bad

So, somehow RC2 contains some stuff that your OS doesn't like - and I need some debug info to try and find out what changed.
Title: Re: OpenAL broken in rc2
Post by: EgonOlsen on September 17, 2008, 20:53:01
No problem. Here are the results with rc2 and a dll in system32:


E:\temp\test\lib\lwjgl-2.0rc2>java -cp jar\jinput.jar;jar\lwjgl.jar;jar\lwjgl_te
st.jar;jar\lwjgl_util.jar; -Dorg.lwjgl.util.Debug=true -Djava.library.path=nativ
e\win32 org.lwjgl.test.openal.OpenALInfo
getPathFromClassLoader: searching for: OpenAL32
Failed to locate findLibrary method: java.lang.NoSuchMethodException: sun.misc.L
auncher$AppClassLoader.findLibrary(java.lang.String)
Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.net.U
RLClassLoader.findLibrary(java.lang.String)
Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.secur
ity.SecureClassLoader.findLibrary(java.lang.String)
getPathFromClassLoader: searching for: lwjgl
Failed to locate findLibrary method: java.lang.NoSuchMethodException: sun.misc.L
auncher$AppClassLoader.findLibrary(java.lang.String)
Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.net.U
RLClassLoader.findLibrary(java.lang.String)
Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.secur
ity.SecureClassLoader.findLibrary(java.lang.String)
Found 3 OpenAL paths
Testing 'native\win32\OpenAL32.dll'
Failed to load native\win32\OpenAL32.dll: Could not load OpenAL library (14001)
Testing 'E:\temp\test\lib\lwjgl-2.0rc2\OpenAL32.dll'
Failed to load E:\temp\test\lib\lwjgl-2.0rc2\OpenAL32.dll: Could not load OpenAL
library (126)
Testing 'OpenAL32.dll'
Found OpenAL at 'OpenAL32.dll'
Exception in thread "main" org.lwjgl.openal.OpenALException: Invalid Enum
        at org.lwjgl.openal.Util.checkALCError(Util.java:55)
        at org.lwjgl.openal.ALC10.alcIsExtensionPresent(ALC10.java:398)
        at org.lwjgl.test.openal.OpenALInfo.printALCInfo(OpenALInfo.java:84)
        at org.lwjgl.test.openal.OpenALInfo.execute(OpenALInfo.java:71)
        at org.lwjgl.test.openal.OpenALInfo.main(OpenALInfo.java:170)



Edit: And the same thing for rc1:


E:\temp\test\lib\lwjgl-2.0rc2>java -cp jar\jinput.jar;jar\lwjgl.jar;jar\lwjgl_te
st.jar;jar\lwjgl_util.jar; -Dorg.lwjgl.util.Debug=true -Djava.library.path=nativ
e\win32 org.lwjgl.test.openal.OpenALInfo
getPathFromClassLoader: searching for: OpenAL32
Failed to locate findLibrary method: java.lang.NoSuchMethodException: sun.misc.L
auncher$AppClassLoader.findLibrary(java.lang.String)
Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.net.U
RLClassLoader.findLibrary(java.lang.String)
Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.secur
ity.SecureClassLoader.findLibrary(java.lang.String)
getPathFromClassLoader: searching for: lwjgl
Failed to locate findLibrary method: java.lang.NoSuchMethodException: sun.misc.L
auncher$AppClassLoader.findLibrary(java.lang.String)
Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.net.U
RLClassLoader.findLibrary(java.lang.String)
Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.secur
ity.SecureClassLoader.findLibrary(java.lang.String)
Found 3 OpenAL paths
Testing 'native\win32\OpenAL32.dll'
Found OpenAL at 'native\win32\OpenAL32.dll'
Available playback devices:
    DirectSound Software on Lautsprecher (2- Realtek High Definition Audio)
    DirectSound Software on Digitales Ausgabegerõt (HDMI) (2- High Definition Au
dio-Gerõt)
    DirectSound Software on Realtek Digital Output (2- Realtek High Definition A
udio)
    Wave File Writer
Available capture devices:
    WaveIn on Realtek Digital Input (2- Realt
Default device: DirectSound Software
Default capture device: WaveIn on Realtek Digital Input (2- Realt
ALC version: 1.1
ALC extensions:
    ALC_ENUMERATE_ALL_EXT
    ALC_ENUMERATION_EXT
    ALC_EXT_CAPTURE
    ALC_EXT_EFX
OpenAL vendor string: OpenAL Community
OpenAL renderer string: OpenAL Soft
OpenAL version string: 1.1
AL extensions:
    AL_EXT_EXPONENT_DISTANCE
    AL_EXT_FLOAT32
    AL_EXT_IMA4
    AL_EXT_LINEAR_DISTANCE
    AL_EXT_MCFORMATS
    AL_EXT_OFFSET
    AL_LOKI_quadriphonic

Title: Re: OpenAL broken in rc2
Post by: Matzon on September 17, 2008, 21:10:00
so, rc2 gives you an error 14001, which appears to be ERROR_SXS_CANT_GEN_ACTCTX
more info here: http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx and http://blogs.msdn.com/astebner/archive/2007/01/09/problems-with-custom-actions-that-depend-on-the-visual-c-8-0-runtime-files-on-windows-vista.aspx

Not sure where to start - anyone else have this issue ?
Title: Re: OpenAL broken in rc2
Post by: EgonOlsen on September 17, 2008, 21:22:24
Quote from: Matzon on September 17, 2008, 21:10:00
Not sure where to start - anyone else have this issue ?
I've tried it under Windows XP on the same machine (dual boot): The exact same problem with the same error number. I've also tried it on a secondary machine with Windows XP...the same error. And i bet the machine at work will print out the same.
Title: Re: OpenAL broken in rc2
Post by: EgonOlsen on September 17, 2008, 22:02:54
I've just downloaded and installed the vcredist Runtime-stuff for Visual C++ 2008...now it works as expected. So i guess you are using some dll internally that "normal people" don't have!?

Edit: I've uninstalled VC++2008 Runtime again...now it fails again. So it definitely has something to do with this. I hope this helps to track down the problem.
Title: Re: OpenAL broken in rc2
Post by: Matzon on September 18, 2008, 05:37:25
ok - this probably means that it has got something to do with my compiler. I am fairly sure that I compiled the last one in RC1 too though - so not sure whats going on!
Title: Re: OpenAL broken in rc2
Post by: Matzon on September 18, 2008, 05:44:49
please try this statically linked (to vcruntime) http://matzon.dk/brian/lwjgl/OpenAL32-1.5.304-static-upx.dll
Title: Re: OpenAL broken in rc2
Post by: EgonOlsen on September 18, 2008, 07:02:01
Quote from: Matzon on September 18, 2008, 05:44:49
please try this statically linked (to vcruntime) http://matzon.dk/brian/lwjgl/OpenAL32-1.5.304-static-upx.dll
That one works fine.... ;D
Title: Re: OpenAL broken in rc2
Post by: EgonOlsen on September 19, 2008, 09:25:32
Anything new on this topic, or is this new dll supposed to be the final solution to the problem?
Title: Re: OpenAL broken in rc2
Post by: Matzon on September 19, 2008, 09:57:00
This dll will work for now. I think the solution will have to be a upx packed, statically linked (to vcruntime 8) OpenAL32.dll
Otherwise I would have to downgrade to vc2005, and assume that more people will have that runtime installed (much more likely). But it is a bit more work than I would like.
Title: Re: OpenAL broken in rc2
Post by: elias on September 19, 2008, 10:23:28
The vc runtime should always be statically linked or included in the distribution, and it is only the dev tools that install the runtimes in system32 as a convenience:

http://support.microsoft.com/kb/326922

Quote
To address this issue, the CRT DLL is no longer considered a system file, therefore, distribute the CRT DLL with any application that relies on it. Because it is no longer a system component, install it in your applications Program Files directory with other application-specific code. This prevents your application from using other versions of the CRT library that may be installed on the system paths.

Visual C++ .NET 2003 or Visual C++ .NET 2002 installs the CRT DLL in the System32 directory on a development system. This is installed as a convenience for the developer.

- elias