Simple Voice Chat

Simple Voice Chat

31M Downloads

Frequent Time Outs

AyauCode opened this issue ยท 28 comments

commented

Bug description
All players on server will frequently time out and lose the ability to speak or hear then at a seemingly random time later the voice chat will reconnect. Relogging fixes the issue temporarily but players will soon have their voicechat time out again. Server CPU use is at 50% and memory usage at 4/6GB.

Steps to reproduce the issue

  1. Create server
  2. Players join
  3. Try talking at random times to test if voice is connected. Attempt /voicechat test {user} to confirm time out

Expected behavior
Players connected to voice chat without timing out.

Log files
[https://gist.github.com/Setlock/5a37fa052e4167194b436774cdb6beb9](latest log)

Versions

  • 1.16.4
  • 35.1.36
  • 1.1.5

Other mods
abnormals_core-3.0.6
AI-Improvements-0.3.0
AppleSkin-1.0.14
Aquaculture-2.1.12
AutoRegLib-1.6-47
BetterCaves-1.1.1
BetterMineshafts-2.0.1
BuildingWands-1.3.1
buzzierbees-3.0.0
bwncr-3.9.16
charm-forge-2.2.2
ChickenChunks-2.7.0.85
CodeChickenLib-3.5.1.408
create-v0.3e
DungeonCrawl-2.2.4
endergetic-3.0.0
FastFurnace-4.4.0
FastLeafDecay-v25
FastWorkbench-4.5.0
Hwyla-1.10.11-B78
jei-7.6.1.68
jeiintegration-6.1.1.11
JustEnoughResources-0.12.0.100
KleeSlabs-9.2.0
mcw-bridges-1.0.5
Morphes-4.2.68
MouseTweaks-2.13
Placebo-4.4.1
ProgressiveBosses-2.2.0
Quark-r2.4-302
repurposedstructures-2.3.4
SereneSeasons-4.0.0.86
swingthroughgrass-1.5.3
voicechat-1.1.5
XaerosMinimap-21.2.0.1
XPFromHarvest-1.2.1
YungsApi-4

commented

Lowering Server Sample Rate Had No Effect. Only 3 Players On Server When Testing.

commented

Thank you for explainung your issue.
The timeout of the test command is just related to a single "ping". If this times out, it doesn' mean you timed out from the voice chat. It just means the single packet that has been sent, hasn't arrived. This may occur because of packet loss.

But I think there is another problem that causes the connection issues after some time. I will look into it. I can't guarantee for it to get fixed soon, because it is a pain to debug this mod.

commented

Your log file is incomplete.

commented

Your log file is incomplete.

Sorry, Fixed Log File. Should now be full log.

commented

What do you mean with "players will soon have their voicechat time out again"?

commented

What do you mean with "players will soon have their voicechat time out again"?

When players initially join their voicechat is connected perfectly with response time around 30-50ms, however after some time normally 3-5 minutes and running the test command some players will time out. However, after waiting more time and running the test command again players will have "reconnected" and the test command will return time between 30-50ms. The time it takes for a voice chat time out, the time for reconnect, and the specific players who will lose connection seems to be random and not deterministic.

Also note, a relog will immediately fix the issue, only for them to time out again some minutes later.

Edit: for context current sample rate in server config is set to 13000

commented

WINMTR Test to Server with Output
image

commented

I've had similar issues that seem to happen after long periods of inactivity. Additionally, my players seem to get their voices pitch shifted at random. This issue also does not resolve until disconnect/server restart.

commented

Thanks for letting me know. The pitch shifting is caused by changing the sample rate while the server is running.

commented

Can you try if it has been fixed with 1.16.5-1.0.3?

commented

Can you try if it has been fixed with 1.16.5-1.0.3?

can you please bring the same fix in the version 1.16.4 because i have a lot of other mods and i cant update the version so easy
i have the same problem, while my friends are speaking i see the icon beside their name but i cant hear them and the icon goes on and off while they speak. and if i do voicechat test often it is 660ms or timeout

commented

You can use 1.16.3 and 1.16.4 mods in 1.16.5 They just work, since nothing changed between these versions.

commented

You can use 1.16.3 and 1.16.4 mods in 1.16.5 They just work, since nothing changed between these versions.

oh ok thank you for that information, i will try it an say you if it is fixed or not

commented

If I know that the issue has been fixed, I will port it to older versions.

if you port it to 1.16.4 i can test it for you with 4 friends

commented

You can use 1.16.3 and 1.16.4 mods in 1.16.5 They just work, since nothing changed between these versions.

so you wont fix it in the 1.16.4?
because everyone who joins with 1.16.5 minecraft crashes everytime so i cant update

commented

If I know that the issue has been fixed, I will port it to older versions.

commented

Was using 1.0.3! Will try 1.0.4 and update you.

commented

My players are still experiencing the same issues on 1.16.5

commented

Which version are you using?

commented

on 1.0.5, I've noticed this in my logs whenever my voice chat cuts off:

[17Feb2021 16:51:36.980] [MicrophoneThread/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.ArithmeticException: / by zero
[17Feb2021 16:51:36.980] [MicrophoneThread/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at de.maxhenkel.voicechat.voice.client.MicThread.sendAudioPacket(MicThread.java:136)
[17Feb2021 16:51:36.980] [MicrophoneThread/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at de.maxhenkel.voicechat.voice.client.MicThread.voice(MicThread.java:93)
[17Feb2021 16:51:36.980] [MicrophoneThread/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at de.maxhenkel.voicechat.voice.client.MicThread.run(MicThread.java:39)

It looks like packetAmount is getting set to 0, causing a divide by zero issue in calculating bytesPerPacket.

I'm not very skilled at java dev, but would something like this work?

private void sendAudioPacket(byte[] data) {
        int dataLength = AudioChannelConfig.getDataLength();
        int packetAmount = (int) Math.ceil((double) data.length / (double) dataLength);
        if (packetAmount != 0) {
            int bytesPerPacket = data.length / packetAmount;
            if (bytesPerPacket % 2 == 1) {
                bytesPerPacket--;
            }
            int rest = data.length - bytesPerPacket * packetAmount;
            for (int i = 0; i < packetAmount; i++) {
                try {
                    new NetworkMessage(new MicPacket(Arrays.copyOfRange(data, i * bytesPerPacket, (i + 1) * bytesPerPacket + ((i >= packetAmount - 1) ? rest : 0))), client.getSecret()).sendToServer(client);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
commented

Thanks for the PR. But I think this is not related to this issue.

commented

1.04 had the same issues.

commented

This should be fixed wit 1.16.5-1.0.7

commented

This should be fixed wit 1.16.5-1.0.7

when will there be a fix for 1.16.4

commented

This should be fixed wit 1.16.5-1.0.7

when will there be a fix for 1.16.4

i tried the newest version still timing out

commented

Please send me your logs

commented

Please send me your logs

20.02 23:12:29 [Server] VoiceChatPacketProcessingThread/INFO [FrankyBaatz: Request timed out]
20.02 23:12:23 [Server] Server thread/INFO [FrankyBaatz: Packet sent. Waiting for response...]
20.02 23:12:23 [Server] Server thread/INFO [FrankyBaatz: Sending packet...]
20.02 23:12:06 [Server] VoiceChatPacketProcessingThread/INFO [voicechat/]: Successfully authenticated player 8ffaf706-dd05-4136-a8b5-fd7b4fb54596
20.02 23:11:52 [Server] Server thread/INFO [voicechat/]: Sent secret to FrankyBaatz

commented

Please send me the full logs from both server and client. Please use github gist or something.