-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenALMusic - Unable to allocate audio buffers. AL Error: 40963 #5318
Comments
i'm able to reproduce with the libgdx MusicTest. First case :
Second case :
libgdx code properly unqueue buffers but as per OpenAL doc : Maybe those kind of use are extreme and maybe Sound should be used instead. |
I have the exact same error on Windows :( - Any news on this ? Scenario:
|
Also happens with LWJGL3, haven't found a solution thus far. |
According to this thread the buffer needs to be processed before |
I've been able to reproduce this in a simple test. If you click and then leave the music running when it gets to the end of the first track the crash will occur. package com.badlogic.gdx.tests;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.tests.utils.GdxTest;
public class MultiMusicTest extends GdxTest {
Music music1, music2;
SpriteBatch batch;
BitmapFont font;
float timer;
@Override
public void create() {
batch = new SpriteBatch();
font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false);
music1 = Gdx.audio.newMusic(Gdx.files.internal("data/60bpm.mp3"));
music1.setLooping(true);
music2 = Gdx.audio.newMusic(Gdx.files.internal("data/8.12.mp3"));
music2.setLooping(true);
}
@Override
public void render() {
timer += Gdx.graphics.getDeltaTime();
if(timer > 1f) {
if(MathUtils.isZero(music1.getVolume())) {
music1.setVolume(1f);
music1.stop();
music2.play();
}
if(MathUtils.isZero(music2.getVolume())) {
music2.setVolume(1f);
music2.stop();
music1.play();
}
music1.setVolume(music1.getVolume() - 0.1f);
music2.setVolume(music2.getVolume() - 0.1f);
timer = 0f;
}
if (Gdx.input.justTouched()) {
if(!music1.isPlaying() && !music2.isPlaying()) {
music1.play();
} else if(music1.isPlaying()) {
music1.stop();
music2.play();
} else {
music2.stop();
music1.play();
}
}
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
font.draw(batch, music1.isPlaying() ? "Music 1 playing" : "Music 1 not playing", 128, 32);
font.draw(batch, music2.isPlaying() ? "Music 2 playing" : "Music 2 not playing", 128, 64);
batch.end();
}
@Override
public void resume () {
System.out.println(Gdx.graphics.getDeltaTime());
}
@Override
public void dispose() {
music1.dispose();
music2.dispose();
}
} |
It seems the specific OpenAL error is: Looking in the OpenAL API docs, alGenBuffers only generates this error when: But if I breakpoint before |
@tomcashman Your crash happens because Since we don't check Also, we should check the volume parameter is in range. |
…erward. Prevent volume from being set < 0. #5318
I have had this happen when I added a fade out and then volume was set to less than zero. Once ensured the volume never went below zero -- things worked as expected. |
Issue 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:
Version of LibGDX and/or relevant dependencies
1.9.9-SNAPSHOT
Stacktrace
Please select the affected platforms
The text was updated successfully, but these errors were encountered: