I have fmod integrated into an android build, but the app crashes when I call:
[code:231vpix6]_pFmodSystem->init(32, FMOD_INIT_NORMAL | FMOD_INIT_ENABLE_PROFILE, NULL);[/code:231vpix6]
Right after the crash, the log output reports:
[code:231vpix6]11-21 15:21:55.287: V/ExtendedExtractor(11496): Failed to open MM_PARSER_LIB, dlerror = Cannot load library: load_library: Library ‘libmmparser.so’ not found
11-21 15:21:55.287: V/ExtendedExtractor(11496): Failed to open MM_PARSER_LITE_LIB, dlerror = Cannot load library: load_library: Library ‘libmmparser_lite.so’ not found
In my build setup, I did NOT do the Java Initialization, found in the "Getting started with Fmod for Android.pdf", as my understanding is that this is only necessary if you want to use Audio Track. Instead, I’m planning on using OpenSL if possible, and so my build setup is targeted for Android 2.3.3 (the minimum needed for OpenSL, as I understand it).
So…can anybody tell me what I might be doing wrong with my build setup, or why I am getting this crash when initializing fmod? Hopefully the above is enough context, but I’m happy to provide more details. Thanks in advance for any help!
- domowicz asked 6 years ago
libmmparser.so isn’t anything related to FMOD, we don’t link that into our .so, is it something you link in your app?
You only need to create and initialize the FMODAudioDevice class if you want to use AudioTrack, however you still need that static section which loads the FMOD .so before your application .so regardless of output choice.
Is System::init returning an error code? or is it crashing inside the function call?
[quote:344mfipz]libmmparser.so isn’t anything related to FMOD, we don’t link that into our .so, is it something you link in your app?[/quote:344mfipz]
My application is using Cocos2d-x, but this error is only reported when I run fmod’s System::init. If I comment out System::init, the app launches and runs just fine (with no audio, of course). Very strange…I wonder what this means.
[quote:344mfipz]You only need to create and initialize the FMODAudioDevice class if you want to use AudioTrack, however you still need that static section which loads the FMOD .so before your application .so regardless of output choice.
Right. And do you know, was I correct above in assuming that I need to target Android 2.3.3 if I don’t use AudioTrack?
As for the static load, I had added the following to the Java bootstrap code:
System.loadLibrary("fmodex"); // <----------- This is the line I added System.loadLibrary("helloworld"); }
Not sure if this matters, but I should probably also mention that my app is all C++ native code.
[quote:344mfipz]Is System::init returning an error code? or is it crashing inside the function call?[/quote:344mfipz]
I should have thought to check this earlier! Here is what it says after System::init crashes:
[code:344mfipz]FMOD error! (43) Not enough memory or resources.[/code:344mfipz]
I’ll look into this more on my end, but I don’t see how my device (HTC Evo, with 512mB ram) could actually be running out of memory.
I was able to solve the problem. Here’s what I did:
Previously, I had this:
[code:2jt4fj2y]_pFmodSystem->init(32, FMOD_INIT_NORMAL | FMOD_INIT_ENABLE_PROFILE, NULL);[/code:2jt4fj2y]
I changed it to this:
[code:2jt4fj2y]_pFmodSystem->init(32, FMOD_INIT_NORMAL, NULL);[/code:2jt4fj2y]
And now it no longer crashes. As an aside, I realized that my ERRCHECK function calls assert(false), which may be the only reason the app was crashing. That is, I’m not convinced that the failed use of FMOD_INIT_ENABLE_PROFILE is necessarily fatal.
Now, I’m having trouble locating the sound effect assets (createSound fails). :b But at least I can launch the app with fmod now!
Yes, to not use AudioTrack you will need Android API level 9 (which is 2.3 or higher).
It’s possible that the network APIs which support the profiler are failing causing that error, do you have the INTERNET permission set in your Android manifest?
I don’t have anything Internet related in the AndroidManifest.xml. So nothing specifically enables or disables Internet permission for me. Also, my handset is serviceless, so I don’t get cell data. However, I do have it connected to WiFi.
Not sure if the above tells you anything. For my specific purposes at least, I don’t need this problem resolved.
Oh, and for your reference, here is the contents of my AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk android:minSdkVersion="10"/> <application android:label="@string/app_name" android:debuggable="true" android:icon="@drawable/icon"> <activity android:name=".ApplicationDemo" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="orientation"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <supports-screens android:largeScreens="true" android:smallScreens="true" android:anyDensity="true" android:normalScreens="true"/>
For anyone affected by this, try adding the following to your AndroidManifest.xml, you can see a demonstration of this with our netstream example.
Please login first to submit.