[Bug 36441] joy.cpl crashes when PS4 Gamepad connected via Bluetooth

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Jan 5 03:15:08 CST 2018


https://bugs.winehq.org/show_bug.cgi?id=36441

--- Comment #11 from Bob Z <jazzsax006 at gmail.com> ---
I think I've narrowed-in on the problem.  When the controller is connected via
USB, the code in dlls/dinput/joystick_osx.c detects the correct number of
axes/buttons/povs.  However, when connected via bluetooth, the correct number
of buttons/povs is detected, but not the correct number of axes.

USB:
002e:trace:dinput:get_osx_device_elements axes 6 povs 1 buttons 14
002e:trace:dinput:alloc_device 6 axes 14 buttons 1 povs

Bluetooth:
002e:trace:dinput:get_osx_device_elements axes 553 povs 1 buttons 14
002e:trace:dinput:alloc_device 553 axes 14 buttons 1 povs

The actual crash occurs in get_osx_device_elements_props when
CFArrayGetValueAtIndex( device->elements, idx ) is then called for the
incorrectly-detected axis elements.

Given the rest of the HID handling for the PS4 controller seems to work
correctly when connected via USB and that the button/pov detection is correct
via bluetooth, I imagine the fix is probably somewhat easy.

I've checked-out the latest wine code from git, built it locally, reproduced
again with my checkout, and have been adding some trace statements of my own to
try to hone in further, but unfortunately I'm both new to the wine code base
and completely unfamiliar with MacOS/IOKit APIs, so I'm fumbling around rather
blindly.

I'll try to reach out via either IRC or mailing list, but any pointers on where
to look would be very appreciated.  I don't mind fixing and submitting a patch
myself if I can get that far.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list