-
Notifications
You must be signed in to change notification settings - Fork 36
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
New send queue issue. #70
Comments
This may actually be an indication of a Ryujinx bug, still investigating. |
I dont remember why, but iirc Ryujinx did not handle the way the TCP/UDP setup worked as something wasn't implemented. |
Side note: Due to this bug I was able to reproduce and fix the memory leak in #63 caused by the full send queue leading to a crash after some time of intensive gameplay. I was able to trigger a full send queue that way on Ryujinx, but couldn't do so on the Switch and assumed that my weak PC emulating the game was the issue of the emulator not being able to keep processing the send queue fast enough. I haven't tested older versions than The changes from |
I've noticed that after stopping the "high levels of activity" (cap jumping etc), it "recovers from the queue backlog" rather slowly. With 100/100 in the send queue, on my really high end PC with really good wired internet etc. it takes about 4 seconds for the send queue to fully empty. Maybe ryujinx's TCP send() function """isn't concurrent""" or just really really slow? |
Also, piplup was testing a handful of commits between 1.3.0 and 1.4.0 and saw no difference in the queue behavior, which makes me further believe that this might be a ryujinx issue. If I remember in the morning, I'll try it on an older version(s) of ryujinx. |
I couldn't reproduce this bug on Ryujinx It's a bit hard to pinpoint the exact commit that introduced the bug. It's definitely coming from #39 and started to appear with ba7612a. But it could have been introduced by commits earlier in that branch, because they have build errors or don't have the send queue yet, because the send queue was only introduced to the branch in-between by merging d4eabff via d666707. (Note: the send queue commit d4eabff released with So IMHO this bug was likely introduced somewhere by these changes: 13c873a...ba7612a Looking at the changes it doesn't really make sense to me why there is any change to the send queue at all. I mean just looking at the changes in [Edit:] unsuprisingly reverting |
My current hypothesis is that the
Commenting out the following polling code and replacing it with a simple SuperMarioOdysseyOnline/source/server/SocketClient.cpp Lines 233 to 274 in ad79fe1
There is a difference between switch and emulators regarding the SuperMarioOdysseyOnline/source/server/SocketClient.cpp Lines 20 to 24 in ad79fe1
(Setting it to |
Can we maybe get rid of that combined polling by splitting up the receive thread into two separate threads, one for TCP and one for UDP? |
I also remember poll being involved in this issue.
Actually
We already have a lot of issues with multithreading surrounding the networking code, so if we can avoid more threads we should. I also dont know if it would fix anything considering it would still be trying to use the two sockets in multiple places and might cause similar blocking. |
Since polltime = 0 on emu is meant to make it non-blocking, and yet
The observed "4 second" behavior is really egregious if true. Is it possible that ryujinx's non-blocking send is ridiculously slow regardless? I wonder if the behavior changes any noticeable amount if set back to -1. |
Yes, that is what seems to be the bug, requesting an immediate timeout seems to cause still have very long delays before returning.
Potentially, but from Istador's testing, it does seem to be the call to
Istador kindly retested the
If it still behaves like it previously did, whenever the client sees other players move, the client will start sending and receiving packets. However, as soon as the other players stop, the packets stop. |
Note: I tested with an older Ryujinx version |
UDP support is very buggy on ryujinx, i found connecting a switch to the server gets ryujinx to use UDP, |
Are there any issues that can be checked or followed? |
Here is a build if someone wants to test |
Just tested on my machine with Ryujinx 1.1.1336 and the issue is still present, since the packet send queue stuff was once related to "whether or not another player is moving on the server", I'll note that I was the only one online. |
Could you also test when its set to
Shadow linked this PR on discord . But according to my observations at the time, it didn't fix it, it only helped. Plus it was the send rather than the poll. So, this might be PR might be unrelated.... Hopefully someone finds a solution with Piplup's reports. |
I believe that is also related to the SuperMarioOdysseyOnline/source/server/SocketClient.cpp Lines 247 to 255 in ad79fe1
![]() Sceenshot by |
When playing, the send queue can (not always) fill up during high levels of activity (e.g., cap jumping around).
It seems that this issue showed up between release 1.3 and 1.4
Investigating cause, will try to update this thread with my suspicions.
The text was updated successfully, but these errors were encountered: