jzy3d / jogl-maven-deployer

Scripts to make a maven distribution out of JOGL 2.4
6 stars 2 forks source link

OPENAL does't work with Mac M1 #2

Closed maheshkurmi closed 2 years ago

maheshkurmi commented 2 years ago

on MAcbook pro M1, opegl is running absolutely fine but when I try to use openAL, it gives error in loading library


com.jogamp.openal.ALException: java.lang.ExceptionInInitializerError
    at com.jogamp.openal.ALFactory.initialize(ALFactory.java:102)
    at com.jogamp.openal.ALFactory.getALC(ALFactory.java:137)
    at com.jogamp.openal.util.ALut.alutInit(ALut.java:64)
    at org.shikhar.simphy.audio.impl.SoundManager.initialize(SoundManager.java:59)
    at org.shikhar.simphy.Simphy.<init>(Simphy.java:1777)
    at org.shikhar.simphy.SplashWindow.invokeMain(SplashWindow.java:135)
    at org.shikhar.simphy.SplashWindow.main(SplashWindow.java:85)
Caused by: java.lang.ExceptionInInitializerError
    at com.jogamp.openal.ALFactory.initialize(ALFactory.java:91)
    ... 6 more
Caused by: java.lang.RuntimeException: Couln't load native AL/JNI glue library
    at jogamp.openal.ALImpl$1.run(ALImpl.java:1618)
    at jogamp.openal.ALImpl$1.run(ALImpl.java:1608)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at jogamp.openal.ALImpl.<clinit>(ALImpl.java:1608)
    ... 7 more

I have added jogl-all, gluegen-rt, joal and all3 corressponding mac universal native jars in classpath. Do i need to add dylibs somewhere?

jzy3d commented 2 years ago

I only worked on JOGL, so JOAL and JOCL should be upgraded the same way I did. Have you seen the howto where I explain how I did it ? The thing I do not understand is that I only built and deployed JOGL (and Gluegen) as RC4 maven artifact, so I wonder how you could even compile your project with these versions.

maheshkurmi commented 2 years ago

The thing I do not understand is that I only built and deployed JOGL (and Gluegen) as RC4 maven artifact, so I wonder how you could even compile your project with these versions. I just downloaded jar files and added to classpath and placed native library jars in same folder as the jar files, it worked. i also tried placing "dylib" files instead of native jars, it still worked.

I think I am using joal from joal-android-natives-macosx-universal.jar which may not be compiled for arm version. By the way I downloaded files from https://download.jzy3d.org/jogl/ since my java project is not a maven project.

Have you compiled joal for Mac arm64? If yes please share, else guide me how to do that?

jzy3d commented 2 years ago

I did not build JOAL for ARM64. If you want to do it, this documentation on enabling JOGL for ARM64 can help you.

You are welcome to do it on this mirror repository, so that I can later bundle it with JOGL. Using a branch name similar to the one I used for JOGL could help (feature/macosx-arm64).

Hope this helps!

maheshkurmi commented 2 years ago

I tried following documentation but I could't find the guide to be usable for building joal(May be it was't obvious for me only). In case you decide to build joal, please let me know.

jzy3d commented 2 years ago

Yes this is normal, it only documents how to patch JOGL, but I think you can use it to patch JOAL.

maheshkurmi commented 2 years ago

Thanyou very much for the help... Following your guide I managed to build joal native libs for mac arm64. You can find the native builds at https://github.com/maheshkurmi/jogl-macarm64-builds. You may update your maven repo with joal natives for arm64.