Placeholder-Software / Dissonance

Unity Voice Chat Asset
69 stars 5 forks source link

[help] iOS build successful, but as soon as it access to dissonance, it crashes #241

Open simonglad opened 2 years ago

simonglad commented 2 years ago

Context

I am having issue while using WebRTC and dissonance in iOS. I am enjoying using Dissonance asset, and it works just fine with android and editor. When I build for iOS, there is no issue. However, as soon as the dissonance connects to the peer, it crashes. I know it's hard to tell which step I am missing, but would you please verify the error I am facing?

Expected Behavior

Supposed to connect with peer with no problem

Actual Behavior

As soon as it connects to the peer, the app crashes and RTC Signalling error appears. The screen shot of Xcode is as follows:

MicrosoftTeams-image (41)

Your Environment

Dissonance Voice Chat 8.0.2 Dissonance For WebRTC Network 8.0.0 Unity 2019.4.17f1 Xcode 13 WebRTC Video Chat 0.9852.0

martindevans commented 2 years ago

Can you check if you can establish a session using just the WebRTC Video Chat asset without Dissonance? If that crashes; please try removing Dissonance from the project and then try it again (make sure to close the editor, delete Assets/Plugins/Dissonance and then open the editor).

simonglad commented 2 years ago

Without dissonance, I have built with only WebRTC Video chat asset on a new project, and it works fine. However, if it combines with dissonance and dissonance for WebRTC, it shows the same symptom. It builds fine, but as soon as it connects to the peer, it crashes with same error. Any suggestions?

martindevans commented 2 years ago

I think what's going on here is that the WebRTC Video Chat asset provides part of WebRTC in a native plugin and Dissonance also has some of WebRTC in the AudioPluginDissonance plugin (used for audio preprocessing). On other platforms this is fine, they're two separate DLLs and there's no confusion. However, on iOS everything is statically linked together so those duplicate symbols clash. One of the two assets will end up calling the method from the other asset and that can cause all kinds of chaos!

Unfortunately I don't know of any easy way to workaround this, it's a fundamental issue with trying to load two different versions of the same library on iOS. I'm going to have to mark the WebRTC for Dissonance package as not compatible with iOS, sorry.

You might be able to use something like this to rename all ofthe symbols in libAudioPluginDissonance.a and then change the C# code in Assets/Plugins/Dissonance/Core/Audio/Capture/AudioPluginDissonanceNative.cs. But I don't fully understand this process at the moment so I wouldn't really be able to support you and can't guarantee that it would work :(

simonglad commented 2 years ago

Do you have any plan to update for iOS users? Or we need to find another solution since we can not hold on to this issue forever. BTW, I really love your asset and I am looking forward to any update sooner or later. Thank you, in advance.

martindevans commented 2 years ago

Unfortunately I don't think I can fix this quickly - I'll need to do a lot of research into that potential solution I linked and then a lot of testing on iOS devices to make sure it hasn't broken something in a subtle way. I recommend switching to a different network backend.

cristiancaride commented 6 months ago

It is happening to me too, do you have any fix already or no?

martindevans commented 6 months ago

We did put out an update for the iOS binaries a while ago which applies the fix I talked about above (this one).

Unfortunately if that isn't working for you I think we'll have to say that Dissonance is incompatible with WebRTC Video Chat on iOS.