[Feature Request]: Better handling of Rumble status
Description
The rumble hasn't gotten much love through the years so its implementation is a bit loose, resulting in a few problematic situations. My understanding of the extend of the issue may be lacking, but I'll try to explain the best I can:
Reason
The emulator initiates and terminates rumble by sending events to a controller once (as far as I know). If a rumble event starts as a result of an action in a game, then a savestate is loaded from a point prior to that, the rumble persists until a new rumble event is initiated and ended.
This behavior could occur in other situations as well, like pausing the emulation, or the emulator outright crashing. We can't fully tackle the latter, but the rest can be mended.
Examples
- Immediately trigger a Rumble End when one attempts to load a savestate.
- Keep track of whether Rumble is ongoing when emulation is paused. If it is, trigger a Rumble End on pause, and a Rumble Start when resuming.
- Booting a new game (reset/disc swap) should ideally trigger Rumble End to be safe.
- Trigger precautionary Rumble End when the emulator is started, to help people caught in an unexpected crash during Rumble that would leave the controller vibrating otherwise.
I should clarify that some of the points made above might already be implemented to a degree. I'm just using my intuition as I have not reviewed the source directly, so I might be describing something that already exists to a degree.
Particularly on point 2, supposing such a variable exists to keep track of rumble status, it could further add to point 1 by ensuring proper continuation or termination of Rumble in any combination of before/after states when relying on the savestate system.
EDIT: Perhaps ending Rumble in the event of a crash can be tackled with a secondary "shadow" process that the main emulator launches on startup, and it closes itself when it notices that the pcsx2 executable is no longer an active process, sending an event to end the Rumble in the process? Perhaps not very graceful, but it may well be very reliable.
@coornio is this still an issue for you as of recently?
Honestly not sure, I can't tell if rumble isn't working for some reason or if the games I tried just now don't use it. Either way, I'll have to check it later in the day more, I don't have the time at present :p
how has this been recently ?
I forgot lol.
I checked it now though. It seems that if a savestate is created while a rumble event is ongoing, loading it doesn't restart the rumble. It was tested in Crash Nitro Kart while grinding along a wall. This produces constant vibration so long as you continue grinding and still moving. After the load, no rumble is produced anymore, a new event must trigger to enable it. Not sure if a sample size of 1 is indicative, perhaps the game spams tiny rumble intervals and I caught it between the events, or maybe it really does ignore ongoing rumble when loading a savestate. Not sure
In regards to the original points: (1) was implemented as described. Honestly feels a little disjointed, but I can't get my controller stuck in rumble anymore so that's good. (2) rumble state is respected when pausing the emulator and resumes exactly as expected. (3) can't test it since I can't get rumble stuck anymore (4) don't have a way to manually crash the emulator, but a forced application termination through a killswitch sees rumble end properly, so perhaps handled too?
I think it's safe to mark as solved, unless someone wishes to add anything more to this.
I think it's safe to mark as solved
Thats good to hear