LWJGL Forum

Archive => Resolved Bugs/RFE => Topic started by: Cero on October 23, 2011, 14:35:07

Title: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Cero on October 23, 2011, 14:35:07
Happens with 2.8.1 aswell as the current nightly build dubbed 2.8.2

When exiting my game, at which point OpenAL will be unloaded by Slick, OpenAL makes java Crash.

(http://img10.imageshack.us/img10/9384/openallwjgl.jpg)

Code: [Select]
Problem signature:
  Problem Event Name: BEX
  Application Name: javaw.exe
  Application Version: 7.0.10.8
  Application Timestamp: 4e897db7
  Fault Module Name: OpenAL32.dll_unloaded
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp: 4e894548
  Exception Offset: 172dd03f
  Exception Code: c0000005
  Exception Data: 00000008
  OS Version: 6.1.7600.2.0.0.256.1
  Locale ID: 18441
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on October 23, 2011, 15:58:50
seeing something similar - however, its AFTER OpenAL has been destroyed and at the end of all java code.
I cannot make it happen in eclipse, so hard to debug.

Code: [Select]
*** DESTROY - context ***
DLL_THREAD_DETACH - start
DLL_THREAD_DETACH - end
*** DESTROY - device ***
[Loaded java.util.HashMap$Values from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded java.util.HashMap$ValueIterator from C:\Program Files\Java\jre6\lib\rt.jar]
*** DESTROY reset AL10 ***
[Dynamic-linking native method org.lwjgl.openal.AL.resetNativeStubs ... JNI]
*** DESTROY reset AL11 ***
*** DESTROY reset ALC10 ***
*** DESTROY reset ALC11 ***
*** DESTROY reset EFX10 ***
*** DESTROY nDestroy ***
[Dynamic-linking native method org.lwjgl.openal.AL.nDestroy ... JNI]
extal_UnloadLibrary '41e0000'
DLL_PROCESS_DETACH - start
DLL_PROCESS_DETACH - end
extal_UnloadLibrary DONE (1)
JAVA DONE!!!
[Loaded java.lang.Shutdown from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded java.lang.Shutdown$Lock from C:\Program Files\Java\jre6\lib\rt.jar]
[Dynamic-linking native method java.lang.Shutdown.halt0 ... JNI]
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on October 23, 2011, 16:28:30
I've debugged it all the way through both LWJGL and OpenAL-Soft dlls. I cannot find a reason for why this is happening - and I certainly have no idea where OpenAL32_unloaded comes from, but then again I dont get that on my end - just a generic stopped working.
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on October 23, 2011, 17:29:01
seeing something similar - however, its AFTER OpenAL has been destroyed and at the end of all java code.

Yeah could be, I still get the line
Code: [Select]
AL lib: FreeContext: (20230D38) Deleting 64 Source(s)and I guess it crashes after that, as I get all my system outs

Not sure if I can verbose it better somehow, to see whats going on. But I'm using OpenAL purely through Slick anyway, nothing special.
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on October 23, 2011, 21:26:44
It's Win 7 64 bit

but everything I use is 32 bit: eclipse, java, lwjgl, everything - because I found java 64 to be unstable, and I dont need it

so it's not a 32bit / 64bit issue whatever somehow suggested
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on October 23, 2011, 22:02:24
I am on it ... seems to be an OpenAL-Soft issue. Tricky to fix, but basically the mmdevapi backend is being de-initialized from the DllMain entry point, which is causing the mmdevapi's call to CoUninitialize to crash, as per:
Quote
Because there is no way to control the order in which in-process servers are loaded or unloaded, do not call CoInitialize, CoInitializeEx, or CoUninitialize from the DllMain function.
Simple fix is to not include mmdevapi, but since its basically required from vista and onwards, we need a better fix. Not sure when tho...
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: princec on October 24, 2011, 08:04:14
Probably going to have to hack on the OpenAL source itself :( Maybe a mutex will fix what sounds like a race condition.

Cas :)
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on October 24, 2011, 10:08:24
Probably going to have to hack on the OpenAL source itself :( Maybe a mutex will fix what sounds like a race condition.

Cas :)
Nah, its a bit more tricky than that. The design is based on deinitlialization on destructore basically, which isn't allowed - for this particular backend.

So AL needs to get an explicit destroy thingy which isn't in the specs.

or something along the lines... I'll find out today I hope
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Faust on October 25, 2011, 15:09:50
Hi,

i just found this topic when searching for problems with version 2.8.1 and AL.destory().
I want to add that calling AL.destroy() causes the error on a Vista 64bit System right out of eclipse (indigo jre1.6.29 64bit), but only shows the generic "has stopped working" message. In fact, stepping through the source code is not possible after AL.destory() has been called since java stoped working some time after the call but not at the end of all threads.
In addition the same source code runs and shuts down error-less on a 32bit Windows XP.

I hope this information might help in any way.
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Ckadge on October 25, 2011, 16:56:22
Hello everyone,
I have exactly the same problem. Java crashes when I destroy AL.
For some reason it takes a while before Java crashes, because when I shutdown my program, and AL is being destroyed, the program can still shutdown properly.
Another weird thing is, Java only crashes when I have loaded a texture in my program and I destroy AL. I don't think this has anything to do with sound.

What are the consequences when I do not destroy AL? Testing has become a but annoying because of this.
As a quick fix, I'll just disable the whole sound manager, but I'd like to see this solved!

I found this problem a few days ago. I'm glad to see that there's already someone on it!

edit: In addition, I'm using a Vista 32-bit system, running Java 1.6.
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on October 25, 2011, 17:17:30
should be fixed as of r3686
Please grab dll from svn (https://java-game-lib.svn.sourceforge.net/svnroot/java-game-lib/trunk/LWJGL/) or wait for next 2.8.2 (https://www.newdawnsoftware.com/jenkins/view/LWJGL/) build.

Just a small FYI: The issue happens on Vista and Windows 7 - it's caused by a late call to CoUninitialize() of the mmdevapi backend. It doesn't happen all the time, but very often - especially after the first run.
It happens on both 32 and 64 bit.

I have updated all OpenAL soft versions to latest, which contains a fix (http://repo.or.cz/w/openal-soft.git/commitdiff/319f40462fe695126b02493a6d2fcd06ae3807b2) for this issue.
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Ckadge on October 25, 2011, 17:57:20
Seems to work! Thank you so much!
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on October 26, 2011, 18:58:05
Yeah works!
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: jim_oflaherty_jr on November 23, 2011, 16:35:19
Hi,

Thank your for this thread. I have been tearing my hair out trying to figure out what I was doing wrong causing this error. I was on 2.8.1.

Summary: After installing 2.8.2, be sure to shut down and restart Eclipse to "unload" the old 2.8.1 dlls

Details:
For others that might follow, I discovered an additional little fun treat. It appears that for as long as Eclipse is up, it somehow caches the .dlls. So, when I dl'ed 2.8.2 and went and changed the referenced libraries (without having shutdown Eclipse) and did a "Clean..." to force a full rebuild, I ran my game and it still popped up the same issue at shutdown. After verifying everything was properly configured in Eclipse to point to the new 2.8.2 version (including renaming the 2.8.1 folders), I tried my program again and it still hit the same shutdown error for the OpenAl dll. On a hunch, I shutdown Eclipse, restarted it and immediately ran my program and shut it down. And the error was gone. I then cycled through it several times and no error appeared. Hope this helps any future followers...
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Cero on March 03, 2012, 18:54:24
Actually I'm getting this error again lately.

(http://img821.imageshack.us/img821/1008/openal2.png)
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Cero on March 03, 2012, 19:06:38
Testing LWJGL version I have laying around:
2.8.4 nightly, error occurs
2.8.2 error occurs
2.8.0 error doesnt occur.

happens when closing the game, sound works fine (hence unloading)

also,
this total crash only happens like once every 10 times I try to exit a game, sometimes more often

but I always know when it CAN happen because I get this
Code: [Select]
AL lib: FreeContext: (1E5B0D88) Deleting 64 Source(s)last line at all, this line only happens when its broken, so that sometimes, this crash occurs
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Cero on March 03, 2012, 19:18:23
I also read a thread in the Slick forum on cleaning up audio nicely.
So this involves a couple of commands, one of them

Code: [Select]
public static void detachBuffer(int sourceID) {
        //detach a buffer if it exists
        AL10.alSourceStop(sourceID);
        AL10.alSourcei(sourceID, AL10.AL_BUFFER, 0);
    }

now, AL10.alSourceStop(sourceID);, results in a
Code: [Select]
UnsatisfiedLinkError: org.lwjgl.openal.AL10.nalSourceStop(I)Vfor me.

And yeah even with latest 2.8.4 & natives.

I even tried the very latest OpenAL32.dll
http://www.newdawnsoftware.com/jenkins/view/OpenAL/job/OpenAL-win32/ (http://www.newdawnsoftware.com/jenkins/view/OpenAL/job/OpenAL-win32/)
which seems to be triple size, that the one contained within the nightly lwjgl, but still this UnsatisfiedLinkError comes up.
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on March 03, 2012, 20:51:31
as per http://lwjgl.org/forum/index.php?topic=4311.0 - try setting debug for lwjgl and openal
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Cero on March 04, 2012, 04:03:04
Code: [Select]
AL lib: GetConfigValue: Key general:hrtf_tables not found
AL lib: GetConfigValue: Key general:rt-prio not found
AL lib: GetConfigValue: Key general:resampler not found
AL lib: GetConfigValue: Key general:trap-alc-error not found
AL lib: GetConfigValue: Key general:trap-al-error not found
AL lib: GetConfigValue: Key reverb:boost not found
AL lib: GetConfigValue: Key reverb:emulate-eax not found
AL lib: GetConfigValue: Key general:drivers not found
AL lib: MMDevApiMsgProc: Starting message thread
AL lib: MMDevApiMsgProc: Starting message loop
AL lib: alc_initconfig: Initialized backend "mmdevapi"
AL lib: alc_initconfig: Added "mmdevapi" for playback
AL lib: alc_initconfig: Initialized backend "dsound"
AL lib: alc_initconfig: Added "dsound" for capture
AL lib: GetConfigValue: Key general:excludefx not found
AL lib: GetConfigValue: Key general:default-reverb not found
AL lib: GetConfigValue: Key general:channels not found
AL lib: GetConfigValue: Key general:sample-type not found
AL lib: GetConfigValue: Key general:format not found
AL lib: GetConfigValue: Key general:frequency not found
AL lib: GetConfigValue: Key general:periods not found
AL lib: GetConfigValue: Key general:period_size not found
AL lib: GetConfigValue: Key general:sources not found
AL lib: GetConfigValue: Key general:slots not found
AL lib: GetConfigValue: Key general:sends not found
AL lib: GetConfigValue: Key general:cf_level not found
AL lib: MMDevApiMsgProc: Got message 1024
AL lib: alcOpenDevice: Created device 0FAE0048, "Speakers (High Definition Audio
 Device)"
AL lib: UpdateDeviceParams: Format pre-setup: Stereo, Float, 44100hz, 1024 updat
e size x4
AL lib: MMDevApiMsgProc: Got message 1025
AL lib: UpdateDeviceParams: Format post-setup: Stereo, Float, 44100hz, 448 updat
e size x9
AL lib: GetConfigValue: Key general:layout_stereo not found
AL lib: GetConfigValue: Key general:layout not found
AL lib: GetConfigValue: Key general:hrtf not found
AL lib: UpdateDeviceParams: HRTF disabled
AL lib: UpdateDeviceParams: BS2B disabled
AL lib: UpdateDeviceParams: Stereo duplication disabled
AL lib: alcCreateContext: Created context 0FB0CD38
Sun Mar 04 05:01:50 CET 2012 INFO:- Sound works
Sun Mar 04 05:01:50 CET 2012 INFO:- 64 OpenAL source available
Sun Mar 04 05:01:50 CET 2012 INFO:- Sounds source generated
AL lib: FreeContext: 0FB0CD38
AL lib: FreeContext: (0FB0CD38) Deleting 64 Source(s)
AL lib: MMDevApiMsgProc: Got message 1026
AL lib: MMDevApiMsgProc: Got message 1027
AL lib: FreeDevice: 0FAE0048
AL lib: FreeDevice: (0FAE0048) Deleting 20 Buffer(s)
AL lib: alcMMDevApiDeinit: Sending WM_QUIT to Thread 0ec4
AL lib: MMDevApiMsgProc: Message loop finished
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Cero on March 04, 2012, 04:06:24
On my Windows XP laptop, OpenAl doesnt crash, but I still get that "AL lib: FreeContext: (0E45D108) Deleting 64 Source(s)" message.

Here the debug from there:
Code: [Select]
AL lib: GetConfigValue: Key general:hrtf_tables not found
AL lib: GetConfigValue: Key general:rt-prio not found
AL lib: GetConfigValue: Key general:resampler not found
AL lib: GetConfigValue: Key general:trap-alc-error not found
AL lib: GetConfigValue: Key general:trap-al-error not found
AL lib: GetConfigValue: Key reverb:boost not found
AL lib: GetConfigValue: Key reverb:emulate-eax not found
AL lib: GetConfigValue: Key general:drivers not found
AL lib: MMDevApiMsgProc: Starting message thread
AL lib: MMDevApiMsgProc: Failed to create IMMDeviceEnumerator instance: 0x800401
54
AL lib: alc_initconfig: Failed to initialize backend "mmdevapi"
AL lib: alc_initconfig: Initialized backend "dsound"
AL lib: alc_initconfig: Added "dsound" for playback
AL lib: alc_initconfig: Added "dsound" for capture
AL lib: GetConfigValue: Key general:excludefx not found
AL lib: GetConfigValue: Key general:default-reverb not found
AL lib: GetConfigValue: Key general:channels not found
AL lib: GetConfigValue: Key general:sample-type not found
AL lib: GetConfigValue: Key general:format not found
AL lib: GetConfigValue: Key general:frequency not found
AL lib: GetConfigValue: Key general:periods not found
AL lib: GetConfigValue: Key general:period_size not found
AL lib: GetConfigValue: Key general:sources not found
AL lib: GetConfigValue: Key general:slots not found
AL lib: GetConfigValue: Key general:sends not found
AL lib: GetConfigValue: Key general:cf_level not found
AL lib: DSoundEnumPlaybackDevices: Got device "SoundMAX HD Audio", GUID "{BD6DD7
1A-3DEB-11D1-B171-00C04FC20000}"
AL lib: alcOpenDevice: Created device 0E430048, "SoundMAX HD Audio"
AL lib: UpdateDeviceParams: Format pre-setup: Stereo, Float, 44100hz, 1024 updat
e size x4
AL lib: UpdateDeviceParams: Format post-setup: Stereo, Float, 44100hz, 1024 upda
te size x4
AL lib: GetConfigValue: Key general:layout_stereo not found
AL lib: GetConfigValue: Key general:layout not found
AL lib: GetConfigValue: Key general:hrtf not found
AL lib: UpdateDeviceParams: HRTF disabled
AL lib: UpdateDeviceParams: BS2B disabled
AL lib: UpdateDeviceParams: Stereo duplication disabled
AL lib: alcCreateContext: Created context 0E45D108
Sun Mar 04 04:59:32 CET 2012 INFO:- Sound works
Sun Mar 04 04:59:32 CET 2012 INFO:- 64 OpenAL source available
Sun Mar 04 04:59:32 CET 2012 INFO:- Sounds source generated
AL lib: FreeContext: 0E45D108
AL lib: FreeContext: (0E45D108) Deleting 64 Source(s)
AL lib: FreeDevice: 0E430048
AL lib: FreeDevice: (0E430048) Deleting 20 Buffer(s)
AL lib: alcMMDevApiDeinit: Sending WM_QUIT to Thread 0150
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Cero on March 06, 2012, 02:20:00
And tested on yet another PC, some Intel dual core with asus onboard sound

Code: [Select]
d:\DIST>java -Djava.library.path=lib -Xms128m -Xmx128m -jar jo.jar
Tue Mar 06 03:13:42 PST 2012 INFO:Initialising sounds..
AL lib: GetConfigValue: Key general:hrtf_tables not found
AL lib: GetConfigValue: Key general:rt-prio not found
AL lib: GetConfigValue: Key general:resampler not found
AL lib: GetConfigValue: Key general:trap-alc-error not found
AL lib: GetConfigValue: Key general:trap-al-error not found
AL lib: GetConfigValue: Key reverb:boost not found
AL lib: GetConfigValue: Key reverb:emulate-eax not found
AL lib: GetConfigValue: Key general:drivers not found
AL lib: MMDevApiMsgProc: Starting message thread
AL lib: MMDevApiMsgProc: Starting message loop
AL lib: alc_initconfig: Initialized backend "mmdevapi"
AL lib: alc_initconfig: Added "mmdevapi" for playback
AL lib: alc_initconfig: Initialized backend "dsound"
AL lib: alc_initconfig: Initialized backend "winmm"
AL lib: alc_initconfig: Added "winmm" for capture
AL lib: GetConfigValue: Key general:excludefx not found
AL lib: GetConfigValue: Key general:frequency not found
AL lib: GetConfigValue: Key general:format not found
AL lib: GetConfigValue: Key general:periods not found
AL lib: GetConfigValue: Key general:period_size not found
AL lib: GetConfigValue: Key general:sources not found
AL lib: GetConfigValue: Key general:slots not found
AL lib: GetConfigValue: Key general:sends not found
AL lib: GetConfigValue: Key general:cf_level not found
AL lib: MMDevApiMsgProc: Got message 1024
AL lib: alcOpenDevice: Created device 04F80048
AL lib: UpdateDeviceParams: Format pre-setup: Stereo, Signed Short, 44100hz, 102
4 update size x4
AL lib: MMDevApiMsgProc: Got message 1025
AL lib: UpdateDeviceParams: Format post-setup: Stereo, Signed Short, 44100hz, 89
6 update size x5
AL lib: GetConfigValue: Key general:layout_STEREO not found
AL lib: GetConfigValue: Key general:layout not found
AL lib: GetConfigValue: Key general:hrtf not found
AL lib: UpdateDeviceParams: HRTF disabled
AL lib: UpdateDeviceParams: BS2B disabled
AL lib: UpdateDeviceParams: Stereo duplication disabled
AL lib: alcCreateContext: Created context 04D40E80
Tue Mar 06 03:13:42 PST 2012 INFO:- Sound works
Tue Mar 06 03:13:42 PST 2012 INFO:- 64 OpenAL source available
Tue Mar 06 03:13:42 PST 2012 INFO:- Sounds source generated
AL lib: FreeContext: 04D40E80
AL lib: FreeContext: (04D40E80) Deleting 64 Source(s)
AL lib: MMDevApiMsgProc: Got message 1026
AL lib: MMDevApiMsgProc: Got message 1027
AL lib: FreeDevice: 04F80048
AL lib: FreeDevice: (04F80048) Deleting 1 Buffer(s)
AL lib: alcMMDevApiDeinit: Sending WM_QUIT to Thread 080c

Since this seems to work everywhere, I made this Dist you can run yourself to get this error:
http://www.mediafire.com/?65pm3itxc6q25ms (http://www.mediafire.com/?65pm3itxc6q25ms)
It differs how many times you have to run it to get a crash, sometimes its only 2 times, sometimes 12.
But here its very fast and its always < 20 for me.

All I do here is:
Code: [Select]
public static void main(String[] args) throws SlickException
{
SoundStore.get().init();
Sound snd = new Sound("content/audio/sound/novashot.ogg");
AL.destroy();
}
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on March 06, 2012, 20:30:50
no crashing here... just the obligatory AL lib: FreeContext: message after lots of runs I get it too ... checking
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on March 07, 2012, 10:38:31
I've been debugging it last night with chris from openal. No clean fix yet.

The issue SEEMS to happen in the DllMain detach part when shutting down - specifically, the worker thread for the mmdev backend - we think - is scheduled to die (posting WM_QUIT), and is then run when the dll is unloaded (basically invalid address space).

Its not easy to fix, because openal does not have a "destroy" method to do cleanup in.

a simple fix, seems to do a Sleep(100) after posting the WM_QUIT message - but its ugly as hell, so probably wont go into OpenAL-Soft :)

So... shit out of luck for now .. .working on a fix ...
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: kappa on March 15, 2012, 09:59:32
was able to reproduce the above bug on my vista machine too.
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on March 15, 2012, 15:30:29
is it odd that the older version of lwjgl do not have this behavior ?
I understand you changed something with OpenAL @ 2.8.2
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on March 15, 2012, 19:27:50
try an older version of openal
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on March 16, 2012, 23:48:25
Please try the latest version of OpenAL (soon 1.14): http://www.newdawnsoftware.com/jenkins/view/OpenAL/
I cannot reproduce it anymore.
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on March 18, 2012, 13:57:05
seems fine now
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: kappa on May 21, 2012, 20:57:18
should be fixed in nightly builds too now.
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: cmasupra on June 29, 2012, 06:18:25
I have tested this using 2.8.4 and the 2.8.5 1714 nightly. I am still getting the error every time I close my game.

Edit: I tried replacing the 2.8.5 1714 nightly OpenAL dll files with the OpenAL dll files from 2.7.1, and I no longer got the "Deleting 64 source(s)" error. As soon as I switched back to the 2.8.5 OpenAL dll files, the error came back.
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Cero on July 03, 2012, 17:53:54
It is indeed still there. Worked with libgdx a lot and have encountered it there using the lwjgl natives
And our main LWJGL game uses 2.8.4 and does indeed too display the "AL lib: FreeContext: (16080CA0) Deleting 64 Source(s)" message

Just tried it a couple of times, and there we go again:

Quote
APPCRASH
Application Name:   javaw.exe
Application Version:   6.0.310.5
Application Timestamp:   4f2c9e1c
Fault Module Name:   OpenAL32.dll_unloaded
Fault Module Version:   0.0.0.0
Title: Re: [FIXED] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on July 04, 2012, 07:03:25
I talked to KittyCat about the issue - and it should be fixed :/
I will look into this, soon - but not sure when I have time ...
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on July 04, 2012, 20:47:25
running with latest nightly - not changed for a while - I cannot reproduce this.
I have run SourceLimitTest, OpenALInfo, ALCTest, OpenALCreationTest many many times.

It always go something like this (with: set ALSOFT_LOGLEVEL=3):
Quote
...
AL lib: MMDevApiMsgProc: Starting message thread
AL lib: MMDevApiMsgProc: Starting message loop
AL lib: alc_initconfig: Initialized backend "mmdevapi"
AL lib: alc_initconfig: Added "mmdevapi" for playback
AL lib: alc_initconfig: Initialized backend "dsound"
AL lib: alc_initconfig: Added "dsound" for capture
...
AL lib: MMDevApiMsgProc: Got message 1024
AL lib: alcOpenDevice: Created device 055C0048, "Speakers (High Definition Audio Device)"
AL lib: UpdateDeviceParams: Format pre-setup: Stereo, Float, 44100hz, 1024 update size x4
AL lib: MMDevApiMsgProc: Got message 1025
AL lib: UpdateDeviceParams: Format post-setup: Stereo, Float, 44100hz, 896 update size x4
...
AL lib: MMDevApiMsgProc: Got message 1026
AL lib: alcCreateContext: Created context 05373B88
...
AL lib: FreeContext: 05373B88
AL lib: MMDevApiMsgProc: Got message 1027
AL lib: MMDevApiMsgProc: Got message 1028
AL lib: FreeDevice: 055C0048

and no errors what so ever.
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on July 05, 2012, 02:13:34
also getting this with the latest libgdx, using the lwjgl natives

Needed a couple of tries.

Code: [Select]
d:\Artificial_Zero_Media\Distributions\StableIsotope>java -jar game.jar
AL lib: GetConfigValue: Key general:hrtf_tables not found
AL lib: GetConfigValue: Key general:rt-prio not found
AL lib: GetConfigValue: Key general:resampler not found
AL lib: GetConfigValue: Key general:trap-alc-error not found
AL lib: GetConfigValue: Key general:trap-al-error not found
AL lib: GetConfigValue: Key reverb:boost not found
AL lib: GetConfigValue: Key reverb:emulate-eax not found
AL lib: GetConfigValue: Key general:drivers not found
AL lib: MMDevApiMsgProc: Starting message thread
AL lib: MMDevApiMsgProc: Starting message loop
AL lib: alc_initconfig: Initialized backend "mmdevapi"
AL lib: alc_initconfig: Added "mmdevapi" for playback
AL lib: alc_initconfig: Initialized backend "dsound"
AL lib: alc_initconfig: Initialized backend "winmm"
AL lib: alc_initconfig: Added "winmm" for capture
AL lib: GetConfigValue: Key general:excludefx not found
AL lib: GetConfigValue: Key general:frequency not found
AL lib: GetConfigValue: Key general:format not found
AL lib: GetConfigValue: Key general:periods not found
AL lib: GetConfigValue: Key general:period_size not found
AL lib: GetConfigValue: Key general:sources not found
AL lib: GetConfigValue: Key general:slots not found
AL lib: GetConfigValue: Key general:sends not found
AL lib: GetConfigValue: Key general:cf_level not found
AL lib: MMDevApiMsgProc: Got message 1024
AL lib: alcOpenDevice: Created device 05220048
AL lib: UpdateDeviceParams: Format pre-setup: Stereo, Signed Short, 44100hz, 102
4 update size x4
AL lib: MMDevApiMsgProc: Got message 1025
AL lib: UpdateDeviceParams: Format post-setup: Stereo, Signed Short, 48000hz, 96
0 update size x4
AL lib: GetConfigValue: Key general:layout_STEREO not found
AL lib: GetConfigValue: Key general:layout not found
AL lib: GetConfigValue: Key general:hrtf not found
AL lib: UpdateDeviceParams: HRTF disabled
AL lib: UpdateDeviceParams: BS2B disabled
AL lib: UpdateDeviceParams: Stereo duplication disabled
AL lib: alcCreateContext: Created context 050A0E80
AL lib: FreeContext: 050A0E80
AL lib: MMDevApiMsgProc: Got message 1026
AL lib: MMDevApiMsgProc: Got message 1027
AL lib: FreeDevice: 05220048
AL lib: alcMMDevApiDeinit: Sending WM_QUIT to Thread 138c
AL lib: MMDevApiMsgProc: Message loop finished

d:\Artificial_Zero_Media\Distributions\StableIsotope>java -jar game.jar
AL lib: GetConfigValue: Key general:hrtf_tables not found
AL lib: GetConfigValue: Key general:rt-prio not found
AL lib: GetConfigValue: Key general:resampler not found
AL lib: GetConfigValue: Key general:trap-alc-error not found
AL lib: GetConfigValue: Key general:trap-al-error not found
AL lib: GetConfigValue: Key reverb:boost not found
AL lib: GetConfigValue: Key reverb:emulate-eax not found
AL lib: GetConfigValue: Key general:drivers not found
AL lib: MMDevApiMsgProc: Starting message thread
AL lib: MMDevApiMsgProc: Starting message loop
AL lib: alc_initconfig: Initialized backend "mmdevapi"
AL lib: alc_initconfig: Added "mmdevapi" for playback
AL lib: alc_initconfig: Initialized backend "dsound"
AL lib: alc_initconfig: Initialized backend "winmm"
AL lib: alc_initconfig: Added "winmm" for capture
AL lib: GetConfigValue: Key general:excludefx not found
AL lib: GetConfigValue: Key general:frequency not found
AL lib: GetConfigValue: Key general:format not found
AL lib: GetConfigValue: Key general:periods not found
AL lib: GetConfigValue: Key general:period_size not found
AL lib: GetConfigValue: Key general:sources not found
AL lib: GetConfigValue: Key general:slots not found
AL lib: GetConfigValue: Key general:sends not found
AL lib: GetConfigValue: Key general:cf_level not found
AL lib: MMDevApiMsgProc: Got message 1024
AL lib: alcOpenDevice: Created device 05290048
AL lib: UpdateDeviceParams: Format pre-setup: Stereo, Signed Short, 44100hz, 102
4 update size x4
AL lib: MMDevApiMsgProc: Got message 1025
AL lib: UpdateDeviceParams: Format post-setup: Stereo, Signed Short, 48000hz, 96
0 update size x4
AL lib: GetConfigValue: Key general:layout_STEREO not found
AL lib: GetConfigValue: Key general:layout not found
AL lib: GetConfigValue: Key general:hrtf not found
AL lib: UpdateDeviceParams: HRTF disabled
AL lib: UpdateDeviceParams: BS2B disabled
AL lib: UpdateDeviceParams: Stereo duplication disabled
AL lib: alcCreateContext: Created context 04FB0E80
AL lib: FreeContext: 04FB0E80
AL lib: MMDevApiMsgProc: Got message 1026
AL lib: MMDevApiMsgProc: Got message 1027
AL lib: FreeDevice: 05290048
AL lib: alcMMDevApiDeinit: Sending WM_QUIT to Thread 1680


The upper output is of a run without the error, next time it happened.
You can see the last line is missing now.
Also the crash is different than in eclipse for some reason:

Quote
Problem Event Name:   APPCRASH
  Application Name:   java.exe
  Application Version:   6.0.330.3
  Application Timestamp:   4faa9fa0
  Fault Module Name:   ntdll.dll
  Fault Module Version:   6.1.7600.16915
  Fault Module Timestamp:   4ec49d10
  Exception Code:   c0000005
  Exception Offset:   0002ff37
  OS Version:   6.1.7600.2.0.0.256.1
  Locale ID:   1031
  Additional Information 1:   0a9e

NTDLL.DLL ? DirectSound problem or something different altogether ?
Anyway seems like a fun problem :|
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on July 05, 2012, 02:14:34
I will try it on other machines too from time to time with the openal variable set.

Because, I know that I do get them on many different machines also, but I just dismiss them...
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on July 05, 2012, 02:31:46
This time I set the variable and started eclipse from command line, so I could do it with eclipse
Code: [Select]
AL lib: GetConfigValue: Key general:hrtf_tables not found
AL lib: GetConfigValue: Key general:rt-prio not found
AL lib: GetConfigValue: Key general:resampler not found
AL lib: GetConfigValue: Key general:trap-alc-error not found
AL lib: GetConfigValue: Key general:trap-al-error not found
AL lib: GetConfigValue: Key reverb:boost not found
AL lib: GetConfigValue: Key reverb:emulate-eax not found
AL lib: GetConfigValue: Key general:drivers not found
AL lib: MMDevApiMsgProc: Starting message thread
AL lib: MMDevApiMsgProc: Starting message loop
AL lib: alc_initconfig: Initialized backend "mmdevapi"
AL lib: alc_initconfig: Added "mmdevapi" for playback
AL lib: alc_initconfig: Initialized backend "dsound"
AL lib: alc_initconfig: Initialized backend "winmm"
AL lib: alc_initconfig: Added "winmm" for capture
AL lib: GetConfigValue: Key general:excludefx not found
AL lib: GetConfigValue: Key general:frequency not found
AL lib: GetConfigValue: Key general:format not found
AL lib: GetConfigValue: Key general:periods not found
AL lib: GetConfigValue: Key general:period_size not found
AL lib: GetConfigValue: Key general:sources not found
AL lib: GetConfigValue: Key general:slots not found
AL lib: GetConfigValue: Key general:sends not found
AL lib: GetConfigValue: Key general:cf_level not found
AL lib: MMDevApiMsgProc: Got message 1024
AL lib: alcOpenDevice: Created device 052D0048
AL lib: UpdateDeviceParams: Format pre-setup: Stereo, Signed Short, 44100hz, 1024 update size x4
AL lib: MMDevApiMsgProc: Got message 1025
AL lib: UpdateDeviceParams: Format post-setup: Stereo, Signed Short, 48000hz, 960 update size x4
AL lib: GetConfigValue: Key general:layout_STEREO not found
AL lib: GetConfigValue: Key general:layout not found
AL lib: GetConfigValue: Key general:hrtf not found
AL lib: UpdateDeviceParams: HRTF disabled
AL lib: UpdateDeviceParams: BS2B disabled
AL lib: UpdateDeviceParams: Stereo duplication disabled
AL lib: alcCreateContext: Created context 052C0C60
AL lib: FreeContext: 052C0C60
AL lib: MMDevApiMsgProc: Got message 1026
AL lib: MMDevApiMsgProc: Got message 1027
AL lib: FreeDevice: 052D0048
AL lib: alcMMDevApiDeinit: Sending WM_QUIT to Thread 1760


Quote
Problem Event Name:   APPCRASH
  Application Name:   javaw.exe
  Application Version:   6.0.330.3
  Application Timestamp:   4faa9fa4
  Fault Module Name:   StackHash_abcc
  Fault Module Version:   0.0.0.0
  Fault Module Timestamp:   00000000
  Exception Code:   c00000fd
  Exception Offset:   74e0e2c4

StackHash_abcc  now, huh ?
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on July 05, 2012, 02:34:01
There we go

Quote
Problem signature:
  Problem Event Name:   APPCRASH
  Application Name:   javaw.exe
  Application Version:   6.0.330.3
  Application Timestamp:   4faa9fa4
  Fault Module Name:   OpenAL32.dll_unloaded
  Fault Module Version:   0.0.0.0

Code: [Select]
AL lib: GetConfigValue: Key general:hrtf_tables not found
AL lib: GetConfigValue: Key general:rt-prio not found
AL lib: GetConfigValue: Key general:resampler not found
AL lib: GetConfigValue: Key general:trap-alc-error not found
AL lib: GetConfigValue: Key general:trap-al-error not found
AL lib: GetConfigValue: Key reverb:boost not found
AL lib: GetConfigValue: Key reverb:emulate-eax not found
AL lib: GetConfigValue: Key general:drivers not found
AL lib: MMDevApiMsgProc: Starting message thread
AL lib: MMDevApiMsgProc: Starting message loop
AL lib: alc_initconfig: Initialized backend "mmdevapi"
AL lib: alc_initconfig: Added "mmdevapi" for playback
AL lib: alc_initconfig: Initialized backend "dsound"
AL lib: alc_initconfig: Initialized backend "winmm"
AL lib: alc_initconfig: Added "winmm" for capture
AL lib: GetConfigValue: Key general:excludefx not found
AL lib: GetConfigValue: Key general:frequency not found
AL lib: GetConfigValue: Key general:format not found
AL lib: GetConfigValue: Key general:periods not found
AL lib: GetConfigValue: Key general:period_size not found
AL lib: GetConfigValue: Key general:sources not found
AL lib: GetConfigValue: Key general:slots not found
AL lib: GetConfigValue: Key general:sends not found
AL lib: GetConfigValue: Key general:cf_level not found
AL lib: MMDevApiMsgProc: Got message 1024
AL lib: alcOpenDevice: Created device 052B0048
AL lib: UpdateDeviceParams: Format pre-setup: Stereo, Signed Short, 44100hz, 1024 update size x4
AL lib: MMDevApiMsgProc: Got message 1025
AL lib: UpdateDeviceParams: Format post-setup: Stereo, Signed Short, 48000hz, 960 update size x4
AL lib: GetConfigValue: Key general:layout_STEREO not found
AL lib: GetConfigValue: Key general:layout not found
AL lib: GetConfigValue: Key general:hrtf not found
AL lib: UpdateDeviceParams: HRTF disabled
AL lib: UpdateDeviceParams: BS2B disabled
AL lib: UpdateDeviceParams: Stereo duplication disabled
AL lib: alcCreateContext: Created context 00880E80
AL lib: FreeContext: 00880E80
AL lib: MMDevApiMsgProc: Got message 1026
AL lib: MMDevApiMsgProc: Got message 1027
AL lib: FreeDevice: 052B0048
AL lib: alcMMDevApiDeinit: Sending WM_QUIT to Thread 148c

Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Matzon on July 05, 2012, 08:58:32
Are you _sure_ you are using the OpenAL dll from nightly?
Can you do it with some of the openal tests - instead of libgdx/slick etc?
Please provide the most basic test - and possibly a zip with jar, src
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: Cero on July 05, 2012, 11:46:52
Are you _sure_ you are using the OpenAL dll from nightly?
Can you do it with some of the openal tests - instead of libgdx/slick etc?
Please provide the most basic test - and possibly a zip with jar, src

Actually the latest stable release 2.8.4, I guess libgdx is using that too
I was under the impression that, by now, it would be in the stable release =o
If not, I'm sure thats the reason here
Title: Re: [BUG] OpenAl crashes while unloading since 2.8.1
Post by: kappa on July 05, 2012, 18:30:55
Downloaded the latest version of LibGDX 0.9.6 (released 3 days ago), they are still using the old LWJGL 2.8.3 hence the issue will still be present there. Please do be careful when reporting such issues and ensure the information stated is correct otherwise it can waste valuable dev time.

As for the "Deleting 64 source(s)" error this is not a serious issue and simply a debug message thrown out by OpenAL-Soft, it basically means that the library/application using it didn't clean up properly before exiting hence it has had to do the clean up for the library/application.