[Solved] OpenAL error: Invalid enum parameter value (40963)

After rewriting my sound class (changed so I stream the .oggs now, less memory used :D) I get these exceptions. Anyone know what causes them?



I get a lot of them for a few seconds while my app is frozen, then they stop and everything continues as normal.


2007-okt-16 10:05:15 class com.jmex.audio.openal.OpenALSystem update()
org.lwjgl.openal.OpenALException: OpenAL error: Invalid enum parameter value (40963)
        at org.lwjgl.openal.Util.checkALError(Util.java:64)
        at org.lwjgl.openal.AL10.alSourceUnqueueBuffers(AL10.java:1192)
        at com.jmex.audio.openal.OpenALStreamedAudioPlayer.empty(Unknown Source)
        at com.jmex.audio.openal.OpenALStreamedAudioPlayer.stop(Unknown Source)
        at com.jmex.audio.AudioTrack.stop(Unknown Source)
        at com.jmex.audio.MusicTrackQueue.update(Unknown Source)
        at com.jmex.audio.openal.OpenALSystem.update(Unknown Source)
        at com.jmex.game.StandardGame.update(Unknown Source)
        at com.jmex.game.StandardGame.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:619)



2007-okt-16 10:13:14 com.jmex.audio.openal.OpenALStreamedAudioPlayer playInNewThread
ALLVARLIG: Audio Error!
org.lwjgl.openal.OpenALException: OpenAL error: Invalid Name parameter (40961)
        at org.lwjgl.openal.Util.checkALError(Util.java:64)
        at org.lwjgl.openal.AL10.alSourcePlay(AL10.java:934)
        at com.jmex.audio.openal.OpenALStreamedAudioPlayer.playStream(Unknown Source)
        at com.jmex.audio.openal.OpenALStreamedAudioPlayer.playInNewThread(Unknown Source)
        at com.jmex.audio.openal.OpenALStreamedAudioPlayer.play(Unknown Source)
        at com.jmex.audio.AudioTrack.play(Unknown Source)
        at com.jmex.audio.MusicTrackQueue.update(Unknown Source)
        at com.jmex.audio.openal.OpenALSystem.update(Unknown Source)
        at com.jmex.game.StandardGame.update(Unknown Source)
        at com.jmex.game.StandardGame.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:619)

I think, like the G11 functions, those AL10 functions need to be executed inside the OpenGl thread.

Did you try sending the play() and stop() calls to the GameTaskQueueManager ?

I tried it now, and that seems to have solved the problem, thanks! :slight_smile:



Are those the only audio commands that need to be executed this way?

Gathers said:

I tried it now, and that seems to have solved the problem, thanks! :)
Are those the only audio commands that need to be executed this way?

I think there is no easy way to tell if a function needs to be executed inside the opengl thread or not.
Simply wait till something fails, and then check if a AL or GL Class is involved :)

Anything that makes GL/AL calls needs to be in the rendering/audio thread, otherwise you will get errors. You can check if a method makes GL calls by checking the source.