I get this error in the log. It is the last line, and happens when I close the game. It is not the effect of a crash.
INFO: Display destroyed.
AL lib: ReleaseALC: 1 device not closed
Should I be worrying?
This is the whole program:
Main:
[java]package mygame;
import com.jme3.animation.AnimChannel;
import com.jme3.animation.AnimControl;
import com.jme3.animation.AnimEventListener;
import com.jme3.animation.LoopMode;
import com.jme3.app.SimpleApplication;
import com.jme3.input.KeyInput;
import com.jme3.input.MouseInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.input.controls.MouseButtonTrigger;
import com.jme3.light.DirectionalLight;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.system.AppSettings;
import java.util.Date;
public class Main extends SimpleApplication implements AnimEventListener{
Anim aniControl = new Anim();
AnimChannel Mchannel;
AnimControl Mcontrol;
static Node player;
public static void main(String[] args) {
Main app = new Main();
AppSettings settings=new AppSettings(true);
settings.setWidth(1024);
settings.setHeight(768);
settings.setFullscreen(true);
settings.setBitsPerPixel(32);
settings.setVSync(false);
settings.setFrequency(60);
settings.setFrameRate(60);
app.setSettings(settings);
app.setShowSettings(false);
app.start();
}
@Override
public void simpleInitApp() {
viewPort.setBackgroundColor(ColorRGBA.LightGray);
initKeys();
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -1f, -1).normalizeLocal());
rootNode.addLight(dl);
player = (Node) assetManager.loadModel("Models/Fin/Fin.j3o");
long lDateTime = new Date().getTime();
Node rock = (Node) assetManager.loadModel("Models/Rock Test/Rock Test.j3o");
rock.setLocalScale(0.05f);
rootNode.attachChild(rock);
long lDateTime2 = new Date().getTime();
System.out.println(lDateTime2 - lDateTime);
//rootNode.attachChild(player);
aniControl.AnimStart();
Mchannel = aniControl.channel;
Mcontrol = aniControl.control;
//flyCam.setEnabled(false);
}
public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) {
/if (animName.equals("Kick")) {
channel.setAnim("Stand", 0f);
channel.setLoopMode(LoopMode.DontLoop);
channel.setSpeed(1f);
}/
}
public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
// unused
}
private void initKeys() {
inputManager.addMapping("Kick", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));;
inputManager.addListener(actionListener, "Kick");
}
private ActionListener actionListener = new ActionListener() {
public void onAction(String name, boolean keyPressed, float tpf) {
if (name.equals("Kick") && !keyPressed) {
if (!Mchannel.getAnimationName().equals("Kick")) {
Mchannel.setAnim("Kick", 0f);
Mchannel.setLoopMode(LoopMode.Cycle);
}
}
}
};
}[/java]
Anim:
[java]package mygame;
import com.jme3.animation.AnimChannel;
import com.jme3.animation.AnimControl;
import com.jme3.animation.AnimEventListener;
import com.jme3.animation.LoopMode;
import com.jme3.app.SimpleApplication;
import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.light.DirectionalLight;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.system.AppSettings;
public class Anim implements AnimEventListener{
AnimChannel channel;
AnimControl control;
public void AnimStart(){
control = Main.player.getControl(AnimControl.class);
control.addListener(this);
channel = control.createChannel();
channel.setAnim("Stand");
channel.setTime(16);
}
public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) {
}
public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
}
}[/java]
I get this almost every time an application closes.
I believe it’s a sound device in OpenAL that’s not successfully closed (or something similar?), which in my case leads to stuttering in the sound if I start and stop the application many times and this error is shown.
It’s not terribly bad though, but I’d be happy to know if there is a solution as well.
Yeah, me too. Anyone knows anything about it?
If you plug “AL lib: ReleaseALC: 1 device not closed” into the little google search bar up in the right below your profile pic + logout button then there are a bunch of hits.
I didn’t find any topics dealing with thus issue. When wezrule brought it up, normen’s reply was: "duh, its just a warning lol "
However, I was becoming worried since it only occurred in one program I was programming.
Well, based on poking into the 5 or 6 other threads I found in that search, it seems to depend on what Java you are running, what OS you have, etc… None of which we know.
I don’t know, though because for me it happens intermittently on seemingly any JME app and I’m running WinXP and regular 32 bit Oracle Java. About as “vanilla” as it gets.
Thanks for your help