Placeholder-Software / Dissonance

Unity Voice Chat Asset
71 stars 5 forks source link

Audio is relayed late to other players in dissonance. Packets are arriving much later than expected time. #233

Closed mariappan10 closed 3 years ago

mariappan10 commented 3 years ago

Context

When the players are speaking the audio is relayed slightly later to other players. This happens only sometimes. I tried to increase the packet usage by setting the frame size to large but still, the issue remains. If more players join the issue happens more frequently. I have attached the console log statements below. image Editor.log

Your Environment

Include as many relevant details about the environment you experienced the bug in

-Unity 2020.3.f1

-Dissonance 8.0.1

-PUN 2 Integration

martindevans commented 3 years ago

I've had a look through the log and the video you sent me on Discord. It looks like this is probably caused by network congestion, the fact that it gets worse as more players join indicates that but there are also some relevant log messages:

Large number of received packets pending dispatch (40). Possibly due to network congestion (last frame was 18.0047ms)

This means that 40 packets were delivered all at once (that's 2.4 seconds of audio). The last frame was ok (18ms == 55fps), so it's a reasonable guess it might be a network problem.

Beginning playback with very large network jitter: 0.6674457s

This means that there is a lot of "jitter" in the network. That means that some packets arrive exactly on time, and others arrive an entire 0.5s late. (note that latency and jitter are different things, Dissonance can handle any amount of latency).

Created new speech session with buffer time of 243ms

This message isn't an error, but it indicates that Dissonance is deliberately delaying audio by 243ms. This is done to try and compensate for bad network conditions (a larger decay can conceal more jitter).


It's possible that this could be caused by a very poor frame rate on the sending end (it's almost impossible to tell the difference between a sending problem and a network probem). If your frame rate is ok you should check your network system for other things sending large numbers of packets which may cause congestion. If PUN2 has a built in tool for analysing network usage (packets/second, bandwidth, latency etc) that would be the best place to look.

mariappan10 commented 3 years ago

Okay I will look into it and let you know

On Mon, 9 Aug, 2021, 7:14 pm Martin Evans, @.***> wrote:

I've had a look through the log and the video you sent me on Discord. It looks like this is probably caused by network congestion, the fact that it gets worse as more players join indicates that but there are also some relevant log messages:

Large number of received packets pending dispatch (40). Possibly due to network congestion (last frame was 18.0047ms)

This means that 40 packets were delivered all at once (that's 2.4 seconds of audio). The last frame was ok (18ms == 55fps), so it's a reasonable guess it might be a network problem.

Beginning playback with very large network jitter: 0.6674457s

This means that there is a lot of "jitter" in the network. That means that some packets arrive exactly on time, and others arrive an entire 0.5s late. (note that latency and jitter are different things, Dissonance can handle any amount of latency).

Created new speech session with buffer time of 243ms

This message isn't an error, but it indicates that Dissonance is deliberately delaying audio by 243ms. This is done to try and compensate for bad network conditions (a larger decay can conceal more jitter).

It's possible that this could be caused by a very poor frame rate on the sending end (it's almost impossible to tell the difference between a sending problem and a network probem). If your frame rate is ok you should check your network system for other things sending large numbers of packets which may cause congestion. If PUN2 has a built in tool for analysing network usage (packets/second, bandwidth, latency etc) that would be the best place to look.

— 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/233#issuecomment-895235259, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATVMC6JOLETR7ZEUO7YPKCDT37LVFANCNFSM5BZMM5UA .

martindevans commented 3 years ago

It's been a while so I'll close this discussion, feel free to re-open it if you have more questions :)