-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
VoiceConnection stuck in signalling state about a minute after creating it #9185
Comments
I've also found a workaround to this problem : Add |
Thank you! This sort of helps as it seems to restart the stream after a few seconds of it being autopaused. But that's not really a solution where I'd create a PR because the stream still stops after each minute. |
I have the same problem. It started to happen today without me changing anything in the code. So probably discord changing something on their side of the connection 🤔. |
I have the exact same issue, after trying to figure out what could possibly be the problem I found that this happen only on some voice servers. I was trying to override voice channel region between Singapore and Hong Kong. The problem will not occur if the channel endpoint has the number greater than around 10,000 e.g. You can enable debugging in VoiceConnection by setting const voiceConnection = joinVoiceChannel({
debug: true,
channelId,
guildId,
adapterCreator: voiceAdapterCreator
});
voiceConnection.on('debug', (m) => {
console.log('Voice Debug:', m);
}); I got this debug message when the connection was closed
Networking status code 4 is "Ready", 5 is "Resuming" and 6 is "Closed" After looking at VoiceConnection code: I can see that it handles disconnection properly but somehow re-signalling/rejoining is not working as expected. The solution I could find right now is try to override server region to other regions until you get a voice server with number greater than 10,000 in its name, but the server will change again if the channel is empty. |
I've noticed a pause too, i guess there is a problem on discord side causing the connection to crash every minute. The pause happens during the time needed to reconnect so we probably can't get better solution for now 😥 |
Interesting, it seems to confirm that the issue is coming from discord |
I tried to override my voice channel to Singapore and I got singapore11014. It is working just fine, no disconnection at all. |
Could you share how you do it? Thanks! |
Do you know if overriding the server region can only be done by end users or if it's possible to make a patch in our bots too ? |
Ok so i've made an announce in my server linking to your solution to help end users |
I believe this was a Discord issue that should be resolved now. Can you guys check (on a new connection, if possible (restart your bot)) if you can still reproduce this? |
Unfortunately still have the same issue. |
I wasn't able to switch the region on the server so I made this as a temporary workaround: this.connection.on('stateChange', (old_state, new_state) => {
this.logger.logMessage('join', 'Connection state change from', old_state.status, 'to', new_state.status)
if (old_state.status === VoiceConnectionStatus.Ready && new_state.status === VoiceConnectionStatus.Connecting) {
connection.configureNetworking();
}
}) The little pause is shorter then on this solution. |
I can't test on a fresh instance for now, but still happens for me too |
That's actually also a much simpler solution as it doesn't require modifying module code 😄 |
Still happens on singapore8142, but works fine on singapore11014 |
Restarted my bot several times. Still same issue. |
Imagine you have no idea about how to write code? Where would you put this so that things work again in Discord? |
- Sending less GUI - fix the bug for discordjs:discordjs/discord.js#9185 (comment) - prepare for the web GUI
- Sending less GUI - fix the bug for discordjs:discordjs/discord.js#9185 (comment) - prepare for the web GUI
- Sending less GUI - fix the bug for discordjs:discordjs/discord.js#9185 (comment) - prepare for the web GUI
Based off this comment discordjs/discord.js#9185 (comment)
…stuck in signalling: discordjs/discord.js#9185 (#13)
This has been fixed in v0.15.0 |
Indeed it has been fixed! Slap that |
so i have to add it to this file? /discor-music-player/dist/managers/Queue.js? |
Fix audio stops playing after 1 minute See discordjs/discord.js#9185
Which package is this bug report for?
voice
Issue description
I've noticed a bug that seems to affect also some other users (see #8482).
All the VoiceConnection works as intended the first minute, and then stop playing anything. The player subscribed switch in AutoPaused and the connection stays signalling state indefinitely.
After looking at the code (https://github.com/discordjs/discord.js/blob/main/packages/voice/src/VoiceConnection.ts), it seems that the only way for it to go back to ready state is to receive a message from discord api, that then create events that can put status back in ready state.
But, if I understand correctly, this discord message never comes(line 335), so an event is not created through the function
configureNetworking
(line 338, 420), and the state cannot change to ready(line 484).That's a messy explanation, and maybe false btw, but I've tried my best to understand.
Code sample
Package version
14.7.0
Node.js version
18.7.0; 18.14.2; 19.7.0 and maybe others
Operating system
Windows, WSL, Ubuntu, Debian...
Priority this issue should have
Medium (should be fixed soon)
Which partials do you have configured?
Not applicable (subpackage bug)
Which gateway intents are you subscribing to?
Guilds, GuildVoiceStates
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: