[SOLVED] StandardGame OpenAL kills game thread if Rhythmbox is playing music?

I'm essentially using a modifed version of the TestIsland class, and nothing actually calling to play any sound in the program, but if I try to run with Rhythmbox open (which probably also uses OpenAL too) I get the following exceptions and the game fails to start until I quit out of Rhythmbox and run again. I'm using lwjgl version 1.1.2 and jme version 1.0 and running Ubuntu 8.04, using Eclipse.  Rhythmbox is the default installed music player for ubuntu. 




ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
open /dev/[sound/]dsp: Device or resource busy
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
open /dev/[sound/]dsp: Device or resource busy
Jul 12, 2008 11:36:03 PM class com.jmex.audio.openal.OpenALSystem OpenALSystem()
SEVERE: Exception
org.lwjgl.LWJGLException: Could not locate OpenAL library.
   at org.lwjgl.openal.AL.create(AL.java:153)
   at org.lwjgl.openal.AL.create(AL.java:104)
   at org.lwjgl.openal.AL.create(AL.java:191)
   at com.jmex.audio.openal.OpenALSystem.<init>(Unknown Source)
   at com.jmex.audio.AudioSystem.getSystem(Unknown Source)
   at com.jmex.game.StandardGame.initSound(Unknown Source)
   at com.jmex.game.StandardGame.initSystem(Unknown Source)
   at com.jmex.game.StandardGame.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:619)
Jul 12, 2008 11:36:03 PM com.jmex.game.DefaultUncaughtExceptionHandler uncaughtException
SEVERE: Main game loop broken by uncaught exception
java.lang.UnsatisfiedLinkError: org.lwjgl.openal.AL10.nalListener3f(IFFF)V
   at org.lwjgl.openal.AL10.nalListener3f(Native Method)
   at org.lwjgl.openal.AL10.alListener3f(AL10.java:675)
   at com.jmex.audio.openal.OpenALEar.update(Unknown Source)
   at com.jmex.audio.Ear.trackOrientation(Unknown Source)
   at com.jmex.game.StandardGame.initSound(Unknown Source)
   at com.jmex.game.StandardGame.initSystem(Unknown Source)
   at com.jmex.game.StandardGame.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:619)

if you google for "open /dev/[sound/]dsp: Device or resource busy" you get a lot of similar problems.



you can look which process uses the device by calling 'lsof | grep dsp'

if artsd is in the list, you can try to kill it and see if it fixes the problem.



http://ubuntuforums.org/showthread.php?t=313755

Bug #76876 “/dev/dsp busy, weird ESD process using it” : Bugs : Ubuntu



the bottom line is, you probably need to tell Rythmbox somehow to use alsa instead of oss.

Also, if it helps, the 2.0 version of lwjgl is supposedly a lot more linux friendly in the openal area.

Ah thanks for the pointer to ALSA, I went to the Sound preferences for Ubuntu and changed all the output sounds to use ALSA instead of the default automatic setting and now it works fine :slight_smile:





edit: I may try lwjgl 2.0 too just cuz its probably a good thing to do, thanks!