OpenAL fails on my computer

I vaguely remember that post too and think the one being referred to is here.

A lot has changed since then and it might be that its been fixed in OpenAL-Soft now, although it looks like the code being referred to is still there.

DirectSound’s been deprecated by Microsoft for a while now so maybe its time for OpenAL-Soft to move to another backed on Windows, in recent versions of Windows its not even hardware accelerated anymore but emulated (therefore slower than it could be).

Thanks. I was able to reproduce this with ALSOFT_DRIVERS=dsound (default is mmdevapi on my machine). Fixed it by patching OpenAL-Soft to fall back to GetDesktopWindow() when GetForegroundWindow() returns NULL (this workaround is recommended by Microsoft). Will update the LWJGL build soon.

But I don’t think it’s related to CopyableCougar4’s problem. It simply makes alcOpenDevice fail, not freeze/block.

Build 3.0.0b #15 is up, it has the updated OpenAL.

Spasi: I create the OpenAL context after the GLFW context.

Okay so when I run it by itself, this is what it says:

DEVICE SPECIFIER: Speakers / Headphones (IDT High Definition Audio CODEC)
DEVICE: 12725456

In the audio creation it says:

DEVICE SPECIFIER: Speakers / Headphones (IDT High Definition Audio CODEC)
DEVICE: 15792480

And just to double check, is this the way you want me to set the log level?

System.setProperty("ALSOFT_LOGLEVEL", "3");

Actually I take that back; I create the OpenAL context before the GLFW one.

Also, with 3.0.0b #15 I so far seem to be able to create the OpenAL context successfully each time. Although I will have to wait and see if that holds up.

[quote=“CopyableCougar4,post:17,topic:55278”]
No, it must be an environment variable. You can do [icode]set ALSOFT_LOGLEVEL=3[/icode] at the command line before running your app. You should be getting a lot of output in stderr if you enable it correctly.

Okay. I will be away from my computer today but I will run the program this evening.

Okay so I ran the program (and learned how to set environment variables in eclipse :)), and this is my output:

By itself:

AL lib: (II) alc_initconfig: Supported backends: mmdevapi, dsound, winmm, null, wave
AL lib: (II) ReadALConfig: Loading config C:\Users\Jonathan\AppData\Roaming\alsoft.ini...
AL lib: (II) GetConfigValue: Key disable-cpu-exts not found
AL lib: (II) FillCPUCaps: Detected max CPUID function: 0xd (ext. 0x80000008)
AL lib: (II) FillCPUCaps: Vendor ID: ""
AL lib: (II) FillCPUCaps: Name: "      Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz"
AL lib: (II) FillCPUCaps: Extensions: +SSE +SSE2 +SSE4.1
AL lib: (II) GetConfigValue: Key rt-prio not found
AL lib: (II) GetConfigValue: Key resampler not found
AL lib: (II) GetConfigValue: Key trap-al-error not found
AL lib: (II) GetConfigValue: Key trap-alc-error not found
AL lib: (II) GetConfigValue: Key reverb/boost not found
AL lib: (II) GetConfigValue: Key reverb/emulate-eax not found
AL lib: (II) GetConfigValue: Key drivers not found
AL lib: (II) ALCmmdevProxy_messageHandler: Starting message thread
AL lib: (II) ALCmmdevProxy_messageHandler: Message thread initialization complete
AL lib: (II) ALCmmdevProxy_messageHandler: Starting message loop
AL lib: (II) alc_initconfig: Initialized backend "mmdevapi"
AL lib: (II) alc_initconfig: Added "mmdevapi" for playback
AL lib: (II) alc_initconfig: Added "mmdevapi" for capture
AL lib: (II) GetConfigValue: Key excludefx not found
AL lib: (II) GetConfigValue: Key default-reverb not found
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1029 (lparam=0000000000000000, wparam=000000000203F610)
AL lib: (II) add_device: Got device "Speakers / Headphones (IDT High Definition Audio CODEC)", "{0.0.0.00000000}.{1719dc6d-db44-4249-8032-b24852ae0a3d}"
DEVICE SPECIFIER: Speakers / Headphones (IDT High Definition Audio CODEC)
AL lib: (II) GetConfigValue: Key channels not found
AL lib: (II) GetConfigValue: Key sample-type not found
AL lib: (II) GetConfigValue: Key frequency not found
AL lib: (II) GetConfigValue: Key periods not found
AL lib: (II) GetConfigValue: Key period_size not found
AL lib: (II) GetConfigValue: Key sources not found
AL lib: (II) GetConfigValue: Key slots not found
AL lib: (II) GetConfigValue: Key sends not found
AL lib: (II) GetConfigValue: Key midi/internal-synth not found
AL lib: (II) SSynth_create: Not using internal MIDI synth
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1024 (lparam=0000000000561F08, wparam=000000000203F610)
AL lib: (II) alcOpenDevice: Created device 0000000000578CF0, "Speakers / Headphones (IDT High Definition Audio CODEC)"
DEVICE: 5737712
AL lib: (II) FreeDevice: 0000000000578CF0
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1028 (lparam=0000000000561F08, wparam=000000000203F5D0)

In my project:

AL lib: (II) alc_initconfig: Supported backends: mmdevapi, dsound, winmm, null, wave
AL lib: (II) ReadALConfig: Loading config C:\Users\Jonathan\AppData\Roaming\alsoft.ini...
AL lib: (II) GetConfigValue: Key disable-cpu-exts not found
AL lib: (II) FillCPUCaps: Detected max CPUID function: 0xd (ext. 0x80000008)
AL lib: (II) FillCPUCaps: Vendor ID: ""
AL lib: (II) FillCPUCaps: Name: "      Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz"
AL lib: (II) FillCPUCaps: Extensions: +SSE +SSE2 +SSE4.1
AL lib: (II) GetConfigValue: Key rt-prio not found
AL lib: (II) GetConfigValue: Key resampler not found
AL lib: (II) GetConfigValue: Key trap-al-error not found
AL lib: (II) GetConfigValue: Key trap-alc-error not found
AL lib: (II) GetConfigValue: Key reverb/boost not found
AL lib: (II) GetConfigValue: Key reverb/emulate-eax not found
AL lib: (II) GetConfigValue: Key drivers not found
AL lib: (II) ALCmmdevProxy_messageHandler: Starting message thread
AL lib: (II) ALCmmdevProxy_messageHandler: Message thread initialization complete
AL lib: (II) ALCmmdevProxy_messageHandler: Starting message loop
AL lib: (II) alc_initconfig: Initialized backend "mmdevapi"
AL lib: (II) alc_initconfig: Added "mmdevapi" for playback
AL lib: (II) alc_initconfig: Added "mmdevapi" for capture
AL lib: (II) GetConfigValue: Key excludefx not found
AL lib: (II) GetConfigValue: Key default-reverb not found
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1029 (lparam=0000000000000000, wparam=000000000224F0C0)
AL lib: (II) add_device: Got device "Speakers / Headphones (IDT High Definition Audio CODEC)", "{0.0.0.00000000}.{1719dc6d-db44-4249-8032-b24852ae0a3d}"
DEVICE SPECIFIER: Speakers / Headphones (IDT High Definition Audio CODEC)
AL lib: (II) GetConfigValue: Key channels not found
AL lib: (II) GetConfigValue: Key sample-type not found
AL lib: (II) GetConfigValue: Key frequency not found
AL lib: (II) GetConfigValue: Key periods not found
AL lib: (II) GetConfigValue: Key period_size not found
AL lib: (II) GetConfigValue: Key sources not found
AL lib: (II) GetConfigValue: Key slots not found
AL lib: (II) GetConfigValue: Key sends not found
AL lib: (II) GetConfigValue: Key midi/internal-synth not found
AL lib: (II) SSynth_create: Not using internal MIDI synth
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1024 (lparam=000000000088F158, wparam=000000000224F0C0)
AL lib: (II) alcOpenDevice: Created device 0000000000892D00, "Speakers / Headphones (IDT High Definition Audio CODEC)"
DEVICE: 8989952
AL lib: (II) FreeDevice: 0000000000892D00
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1028 (lparam=000000000088F158, wparam=000000000224F080)
AL lib: (II) GetConfigValue: Key channels not found
AL lib: (II) GetConfigValue: Key sample-type not found
AL lib: (II) GetConfigValue: Key frequency not found
AL lib: (II) GetConfigValue: Key periods not found
AL lib: (II) GetConfigValue: Key period_size not found
AL lib: (II) GetConfigValue: Key sources not found
AL lib: (II) GetConfigValue: Key slots not found
AL lib: (II) GetConfigValue: Key sends not found
AL lib: (II) GetConfigValue: Key midi/internal-synth not found
AL lib: (II) SSynth_create: Not using internal MIDI synth
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1024 (lparam=000000000088EC58, wparam=000000000224EFF0)
AL lib: (II) alcOpenDevice: Created device 0000000000892D00, "Speakers / Headphones (IDT High Definition Audio CODEC)"
AL lib: (II) GetConfigValue: Key frequency not found
AL lib: (II) GetConfigValue: Key sends not found
AL lib: (II) GetConfigValue: Key hrtf not found
AL lib: (II) UpdateDeviceParams: Pre-reset: Stereo, Float, 44100hz, 1024 update size x4
AL lib: (II) ALCmmdevProxy_messageHandler: Got message 1025 (lparam=000000000088EC58, wparam=000000000224EDD0)

It uses the mmdevapi, so the fix I did shouldn’t have changed anything for you. Are you sure build #15 has fixed the issue?

I don’t think it actually fixed it, it just seems to have made the locking up happen less often.

EDIT: It still locks up quite a bit, it just seems to have bigger patches where it goes without locking up.

If it has never locked up on its own and it only happens in your app, then I don’t think I can help more without a code sample that reproduces the issue. Could you please provide one?

It also locks up when I run We Shall Wake.

This is all I do to create the OpenAL context:

context = ALContext.create();

[quote=“CopyableCougar4,post:26,topic:55278”]
Yes, but if that alone works fine, then it must be some interaction with what your application (or We Shall Wake) is doing. I cannot figure this out without some code to test. Also, does the ALSOFT_LOGLEVEL output look any different when it locks up?

The output is identical when it locks up (except for the device ID).

I guess maybe it’s just my system and I just have to test audio code on another system?

CopyableCougar4, the title of your thread is a bit misleading as your problem is specific to one version of a set of Java bindings that supports OpenAL.

The problem is not necessarily the Java bindings, because the bindings work for most everybody else.

[quote=“gouessej,post:29,topic:55278”]
After all these years, aren’t you fucking tired already? Do you really gain anything from bashing LWJGL all the time?

It’s an open-source project. The source is here. All binary dependencies are built from source, you can find it here. If you think there’s something wrong/buggy/evil about any of the above, you’re welcome to submit a pull request. You won’t catch a disease.

There is no corporation behind LWJGL. I have personally written most of the code. Is there something about me that you feel uncomfortable about and would like to discuss?

Chortle ::slight_smile:

Cas :slight_smile:

Wasn’t this issue finally dealt with here? Not sure why you’re provoking the same problems again.