Placeholder-Software / Dissonance

Unity Voice Chat Asset
69 stars 5 forks source link

Dissonance not working on mac osx silicon after unity update #248

Closed battlebosseseye closed 1 year ago

battlebosseseye commented 2 years ago

We have been using Dissonance in our unity game for many months with no issues. Our unity was on a 2020 version and we then upgraded to Unity 2021.2.11f1. Ever since then Dissonance does not work on Macs with Silicon chips but it does work with Macs on Intel chips. We have tried debugging and even started a new project and only added Dissonance to make sure nothing else was causing the issue but the error still persisted:

DllNotFoundException: opus assembly:<unknown assembly> type:<unknown type> member:(null)

Is there anyone that can verify that Dissonance works for them on a mac silicon chip with a unity version 2021.2.11f1 or greater?

Screen Shot 2022-03-02 at 6 09 39 PM
martindevans commented 2 years ago

If you locate the bundle for MacOS (Assets/Plugins/Dissonance/Plugins/macOS/opus.bundle) which architecture is it set to?

2022-03-03_15-46-51

It should be Any CPU.

Edit: If this is the issue and changing it to Any CPU fixes it you'll need to make the same change to AudioPluginDissonance.bundle.

battlebosseseye commented 2 years ago

Both are set to "Any CPU" and the issue still persists

martindevans commented 2 years ago

Could you please create a new project in Unity 2020 and Unity 2021. Add this script and copy in Assets/Plugins/Dissonance/Plugins/macOS/opus.bundle from Dissonance to Assets/Plugins in your new projects.

When you click the TestNow it will call a method in the Opus.bundle and either print out the result or it will print the DllNotFoundError. That should be the smallest reproduction of the issue. If it fails in the same way we'll probably need to report it to Unity.

martindevans commented 2 years ago

I've been reading some similar issues on other projects. In particular this comment mentions a Security & Privacy window which shows a blocked bundle. Could you check what that looks like for the Dissonance opus.bundle?

battlebosseseye commented 2 years ago

We discovered that in the build settings we had to switch the architecture to be only Intel even though we are building on a Silicon Mac. That was the only way we could get it working.

martindevans commented 2 years ago

Did you get any results from the TestNow script?

The binaries we have compiled do not currently include ARM code, instead we rely on the platform emulating x86 (Rosetta). From all these results it looks like something is wrong with that in Unity 2021.

If you send me your invoice number (DM on Discord, or email me) you can recompile the binaries for ARM and include those in your build (although even if you do that I would appreciate it if you could still run the TestNow script and report it to Unity).

battlebosseseye commented 2 years ago

Okay I will report it to unity. We ran the script and it still didn’t work. Still got the DLL not found error.

martindevans commented 2 years ago

Did it produce the same results in both editor versions?

battlebosseseye commented 2 years ago

It would work in game just fine but when we would export the build the only time it changed is when we changed the build settings to go from silicon to intel.

battlebosseseye commented 2 years ago

We had to make sure the architecture in the build settings was intel only and then it worked even though my Mac was a silicon M1 chip

tolosafan commented 2 years ago

Same issue with U3D 2021.2.5f1 with Mac SiliconM1 and Dissonance last version downloaded on the 20 April 2022. The settings on the Opus And AudioPluginDissonance are equal AnyCPU. Can you send us a fix quickly? We have a demo on Friday.. Same test works well on our PC, but our main dev machines are MacOS.. Thanks

martindevans commented 2 years ago

Did you try that workaround battlebosseye mentioned?

Unfortunately I won't be able to build any M1 binaries myself by Friday, since I don't have access to an M1 device.

If you send me an invoice number (martin@placeholder-software.co.uk) I can send you the source code for the plugins and you can try to build them yourself. I don't think it will be trivial though, some of the code is architecture specific so the ARM parts for iOS/Android will have to be included in the new M1 targetted build.

tolosafan commented 2 years ago

Thanks for your quick reply. Yes, we tried to setup the two bundle as intel64 only, but it doesn t work. Can t build ourself a special version. We have submit this issue several months ago.. And we bought your product specially because the photon voice had an issue. Too much time spent and no result.

Le 20 avr. 2022 à 23:35, à 23:35, Martin Evans @.***> a écrit:

Did you try that workaround battlebosseye mentioned?

Unfortunately I won't be able to build any M1 binaries myself by Friday, since I don't have access to an M1 device.

If you send me an invoice number @.***) I can send you the source code for the plugins and you can try to build them yourself. I don't think it will be trivial though, some of the code is architecture specific so the ARM parts for iOS/Android will have to be included in the new M1 targetted build.

-- Reply to this email directly or view it on GitHub: https://github.com/Placeholder-Software/Dissonance/issues/248#issuecomment-1104476157 You are receiving this because you commented.

Message ID: @.***>

martindevans commented 2 years ago

I'm not certain, but I believe @battlebosseseye set the build settings for the entire application to Intel64, instead of just the plugins. I assume that forces it to run under Rosetta.

martindevans commented 1 year ago

Dissonance 8.2.0 is now live on the asset store with a new set of plugins for MacOS which include native support for ARM64 (M1). Rosetta is no longer required 🥳