-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android: OpenAL fails to load due to missing SL_IID_ENGINE #1087
Comments
I'm not sure where that code comes from, but it doesn't seem to be OpenAL Soft's OpenSL backend. It looks like a custom one, probably from before OpenAL Soft had its own OpenSL backend. Interestingly, the log shows it loading "openal 1.24", but the linked code base is very old, from over a decade ago. That code is also dynamically loading the It looks like it may actually be using a newer OpenAL Soft, which has a different OpenSL backend that doesn't dynamically load SLES symbols. I don't know why it would be failing though, I found a couple other similar issues (different IIDs, though): The first blames a potentially faulty (possibly non-official) emulator image. The second didn't find a cause, though switched to dynamic run-time loading to fail gracefully if it's not found. I could, and I guess probably should, also do dynamic run-time loading, though you'll need an OpenAL build with Oboe or something enabled or else you'll get no audio. |
You are right. No idea how I ended up with the wrong web links. In your code base of the matching version (which I'm using) the symbol is used in these two locations: openal-soft/alc/backends/opensl.cpp Line 330 in dc83d99
openal-soft/alc/backends/opensl.cpp Line 700 in dc83d99
The problem happens on a real device when compiled using Android Studio 2024.2.1P3 using NDK 27.0.12077973 |
I've also tried now with the latest 1.24.1 release but the error is the same. |
Commit e359dbf now will dynamically load |
Is the command line switch "-DALSOFT_REQUIRE_OBOE=ON" in that case? EDIT: I checked the default build options and OBOE is by default enabled. So I assume I have to do nothing. |
|
I tried applying the patch from the commit to the 1.24.1 release but it fails. Looks like there are too many changes since then for the patch to work. I would prefer to apply the patch to a release version if possible. |
It needs commit 8767fdd too, since commit e359dbf is fixing a couple things from it. Although it likely still won't work because logging is slightly different, and the I intend to make another release in the next few days, so it won't be too long before an updated release version. |
That's fine with me. I'm not in a hurry right now with the Android stuff. |
1.24.2 was released with this fix included. |
Sorry. I didn't have time yet to yet it. The missing SL_IID_ENGINE symbol is fixed but now I've got another problem:
I have the suspicion that the "android_openal_setjavavm" has been required in older OpenAL versions but now it is no more present. What has to be done now to get openal properly receive the javavm pointer? EDIT: I removed the function call and the library seems to load. Let's see if somewhere down the line a problem shows up. |
That's not something from OpenAL Soft. There were times I would've liked to get the Java VM pointer to get access to information that wasn't provided through OpenSL, but I never got around to making such a function (and the little bit of code I wrote that would use the VM handle was always optional and never well-tested, and had been disabled for some time before getting removed). And with Oboe now, I don't really see a need for it. |
Compile OpenAL Soft 1.22.2 for Android arm64-v8a min api level 26. Compiling works but trying to load the module using OpenAL fails with the following error:
I searched through the sources and found the reference here: https://github.com/apportable/openal-soft/blob/9658f0dc274eafa596dc55dd83f5decbf85f1497/jni/OpenAL/Alc/opensles.c#L427
This seems to be linked to OpenSLES. But as mentioned here it is deprecated: https://developer.android.com/ndk/guides/audio/opensl . To be on the safe side I also tried preloading the library but the error is the same:
Could it be OpenAL is no work working on Android due to linking to a deprecated library? What could cause this symbol to me missing even when I ensure the library the symbol should be located in is loaded before hand?
The text was updated successfully, but these errors were encountered: