https://bugs.winehq.org/show_bug.cgi?id=52462
Bug ID: 52462 Summary: Wine don't recognize Ipega PG-9025 LT, RT and up/down axis of right analog stick Product: Wine Version: 7.0-rc5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dinput Assignee: wine-bugs@winehq.org Reporter: joseskvolpe@gmail.com Distribution: ---
Left trigger, right trigger, and up/down axis of right analog stick aren't recognized by Wine, according to game input settings from control panel.
Procedures: 1 - Connect Ípega PG-9025 on Bluetooth 2 - run 'wine control' 3 - Open Game Input Settings 4 - Select "Control test" tab 5 - Press LT, RT buttons, and move right analog stick to up and down
Triggers does works on native GNU/Linux applications
Video: https://www.youtube.com/watch?v=BI2p5Z6rqdE
https://bugs.winehq.org/show_bug.cgi?id=52462
--- Comment #1 from Josesk Volpe joseskvolpe@gmail.com --- I've made a new video to show the issue https://www.youtube.com/watch?v=4Hu7jni80g0
Right analog is being mapped as Left and Right Trigger instead, while the true LT and RT aren't being mapped neither recognized. Interesting is that, natively, it's miss-mapped on the website, however the website used maps them as a Xbox controller, and it isn't a Xbox controller anyways. Wine, instead, maps every button correctly but LT, RT and right analog stick. On Linux, controllers are identifiable and has their own button mappings, so their missplacing on the website maybe don't really matters, however on Windows gamepad drivers has to map their buttons to XInput as a Xbox controller regardless it's a Xbox, PlayStation, Nintendo or a Generic controller.
https://bugs.winehq.org/show_bug.cgi?id=52462
Josesk Volpe joseskvolpe@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Wine don't recognize Ipega |Wine don't recognize Ipega |PG-9025 LT, RT and up/down |PG-9025 LT, RT and right |axis of right analog stick |analog stick is miss-mapped | |to RT and LT
https://bugs.winehq.org/show_bug.cgi?id=52462
Josesk Volpe joseskvolpe@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|directx-dinput |hid
--- Comment #2 from Josesk Volpe joseskvolpe@gmail.com --- Changing component from 'directx-dinput' to 'hid' as it's probably a issue from the Wine NT layer to send Ipega's input codes to xinput
https://bugs.winehq.org/show_bug.cgi?id=52462
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |hardware
https://bugs.winehq.org/show_bug.cgi?id=52462
--- Comment #3 from Josesk Volpe joseskvolpe@gmail.com --- Created attachment 71777 --> https://bugs.winehq.org/attachment.cgi?id=71777 Event codes from Ipega (evtest)
https://bugs.winehq.org/show_bug.cgi?id=52462
--- Comment #4 from Josesk Volpe joseskvolpe@gmail.com --- By tracing joystick_hid.c read_device_state_value calls, after a new value is detected, *impl value only returns 00000202 for right analog stick, while left analog stick returns 00000202 and 00000102. Brake and Gas (LT and RT triggers) aren't recognized by the function and returns no value.
For details archive, to trace the calls, i've modified line 1199 to:
if (old_value != value){ FIXME("(%p, %p, %p, %p): iface, %d, %d \n", instance->dwType, value); queue_event( iface, instance->dwType, value, params->time, params->seq ); }
(It's my first time studying Wine's code hehe >w< )
https://bugs.winehq.org/show_bug.cgi?id=52462
--- Comment #5 from Josesk Volpe joseskvolpe@gmail.com --- By looking deep in the code and Windows documentations, i guess this conception
however on Windows gamepad drivers has to map their buttons to XInput as a Xbox controller >regardless it's a Xbox, PlayStation, Nintendo or a Generic controller.
Is much probably very wrong ¿maybe? I would like to know, still learning :3
Anyways, Wine has implemented a library to detect if a device is a gamepad, on unixlib.c, there's the functions:
BOOL is_xbox_gamepad(WORD vid, WORD pid) BOOL is_dualshock4_gamepad(WORD vid, WORD pid) BOOL is_dualsense_gamepad(WORD vid, WORD pid)
And other functions to identify other kind of devices such as mouse and keyboard. On these 3 specified functions, Wine lists many VID and PID for known devices. But VID 0x1949 PID 0x402 aren't listed. However, looking by tracing functions, handle_DeviceMatchingCallback from bus_iohid.c isn't invoked when starting Wine, ´wine control´'s gamepad settings and testing the gamepad from there. So i'm not sure it matters at all on this case.
¿Should i go to Windows and look into how this gamepad works with the generic gamepad driver to view what keycodes does it receive from the driver?
https://bugs.winehq.org/show_bug.cgi?id=52462
Rémi Bernon rbernon@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rbernon@codeweavers.com
--- Comment #6 from Rémi Bernon rbernon@codeweavers.com --- Hi, you can probably do that but the windows driver may do some mapping when we usually don't.
A helpful first step would be to attach Wine output when running with WINEDEBUG=+hid,+dinput,+xinput environment variable.
From the evtest output I see that the device uses Z/RZ, probably for the right
stick, and these are usually mapped indeed to LT/RT.
If you are using the default Wine configuration, we use SDL as a game controller backend, and SDL should already allow you to remap controllers and joysticks axes easily through some environment variables or configuration file (Wine also supports additional SDL mappings from a registry key, but the two other methods are probably easier).
You can find more details about the SDL mapping support there: https://github.com/gabomdq/SDL_GameControllerDB, as well as some links with tools which can help you configure your gamepad easily.
https://bugs.winehq.org/show_bug.cgi?id=52462
--- Comment #7 from Josesk Volpe joseskvolpe@gmail.com --- Created attachment 71884 --> https://bugs.winehq.org/attachment.cgi?id=71884 +hid,+dinput,+xinput
Thanks for the answer Well, i didn't knew there was a easier solution lol SDL detects my gamepad as GUID 0500000049190000020400001b010000, wich is identified as Ipega PG 9069 with a different mapping settings. Remmaping them and running Wine with the environment variable solved this, thanks.
By running Wine with these debug environment variables, dinput receives RT and LT events as actions 600, 603 and 604, but they aren't traced by xinput nor hid Wine HID outputs right analog with: 0120:trace:dinput:hid_joystick_read 00000000 00 80 80 80 80 00 80 00 80 00 b8 00 00 00 00
Where b8 is the value being changed to both left-right and up-down
https://bugs.winehq.org/show_bug.cgi?id=52462
--- Comment #8 from Josesk Volpe joseskvolpe@gmail.com --- I forgot to mention
I had to set environment variable "SDL_GAMECONTROLLERCONFIG" to:
"0500000049190000020400001b010000,Ipega PG-9025,a:b0,b:b1,x:b3,y:b4,back:b10,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Linux,"
https://bugs.winehq.org/show_bug.cgi?id=52462
--- Comment #9 from Josesk Volpe joseskvolpe@gmail.com --- Tested in Wine 8.0, on Arch Linux using KDE Plasma 5.26 and Wayland, it now works out-of-the-box
https://bugs.winehq.org/show_bug.cgi?id=52462
Rémi Bernon rbernon@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #10 from Rémi Bernon rbernon@codeweavers.com --- Well I don't think I did anything but... awesome! I guess?
Marking this as resolved.
https://bugs.winehq.org/show_bug.cgi?id=52462
--- Comment #11 from Josesk Volpe joseskvolpe@gmail.com --- ¿Really? lol I moved from Manjaro Linux to Arch Linux, but that's still strange, because i didn't messed with SDL2
https://bugs.winehq.org/show_bug.cgi?id=52462
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.1.