net.java.games.joal.ALException: Error opening default OpenAL device

Though I can run the Point Sound demo from webstart. I get the following error when I try it in code with Idea IDE and from a command line .

net.java.games.joal.ALException: Error opening default OpenAL device
at net.java.games.joal.util.ALut.alutInit(ALut.java:71)
at org.jdesktop.j3d.audioengines.joal.JOALMixer.initialize(JOALMixer.java:600)

I have downloaded all the jars and put the dlls in the application paths, I have no unsatisfied link errors. I have searched the web High and Low for a post with the same problem. What am I missing.

Jars:
gluegen-rt.jar
j3dcore.jar
j3dutils.jar
joal.jar
joalmixer.jar
vecmath.jar

Dlls:
gluegen-rt.dll
j3dcore-d3d.dll
j3dcore-olg.dll
j3dcore-ogl-cg.dll
j3dcore-ogl-chk.dll
joal_native.dll
OpenAL32.dll
wrap_oal.dll

Thanks in advance
Greg

You’ve got all the JARs and DLLs needed to start a JOAL app, so UnsatisfiedLinkErrors are the least of your worries. From the stack trace you’ve given, it seems the problem is internal somehow. The code in ALut.java surrounding line 71 is:

68: String deviceName = null;
69: ALCdevice d = alc.alcOpenDevice(deviceName);
70: if (d == null) {
71: throw new ALException(“Error opening default OpenAL device”);
72: }

Considering this works in webstart but not Idea, I’d suspect that somehow webstart is finding an OpenAL sound device, whereas the code when run from Idea isn’t.

Do you have the latest drivers installed for your soundcard, and do they drivers include OpenAL drivers? My guess is that webstart is using the OpenAL software device provided by wrap_oal.dll, whereas when running it from Idea it tries to find OpenAL drivers in your Windows/System32 directory and fails to fallback to the software device.
If your sound drivers don’t include OpenAL, you can install an OpenAL software device (much like that in the webstart version of the sound demos) by downloading the Windows installer from www.openal.org

Failing all that, could you see if any OpenAL devices are listed by the following code:

ALC alc = ALFactory.getALC();
System.out.println("Available devices: " + alc.alcGetDeviceSpecifiers(null, ALC_DEVICE_SPECIFIERS));

OK… Fixed it
For the record

  1. Thank you Ultraq for the posting. It set me on the correct vector. The example using the api ended up been this.

     ALC alc = ALFactory.getALC();
    System.out.println("Available devices: " + alc.alcGetString(null, ALC.ALC_DEFAULT_DEVICE_SPECIFIER));
    
  2. Though the there were no unsatisfied link errors. The following dll’s “OpenAL32.dll, wrap_oal.dll” needed to be in a published native class path. It was just not enough to be discovered and loaded by the JVM.

Thanks Again
Greg