Placeholder-Software / Dissonance

Unity Voice Chat Asset
70 stars 5 forks source link

"Echo" problem that scales with number of players (LAN) #118

Closed kristianpd closed 5 years ago

kristianpd commented 5 years ago

Context

I'm encountering an issue with a relatively straightforward setup. A global room (single root level game object with Broadcast and Receipt triggers on Global Room) setup with 4 or more players begins to echo and scales with the number of players. Our facility has 6 seats, spread out over two separate rooms (4 and 2). When testing multiplayer at home, there is no echo that occurs when running multiple clients off the same machine. When testing multiplayer at our facility, the echo seems to scale with the number of players.

I should point out, I don't believe this is necessarily a real echo, in that I am not sure it's related to the voice actually being picked up. It's my best guess that there seems to be some sort of post processing that results in the echo of the player hearing their own voice as if it was being transmitted through their mic (not being picked up on other mics).

I think the problem here is some form of processing behaviour, that is magnified when more latency and more broadcasters are introduced.

Expected Behavior

We are currently running an old (1.5yrs +) version of Dissonance without this issue. This is my second attempt at updating this library but both have failed for similar reasons. I do expect a little echo, a single echo, where I would hear my own voice in the background on other player mics. I know there are some options for trying to eliminate this but the background noise of my own voice isn't the problem.

Actual Behavior

I apologize if this is a vague, but the actual behaviour is best described as follows:

I've had a real hard time narrowing this. I've tried eliminating all other forms of windows/mic configuration issues and at this point I'm really thinking it's a Dissonance thing. It's also only present in the last few version of dissonance (I tried updating to v4 and then v6) and not so in an old (1.5yrs) version. In the old version, the expected behaviour of hearing my faint voice in the background after a slight latency delay (just once) is what I would expect in this newer version.

Workaround

I cannot find a workaround for this, nor can I seem to reproduce it locally.

I have tried playing with various voice settings including: Noise supression, and Acoustic echo cancellation. I have also disabled filters in Advanced desktop options to no avail (if anything it may have been slightly worse?)

Steps to Reproduce

I have been able to reproduce this (in the 4.0 version, but identical problems) on a simple project

  1. Set up a basic project with root game object DissonanceSetup and another root object with a Global room broadcast/receipt trigger
  2. Build the project and deploy to 4 or 6 machines (gets worse with more)
  3. Place 4 machines in same room (I am not convinced this is the problem, but this is our setup)
  4. Start talking or having you and others talk at the same time. The problem seems to be magnified by volume of players speaking (into their own mics) (can't 100% confirm this)

Your Environment

I'll try to answer any questions, hope this gives a starting point.

martindevans commented 5 years ago

This is an odd one, no one else has reported hearing their own voice and such a thing is basically impossible with Dissonance because there is no audio pipeline allocated for your own voice, one being created and properly working entirely by accident is pretty unlikely! There's also no mixing of voices performed by Dissonance at any stage of it's pipeline, so it can't be your voice getting mixed into a signal with someone else's voice on the server side. I can't think of any mechanism for your own voice to be played through your own speakers except a remote player somehow transmitting it back to you, I think this is backed up by the fact that it scales with the number of players - they're likely each individually sending back your voice.

So I think there are two questions to answer:

My suspicion is that it's mic echo, to confirm that if it's not can you:

To answer the second question there are two changes which I think may be pertinent:

An extra question: Have you used the acoustic echo cancellation system? It won't work well in a closed environment with many voices overlapping, most likely that wouldn't cause any issues but it's worth disabling it just to be sure.

kristianpd commented 5 years ago

I don't believe it's a simple mic echo. Another theory was that perhaps the new and improved voice processing may be picking up similar sounds and therefore amplifying them?

The part I can't explain is why speaking into a mic (mouth against mic, hands cupped around to try and reduce any sound. speaking or blowing into mic) results in a louder echo in my own headphones. When I say echo I don't think it's actually the other mics picking it up, but basically a local representation of my own voice that comes back after a latency period of some sort, then repeats on that interval until it fades.

I could understand a louder echo being picked up on other mics when talking loudly, but hearing it locally in a louder volume when I blow into my mic for example doesn't make any sense to me :.

I have tried (in the past) muting the mic's and still had a similar issue.

I did try the acoustic echo cancellation in a quick build i made to try and eliminate this issue (along with turning off the two filters in advanced options), and it didn't make a difference (if anything it may have been slightly louder with all those options changed).

It's very possible that the AGC is causing an issue for me that wasn't there before, but the echo just doesn't sound right to me. I apologize for over-using the word echo here. Before, as expected, i would hear a single echo as the other mics picked up my voice and played it back. Even if that was louder now (very likely), the multiple echo (more echos more players) doesn't really make sense.

I've written you an email at placeholder software to give you my personal email, if we could do a quick hangout / discord chat I think I can much better explain the behaviour!

martindevans commented 5 years ago

Discussed further on discord, it sounds like it's probably remote mics echoing back audio although that's not entirely certain.

A few ideas for further testing:

martindevans commented 5 years ago

Since we never really established what the problem was here (besides a lot of echoes from the environment) I'm going to close this issue. Feel free to re-open it or to open a new one if the problem persists :)