Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-9974

Initialization of OpenAL fails sometimes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w06a, Snapshot 13w07a, Minecraft 1.8.8, Minecraft 15w47a, Minecraft 1.8.9, Minecraft 16w03a, Minecraft 16w04a, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w35a, Minecraft 16w36a, Minecraft 16w39a, Minecraft 16w39c, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 5, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2
    • Fix Version/s: Minecraft 17w43a
    • Labels:
    • Confirmation Status:
      Confirmed

      Description

      Workaround

      If you experience this bug, you can press F3+T while ingame to reload the sound engine, which should fix it temporarily.

      If the bug persists for an extended period of time, you should instead contact đź’¬ Community Support as it is likely a driver issue or another configuration issue on your end.

      Occasionally when resources are loaded, OpenAL fails to start and there is no sound. Generally it works fine, but very rarely it fails.
      In that case, it switches to no-sound version.
      This is a game log from when it failed to start:

      [09:46:32] [Sound Library Loader/INFO]: Starting up SoundSystem...
      [09:46:32] [Thread-6/INFO]: Initializing LWJGL OpenAL
      [09:46:32] [Thread-6/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
      AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005
      AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005
      [09:46:32] [Thread-6/ERROR]: Error in class 'LibraryLWJGLOpenAL'
      [09:46:32] [Thread-6/ERROR]: Unable to initialize OpenAL.  Probable cause: OpenAL not supported.
      [09:46:32] [Thread-6/WARN]: ERROR MESSAGE:
      [09:46:32] [Thread-6/INFO]: Could not locate OpenAL library.
      [09:46:32] [Thread-6/WARN]: STACK TRACE:
      [09:46:32] [Thread-6/INFO]: org.lwjgl.openal.AL.create(AL.java:156)
      [09:46:32] [Thread-6/INFO]: org.lwjgl.openal.AL.create(AL.java:102)
      [09:46:32] [Thread-6/INFO]: org.lwjgl.openal.AL.create(AL.java:206)
      [09:46:32] [Thread-6/INFO]: paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164)
      [09:46:32] [Thread-6/INFO]: paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576)
      [09:46:32] [Thread-6/INFO]: paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572)
      [09:46:32] [Thread-6/INFO]: paulscode.sound.CommandThread.run(CommandThread.java:121)
      [09:46:33] [Sound Library Loader/WARN]: ERROR MESSAGE:
      [09:46:33] [Sound Library Loader/INFO]: Could not locate OpenAL library.
      [09:46:33] [Sound Library Loader/INFO]: Starting up SoundSystem...
      [09:46:33] [Thread-8/INFO]: Switching to No Sound
      [09:46:33] [Thread-8/INFO]: (Silent Mode)
      

      A second reproduction with a debug log4j config, and with -Dorg.lwjgl.util.Debug=true in the launcher args, and with the system environment variable ALSOFT_LOGLEVEL set to 3, gives this:

      [21:00:54.655] [Client thread/INFO]: Setting user: pokechu22
      [21:00:54.662] [Client thread/DEBUG]: (Session ID is token:<censored>)
      [21:01:01.502] [Client thread/INFO]: Loaded 482 advancements
      [21:01:02.371] [Client thread/INFO]: LWJGL Version: 2.9.4
      [21:01:02.517] [Client thread/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Initial mode: 1366 x 768 x 32 @60Hz
      [21:01:02.826] [Client thread/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] MemoryUtil Accessor: AccessorUnsafe
      [21:01:03.520] [Client thread/INFO]: Reloading ResourceManager: Default, SoundDemo
      [21:01:07.891] [Client thread/DEBUG]: Replaced sound event location minecraft:music.creative
      [21:01:07.894] [Client thread/DEBUG]: Adding duplicate key 'minecraft:music.creative' to registry
      [21:01:07.910] [Client thread/DEBUG]: Replaced sound event location minecraft:music.credits
      [21:01:07.911] [Client thread/DEBUG]: Adding duplicate key 'minecraft:music.credits' to registry
      [21:01:07.914] [Client thread/DEBUG]: Replaced sound event location minecraft:music.dragon
      [21:01:07.914] [Client thread/DEBUG]: Adding duplicate key 'minecraft:music.dragon' to registry
      [21:01:07.917] [Client thread/DEBUG]: Replaced sound event location minecraft:music.end
      [21:01:07.917] [Client thread/DEBUG]: Adding duplicate key 'minecraft:music.end' to registry
      [21:01:07.919] [Client thread/DEBUG]: Replaced sound event location minecraft:music.game
      [21:01:07.920] [Client thread/DEBUG]: Adding duplicate key 'minecraft:music.game' to registry
      [21:01:07.937] [Client thread/DEBUG]: Replaced sound event location minecraft:music.menu
      [21:01:07.937] [Client thread/DEBUG]: Adding duplicate key 'minecraft:music.menu' to registry
      [21:01:07.942] [Client thread/DEBUG]: Replaced sound event location minecraft:music.nether
      [21:01:07.943] [Client thread/DEBUG]: Adding duplicate key 'minecraft:music.nether' to registry
      [21:01:07.955] [Client thread/WARN]: Missing sound for event: minecraft:entity.player.hurt_drown
      [21:01:07.958] [Client thread/WARN]: Missing sound for event: minecraft:entity.player.hurt_on_fire
      [21:01:07.988] [Sound Library Loader/INFO]: Starting up SoundSystem...
      [21:01:08.221] [Thread-3/INFO]: Initializing LWJGL OpenAL
      [21:01:08.225] [Thread-3/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
      [21:01:08.236] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] getPathFromClassLoader: searching for: OpenAL64
      AL lib: (II) alc_initconfig: Supported backends: mmdevapi, dsound, winmm, null, wave
      AL lib: (II) GetConfigValue: Key general:disable-cpu-exts not found
      AL lib: (II) FillCPUCaps: Got caps: SSE
      AL lib: (II) GetConfigValue: Key general:rt-prio not found
      AL lib: (II) GetConfigValue: Key general:resampler not found
      AL lib: (II) GetConfigValue: Key general:trap-al-error not found
      AL lib: (II) GetConfigValue: Key general: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 general:drivers not found
      [21:01:08.239] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to locate findLibrary method: java.lang.NoSuchMethodException: sun.misc.Launcher$AppClassLoader.findLibrary(java.lang.String)
      AL lib: (II) MMDevApiMsgProc: Starting message thread
      AL lib: (II) alc_initconfig: Initialized backend "mmdevapi"
      AL lib: (II) alc_initconfig: Added "mmdevapi" for playback
      AL lib: (II) alc_initconfig: Initialized backend "dsound"
      AL lib: (II) alc_initconfig: Added "dsound" for capture
      AL lib: (II) GetConfigValue: Key general:excludefx not found
      AL lib: (II) GetConfigValue: Key general:default-reverb not found
      AL lib: (II) GetConfigValue: Key general:channels not found
      AL lib: (II) GetConfigValue: Key general:sample-type not found
      AL lib: (II) GetConfigValue: Key general:format not found
      AL lib: (II) GetConfigValue: Key general:frequency not found
      AL lib: (II) GetConfigValue: Key general:periods not found
      AL lib: (II) GetConfigValue: Key general:period_size not found
      AL lib: (II) GetConfigValue: Key general:sources not found
      AL lib: (II) GetConfigValue: Key general:slots not found
      AL lib: (II) GetConfigValue: Key general:sends not found
      AL lib: (II) GetConfigValue: Key general:cf_level not found
      AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005
      AL lib: (II) GetConfigValue: Key general:channels not found
      AL lib: (II) GetConfigValue: Key general:sample-type not found
      AL lib: (II) GetConfigValue: Key general:format not found
      AL lib: (II) GetConfigValue: Key general:frequency not found
      AL lib: (II) GetConfigValue: Key general:periods not found
      AL lib: (II) GetConfigValue: Key general:period_size not found
      AL lib: (II) GetConfigValue: Key general:sources not found
      AL lib: (II) GetConfigValue: Key general:slots not found
      AL lib: (II) GetConfigValue: Key general:sends not found
      AL lib: (II) GetConfigValue: Key general:cf_level not found
      AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005
      AL lib: (II) MMDevApiMsgProc: Starting message loop
      [21:01:08.242] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.net.URLClassLoader.findLibrary(java.lang.String)
      [21:01:08.242] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.security.SecureClassLoader.findLibrary(java.lang.String)
      [21:01:08.250] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] getPathFromClassLoader: searching for: lwjgl
      [21:01:08.250] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to locate findLibrary method: java.lang.NoSuchMethodException: sun.misc.Launcher$AppClassLoader.findLibrary(java.lang.String)
      [21:01:08.252] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.net.URLClassLoader.findLibrary(java.lang.String)
      [21:01:08.252] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to locate findLibrary method: java.lang.NoSuchMethodException: java.security.SecureClassLoader.findLibrary(java.lang.String)
      [21:01:08.276] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Found 3 OpenAL paths
      [21:01:08.277] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Testing 'C:\Users\Pokechu22\AppData\Roaming\.minecraft\versions\17w18b\17w18b-natives-12740868475532\OpenAL64.dll'
      [21:01:08.282] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Found OpenAL at 'C:\Users\Pokechu22\AppData\Roaming\.minecraft\versions\17w18b\17w18b-natives-12740868475532\OpenAL64.dll'
      [21:01:08.348] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to load C:\Users\Pokechu22\AppData\Roaming\.minecraft\versions\17w18b\17w18b-natives-12740868475532\OpenAL64.dll: Could not open ALC device
      [21:01:08.349] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Testing 'C:\Users\Pokechu22\AppData\Roaming\.minecraft\OpenAL64.dll'
      [21:01:08.350] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to load C:\Users\Pokechu22\AppData\Roaming\.minecraft\OpenAL64.dll: Could not load OpenAL library (126)
      [21:01:08.351] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Testing 'OpenAL64.dll'
      [21:01:08.357] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Found OpenAL at 'OpenAL64.dll'
      [21:01:08.360] [Thread-3/INFO]: [STDERR]@.(LWJGLUtil.java:514): [LWJGL] Failed to load OpenAL64.dll: Could not open ALC device
      [21:01:08.362] [Thread-3/ERROR]: Error in class 'LibraryLWJGLOpenAL'
      [21:01:08.363] [Thread-3/ERROR]: Unable to initialize OpenAL.  Probable cause: OpenAL not supported.
      [21:01:08.363] [Thread-3/WARN]: ERROR MESSAGE:
      [21:01:08.363] [Thread-3/INFO]: Could not locate OpenAL library.
      [21:01:08.363] [Thread-3/WARN]: STACK TRACE:
      [21:01:08.364] [Thread-3/INFO]: org.lwjgl.openal.AL.create(AL.java:156)
      [21:01:08.364] [Thread-3/INFO]: org.lwjgl.openal.AL.create(AL.java:102)
      [21:01:08.364] [Thread-3/INFO]: org.lwjgl.openal.AL.create(AL.java:206)
      [21:01:08.364] [Thread-3/INFO]: paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164)
      [21:01:08.365] [Thread-3/INFO]: paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576)
      [21:01:08.365] [Thread-3/INFO]: paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572)
      [21:01:08.365] [Thread-3/INFO]: paulscode.sound.CommandThread.run(CommandThread.java:121)
      [21:01:08.598] [Sound Library Loader/WARN]: ERROR MESSAGE:
      [21:01:08.599] [Sound Library Loader/INFO]: Could not locate OpenAL library.
      [21:01:08.599] [Sound Library Loader/INFO]: Starting up SoundSystem...
      [21:01:08.936] [Thread-5/INFO]: Switching to No Sound
      [21:01:08.938] [Thread-5/INFO]: (Silent Mode)
      [21:01:09.212] [Sound Library Loader/INFO]: Sound engine started
      [21:01:28.017] [Client thread/INFO]: Created: 1024x512 textures-atlas
      [21:01:34.657] [Client thread/INFO]: [STDOUT]@.(NarratorWindows.java:20): Narrator library for x64 successfully loaded
      [21:01:39.821] [Client thread/DEBUG]: Playing sound minecraft:random/click for event minecraft:ui.button.click as channel d8c5b63b-c0f9-4858-8689-ab8f92918a44
      [21:01:40.861] [Client thread/DEBUG]: Removed channel d8c5b63b-c0f9-4858-8689-ab8f92918a44 because it's not playing anymore
      [21:01:40.894] [Client thread/DEBUG]: Playing sound minecraft:random/click for event minecraft:ui.button.click as channel 558503eb-5f3b-4f9e-a925-f13464f9493a
      [21:01:41.960] [Client thread/DEBUG]: Removed channel 558503eb-5f3b-4f9e-a925-f13464f9493a because it's not playing anymore
      [21:01:41.993] [Client thread/DEBUG]: Playing sound minecraft:music/menu/menu1 for event minecraft:music.menu as channel 730fee9b-fcfd-4261-a427-ce33b23d8dcb
      [21:01:43.028] [Client thread/DEBUG]: Removed channel 730fee9b-fcfd-4261-a427-ce33b23d8dcb because it's not playing anymore
      [21:02:04.899] [Client thread/DEBUG]: Playing sound minecraft:music/menu/menu1 for event minecraft:music.menu as channel 89e96207-569a-4b2e-9760-a3cceacebd50
      [21:02:05.865] [Client thread/DEBUG]: Removed channel 89e96207-569a-4b2e-9760-a3cceacebd50 because it's not playing anymore
      [21:02:23.418] [Client thread/DEBUG]: Playing sound minecraft:music/menu/menu2 for event minecraft:music.menu as channel a78416a6-5d39-4bef-ac14-5092f42eb20d
      [21:02:24.351] [Client thread/DEBUG]: Removed channel a78416a6-5d39-4bef-ac14-5092f42eb20d because it's not playing anymore
      [21:02:31.051] [Client thread/DEBUG]: Playing sound minecraft:music/menu/menu3 for event minecraft:music.menu as channel 2905b576-5eb4-4059-a7e8-83dd15f314c9
      [21:02:32.017] [Client thread/DEBUG]: Removed channel 2905b576-5eb4-4059-a7e8-83dd15f314c9 because it's not playing anymore
      [21:02:44.351] [Client thread/DEBUG]: Playing sound minecraft:music/menu/menu3 for event minecraft:music.menu as channel ae31f3f9-fa8b-43a8-8feb-635fc79b3ba1
      [21:02:45.317] [Client thread/DEBUG]: Removed channel ae31f3f9-fa8b-43a8-8feb-635fc79b3ba1 because it's not playing anymore
      [21:03:00.152] [Client thread/DEBUG]: Playing sound minecraft:music/menu/menu1 for event minecraft:music.menu as channel 271cec83-88d6-4d8e-a7ac-671891e4a219
      [21:03:01.122] [Client thread/DEBUG]: Removed channel 271cec83-88d6-4d8e-a7ac-671891e4a219 because it's not playing anymore
      [21:03:20.110] [Client thread/DEBUG]: Playing sound minecraft:random/click for event minecraft:ui.button.click as channel b37436b6-ea17-4a68-a2ac-8f704d664e73
      [21:03:20.141] [Client thread/INFO]: Stopping!
      [21:03:20.147] [Client thread/INFO]: SoundSystem shutting down...
      [21:03:20.348] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
      Could not locate symbol glEnableClientStateiEXT
      Could not locate symbol glDisableClientStateiEXT
      Could not locate symbol glGetFloati_vEXT
      Could not locate symbol glGetDoublei_vEXT
      Could not locate symbol glGetPointeri_vEXT
      

      Note that the 3 failures after each instance of "getPathFromClassLoader: searching for:" happen even when audio works successfully - it's likely a platform thing. Additionally, "Could not locate symbol" at the bottom also occurs each time. Finally, note that C:\Users\Pokechu22\AppData\Roaming\.minecraft\OpenAL64.dll does not exist and never should exist (as it is only supposed to be located in the temporary natives folder) - the "Could not load OpenAL library" message from it probably is a red herring; the earlier "Could not open ALC device" and "MMDevApiOpenPlayback: Device init failed: 0x80004005" are probably more useful. Also, note that 0x80004005 is a meaningless error code; it just represents E_FAIL which means "Unspecified failure".


      After asking the OpenAL mailing list for additional information, it turns out that this is a fairly old OpenAL bug, which was fixed in OpenAL Soft version 1.16. Minecraft is using version 1.15.1 (as LWJGL 2 uses it). This can be fixed by updating OpenAL, either by migrating to LWJGL 3, or just directly updating the OpenAL dll using the one from LWJGL 3 on LWJGL 2.


      I would suggest having Minecraft detect when this happens, and try to restart OpenAL. If it fails multiple times, then it should force a no sound mode. At minimum, a message should be displayed on the title screen in some way, advising the user to use F3+T to reload the sound engine.

      MC does attempt to detect this happening in SoundManager, but the sound is loaded in a separate thread from which the catch statement happens. Thread.setUncaughtExceptionHandler should be used instead. Even then, that handler only logs an error and mutes audio; for the general user this behavior isn't entirely obvious ("Why did my game just mute itself‽") although (IIRC) doing that does reload the sound engine when it's unmuted.

      MC also has a custom SoundSystemLogger (also declared in SoundManager); that could be used to identify such errors as well.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pokechu22 [Mod] Pokechu22
              • Votes:
                25 Vote for this issue
                Watchers:
                24 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: