Closed ghost closed 6 years ago
Maybe the issue is just that you should build the project from Unity in a complete new folder, did you try that? I have seen similar issues being resolved this way.
Building the solution from Unity in a new folder outside of the Unity project directory seems to have worked. The missing packages now install automatically when I deploy to the device. However, I am now getting the following exception:
Exception thrown: 'System.BadImageFormatException' in Assembly-CSharp-firstpass.dll
'Voice Chat.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\Template3DVS.Debug_x86.fully\System.Diagnostics.StackTrace.dll'. Symbols loaded.
BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at Dissonance.Audio.Codecs.Opus.OpusNative.OpusNativeMethods.opus_encoder_create(Int32 samplingRate, Int32 channels, Int32 application, Int32& error)
at Dissonance.Audio.Codecs.Opus.OpusNative.OpusEncoder..ctor(Int32 srcSamplingRate, Int32 srcChannelCount)
at Dissonance.Audio.Codecs.Opus.OpusEncoder..ctor(AudioQuality quality, FrameSize frameSize, Boolean fec)
at Dissonance.CodecSettingsLoader.CreateEncoder(AudioQuality quality, FrameSize frameSize, Boolean fec)
at Dissonance.CodecSettingsLoader.Generate()
at Dissonance.DissonanceComms.Start()
at Dissonance.DissonanceComms.$Invoke65Start(Int64 instance, Int64 args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64 args, IntPtr method)
(Filename:
Any advice?
================================ EDIT
Based on some more searching it looks like I need a 32 bit version of the dll files. Dissonance only seems to come with 64 bit versions...
A BadImageFormatException
means it's successfully found all of the dependencies of opus.dll but when loading something (either opus.dll or a depenency) it loaded something with the wrong format.
This could mean you're loading a file which is corrupted in some way. However I think that's fairly unlikely because a corrupted file would be more likely to fail at the previous stage (searching for dependencies, can't find the ones we're looking for in this file because it makes no sense). Of course it's always possible the headers are intact and the payload is corrupt. It's easy to check for that - navigate to the root Assets folder and run these commands in powershell, they should all return true:
//Verify that files exist
[System.IO.File]::Exists("Plugins/Dissonance/Plugins/UWP/x86/Opus.dll")
[System.IO.File]::Exists("Plugins/Dissonance/Plugins/UWP/x86_64/Opus.dll")
//Verify that they are intact
(get-filehash Plugins/Dissonance/Plugins/UWP/x86/Opus.dll).Hash -eq "B7D04E35E36A7E90196A386F8953BE1E6E356B723A2C0673B049E134C3A1E09E"
(get-filehash Plugins/Dissonance/Plugins/UWP/x86_64/Opus.dll).Hash -eq "B368FC64F3314C415BB26771F3BE1FCC7768ABB0AECB90FFE0061AC6E1C60425"
I would suggest finding the same files in your build output and checking the same hashes, to check that the right files have been exported.
Finally you should check that the settings are correct in Unity. They should look like this:
Yes thank you! It's working as expected now.
The issue was that the UWP folder under Plugins was completely missing from our project directory for some reason. I'm not sure why - we were using the latest version of Dissonance and importing it into a clean project and had not removed anything. In any case, manually re-importing Dissonance and making sure the UWP folder was selected solved the issue.
So to recap for anyone else experiencing the same issue:
1) Make sure the UWP folder under Plugins is present and configured as per the above image. 2) Build the solution in Unity into a new folder outside of the project directory.
Perhaps you could put a UWP section in the user manual if there isn't one already.
Cheers :-)
Excellent, I'm glad to hear you've worked this out :D
Context
I cannot seem to test my app on the Hololens via Unity's holographic remoting tool as Dissonance requires the microphone, which does not seem to be supported via holographic remoting at this time. So instead I simply have to build the application for UWP in Unity, then open the solution in Visual Studio and deploy it to the Hololens in debug mode. However, the application crashes after only a few seconds and I get an error log about a missing Opus.dll. I did a bit of searching and based on the forum posts of other users experiencing the same issue, it seems that I have to include the Microsoft Visual C++ Redistributable for Visual Studio 2017 in the build on the hololens. However, I have no idea how to actually do this. Everything that I have found online suggests that I can include dependencies in my installer, however I am not using an installer as I am just deploying straight from Visual Studio to the device for debugging. Does anybody know how to fix this issue? Is there a way to manually install the redistributable package on the hololens somehow?
Expected Behavior
Dissonance should work correctly on the hololens without crashing.
Actual Behavior
Dissonance crashes after only a few seconds logging an error about a missing Opus.dll, which seems to be the result of a missing Microsoft Visual C++ Redistributable for Visual Studio 2017 on the hololens.
Workaround
N/A
Fix
Installing Microsoft Visual C++ Redistributable for Visual Studio 2017 on the hololens somehow?
Steps to Reproduce
Your Environment
Dissonance version used: v6.2.3 (2018-07-05)
Unity version: e.g. 2018.1.0f2 Personal
Editor Operating System and version: Microsoft Windows 10 Home 10.0.17134 (x64)
Build Settings: Universal Windows Platform
Link to your project: N/A