You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Calling UDPConn.ReadPacket() consistently fails when reading from a Discord voice UDP connection. The method almost never successfully reads a packet once the connection is opened.
Error
The following error is logged on every call to ReadPacket():
failed to read packet: read udp 192.168.0.108:61986->34.0.245.81:50006: wsarecv: A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself.
To Reproduce
Create a voice connection using VoiceManager.CreateConn.
Open the voice connection and set the speaking flag.
Continuously read packets from the voice UDP connection in a goroutine using UDPConn.ReadPacket().
vs:=global.Session.VoiceManager.CreateConn(guildID)
err:=vs.Open(ctx, channelID, false, false)
iferr!=nil {
returnfmt.Errorf("failed to open voice connection: %w", err)
}
err=vs.SetSpeaking(ctx, voice.SpeakingFlagMicrophone)
iferr!=nil {
returnfmt.Errorf("failed to set speaking: %w", err)
}
gofunc() {
for {
_, err:=vs.UDP().ReadPacket() // this failsiferr!=nil {
slog.Error("error reading voice packet", "error", err)
continue
}
}
}()
Expected behavior UDPConn.ReadPacket() should successfully read incoming UDP voice packets once the voice connection is established.
I tried to use my existing code and I can not reproduce this issue right now as well. I didn't introduce any changes to the code. But I noticed that the discord voice server has switched since the last time I tried to use voice. The branch you shared also seems to work as expected.
I am pretty clueless why this is happening. If you want to debug this further maybe we can chat in discord. The invite link is in the readme
I am really interested in getting this bug fixed. I am not sure if I will be helpful enough, but I will message you on the Discord server in a couple of days.
Would you mind installing disgo from the feature/dave branch and seeing if your issue is fixed? You don't have to actually setup DAVE support, just updating might be enough :)
Would you mind installing disgo from the feature/dave branch and seeing if your issue is fixed? You don't have to actually setup DAVE support, just updating might be enough :)
Hello. Tried that branch but unfortunately the error still occurs.
Hello. Sorry for a this long reply. Yes, it looks like this issue has indeed been resolved.
However, I have noticed a differrent problem. Reading packet returns "failed to decrypt frame" error whenever there is a user with camera on, even if they are silent.
Additionally, on a couple of occasions, the same error started occurring on every read after a user joined the bot when it had been alone in a voice channel for a long time (at least 4 hours).
However, I have noticed a differrent problem. Reading packet returns "failed to decrypt frame" error whenever there is a user with camera on, even if they are silent.
I can't reproduce this
is this still a thing? if so can you show it to me or something? idk
Additionally, on a couple of occasions, the same error started occurring on every read after a user joined the bot when it had been alone in a voice channel for a long time (at least 4 hours).
a few of those errors are "normal" since its a race condition if we get the keys first, or they send audio
if it happens more than a few frames thats bad tho. Can you clarify?
Activity
topi314 commentedon Dec 14, 2025
I've never seen that issue and can't reproduce it either lol
can you try https://github.com/disgoorg/disgo/tree/exp/increase-voice-receive-buffer?
lepterion commentedon Dec 14, 2025
I tried to use my existing code and I can not reproduce this issue right now as well. I didn't introduce any changes to the code. But I noticed that the discord voice server has switched since the last time I tried to use voice. The branch you shared also seems to work as expected.
lepterion commentedon Dec 15, 2025
Hello again. Today I tried to use voice again, and the issue returned. The error is the same. The issue persists on your branch as well.
topi314 commentedon Dec 29, 2025
I am pretty clueless why this is happening. If you want to debug this further maybe we can chat in discord. The invite link is in the readme
lepterion commentedon Dec 31, 2025
I am really interested in getting this bug fixed. I am not sure if I will be helpful enough, but I will message you on the Discord server in a couple of days.
davfsa commentedon Jan 1, 2026
Hey!
Its possible I might have indirectly fixed this issue while working on DAVE: https://github.com/disgoorg/disgo/pull/506/changes#diff-658cf4be28f310e298f7c966d33b56e611777ba2f2d1270a845d1494aa9bdee5R302
Would you mind installing disgo from the
feature/davebranch and seeing if your issue is fixed? You don't have to actually setup DAVE support, just updating might be enough :)lepterion commentedon Jan 1, 2026
Hello. Tried that branch but unfortunately the error still occurs.
topi314 commentedon Feb 12, 2026
can you see if this is resolved in https://github.com/disgoorg/disgo/releases/tag/v0.19.0?
lepterion commentedon Feb 27, 2026
Hello. Sorry for a this long reply. Yes, it looks like this issue has indeed been resolved.
However, I have noticed a differrent problem. Reading packet returns "failed to decrypt frame" error whenever there is a user with camera on, even if they are silent.
Additionally, on a couple of occasions, the same error started occurring on every read after a user joined the bot when it had been alone in a voice channel for a long time (at least 4 hours).
topi314 commentedon Feb 27, 2026
probably relevant here
#5
topi314 commentedon Mar 8, 2026
@lepterion
I can't reproduce this
is this still a thing? if so can you show it to me or something? idk
a few of those errors are "normal" since its a race condition if we get the keys first, or they send audio
if it happens more than a few frames thats bad tho. Can you clarify?