Skip to content

wrong padding size #187

@foriequal0

Description

@foriequal0

I don't know much about the HID drivers, so this might not be accurate.

I'm using T300RS, and I tried to fix the wheel problem in Assetto Corsa Rally (related issue in proton repo: ValveSoftware/Proton#9220 (comment) )

Windows, proton 6.3.8: works fine.
proton 10, without PROTON_ENABLE_HIDRAW: axes are not registered.
proton 10, without PROTON_ENABLE_HIDRAW=0x044f/0xb66e: entire devices (wheel, shifter, handbrake) are not recognized.

so I dumped HID descriptors on both Windows and Linux and compared them.
(I used this: https://nondebug.github.io/webhid-explorer/ )

I found that hid-tmff2 has 4 bits of padding, while Windows has 396 bits.

I tried to apply this patch:

diff --git i/src/tmt300rs/hid-tmt300rs.c w/src/tmt300rs/hid-tmt300rs.c
index 00eecee..32acee4 100644
--- i/src/tmt300rs/hid-tmt300rs.c
+++ w/src/tmt300rs/hid-tmt300rs.c
@@ -128,6 +128,8 @@ static u8 t300rs_rdesc_nrm_fixed[] = {
        0x75, 0x04, /* Report size (4) */
        0x81, 0x42, /* Input (Variable, Absolute, NullState) */
        0x65, 0x00, /* Unit (None) */
+       0x76, 0x8c, 0x01, /* Report size (396) */
+       0x95, 0x01, /* Report count (1) */
        0x81, 0x03, /* Input (Variable, Absolute, Constant) */
        0x85, 0x60, /* Report ID (96), prev 10 */
        0x06, 0x00, 0xff, /* Usage page (Vendor 1) */

It didn't work.

But it works with the size and report count switched.
This patch fixes device recognition and analog axes registration.

diff --git i/src/tmt300rs/hid-tmt300rs.c w/src/tmt300rs/hid-tmt300rs.c
index 00eecee..32acee4 100644
--- i/src/tmt300rs/hid-tmt300rs.c
+++ w/src/tmt300rs/hid-tmt300rs.c
@@ -128,6 +128,8 @@ static u8 t300rs_rdesc_nrm_fixed[] = {
        0x75, 0x04, /* Report size (4) */
        0x81, 0x42, /* Input (Variable, Absolute, NullState) */
        0x65, 0x00, /* Unit (None) */
+       0x75, 0x01, /* Report size (1) */
+       0x96, 0x8c, 0x01, /* Report count (396) */
        0x81, 0x03, /* Input (Variable, Absolute, Constant) */
        0x85, 0x60, /* Report ID (96), prev 10 */
        0x06, 0x00, 0xff, /* Usage page (Vendor 1) */

I think this is a bug in Wine (different behavior from Windows with an incomplete(?) HID report descriptor).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions