Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  JOAL not working in windows  (Read 3655 times)
0 Members and 1 Guest are viewing this topic.
Offline Conzar

Junior Devvie




There is nothing common about common sense


« Posted 2007-04-01 15:07:59 »

Hello.  So I am trying to initialize the SoundEngine3D object.  I am able to do this succesfully with the Linux version (release version 1.1.0).  The code snip below is what I use to do this.

1  
2  
3  
4  
5  
        AudioSystem3D.init();
        // is the input here right?
        dev = AudioSystem3D.openDevice(null);
        ctx = AudioSystem3D.createContext(dev);
        AudioSystem3D.makeContextCurrent(ctx);


The above code works fine under Linux; however, for Windows XP, I get the following exception.

1  
2  
3  
Exception in thread "main" java.lang.RuntimeException: 
Can not get proc address for method "alcCaptureCloseDevice":
Coldn't set value of field "_addressof_alcCaptureCloseDevice" in class net.java.games.joal.imp.ALCProcAddressTable


Note, for windows I include joal.jar and gluegen-rt.jar in my classpath.
I also include the gluegen-rt.dll and joal_native.dll in the Library path.

Anyone have any hints to what I might need to do extra in windows?

Thanks

Ubuntu
Offline Ultraq

Junior Devvie




That's what she said


« Reply #1 - Posted 2007-04-02 06:55:57 »

Well I can't replicate the issue on my machine.  Your setup of JOAL on Windows seems fine to me.

Do you know at which line in that code it throws this error?  Also, is there more code than just those e lines you've given? (I find the error a bit strange, because none of source code in the Sound3D package uses the alcCaptureCloseDevice method of OpenAL)

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Offline Conzar

Junior Devvie




There is nothing common about common sense


« Reply #2 - Posted 2007-04-06 00:41:35 »

Alrighty, here is the test class.  Below it is the output of the exception.

Thanks for your help!!!

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
package test;

import net.java.games.joal.*;
import net.java.games.sound3d.*;

public class JOALDemo{
    public static void main(String[] args){
        AudioSystem3D.init();
        Device dev = AudioSystem3D.openDevice(null);
        Context ctx = AudioSystem3D.createContext(dev);
        AudioSystem3D.makeContextCurrent(ctx);

        AudioSystem3D.getListener().setPosition(0,0,0);

        ctx.destroy();
        dev.close();
    }
}



1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
java -cp build_test;lib\sound\gluegen-rt.jar;lib\sound\joal.jar -Djava.library.path=lib\native\win test.JOALDemo 
 
Exception in thread "main" java.lang.RuntimeException: Can not get proc address for method "alcCaptureCloseDevice": Couldn't set value of fie
ld "_addressof_alcC
aptureCloseDevice" in class net.java.games.joal.impl.ALCProcAddressTable
        at com.sun.gluegen.runtime.ProcAddressHelper.resetProcAddressTable(ProcAddressHelper.java:68)
        at net.java.games.joal.impl.ALProcAddressLookup.resetALCProcAddressTable(ALProcAddressLookup.java:100)
        at net.java.games.joal.impl.ALCImpl.alcOpenDevice(ALCImpl.java:342)
        at net.java.games.sound3d.AudioSystem3D.openDevice(AudioSystem3D.java:105)
        at test.JOALDemo.main(Unknown Source)
Caused by: java.lang.RuntimeException: Unable to find and load OpenAL library
        at net.java.games.joal.impl.ALProcAddressLookup$DynamicLookup.dynamicLookupFunction(ALProcAddressLookup.java:64)
        at com.sun.gluegen.runtime.ProcAddressHelper.resetProcAddressTable(ProcAddressHelper.java:64)
        ... 4 more


Ubuntu
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ultraq

Junior Devvie




That's what she said


« Reply #3 - Posted 2007-04-06 22:47:25 »

Exception in thread "main" java.lang.RuntimeException: Can not get proc address for method "alcCaptureCloseDevice": Couldn't set value of fie
ld "_addressof_alcC
aptureCloseDevice" in class net.java.games.joal.impl.ALCProcAddressTable
        at com.sun.gluegen.runtime.ProcAddressHelper.resetProcAddressTable(ProcAddressHelper.java:68)
        at net.java.games.joal.impl.ALProcAddressLookup.resetALCProcAddressTable(ALProcAddressLookup.java:100)
        at net.java.games.joal.impl.ALCImpl.alcOpenDevice(ALCImpl.java:342)
        at net.java.games.sound3d.AudioSystem3D.openDevice(AudioSystem3D.java:105)
        at test.JOALDemo.main(Unknown Source)
Caused by: java.lang.RuntimeException: Unable to find and load OpenAL library
        at net.java.games.joal.impl.ALProcAddressLookup$DynamicLookup.dynamicLookupFunction(ALProcAddressLookup.java:64)
        at com.sun.gluegen.runtime.ProcAddressHelper.resetProcAddressTable(ProcAddressHelper.java:64)
        ... 4 more

OK, there's your problem.  The 'Unable to find and load OpenAL library' does mean there's something wrong with your setup.  You said you've already put the DLLs on the library path, so I guess the only thing left to find-out is if you've installed OpenAL drivers for your sound hardware.

If your vendor doesn't provide OpenAL drivers, you can download a sofware OpenAL wrapper from http://www.openal.org/ (which then links to this Creative Labs article for the download: http://developer.creative.com/articles/article.asp?cat=1&sbcat=31&top=38&aid=46 )

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Offline Conzar

Junior Devvie




There is nothing common about common sense


« Reply #4 - Posted 2007-04-06 22:58:22 »

AHHHHHHHHHHHHH.

Thats percicly what the problem was.  I didn't think about it in Linux since I guess OpenAL gets installed by dependancy (I'm running gentoo).  So I never explicity emerge it.

So how do other folks handle Installing OpenAL for the user?  For instance, games. 

Thanks for all your help man!

Ubuntu
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #5 - Posted 2007-04-08 17:00:00 »

In the Java Web Start extension for JOAL, we ship an OpenAL implementation along with the JOAL native libraries. We supplied a patch a while ago to the OpenAL source tree to allow the OpenAL wrapper library to find an OpenAL implementation in the same directory it's loaded from, which basically means that you don't have to have OpenAL installed in order to use it.

If it's working correctly, the Java Web Start links for the Devmaster demos on the joal-demos web site should work without an OpenAL implementation pre-installed.

Let us know whether this is working for you. If you deploy via Java Web Start you should be able to just point to our extension JNLP file in your JNLP with no other work.
Offline Ultraq

Junior Devvie




That's what she said


« Reply #6 - Posted 2007-04-09 02:02:21 »

So how do other folks handle Installing OpenAL for the user?  For instance, games.

Sounds like Ken's solution is a much better way to ensure the user has OpenAL installed.  Whereas I've always just put a note before the download link, telling people that they need an OpenAL installed for their sound hardware, or get the OpenAL wrapper from that link I gave you a few posts up  Roll Eyes

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Offline Conzar

Junior Devvie




There is nothing common about common sense


« Reply #7 - Posted 2007-04-09 21:32:58 »

Well, I will be releasing my game via JWS so his solution is very much preferable.  I was just testing the game on windows via a command line script that the user will not have access to.  I'll let you know if I have any problems with JOAL and JWS once I add that in (which should be in about 2 - 3 weeks).

Thanks guys.

Ubuntu
Offline Conzar

Junior Devvie




There is nothing common about common sense


« Reply #8 - Posted 2007-05-04 03:39:33 »

So I have finally tried to use joal via web start.

I have put the following line in my jnlp "<resources>" element.

1  
<extension name="joal" href="http://download.java.net/media/joal/webstart/joal.jnlp"/>


However, it seems that I am unable to load audio files (.wavs).
Note, I am using the below code to get the URL of the audio file
1  
return Thread.currentThread().getContextClassLoader().getResource(file);


Here is the error that I am getting while trying to load ts/data/sounds/engine/JetEngine.wav
1  
2  
3  
4  
5  
6  
7  
8  
Creating a buffer for ts/data/sounds/fx/engine/JetEngine.wav
java.io.FileNotFoundException: file:/home/mspeth/.java/deployment/cache/javaws/http/Doutlawstar/P8888/DMwebstart/DMlib/RMts_data.jar!/ts/data/sounds/fx/engine/JetEngine.wav (No such file or directory)
   at java.io.FileInputStream.open(Native Method)
   at java.io.FileInputStream.<init>(FileInputStream.java:106)
   at com.sun.media.sound.WaveFileReader.getAudioInputStream(WaveFileReader.java:205)
   at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1162)
   at net.java.games.joal.util.WAVLoader.loadFromFile(WAVLoader.java:68)
   at net.java.games.sound3d.AudioSystem3D.loadBuffer(AudioSystem3D.java:149)


Do I need to do something different with JOAL and Webstart?

Ubuntu
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #9 - Posted 2007-05-04 05:18:07 »

Please look at the code in the joal-demos source tree to see examples of loading audio files in a Java Web Start compatible way.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Conzar

Junior Devvie




There is nothing common about common sense


« Reply #10 - Posted 2007-05-04 06:40:55 »

So it seems the problem is that according to the demos, you are required to load the files as a stream shown by the example code below.

1  
SingleStaticSource.class.getClassLoader().getResourceAsStream("demos/data/FancyPants.wav")


The problem with my code is that I'm using the net.java.games.sound3d package.  The only option I have for loading a buffer is to provide a String.

Is there any way to do JWS and sound3d?

Thanks

Ubuntu
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (114 views)
2014-11-26 15:22:04

toopeicgaming1999 (102 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!