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

USB: Work around FFB dropouts with certain modern wheels #11906

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

badfontkeming
Copy link
Contributor

@badfontkeming badfontkeming commented Oct 12, 2024

Description of Changes

When updating a constant force FFB effect, unconditionally start the effect regardless of whether it is currently running.

Rationale behind Changes

Certain modern direct-drive wheels such as the Moza R5, R9, etc. implement timeouts for FFB constant forces, and only restart their 'timeout clock' when the force is started, regardless of whether the effect is regularly being updated. I've read similar-sounding complaints from users of the Logitech G29, but I don't have that wheel on hand to test with.

In Gran Turismo 4 (and likely other titles with wheel support unless their implementation differs significantly), Moza wheels will experience sudden, sporadic dropouts of FFB during racing. The FFB won't return until the wheel returns to neutral and the car is settled, as this is when the game (conditionally) issues a CMD_STOP to the FFB hardware. After the CMD_STOP is received, PCSX2 will send another 'start' command when the next constant force is sent, resulting in a momentary return of FFB.

Most of GT4's ingame FFB comes from constant force commands. I regression tested against my other wheel, a Thrustmaster T150, which was unaffected by this issue, to confirm that FFB still feels the same after this change.

Note that this is a workaround, and doesn't fix certain cases. Long-living constant forces will still eventually timeout, but in most cases this only happens within menus, which isn't nearly as impactful. "Fully" fixing this issue would require repeatedly restarting the constant force, which was a larger code impact than I was comfortable prescribing given that this change alone is enough to satisfy most affected users.

Suggested Testing Steps

Tested on Windows 11 playing Gran Turismo 4 with the following wheels for 30+ minutes:

  • Moza R9 (primary testing)
  • Thrustmaster T150 (for regression testing, did not experience this issue)
  • Any other commercial wheels from other manufacturers would be appreciated.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

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!

@limeaway510
Copy link

Tested this for roughly 30 consecutive minutes on a single track (Laguna Seca) with the same car. Wheel base used was a Simagic Alpha Mini set to 10Nm max torque, 50% gain, and 5 smoothness. Windows 10. The other wheel base settings are likely irrelevant to discuss here.

Not sure if this is specific to my wheel base, but with this workaround I get a cobblestone or jackhammer like effect when a lateral force is being applied to the tires (aka steering input while moving forward). I guess this makes sense if I'm understanding your change correctly. You made it so that when a FFB command is sent by the game, pcsx2 starts/stops the command until a FFB stop command (steering at neutral) is sent by the game. Is that right?

@badfontkeming
Copy link
Contributor Author

Interesting. So, to clarify, what this change does is simply send a "stop" before each constant force "start" command.

If GT4 was working previously on your wheel and is now experiencing a "jackhammer" effect, that'd imply that different devices interpret these commands differently, meaning my changes either need to be reworked or relegated to a configuration option.

I'm going to do some more investigating. Thank you so much for testing this on your hardware!

Certain modern direct-drive wheels such as the Moza R5, R9, etc. implement
timeouts for FFB constant forces, and expect the forces to be re-run
rather than updated in order to refresh these timeouts.
@badfontkeming badfontkeming force-pushed the ffb-timeout-workaround branch from 3862b7c to 43fdcaf Compare October 12, 2024 19:25
@badfontkeming
Copy link
Contributor Author

@limeaway510 Thanks again for your initial testing. I force-pushed an alternative approach, as after a night's sleep I realized the hardware only cares about receiving a new 'start' command, and doesn't need the force to be 'stopped' first.

It works on my end and may solve the jackhammer/cobblestone issues you experienced. If you have the time, could you please pull down the changes and give them a try?

@limeaway510
Copy link

Works great on my end!

Jackhammer effect is gone. I tested using the same parameters I listed in my original comment. In addition, I also did some testing on Fuji 80s, which from my experience is one of the tracks more susceptible to FFB drops. This makes sense because of the extremely long high speed turns of this track, which matches your description of "long-living constant forces". Happy to report I had no drops in my testing on Fuji 80s as well.

I also periodically paused the game in the middle of turns to see how the wheel would react. With the stable release, in this scenario the wheel would continue to turn in the pause menu until the timer runs out and cuts FFB. With your changes, FFB would immediately cut after hitting pause and had no issues "recovering" as soon as I resumed the game.

Really appreciate you taking the time to figure this out!

@F0bes F0bes merged commit dafca1e into PCSX2:master Oct 13, 2024
12 checks passed
@SOVL22
Copy link

SOVL22 commented Oct 14, 2024

@limeaway510 Thanks again for your initial testing. I force-pushed an alternative approach, as after a night's sleep I realized the hardware only cares about receiving a new 'start' command, and doesn't need the force to be 'stopped' first.

It works on my end and may solve the jackhammer/cobblestone issues you experienced. If you have the time, could you please pull down the changes and give them a try?

I tried the latest build, the ffb is working but I am still getting some horrible cobble stoneing on my acuforce v2 dd wheel. tried the updated official release same result.

@badfontkeming
Copy link
Contributor Author

@SOVL22 Hi, could you please tell me whether your wheel was affected by dropouts before this patch?

@SOVL22
Copy link

SOVL22 commented Oct 14, 2024 via email

@limeaway510
Copy link

@SOVL22 can you confirm which version you’re using? I know it sounds silly but would be good to rule this out. Nightly release v2.1.202 is the one with the ffb fix.

@SOVL22
Copy link

SOVL22 commented Oct 14, 2024 via email

@badfontkeming
Copy link
Contributor Author

@SOVL22 Hmm. This is hard, since it's not a complete regression; I don't have your wheel available, but give me some time to poke around in the code and I'll see if I find a change that makes things work.

@badfontkeming
Copy link
Contributor Author

@SOVL22 Thanks again for adding your report to the mix.

Thanks to the report, I think I identified what the actual root cause of the cutouts was, and as a result I'm going to do some more testing and then create a followup PR.

@limeaway510 would you mind if I pinged the both of you when the new PR is ready for testing?

@flodavid
Copy link

flodavid commented Oct 14, 2024

I tested with a Logitech Driving Force GT (older wheel supported by PS3 and PS2 compatible I think), no regression found

@limeaway510
Copy link

@badfontkeming nope not at all

@SOVL22
Copy link

SOVL22 commented Oct 14, 2024 via email

@badfontkeming
Copy link
Contributor Author

@SOVL22 @limeaway510 @flodavid

If the three of you are able, the new PR has builds ready, I'd appreciate a quick re-test if you all have the time. Thanks again for your time.

#11915

@SOVL22
Copy link

SOVL22 commented Oct 14, 2024 via email

@SOVL22
Copy link

SOVL22 commented Oct 14, 2024 via email

@badfontkeming
Copy link
Contributor Author

@SOVL22 Awesome, glad to hear there's a notable improvement! If you could copy-paste your response over to the new pull request at #11915 that'll help us keep the discussion organized.

@JZStudiosGit
Copy link

Oh good, someone's mentioned this and started looking into it. I do know the old plugin doesn't have the dropouts on my Fanatec CSL DD, and in the current just released version Enthusia still has weird overly strong FFB spikes the plugin 1.6 version doesn't.
I'll have to look into this and see how to get it to work.

@badfontkeming
Copy link
Contributor Author

@jshfdoiquergh the changes in this pull request should be fully integrated into the latest stable build of PCSX2.

If you have any further comments or reports on quality of FFB in the latest builds, please let me know. I'm still gathering information as there's still a handful of people claiming that detail is worse than previous versions, but I can't tell if it's placebo/driver config or if it's something real.

@SOVL22
Copy link

SOVL22 commented Oct 31, 2024 via email

@badfontkeming
Copy link
Contributor Author

@SOVL22 So, I'm not sure what's up with that assuming you're playing Gran Turismo 4 (which is the only FFB-using game I currently have on hand to test).

That game uses the same single force for both centering and curb/road effects, so it's not possible for them to point in opposite directions at a logical level.

There are a few possibilities:

  • Placebo: The curbs might still be backwards, but your brain might have a disconnect since the rest of the feedback is also backwards
  • Weird drivers: your drivers could be misbehaving and adding their own negative spring force somehow
  • Weird SDL or PCSX2 behavior: I'm not actually sure what adding ~ to a force axis does under the hood. Maybe it does something funky that is either invalid or incompatible with your wheel.

A plain old "Reverse FFB direction" checkbox wouldn't be hard to make, but between work, life, and health issues I unfortunately haven't been able to put together enough time to look into it and make a PR that I'd have sufficient energy to follow through on. Sorry about that.

@SOVL22
Copy link

SOVL22 commented Oct 31, 2024 via email

@badfontkeming
Copy link
Contributor Author

Thanks for letting me know, it's valuable knowledge to hear that this has happened to other games, but dang that's weird. It gives me something I can research, though, so that's helpful. I'd like to understand what exactly is happening, since what you're describing is really hard for me to come up with a good explanation for. I want to make sure it doesn't imply something else might be broken.

I may open a draft PR with my DirectInput hack later, just so I can point people towards it for testing purposes. If I do, I'll let you know so that we can move the discussion over.

@SOVL22
Copy link

SOVL22 commented Oct 31, 2024 via email

@JZStudiosGit
Copy link

@badfontkeming do you know if an ffb inversion switch will be possible yet? Since we last spoke I haven't had any quality issues but I know the inverted ffb issue still persists.

10-31-24_03-48 12PM
The old plugin had a toggle that got removed when it was. Can you try 1.6 with the Qemu plugin?

@SOVL22
Copy link

SOVL22 commented Nov 1, 2024 via email

@JZStudiosGit
Copy link

JZStudiosGit commented Nov 1, 2024

I had heard that but I wasn't sure where to find the correct versions of pcsx2 and the qemu plug-in

1.6 is available on the main download site under previous versions. Qemu can just be found by google, there's only the 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants