| Summary: | [Patch] Read of feature report of DualSohck4 off by one | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Mathieu Eyraud <meyraud705> |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.13 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
read of feature report off by one
fix linux hidapi |
||
Bug is actually is Linux hidapi implementation. A BLE hack is always executed in hid_get_feature_report because is_BLE() always return true. is_BLE return the value of parse_uevent_info which is 1 in case of success. There is still an issue with the size: windows usb: PS4 calibration packet: size = 38 00: 0x02 0x01 0x00 0x01 0x00 0xf1 0xff 0xa4 08: 0x22 0xef 0xdd 0xdb 0x22 0x28 0xdd 0xd0 16: 0x22 0x87 0xdc 0x1c 0x02 0x1c 0x02 0xd2 24: 0x1f 0x09 0xe0 0x04 0x21 0xff 0xe0 0x67 32: 0x1f 0x38 0xdf 0x0c 0x00 0x00 linux usb: PS4 calibration packet: size = 38 00: 0x02 0x02 0x01 0x00 0x01 0x00 0xf1 0xff 08: 0xa4 0x22 0xef 0xdd 0xdb 0x22 0x28 0xdd 16: 0xd0 0x22 0x87 0xdc 0x1c 0x02 0x1c 0x02 24: 0xd2 0x1f 0x09 0xe0 0x04 0x21 0xff 0xe0 32: 0x67 0x1f 0x38 0xdf 0x0c 0x00 linux usb ble hack disabled: SDL: PS4 calibration packet: size = 37 00: 0x02 0x01 0x00 0x01 0x00 0xf1 0xff 0xa4 08: 0x22 0xef 0xdd 0xdb 0x22 0x28 0xdd 0xd0 16: 0x22 0x87 0xdc 0x1c 0x02 0x1c 0x02 0xd2 24: 0x1f 0x09 0xe0 0x04 0x21 0xff 0xe0 0x67 32: 0x1f 0x38 0xdf 0x0c 0x00 Created attachment 4528 [details] fix linux hidapi Patch that fixes BLE hack, size, and include upstream patch "File descriptor 0 is perfectly valid, and shouldn't be considered as an error" ( https://github.com/libusb/hidapi/issues/199 ). Fixed, thanks! http://hg.libsdl.org/SDL/rev/d4587072b314 http://hg.libsdl.org/SDL/rev/ddd319229757 http://hg.libsdl.org/SDL/rev/60dcd2afd107 The actual value should be 37 bytes. The windows code had a bug where it was adding an extra zero byte. |
Created attachment 4526 [details] read of feature report off by one The report id is repeated at the beginning of the answer of ReadFeatureReport(). Actual data start at offset 2. Here the calibration data as reported by HIDAPI_DumpPacket(): PS4 calibration packet: size = 42 00: 0x05 0x05 0x01 0x00 0x01 0x00 0xf1 0xff 08: 0xa4 0x22 0xdb 0x22 0xd0 0x22 0xef 0xdd 16: 0x28 0xdd 0x87 0xdc 0x1c 0x02 0x1c 0x02 24: 0xd2 0x1f 0x09 0xe0 0x04 0x21 0xff 0xe0 32: 0x67 0x1f 0x38 0xdf 0x0c 0x00 0x90 0x0d 40: 0x99 0xfc I do not own a DualSense controller to test, but it may also need this patch.