OpenAL NoSuchMethodError in linux in Lwjgl 2.0

Started by laDanz, October 17, 2008, 15:26:26

Previous topic - Next topic

laDanz

Hi there,

I just upgraded from Lwjgl2.0rc2 to Lwjgl2.0 because of some OpenAL issues in win32.
But now the OpenAL in linux (with newer 2.0 Version) throws this error:

Exception in thread "main" java.lang.NoSuchMethodError: Method org.lwjgl.openal.AL10.alEnable(I)V is not declared as native
	at org.lwjgl.openal.AL10.initNativeStubs(Native Method)
	at org.lwjgl.openal.AL.init(AL.java:158)
	at org.lwjgl.openal.AL.create(AL.java:140)
	at org.lwjgl.openal.AL.create(AL.java:104)


Am i doing something wrong, or what?
I also noticed that the OpenAL library in the win32 part got bigger with the upgrade, but the one in the linux part had the same size(same file ?)

Thanks for your time!

NateS

This is happening to me also, but on Mac OS X 10.5.5. I have reverted to an older version (2.0b1) and it works. Any ideas?

Matzon

I am re-building for a 2.0.1 release, not sure what happened...  >:(

broumbroum

Quote from: Matzon on November 18, 2008, 06:32:42
I am re-building for a 2.0.1 release, not sure what happened...  >:(

I can't run neither openAL LWJGL 2.0rc2 nor 2.0.1.. openSUSE 11.1 + KDE4 running JDK 6 U 11.
I've tried GIT openALSoft and I get the same error. :(
OPENAL is generating 100 buffers and sources...
java.lang.NoSuchMethodError: Method org.lwjgl.openal.AL10.nalEnable(I)V not found
        at org.lwjgl.openal.AL10.initNativeStubs(Native Method)
        at org.lwjgl.openal.AL.init(AL.java:158)
        at org.lwjgl.openal.AL.create(AL.java:140)
        at org.lwjgl.openal.AL.create(AL.java:104)
        at org.lwjgl.openal.AL.create(AL.java:191)
        at net.library.jiga.sf3.SoundInput._genALBuffersAndSources(SoundInput.java:207)

Matzon

strange could you try and run with -Dorg.lwjgl.util.Debug=true ?

broumbroum

Sure, I'm running now Suse 10.1 + KDE3.5 + X.org 6.9, 1.5 GB RAM, Radeon 9250SE and Java 6U11 with LWJGL 2.0.1.
Found 12 OpenAL paths
Testing '.JXAexts/libopenal64.so'
Failed to load .JXAexts/libopenal64.so: Could not load OpenAL library
Testing './.JXAexts/libopenal64.so'
Failed to load ./.JXAexts/libopenal64.so: Could not load OpenAL library
Testing '/home/bruno/java-prj/JIGAXtendedAPI/dist/Linux/libopenal64.so'
Failed to load /home/bruno/java-prj/JIGAXtendedAPI/dist/Linux/libopenal64.so: Could not load OpenAL library
Testing 'libopenal64.so'
Failed to load libopenal64.so: Could not load OpenAL library
Testing '.JXAexts/libopenal.so'
Found OpenAL at '.JXAexts/libopenal.so'
java.lang.reflect.InvocationTargetException
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:997)
        at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1323)
        at net.library.jiga.installer.AppLauncher$14$2.run(AppLauncher.java:812)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoSuchMethodError: Method org.lwjgl.openal.AL10.nalEnable(I)V not found
        at org.lwjgl.openal.AL10.initNativeStubs(Native Method)
        at org.lwjgl.openal.AL.init(AL.java:158)
        at org.lwjgl.openal.AL.create(AL.java:140)
        at org.lwjgl.openal.AL.create(AL.java:104)
        at org.lwjgl.openal.AL.create(AL.java:191)
        at net.library.jiga.sf3.SoundInput._genALBuffersAndSources(SoundInput.java:210)
        at net.library.jiga.sf3.SoundInput.<clinit>(SoundInput.java:192)
        at net.library.jiga.installer.test.TestAntFrame.initComponents(TestAntFrame.java:83)
        at net.library.jiga.installer.AppLauncher$14$2$1.run(AppLauncher.java:803)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

openAL loading fine but enabling it causes this exception.


Matzon

are you running 32 or 64 bit linux and/or java ?

broumbroum

32 bits 2600+ Sempron AMD. This is exactly the same config I used to run with Windows XP a month ago. openAL simply doesn't work. Since my code can switch between Java Sound and openAL seemlessly, Java sound is used on Linux.

Matzon

I'll look into this soon - just getting a bit late here...

broumbroum


Matzon

right, so I installed Debian Etch 4.0r6 32 bit, net install - desktop environment.
apt-get insall sun-java5-jdk
download lwjgl 2.0.1
ran lwjgl: org.lwjgl.test.openal.PlayTest - no problems at all:
Quotematzon@debian:~/Desktop/lwjgl-2.0.1$ java -cp res:jar/lwjgl.jar:jar/lwjgl_test.jar:jar/lwjgl_util.jar -Dorg .lwjgl.util.Debug=true -Djava.library.path=native/linux org.lwjgl.test.openal.PlayTest
Found 9 OpenAL paths
Testing 'native/linux/libopenal64.so'
Failed to load native/linux/libopenal64.so: Could not load OpenAL library
Testing '/home/matzon/Desktop/lwjgl-2.0.1/libopenal64.so'
Failed to load /home/matzon/Desktop/lwjgl-2.0.1/libopenal64.so: Could not load OpenAL library
Testing 'libopenal64.so'
Failed to load libopenal64.so: Could not load OpenAL library
Testing 'native/linux/libopenal.so'
Found OpenAL at 'native/linux/libopenal.so'
Default device: ALSA Software on default
Available devices:
0: ALSA Software on default
1: ALSA Software on Intel 82801AA-ICH
2: OSS Software
3: Wave File Writer
no argument supplied, assuming Footsteps.wav
Waiting 5 seconds for sound to complete


Matzon

maybe its an pulseaudio thing? - do you have OSS or ALSA ?

broumbroum

I'm using ALSA. Anyway, this is not alsa, but I think a link in the JNI can be broken. Because you posted that the libopenal.so loaded itself right ? It is the case for me, too. But as I can tell you I hear no sound when invoking the playback further (though Java Sound works good, as well as JLayer mp3 library for background music). This seems to cause an exception when creating AL source. Here I expand SoundInput._genALBuffersAndSources(SoundInput.java:210) :
    /** this method initializes openAL and generates the specified numbers of sources and buffers.
    NOTICE :  this method should not be called more than required, and is unnecessary to be called to use this class, because 
    it is initialized once at class loading time. 
     * The initial buffer size is specified in the net.library.jiga.sf3.game.rendering properties file.
     * @param numBuffers the amount of buffers and source to mutually generate (all prev buffers and source are discarded)
     */
    public static void _genALBuffersAndSources(int numBuffers) {
        System.out.println("OPENAL is generating " + numBuffers + " buffers and sources...");
        buffers = IntBuffer.allocate(numBuffers);
        sources = IntBuffer.allocate(numBuffers);
        ALBuffersMap.clear();
        ALSourcesMap.clear();
        _ALBackBuffer.setListCapacity(numBuffers);
        /* Initialize OpenAL and clear the error bit.*/
        try {
            AL.destroy();
            AL.create(); // <= Exception is thrown HERE at this point
            AL10.alGetError();
            AL10.alGenBuffers(buffers);
            int result;
            if ((result = AL10.alGetError()) != AL10.AL_NO_ERROR) {
                throw new OpenALException(_getALErrorString(result));
            }
            AL10.alGenSources(sources);
            if ((result = AL10.alGetError()) != AL10.AL_NO_ERROR) {
                throw new OpenALException(_getALErrorString(result));
            }
        } catch (LWJGLException le) {
            le.printStackTrace();
        }
    }

I tried with the last OpenAL Soft source release, too, but it's as the same as with 2.0.1 release.

Matzon

could you try and run org.lwjgl.test.openal.PlayTest ?

broumbroum

Sure, here's what the Konsole returns (same stuff...) :
bruno@linux-6u1s:~/java-prj/JIGAXtendedAPI/dist/Linux> /usr/java/latest/jre/bin/java -Djava.library.path=. -cp JIGAXtended-i386_signed.jar org.lwjgl.test.openal.PlayTest
Exception in thread "main" java.lang.NoSuchMethodError: Method org.lwjgl.openal.AL10.nalEnable(I)V not found
        at org.lwjgl.openal.AL10.initNativeStubs(Native Method)
        at org.lwjgl.openal.AL.init(AL.java:158)
        at org.lwjgl.openal.AL.create(AL.java:140)
        at org.lwjgl.openal.AL.create(AL.java:104)
        at org.lwjgl.openal.AL.create(AL.java:191)
        at org.lwjgl.test.openal.BasicTest.<init>(BasicTest.java:57)
        at org.lwjgl.test.openal.PlayTest.<init>(PlayTest.java:61)
        at org.lwjgl.test.openal.PlayTest.main(PlayTest.java:217)
bruno@linux-6u1s:~/java-prj/JIGAXtendedAPI/dist/Linux>