Skip to content

fix(horipad_steam): : invert gyroscope values and prevent UHID timeout#540

Open
honjow wants to merge 3 commits intoShadowBlip:mainfrom
honjow:hori_fix
Open

fix(horipad_steam): : invert gyroscope values and prevent UHID timeout#540
honjow wants to merge 3 commits intoShadowBlip:mainfrom
honjow:hori_fix

Conversation

@honjow
Copy link
Contributor

@honjow honjow commented Mar 1, 2026

With the current version, when using the horipad_steam target, it takes a long time to detect the target after switching. Additionally, all gyroscope sensor axes are inverted. Fix both of these issues.

@ShadowApex
Copy link
Contributor

Are we sure the horipad gyro uses inverted values or is this an issue with the mount matrix of the source device?

@honjow
Copy link
Contributor Author

honjow commented Mar 3, 2026

Are we sure the horipad gyro uses inverted values or is this an issue with the mount matrix of the source device?

When switching the target to DualSense or Deck-UHID, the motion control values are correct. I have tested on multiple devices, and only the horipad_steam target has the inversion issue. Therefore, the matrix problem can be ruled out.

honjow added 3 commits March 6, 2026 17:07
Without a reply, each GET_REPORT request times out after ~5 seconds,
causing significant delays when Steam probes the device during
controller enumeration.
According to SDL_hidapi_steam_hori.c lines 329-330, bytes 12-13 are
read as yaw (imu_data[1]) and bytes 14-15 are read as roll (imu_data[2]).
The previous field names had them reversed.

https://github.com/libsdl-org/SDL/blob/main/src/joystick/hidapi/SDL_hidapi_steam_hori.c#L329-L330
SDL negates all three gyro axes when reading from this device, so we
pre-negate the values here to produce the correct orientation after
SDL's correction.

https://github.com/libsdl-org/SDL/blob/main/src/joystick/hidapi/SDL_hidapi_steam_hori.c#L329-L331
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.

3 participants