FMOD::System::init crash in Android

Running into a crash with FMOD Studio (low level api) version 10602 on Android.

Here’s the output from LogCat. Project is building against SDK19. I saw a similar post that seemed to indicate fmod.jar not in “Order and Export” so I verified that I do in fact have this set.

I/fmod(31561): [LOG] SystemI::init : FMOD Studio Version: 00010602 (63981)

I/fmod(31561): [LOG] SystemI::init : maxchannels = 32, flags = 00000000, extradriverdata = 0x0

I/fmod(31561): [LOG] SystemI::close :

I/fmod(31561): [LOG] SystemI::close : Stop all sounds

I/fmod(31561): [LOG] SystemI::close : Remove miscllaneous DSP stuff.

I/fmod(31561): [LOG] SystemI::close : done.

I/fmod(31561): [LOG] FMOD_OS_Init : Detected Neon instruction support, will use Neon optimized mixing and resampling.

I/fmod(31561): [ERR] AndroidAssetFile::registerLib : JavaVM::GetEnv returned -2.

I/fmod(31561): [ERR] FMOD_OS_Output_GetDefault : JavaVM::GetEnv returned -2.

I/fmod(31561): [ERR] assert : assertion: ‘mOutput’ failed

A/libc(31561): Fatal signal 11 (SIGSEGV) at 0x00000018 (code=1)

This is most likely due to the thread you are calling FMOD on not being attached to the Java VM. This can happen if you are using a native activity application.

I will improve the error reporting and platform documentation to better reflect this for a future version.

The required JNI API is AttachCurrentThread, this will allow FMOD to make calls into Java.

Hi
When I use FMOD_System_Init to initialize the system, the return value is FMOD_ERR_NEEDSHARDWARE. I don’t know why it failed. My code:
FMOD_INITFLAGS initFlags = FMOD_INIT_NORMAL | FMOD_INIT_3D_RIGHTHANDED | FMOD_INIT_VOL0_BECOMES_VIRTUAL;
result = FMOD_System_Init(SoundUtil::FMODSystem, 100, initFlags, 0);
, is some initflag have hardware limitation?

It would be best to start a new thread, and link back to this one if you really need to.

Can you please also provide the FMOD version you are using.