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

fake friction effect using damper effect #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

poisotf
Copy link

@poisotf poisotf commented Oct 5, 2024

Dirt Rally 2.0 relies on the 'friction' effect to feel good, and is not able to fall back on 'damper' if the wheel does not expose FF_FRICTION.

The g923 fails spectacularly when sent a 'friction' effect (#86).

This patch replaces the 'friction' effect with a 'damper' effect of same intensity. This is what the Logitech Windows driver does for this model.
Because this wheel also ignores the Clip parameter, two 'damper' effects actually add up somewhat coherently ? I'm assuming no game use both 'friction' and 'damper'.

This should probably be enabled on other similar models as well, but I do not know which

@berarma
Copy link
Owner

berarma commented Oct 5, 2024

Thanks!

How do you know this is what the Logitech Windows driver does?

I already thought about this solution: #49 (comment)

I guess it's time to try it. :)

This problem seems to be present in most (maybe all) Logitech wheels using this driver. Why not apply it to all of them?

Instead of trying to play both friction and damper at the same time, I think it would be better to play one or the other, giving preference to the damper effect when both are playing.

If possible I'd prefer that all the logic was in one place just before

for (i = 0; i < 4; i++) {

What do you think?

@poisotf
Copy link
Author

poisotf commented Oct 6, 2024

How do you know this is what the Logitech Windows driver does?

I've set up a VM, a USB packet capture, and some DirectInput test programs (see #86 (comment)).
I have not looked into capturing actual games this way yet.
(note that I let new-lg4ff initialize the wheel, then pass only 046d:c266 to qemu, which I guess is evil ?)

This also shows that they allocate slots 2, 3 and 4 to DirectInput 'spring', 'damper', 'friction' and 'inertia' effects, on a "first come, first served" basis. So they would sum 'friction' and 'damper' for a game that uses both.

This problem seems to be present in most (maybe all) Logitech wheels using this driver. Why not apply it to all of them?

I'm confident this is good for all small, low-strength wheels, but some higher-end ones might do friction properly.

I doubted it on my first read, but the list of models in https://opensource.logitech.com/wiki/force_feedback/Logitech_Force_Feedback_Protocol_V1.6.pdf (§3.2.15) might be complete (4 models to keep)

Instead of trying to play both friction and damper at the same time, I think it would be better to play one or the other, giving preference to the damper effect when both are playing.

I agree. I'm looking into it

@berarma
Copy link
Owner

berarma commented Oct 7, 2024

I've set up a VM, a USB packet capture, and some DirectInput test programs (see #86 (comment)).

I'm sorry I couldn't pay more attention to that comment of yours. I'm glad you took on it.

This also shows that they allocate slots 2, 3 and 4 to DirectInput 'spring', 'damper', 'friction' and 'inertia' effects, on a "first come, first served" basis. So they would sum 'friction' and 'damper' for a game that uses both.

This is incredibly similar to what new-lg4ff does. I hope you didn't get capture packets coming from the Linux driver instead of the Windows driver. If this is confirmed it's a big confidence boost in what we're doing.

I'm confident this is good for all small, low-strength wheels, but some higher-end ones might do friction properly.

I don't know any higher-end wheels than the G923 using this driver.

Instead of trying to play both friction and damper at the same time, I think it would be better to play one or the other, giving preference to the damper effect when both are playing.

I agree. I'm looking into it

Feel free to experiment and see which is the best option. I wouldn't mind doing the same as the Windows driver as long as we know for sure what's doing and it works correctly in games.

Thanks for working on this!

@poisotf poisotf changed the title g923: fake friction effect using damper effect fake friction effect using damper effect Oct 7, 2024
This is what the Logitech Windows driver does for most of these wheels.
Fixes berarma#86
@poisotf
Copy link
Author

poisotf commented Oct 11, 2024

I don't know any higher-end wheels than the G923 using this driver.

My bad, I just looked up pictures of what these 4 friction-enabled wheels look like. They're just older, and device-side effects as a whole are getting phased out I guess.

Because there are some reports of them working correctly with friction, I set this MR to not change anything to them by default (G25, G27, DF Pro, DF GT).
But there is a new module parameter "always_fake_friction=1", to test using them like the other wheels.

This is incredibly similar to what new-lg4ff does

No, I mean they change force type on demand, like in #108.
Dropping later effects instead of trying to combine them seems right though

#108 does also carry the 'friction -> damper' fixup, but this MR feels safer, and seems to be enough to not drop effects in the games I know about

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

Successfully merging this pull request may close these issues.

2 participants