Skip to content
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

BBA/HLE: Increase polling efficiency #12560

Merged
merged 4 commits into from May 4, 2024

Conversation

sepalani
Copy link
Contributor

@sepalani sepalani commented Feb 3, 2024

This PR is based on #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.

@JMC47
Copy link
Contributor

JMC47 commented Mar 9, 2024

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.

@sepalani
Copy link
Contributor Author

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.

@ShiftaDeband
Copy link
Contributor

ShiftaDeband commented Mar 12, 2024

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.

@AdmiralCurtiss
Copy link
Contributor

You can rebase this now.

@sepalani sepalani marked this pull request as ready for review April 17, 2024 16:24
@sepalani
Copy link
Contributor Author

sepalani commented Apr 21, 2024

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.

@JMC47
Copy link
Contributor

JMC47 commented Apr 23, 2024

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.

Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JMC asked me to review this. Completely untested but the code changes look sane.

@JMC47 If you want to merge it you should test it.

@JMC47
Copy link
Contributor

JMC47 commented Apr 26, 2024

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.

@AdmiralCurtiss
Copy link
Contributor

Let's just get this in, people will yell if it breaks stuff anyway...

@AdmiralCurtiss AdmiralCurtiss merged commit 1b19a75 into dolphin-emu:master May 4, 2024
11 checks passed
@sepalani sepalani deleted the bba-poll branch May 4, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants