Skip to content

fix(ROG Ally): invert gyro yaw for deck-uhid target - #607

Open
lonsdaleite wants to merge 1 commit into
ShadowBlip:mainfrom
lonsdaleite:fix/rog-ally-gyro-yaw-invert
Open

fix(ROG Ally): invert gyro yaw for deck-uhid target#607
lonsdaleite wants to merge 1 commit into
ShadowBlip:mainfrom
lonsdaleite:fix/rog-ally-gyro-yaw-invert

Conversation

@lonsdaleite

Copy link
Copy Markdown

Summary

Fix inverted gyro yaw (left/right rotation) on ASUS ROG Ally devices when using the deck-uhid target.

Problem

On ROG Ally / Ally X / Xbox Ally, gyro yaw is reversed with deck-uhid compared to ds5-edge. The IMU source is fine; the mismatch is in how yaw is written to the Deck UHID report versus how hid-steam exposes it as ABS_RZ.

Changes

  • Add invert_gyro_yaw to SteamDeckConfig
  • Apply yaw sign correction when writing gyro data in steam_deck_uhid
  • Enable inversion only for Ally DMI board names: RC71L, RC72LA, RC73XA, RC73YA (from the existing 50-rog_*.yaml profiles). This avoids affecting other handhelds that also use a BMI323 IIO source (e.g. Ayaneo). Detection uses runtime DMI board_name, so it still applies when the composite profile name is changed for controller spoofing.

Test plan

  • Tested manually on ASUS ROG Xbox Ally X with deck-uhid target
  • Verified left/right gyro rotation in inputplumber device 0 test
  • Compared behavior against ds5-edge target (yaw direction matches)

ROG Ally devices report gyro yaw with the opposite sign from what
hid-steam expects when using the deck-uhid target. Enable yaw inversion
only on known Ally DMI board names (RC71L, RC72LA, RC73XA, RC73YA).
@pastaq

pastaq commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This makes no sense to me. There are three distinct possibilities for this:

  • 1.) The ds5 yaw is wrong for all devices.
  • 2.) The deck-uhid is wrong for all devices.
  • 3.) The IMU matrix is wrong for the ROG Ally along with one of the previous two, leading to an inverted conclusion of which is wrong.

Given that SteamOS officially released on the Go S and was validated by Valve, and that it has been tested as 1:1 compatible with the deck as a source device, I think it's much more likely that 1 and 3 are more likely.

@lonsdaleite

lonsdaleite commented Jun 15, 2026

Copy link
Copy Markdown
Author

I didn't update Ally's matrix because I checked ds5 emulation and it worked correctly. But I definitely didn't think that maybe there are two problems exist simultaneously (1 and 3 from your message).
Unfortunately I don't have any another handheld, so I can't check it :(

@lonsdaleite

lonsdaleite commented Aug 22, 2026

Copy link
Copy Markdown
Author

@pastaq Hello!

Tested on the same Ally X with external controllers routed through InputPlumber, judged in-game (Talos Principle 2, gyro on, default settings, unchanged between runs):

  • DualSense → deck-uhid: ok
  • DualShock 4 → deck-uhid: ok
  • DualShock 4 → ds5: ok
  • Ally internal gyro → ds5: ok
  • Ally internal gyro → deck-uhid: inverted

So options 1 and 2 are out - neither target flips yaw for every device. Option 3 doesn't fit either: an inverted Ally source would show through both targets, but through ds5 it's fine. Only the IIO source + deck-uhid combination inverts, and no hidraw source reproduces it.

That combination is exactly what this PR patches, so it does fix the reported symptom. What I don't know is how wide the problem is: does it hit only the Ally, or every handheld whose gyro comes from a built-in sensor (the iio source type)? If it's the latter, the sign belongs in one place on that source path and would fix all of them at once, instead of a board-name list that has to grow with every new model.

UPD
Checked it: the inversion follows the emulated product id, not the source or the target.
Same Ally, same gyro, same deck-uhid - under 0x12f0 Generic yaw is correct, under 0x12fd Ally (and 0x12fe/0x12ff Lenovo) it's inverted. So it's Steam's per-PID handling, not InputPlumber.

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