OpenALMusic - Unable to allocate audio buffers. AL Error: 40963
See original GitHub issueIssue details
This is a really elusive bug to reproduce. From the crash reports I receive from players, it crops up randomly if one does pause(), setPosition(), play() or dispose() repeatedly. I’m not sure if its hardware related or due to some timing issue. While I could reproduce it consistently with a code similar to #5316 , I’m pretty sure it is not related.
Reproduction steps/code
Just the render() of an empty ApplicationListener:
Music music = null;
@Override
public void render() {
int frameNumber = (int)Gdx.graphics.getFrameId();
Gdx.app.log("CRASH", "Frame " + frameNumber);
switch (frameNumber) {
case 0:
// Frame 1
music = Gdx.audio.newMusic(Gdx.files.external("any_audio_file.ogg"));
music.play();
break;
case 1:
// Frame 2
music.setPosition(26.300f); // must be within at least 200ms from the end
break;
case 2:
// Frame 3
music.setPosition(26.300f); // must be within at least 200ms from the end
break;
case 3:
// Frame 4
music.dispose();
break;
case 4:
// Frame 5
music = Gdx.audio.newMusic(Gdx.files.external("any_audio_file.ogg"));
music.play(); // Crashes here
break;
}
}
Version of LibGDX and/or relevant dependencies
1.9.9-SNAPSHOT
Stacktrace
com.badlogic.gdx.utils.GdxRuntimeException: Unable to allocate audio buffers. AL Error: 40963
at com.badlogic.gdx.backends.lwjgl.audio.OpenALMusic.play(OpenALMusic.java:83)
at game27.DesktopMain$2.render(DesktopMain.java:270)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Please select the affected platforms
- Android
- iOS (robovm)
- iOS (MOE)
- HTML/GWT
- Windows
- Linux
- MacOS
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Libgdx Audio Buffer Error - Stack Overflow
The thing is libgdx's audio class have a logic like this: when do u calling play(); method is adding the object to an...
Read more >Have a music file that plays when we are in a certain zone ...
GdxRuntimeException : Unable to allocate audio buffers. AL Error: 40963' , similar to this guy : https://github.com/libgdx/libgdx/issues/2537.
Read more >Game crashes on disasters or even small fire... - TheoTown
GdxRuntimeException: Unable to allocate audio buffers. AL Error: 40963 at com.badlogic.gdx.backends.lwjgl3.audio.OpenALMusic.play(OpenALMusic.java:84)
Read more >Replay the Spire :: Discussions - Steam Community
A place too hopefully store all the bug reports in one area ... GdxRuntimeException: Unable to allocate audio buffers. AL Error: 40963
Read more >LAsso - Bountysource
Issue details. Running gradle checkGwt task results in build error. ... LWJGL2 OpenALMusic - Unable to allocate audio buffers. AL Error: 40963 $...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the exact same error on Windows 😦 - Any news on this ?
Scenario:
i’m able to reproduce with the libgdx MusicTest.
First case :
Second case :
Unable to allocate audio buffers. AL Error: 40963
libgdx code properly unqueue buffers but as per OpenAL doc :
The unqueue operation will only take place if all n buffers can be removed from the queue.
maybe OpenAL can’t cancel some running buffers which lead to a kind of accumultation due to allocation/free frequency.Maybe those kind of use are extreme and maybe Sound should be used instead.