dolphin
dolphin copied to clipboard
BBA/HLE: Increase polling efficiency
This PR is based on https://github.com/dolphin-emu/dolphin/pull/12559 and updates the way BBA/HLE polls data. It does so by sleeping less often and pulling data as soon as possible and as much as possible.
I suspect this PR has improved the matchmaking stability. My Windows build seems to match consistently my Android phone and the other way around. It might be a coincidence since I don't have a lot of device to test it.
This PR is ready to be tested.
Sorry for the late response here. Is the optimal way to test this with a Windows computer? Is there any need to test it on Linux/Android connectivity, which already worked fine for me.
Sorry for the late response here. Is the optimal way to test this with a Windows computer?
Not necessarily, Dolphin on Linux/Android were working fine for me as well. Whereas I had matchmaking/stability issues on Windows which seems less present on this build. Though, I wasn't able to confirm that's related.
Is there any need to test it on Linux/Android connectivity, which already worked fine for me.
It might be worth checking if there is a speed improvement compared to the current build. I was only able to confirm that by sleeping more often, it degrades the performance (FPS) significantly on Mario Kart: Double Dash and Kirby Air Ride. That's why I suppose that sleeping less often might improve the performance.
Sadly my actual setup (Windows PC + Linux VM + Android phone) don't allow me to explore this further in a reliable way. I might be able to push the testing further by adding two of my Wii into the mix (using Nintendont) but it will have to wait 2 weeks or so as I don't have the time to do so currently.
I was able to test the Universal MacOS binary on an M-series chip just now and had no issues with PSO. I also tested the ARM64 build as well without issue.
It did feel like the network speed was faster, but I can also attribute that to a placebo effect, and I'm not sure one would really see much improvement for a game that was made for the days of dial up internet, though I swear it felt better. Who knows.
Thank you for this.
E: Tested on Windows X64 and also had no issues with online functionality.
You can rebase this now.
I did some extensive testing with this PR. When I increase the sleep period it does decrease performance, sleeping less often seem to improve performance to some extent. However, when comparing with latest master and this PR, I didn't notice a difference when playing.
My testing environment
I tested this PR using Mario Kart: Double Dash! (60Hz mode) and in my testing environment (where I have a TV and my Nintendo Wiis). This room is different from where I usually use my Windows 10 laptop. All devices were connected to the same Wi-Fi network and my Windows machine has UPnP service disabled and Windows' network protection turned off.
Devices
- Nintendo Wii (using Nintendont)
- Windows 10
- Linux (using a VM)
- Android (ASUS ROG Phone 2)
Matchmaking tests
Here is the result of different matchmaking orders when using this PR :
- [KO] Nintendont, Android
- [KO] Nintendont, Linux
- [KO] Nintendont, Windows
-
[~OK] Windows, Android
- Failed on my test environment
- [KO] Windows, Linux
- [OK] Windows, Nintendont
-
[~OK] Linux, Android
- Failed on my test environment
- [OK] Linux, Nintendont
- [KO] Linux, Nintendont, Android
- [KO] Linux, Nintendont, Windows
- [OK] Linux, Windows
-
[~OK] Linux, Windows, Android
- Failed on my test environment
- [OK] Linux, Windows, Nintendont
- [OK] Android, Linux
- [OK] Android, Linux, Windows
- [OK] Android, Linux, Windows, Nintendont
- [OK] Android, Nintendont
- [OK] Android, Windows
- [KO] Android, Windows, Linux (stuck)
- [KO] Android, Windows, Linux (stuck), Nintendont (stuck)
- [OK] Android, Windows, Nintendont
Some takeaways
- My Windows host doesn't like its Linux guest (VM) nor my Android phone.
- So I suppose that Windows hosts should join last or before Nintendont.
- The opposite is not true, both Android/Linux seem to accept the others fine.
- I can confirm that Nintendont has to join last for some reasons.
- The Wi-Fi signal in the room where I have my testing environment isn't as strong as where I use to have my laptop/phone.
- That might be the reason why some testing involving Linux/Android failed.
- This suggests that the network performance is also a key factor.
- It seems MKDD countdown is stuck when one of the pairs can't detect a pair advertised by the other pairs.
These tests aren't as rigorous/stable as proper hardware testing (especially since I don't have a BBA) so they should be taken as what they are, some (bruteforce) testing within an environment where I try to keep the same settings as a base for each test case.
In my experience (prior to this PR) real BBA worked fine as long as it wasn't the first thing to connect. Kirby Air Ride was way more stringent than Mario Kart though.
I tested it on Linux a while back, but I can't test it on Windows because I don't run that OS anymore, and that's where the actual benefits supposedly show.
Let's just get this in, people will yell if it breaks stuff anyway...