Pr/keep alive update - #14937
Closed
verbst wants to merge 10 commits into
Closed
Conversation
10: Bug fixing (needs testing)
9 (82): Revendored API input
9 (81): Revendored API input
9: input label fix
9 (76): rumble stop fix
8: Interlaced support
7: rumble fix, stage a
6 & 71: Input API and integration
5: Adding support for virtual mister controllers into PCSX2
4: Bug fix on connection
3: Fix to switchres presets
2: Groovy settings added
compile error fix
1: Initial implmentation
NLC & Input supoprt
What changed
Vendored client (3rdparty/groovymister/) — re-synced to upstream 6cce1ac. Delta vs pristine upstream is now exactly one logical patch: rioServiceQueues() in groovymister.{h,cpp} (34 lines, 3 call sites). Every other file is byte-identical. Upstream api/ turned out to already ship CRLF, so the re-sync is a straight cp — I corrected PROVENANCE.md, which told the next person to convert.
The keepalive — GroovyMiSTerKeepAlive.h holds the timing decision (2000 ms threshold / 250 ms poll, static_asserted against the core's 5 s timeout), and SenderLoop()'s queue wait became a wait_for. Because PCSX2 streams from a dedicated thread nothing can stall, that single change covers pause, savestate loads, disc swaps and modal dialogs — no timer or host plumbing.
Frame counter — realigned on gmw_reconnect_epoch() change and in TryConnect(), with the unbounded forward jump kept deliberately and the reasoning in a comment.
Three things worth your attention
1. A hole I found while wiring it up, not in the plan. The oversized-frame drop path continues with have_frame still true, so a pathological run of oversized frames would look busy while sending nothing — and starve the core's idle timer. The keepalive check therefore runs on every iteration, not just idle ticks.
2. gmw_reconnect_epoch() is not monotonic. gmw_close() deletes the wrapper's singleton, so the epoch is per-object and restarts at 0 on every TryConnect(). The comparison is !=, never >. My first comment on this was weaker than the truth; it's corrected in the code and recorded in memory.
3. Verification is partial, deliberately. The five keepalive tests pass — I ran them under a minimal gtest shim since gtest isn't built in WSL, so the assertions genuinely executed rather than just compiling. Both changed TUs and the whole vendored client pass -fsyntax-only. The MSVC build and every hardware drill are unrun, and the drills need the cab flashed with MiSTer_groovy_nlc_idletimeout + Groovy_idletimeout.rbf — against your current 3738621a… binary the keepalive is inert and unverifiable.
Upstream feedback
- 3rdparty/groovymister/groovymister.h — CmdSwitchres now returns int. - 3rdparty/groovymister/groovymister.cpp — CmdSwitchres retries the send up to 3x waiting for a getACK(60) ACK before giving up; CmdBlit's internal reconnect watchdog checks that return and only logs "modeline replayed" when it actually succeeded. - 3rdparty/groovymister/groovymister_wrapper.h/.cpp — gmw_switchres() propagates the new return value. - pcsx2/GroovyMiSTer/GroovyMiSTerOutput.cpp — SenderLoop()'s switchres call site logs a Console.Warning on failure. - PROVENANCE.md — documents this as a manual cherry-pick from the (still-uncommitted) canonical repo, so a future full re-sync reconciles rather than double-applies or drops it. All three touched .cpp files pass g++ -fsyntax-only with the project's established WSL verification flags. This doesn't cover the actual Windows build/link — that still needs to happen on your end, and testing the fix requires the rebuilt MiSTer core binary (with the matching sendACK(0,0) change) deployed to hardware, since the PCSX2 side is inert without it.
Keepalive & reconnection
keep alive fix nlc limited to rgb888
Author
|
wrong fork sorry |
Contributor
There was a problem hiding this comment.
Thank you for submitting a contribution to PCSX2
As this is your first pull request, please be aware of the contributing guidelines.
Additionally, as per recent changes in GitHub Actions, your pull request will need to be approved by a maintainer before GitHub Actions can run against it. You can find more information about this change here.
Please be patient until this happens. In the meantime if you'd like to confirm the builds are passing, you have the option of opening a PR on your own fork, just make sure your fork's master branch is up to date!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
keep alive update
latest groovy nlc api
nlc limited to rgb888