BananaHemic / Mumble-Unity

Performant Mumble Client For Unity3D
MIT License
78 stars 29 forks source link

Multiple mumble clients talking at same time #9

Closed virusmarathe closed 6 years ago

virusmarathe commented 6 years ago

This is a great plugin, very easy to setup and use. I had an issue where 3 clients were connected to mumble using the plugin. When two clients were talking at the same time, and the 3rd listening, the audio becomes super distorted. It sounds like the two are getting combined together somehow. Is there any setting I should be looking at for this or is this a known issue?

BananaHemic commented 6 years ago

Thanks for taking the time to write this issue!

I think the problem was that the Opus codec is stateful, so each speaker should really be getting its own instance of the codec. Fortunately, that was a pretty easy change to make. Can you checkout the per-speaker-codec branch and see if that improves the situation?

virusmarathe commented 6 years ago

Alright checked out the updated branch. It looks like it fixes the problem thanks! I am seeing a possible side effect of the change. I seem to be getting "Error establishing UDP connection, will switch to TCP" (MumbleUDPConnection.cs line 189) intermittently, which eventually causes "Error sending packet: " + e);" exception (MumbleUDPConnection line 236). Is this something related? I wasn't getting these problems from the master branch.

BananaHemic commented 6 years ago

Hmm, I'm not sure why the codec changes would affect that. It's possible that your network had some fluctuations, which happens from time to time on every network I've seen, which caused some UDP packets to be missed and Mumble-Unity switched to TCP to compensate (which is expected behavior). However, I'm not sure why that would cause an exception in MumbleUDPConnection when sending a packet. Do you know what type of error "e" was in that log?

I also just pushed a commit to switch from total UDP pings missed to sequential missed UDP pings, so the switch to TCP should be less common.

virusmarathe commented 6 years ago

Awesome thanks! I just updated your changes, looks like the changes work, or at least keep it from switching to TCP as often so it doesn't close. Thanks again!