Placeholder-Software / Dissonance

Unity Voice Chat Asset
71 stars 5 forks source link

[bug] Audio distortion when disconnecting and reconnecting to a session #47

Closed maburkitt closed 7 years ago

maburkitt commented 7 years ago

Context

When initially joining a session (using Photon), all audio works as expected. If one of the clients drops out and then reconnects (closing and restarting their client) their audio is distorted - it's as if it is being slowed down (possibly problem with quality settings on reconnect?).

Expected Behaviour

The audio to be the same as before they disconnected

Actual Behaviour

The audio received from the new joining client (what everyone else hears) is distorted as if it has been slowed down.

Workaround

All clients closing down and initiating a new session resolves the problem.

Fix

I observed similar behaviour when testing out audio settings and accidentally connecting 2 clients with different quality settings - so maybe it's related to this.

Steps to Reproduce

  1. setup a voice session with 2 or more clients using Photon as the back end (latest version of all software), using Unity 2017,1.
  2. Using Windows 10 (x64 build).
  3. disconnect one of the clients, by closing the application
  4. reconnect the same client
  5. The audio received from that client is now distorted

Your Environment

martindevans commented 7 years ago

Hi

Dissonance tweaks playback speed to keep capture and playback channels in perfect sync. When the client disconnects and reconnects some piece of state is probably not properly reset and so the sync mechanism is doing something wrong (causing an excessive slowdown in an attempt to sync things).

I've recently done a huge amount of work to both channels and to the internals of the network (just pushed to the store a couple of hours ago, should be available within a week). If you email me your order number I can send you a preview of that release and we'll see if the problem is fixed :)

connecting 2 clients with different quality settings

As an aside this is expected - Dissonance (currently) requires that all clients use the same settings. It uses the local encoding settings to configure it's decoders so if someone else is using different settings it will end up decoding it incorrectly (usually with an incorrect sample rate, which naturally causes a playback rate error).

maburkitt commented 7 years ago

Hi Martin,

thanks for getting back to me. I believe the distorted speech is on both the local machine and the remote machine - yes, this does sound like a likely cause. I emailed you my invoice details - so please let me know if you don't receive them.

Out of interest, we just had a less than successful 3 way conversation with one of our clients using the software - around 20-30% of the speech was choppy (beginning and end of sentences being chopped off) or missing. It seems when the bandwidth is low, the speech becomes very choppy. Are your new changes likely to have an impact on this? If not, any tips for getting the best performance when some of the clients have a poor internet connection? Maybe some kind of quality degrading to maintain complete content?

thanks again

Mark

martindevans commented 7 years ago

I emailed you my invoice details

Received, and I sent you back the Dissonance-3.0.0 package :)

when the bandwidth is low, the speech becomes very choppy

That's odd, Dissonance uses very little bandwidth (about 2-3kbit/s iirc). It's unlikely your connection is that badly bandwidth limited! Was there perhaps high packet loss (>5% loss)?

Are your new changes likely to have an impact on this? If not, any tips

If you're using PUN the new networking changes will probably save a little bit of bandwidth - previously all voice was sent to the host and then resent out to each peer so if your host had a problem that could cause all voice to break up. I doubt that will have an impact on this unless your host was having some really bad networking problems! I'd like to pin down a bit more detail about the issue before offering any tips, would you mind opening a new issue and giving me as many details about the problem as possible?

maburkitt commented 7 years ago

Thanks,

let me do a few tests to look at packet losses and get back to you.

Mark

On 16 August 2017 at 23:32, Martin Evans notifications@github.com wrote:

I emailed you my invoice details

Received, and I sent you back the Dissonance-3.0.0 package :)

when the bandwidth is low, the speech becomes very choppy

That's odd, Dissonance uses very little bandwidth (about 2-3kbit/s iirc). It's unlikely your connection is that badly bandwidth limited! Was there perhaps high packet loss (>5% loss)?

Are your new changes likely to have an impact on this? If not, any tips

If you're using PUN the new networking changes will probably save a little bit of bandwidth - previously all voice was sent to the host and then resent out to each peer so if your peer had a problem that could cause all voice to break up. I doubt that will have an impact on this unless your host was having some really bad networking problems! I'd like to pin down a bit more detail about the issue before offering any tips, would you mind opening a new issue and giving me as many details about the problem as possible?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Placeholder-Software/Dissonance/issues/47#issuecomment-322917946, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5mMojKgKyTNr7njLYKwfTusF857_OMks5sY24RgaJpZM4O4haw .

martindevans commented 7 years ago

Hi maburkitt

Motivated by this issue I have included some improvements related to packet loss and jitter in the next version of Dissonance (which we'll be submitting to the store today or tomorrow, it should be available within a week).

I'll close this issue once that's available on the store. Of course please feel free to re-open it or to open a new issue if the problem persists :)

martindevans commented 7 years ago

Dissonance 3.0.1 has just released on the Unity asset store, this includes the changes made to resolve this issue so I'll close it now. If the problem persists please feel free to continue posting in this thread. If you're happy with how this issue was handled please consider rating and reviewing us on the asset store!

maburkitt commented 7 years ago

Hi Martin,

thats great news, thanks. I'll check it out and let you know if there are any more issues.

cheers

Mark

On 8 September 2017 at 17:51, Martin Evans notifications@github.com wrote:

Dissonance 3.0.1 has just released on the Unity asset store, this includes the changes made to resolve this issue so I'll close it now. If the problem persists please feel free to continue posting in this thread. If you're happy with how this issue was handled please consider rating and reviewing us on the asset store!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Placeholder-Software/Dissonance/issues/47#issuecomment-328156900, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5mMlmvqiJfRBLq8WAUv9sqmhUbWGCBks5sgXCZgaJpZM4O4haw .