Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DirectInput FFB: Calculate appropriate update flags#14570

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
dwillbarron wants to merge1 commit intolibsdl-org:main
base:main
Choose a base branch
Loading
fromdwillbarron:calculate-dinput-update-flags

Conversation

@dwillbarron
Copy link

Hi there. Same guy, different account--It's been a while, but I finally got the time to write the PR for this.

Currently in draft

Since FFB is a famously treacherous territory (hence how we got here), I'm going to try and round up some folks to test and make sure there are no unforeseen consequences to these changes.

In the meantime, if you have the time to look, please let me know if you have any feedback on the code itself.

Context

Anecodtally, some force-feedback wheels have been reported to experience a reduced "definition", "texture", "precision", or "je ne sais quoi", which appears to be caused by sending more update flags than necessary to DirectInput.

This may be related to the fact that there are two USB PID packets that are sent when updating a device: One contains the "general" force data, and the other contains the "type-specific" data. My speculation is that many wheels expect to only receive the latter, and misbehave when receiving both.

This has been tested and validated anecdotally by others who have received a hacked-together version of PCSX2 that corrects the flags sent to DirectInput, who noted a significant improvement in the "feeling" of the FFB effects.

The only way to validate this at a technical level is to grab a wheel that uses the "generic" DirectInput FFB drivers (which map nearly 1:1 with the USB PID specification), and inspect the USB packets (e.g. with USBPcap) to check whether redundant data is being sent.

Description

This PR adjusts the DirectInput Haptic implementation to compare the requested haptic update to the previous state of the haptic effect. Using this, it calculates which update flags to pass on to DirectInput, which prevents redundant flags from being sent. This appears to fix subjective FFB quality problems on certain specific FFB wheels.

Existing Issue(s)

Issue #12511: SDL_DINPUT_HapticUpdateEffect sends unnecessary flags to IDirectInputEffect_SetParameters, which harms FFB quality in certain devices/usecases

Anecodtally, some force-feedback wheels have been reported to experience areduced "definition", "texture", "precision", or "je ne sais quoi", whichappears to be caused by sending more update flags than necessary toDirectInput.This may be related to the fact that there are two USB PID packets that aresent when updating a device: One contains the "general" force data, and theother contains the "type-specific" data. My speculation is that many wheelsexpect to only receive the latter, and misbehave when receiving both.This has been tested and validated anecdotally by others who have receiveda hacked-together version of PCSX2 that corrects the flags sent to DirectInput,who noted a significant improvement in the "feeling" of the FFB effects.The only way to validate this at a technical level is to grab a wheel that usesthe "generic" DirectInput FFB drivers (which map nearly 1:1 with the USB PIDspecification), and inspect the USB packets (e.g. with USBPcap) to check whetherredundant data is being sent.
@slouken
Copy link
Collaborator

slouken commentedDec 3, 2025
edited
Loading

Welcome back! Offhand the code looks good.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@dwillbarron@slouken

[8]ページ先頭

©2009-2025 Movatter.jp