Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
maburkitt opened this issue Aug 16, 2017 · 7 comments
Closed

Comments

@maburkitt
Copy link

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

  • Dissonance version used: # 1.1.1

  • Unity version: 2017.1

  • Photon version: v1.85 (6. July 2017)

  • Editor Operating System and version: e.g. Microsoft Windows 10 Pro (x64)

  • Build Settings: Windows, x86_64

@martindevans
Copy link
Member

martindevans commented Aug 16, 2017

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
Copy link
Author

maburkitt commented Aug 16, 2017 via email

@martindevans
Copy link
Member

martindevans commented Aug 16, 2017

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
Copy link
Author

maburkitt commented Aug 17, 2017 via email

@martindevans
Copy link
Member

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).

  • Feeding packet loss measurements into the encoder, so it can dynamically trade off quality for packet loss resilience (more resilient to high loss)
  • Expanded the measurement window for jitter, so it will be more accurate (more resilient to high jitter)
  • Fixed a few bugs related to audio sync (see the discussion in Warning that pops up a lot #28). This isn't directly related to this, but those improvements to the sync system will also improve quality when there's a bad network connection.

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
Copy link
Member

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
Copy link
Author

maburkitt commented Sep 9, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants