googlearchive / gvr-audio-wwise-sdk

Google VR Audio SDK for Wwise
https://developers.google.com/vr/audio/wwise-getting-started
Other
22 stars 13 forks source link

Unity crashes upon stop in Editor using GVR #5

Closed EgilSandfeld closed 7 years ago

EgilSandfeld commented 7 years ago

Crashing updated and new Unity projects using GVR Audio Wwise Renderer plugin 0.3.

To reproduce:

  1. Make a new Unity Project (5.5.0 or 5.6.0f3) and integrate Wwise (2016.2.2.6022) into it. Also, set up GVR Audio Renderer (0.3) plugin into the required plugin folder in _Assets\Wwise\Deployment\Plugins\Windows\x8664\DSP
  2. Register the plugin when Unity starts playing with eg. AkSoundEngine.RegisterPluginDLL("GvrAudioFX");
  3. Start the scene in Unity Editor and set it to play AkEvent via Unity on eg. the camera, set its position to 3D in Wwise. The sound gets spatialized correctly in Unity using the GVR Audio Renderer.
  4. Stop the Editor running

RESULT: Unity 5.5.0 and 5.6.0f3 crashes on stopping the Editor running in Windows or Android build configs. EXPECTED RESULT: Unity shouldn't crash.

EgilSandfeld commented 7 years ago

Reproduced issue with Unity 5.5.0 as well. Updated OP

anokta commented 7 years ago

Hi Egil,

I can't seem to reproduce the issue in Unity 5.6.0f3, using the Release dynamic library on Windows - unless I follow the second step.

However, one thing to note here is that, you should not explicitly register the plugin DLL through scripting, as the Wwise integration handles that automatically if you have the GVR plugins added in your mixer hierarchy. In other words, I think the main problem you're experiencing here is that "plugin is missing" error. So, I'm wondering if there's something going wrong in the generated sound banks from the Wwise project, rather than the Unity integration?

anokta commented 7 years ago

In the meantime, of course, the crash is still not desired in any case. We will push a fix on that in the next update.

Thanks!

EgilSandfeld commented 7 years ago

capture

Thanks for replying back to me, Anokta.

The screenshot provided is how I have the Wwise project set up. I have a sound playing to the Spatializer Bus. That bus has the GVR Audio Renderer effect on, and the channel config is set to Ambisonics 3-3. I'm able to hear spatialization in both Wwise and Unity using this setup. I have followed the GVR Wwise Plugins User Guide.

Where I might differ is in the inital setup phase. 2nd point in your User Guide state:

Extract and copy the package content into your Wwise installation folder.

Here I have extracted only the files from

gvr-audio-wwise-sdk-master\Authoring\x64\Release\bin\plugins

into the Wwise installation folder's subfolders, like this:

Wwise 2016.2.2.6022\Authoring\x64\Release\bin\plugins

I hereby omit extracting the Win32 files (as I run Win 10 64-bit), and don't place the SDK folder content inside the Wwise Installation folder either, as I believe this is for the Unity project instead. Am I wrong about this?

anokta commented 7 years ago

The setup seems alright to me, omitting 32-bit part should be fine too.

Just to make double sure, could you verify which library file did you copy to the Wwise Unity integration deployment folder for win_x64? (e.g. Wwise 2016.2.2.6022\SDK\x64_vc140\Release(StaticCRT)\bin\GvrAudioFX.dll)

EgilSandfeld commented 7 years ago

I'm using the

Wwise 2016.2.2.6022\SDK\x64_vc140\Release\bin\GvrAudioFX.dll

file (non staticCRT)

anokta commented 7 years ago

That should also be okay. Would you be able to share example Wwise/Unity projects that demonstrate the issue? Otherwise, I unfortunately can't seem to reproduce the issue on my end.

Thanks

EgilSandfeld commented 7 years ago

Thanks for the commitment to finding this, anokta! Weird thing is that I tried again today, and now it works all fine without any issues. I was hoping to be able to point on exactly what's changed, but to be frank I don't know.

Main project I'm working on is working now Test project, in order to reproduce the bug also works now.

I did not update Unity, Wwise, the projects or anything else. I can even omit registering the DLL via code now. I swear I have not changed the way Soundbanks are built either. I did however restart PC since last I saw the issue. And I did succumb to the Windows 10 Creator update between the reports, so who knows if that fixed it. If the issue comes back, I'll re-open this issue thread of course.

Anyway, big thanks for the help and thanks for a GREAT spatializer! :)

EgilSandfeld commented 7 years ago

Apparently my Unity still crashes after the following:

  1. Adding GVRAudioFX.dll to Win 64 folder in Unity project's Wwise folder
  2. Starting Unity scene
  3. Start Profiling the scene with Wwise Profiler
  4. Stopping Unity.

It does not matter if I stop Wwise profiler before I stop Unity. It does not matter if I de-include GVR audio renderer effect in the Wwise project and build the soundbank without the effect. It still crashes.

If I remove the GVRAudioFX.dll from the Unity project's Wwise folder, start Unity scene and profile the scene via Wwise profiler it does not crash.

If I add the GVRAudioFX.dll back in, run Unity scene and don't Wwise Profile, then it does not crash.

So culprit now looks like profiling with GVR causes crash when stopping Unity Editor.

anokta commented 7 years ago

Very interesting find, thanks for investigating this! The crash should be fixed with the next version update.