LWJGL
June 19, 2013, 06:12:56 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: oggEffect.isPlaying() dies with UnsatisfiedLinkError  (Read 3074 times)
Cottonwood
Regular nerd
**
Posts: 50



WWW
« on: February 06, 2011, 03:30:56 »

My program dies while asking for "ogg sound is playing or not". The only hint I found in the web is in Spanish and seems not to hit the problem exactly:
http://www.javahispano.org/forum/javacup/es/bug_en_visor_opengl/

Exception in thread "Thread-5" java.lang.UnsatisfiedLinkError: org.lwjgl.openal.AL10.nalGetSourcei(II)I
   at org.lwjgl.openal.AL10.nalGetSourcei(Native Method)
   at org.lwjgl.openal.AL10.alGetSourcei(AL10.java:881)
   at org.newdawn.slick.openal.SoundStore.isPlaying(SoundStore.java:437)
   at org.newdawn.slick.openal.AudioImpl.isPlaying(AudioImpl.java:73)
   at de.virginiacity.software.JukeSound.playSound(JukeSound.java:77)
   at de.virginiacity.software.MusicPlayer.run(MusicPlayer.java:112)
   at java.lang.Thread.run(Unknown Source)

JukeSound.java:77    while (oggEffect.isPlaying()){

What can I do to solve the problem?
Logged

Regards. Cottonwood.
broumbroum
Prolific Timewaster
****
Posts: 324



WWW
« Reply #1 on: February 06, 2011, 03:40:20 »

check your java library path. It must find the openal dynamic library file.
check what version of lwjgl/slick you're running and maybe get to the latest release. Smiley
Logged

Sf3JSwing project, code repo (Apache License) -  http://www.sourceforge.net/p/sf3jswing
Sf3jswing Project Forum - http://apps.sourceforge.net/phpbb/sf3jswing/
Cottonwood
Regular nerd
**
Posts: 50



WWW
« Reply #2 on: February 06, 2011, 12:29:05 »

Sorry I've forgotten to tell that the problem occurs very sporadically. Usually the sound works.
Logged

Regards. Cottonwood.
broumbroum
Prolific Timewaster
****
Posts: 324



WWW
« Reply #3 on: February 06, 2011, 13:48:57 »

That's unusual though.
Logged

Sf3JSwing project, code repo (Apache License) -  http://www.sourceforge.net/p/sf3jswing
Sf3jswing Project Forum - http://apps.sourceforge.net/phpbb/sf3jswing/
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #4 on: February 06, 2011, 14:40:43 »

multiple threads?
Logged

Cottonwood
Regular nerd
**
Posts: 50



WWW
« Reply #5 on: February 06, 2011, 16:54:54 »

My program has some threads. In this part there are two. The player starte always with it's own thread, I think. Meanwhile I prepare the next title

Code:
       if (firstRun){
            try {oggEffect = AudioLoader.getAudio("OGG", new FileInputStream("temporary.ogg"));
            } catch (IOException e) {e.printStackTrace();return;}
            firstRun = false;
        }else{
            try {oggEffect1 = AudioLoader.getAudio("OGG", new FileInputStream("temporary.ogg"));
            } catch (IOException e) {e.printStackTrace();return;}
            while (oggEffect.isPlaying()){
                try{Thread.sleep(100);
                } catch (InterruptedException e) {e.printStackTrace();return;}
            }
            oggEffect = oggEffect1;
        }
            oggEffect.playAsMusic(1.0f, 1.0f, false);

But it happend somewhere within a title. At that moment the program must have been in the loop.
Logged

Regards. Cottonwood.
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #6 on: February 06, 2011, 22:34:09 »

I dont recommend using multiple threads accessing OpenAL. Try to use only 1 thread - specifically, the one that creates the OpenAL context.
Logged

Cottonwood
Regular nerd
**
Posts: 50



WWW
« Reply #7 on: February 07, 2011, 06:03:20 »

Maybe we missunderstand each other. The java program has to create the next sound. Otherwise there will be a long gap between two songs. The second thread ist the sound itselvf.
Logged

Regards. Cottonwood.
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #8 on: February 07, 2011, 09:52:27 »

I think you need to reorder your stuff a bit Smiley

Simple games only need 1 thread. You should not sleep while you are playing the 1st sound. Instead the thread should be busy rendering and handling AI, Input and whatnot.

Consider looking at the SoundManager for the space invaders example, which is a fairly simplistic approach, but gets the job done: http://lwjgl.org/wiki/index.php?title=Examples:SpaceInvaders_SoundManager

In this case you'd feed the soundmanager using addSound and then play them when you need to
Logged

Cottonwood
Regular nerd
**
Posts: 50



WWW
« Reply #9 on: February 09, 2011, 03:01:20 »

Thank you for the answer. Sorry, but at the moment I have urgent things to do. I'll come back in a few days.
Logged

Regards. Cottonwood.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!