Hello Guest

[FIXED] OpenAl crashes while unloading since 2.8.1

  • 39 Replies
  • 58608 Views
*

Offline Cero

  • *
  • 22
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #15 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

*

Offline Cero

  • *
  • 22
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #16 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/
which seems to be triple size, that the one contained within the nightly lwjgl, but still this UnsatisfiedLinkError comes up.
« Last Edit: March 03, 2012, 19:21:06 by Cero »

*

Offline Matzon

  • *****
  • 2242
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #17 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

*

Offline Cero

  • *
  • 22
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #18 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

*

Offline Cero

  • *
  • 22
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #19 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

*

Offline Cero

  • *
  • 22
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #20 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
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();
}
« Last Edit: March 06, 2012, 02:22:31 by Cero »

*

Offline Matzon

  • *****
  • 2242
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #21 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
« Last Edit: March 06, 2012, 20:32:52 by Matzon »

*

Offline Matzon

  • *****
  • 2242
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #22 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 ...

*

Offline kappa

  • *****
  • 1319
Re: [BUG] OpenAl crashes while unloading since 2.8.1
« Reply #23 on: March 15, 2012, 09:59:32 »
was able to reproduce the above bug on my vista machine too.

*

Offline Cero

  • *
  • 22
Re: [BUG] OpenAl crashes while unloading since 2.8.1
« Reply #24 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

*

Offline Matzon

  • *****
  • 2242
Re: [BUG] OpenAl crashes while unloading since 2.8.1
« Reply #25 on: March 15, 2012, 19:27:50 »
try an older version of openal

*

Offline Matzon

  • *****
  • 2242
Re: [BUG] OpenAl crashes while unloading since 2.8.1
« Reply #26 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.

*

Offline Cero

  • *
  • 22
Re: [BUG] OpenAl crashes while unloading since 2.8.1
« Reply #27 on: March 18, 2012, 13:57:05 »
seems fine now

*

Offline kappa

  • *****
  • 1319
Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #28 on: May 21, 2012, 20:57:18 »
should be fixed in nightly builds too now.
« Last Edit: May 21, 2012, 21:56:50 by kappa »

Re: [FIXED] OpenAl crashes while unloading since 2.8.1
« Reply #29 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.
« Last Edit: June 29, 2012, 14:39:57 by cmasupra »