https://bugs.winehq.org/show_bug.cgi?id=52177
Bug ID: 52177 Summary: Gamepad stopped working (In The Groove, Fedora 35, wine 6.21) Product: Wine Version: 6.21 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: kas@yenya.net Distribution: ---
After upgrade to Fedora 35 (wine-6.21-1.fc35.x86_64) from Fedora 34 I am no longer able to play the game In The Groove (a rhythm game based on StepMania engine): The game itself detects my gamepad both as /dev/input/eventX and /dev/input/jsY, but when I try to configure the input, pressing buttons on the gamepad is not recognized by the game. When I disable the /dev/input/js* (by chmod a-rw), it can see the first four buttons out of ten, but when the button 3 is pressed, it does not see the button 0 being pressed.
When I run "jstest /dev/input/jsY", jstest recognizes all ten buttons and their combinations. So the hardware works as expected.
What should I try in order to get the game working with my gamepad? Thanks!
https://bugs.winehq.org/show_bug.cgi?id=52177
--- Comment #1 from Jan "Yenya" Kasprzak kas@yenya.net --- This is also present in wine-7.0-0.1rc2.fc35.x86_64: with event device, only four of ten buttons work, and some of them do not work simultaneously. When I disable the event device (chmod 000 /dev/input/eventN), the game does not see the controller at all. jstest /dev/input/jsY works as expected on all ten buttons and their combinations.
https://bugs.winehq.org/show_bug.cgi?id=52177
Jan "Yenya" Kasprzak kas@yenya.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|6.21 |7.0-rc2
https://bugs.winehq.org/show_bug.cgi?id=52177
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #2 from joaopa jeremielapuree@yahoo.fr --- To increase the chances to see the bug fixed, you should try to perform a regression test: https://wiki.winehq.org/Regression_Testing
https://bugs.winehq.org/show_bug.cgi?id=52177
--- Comment #3 from Jan "Yenya" Kasprzak kas@yenya.net --- Hi all,
trying to research this further:
It seems that with evdev-based interface buttons are recognized also as a motion directions in two axes, so it obviously cannot handle simultaneous left+right or up+down. And the ITG/StepMania seems to prefer joystick axes instead of buttons, when they are present.
The /dev/input/js-based interface in Wine <= 5 does not seem to map the gamepad buttons to axes, so it does not have this problem.
Is there a way how to disable mapping buttons to axes in Wine evdev-based joystick interface (or maybe in the Linux kernel somehow)?
https://bugs.winehq.org/show_bug.cgi?id=52177
Rémi Bernon rbernon@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rbernon@codeweavers.com
--- Comment #4 from Rémi Bernon rbernon@codeweavers.com --- Hi, could you provide a trace with WINEDEBUG=+hid,+rawinput,+dinput,+xinput,+input while running the game with your gamepad, and pressing some of the incorrectly mapped buttons?
I think this is maybe something with dpad-like buttons, which are mapped to hatswitch control and could be recognized by games as directions?
Wine now uses SDL as its main controller backend, which has its own button mapping mechanism (see maybe https://github.com/gabomdq/SDL_GameControllerDB and the tools listed there to create custom mappings), maybe it can help.
Other than that we also have lower-level backends, with direct evdev access, or hidraw, but these don't support any remapping (at least currently).
Fwiw you can also run `wine control joy.cpl` to open the joystick control panel and try a few more configuration options and get some visual feedback of how the controller is seen from the Windows application perspective.
https://bugs.winehq.org/show_bug.cgi?id=52177
--- Comment #5 from Jan "Yenya" Kasprzak kas@yenya.net --- I have captured using jstest and evtest, how the dancepad on /dev/input/js1 and /dev/input/event18 communicates. Both kernel interfaces seem to report the button events well, including simultaneous button press events. See the attachments.
I also tried to disable axis movements by setting both max and min value for each axis to the middle value using
evdev-joystick -e /dev/input/event18 -m 128 -M 128
but then the ITG/StepMania game inside WINE did not see any joystick events.
I have verified that WINE uses the evdev interface - in /proc/<pid>/fd of one of the wine processes there is /dev/input/event18 as open.
When I select "Configure input" from the ITG/StepMania menu, the following gets reported to STDERR:
00b4:err:rawinput:add_device Failed to open device file L"\??\HID#VID_0000&PID_0000#0&WINEMOUSE&0&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd}", status 0xc0000034. 00b4:err:rawinput:add_device Failed to open device file L"\??\HID#VID_0000&PID_0000#0&WINEKEYBOARD&0&1#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}", status 0xc0000034. 00b4:err:rawinput:add_device Failed to open device file L"\??\HID#VID_0000&PID_0000#0&WINEKEYBOARD&0&1#{4d1e55b2-f16f-11cf-88cb-001111000030}", status 0xc0000034. 00b4:err:rawinput:add_device Failed to open device file L"\??\HID#VID_0000&PID_0000#0&WINEMOUSE&0&0#{4d1e55b2-f16f-11cf-88cb-001111000030}", status 0xc0000034. 00b4:err:rawinput:add_device Failed to open device file L"\??\HID#VID_6677&PID_8811#256&03000000776600001188000000010000&0&0#{4d1e55b2-f16f-11cf-88cb-001111000030}", status 0xc0000034.
These are all my input devices, with the latest one (VID 6677, PID 8811) being the dancepad. According to strace, jjust before reporting the above error, WINE does the following:
77493 newfstatat(AT_FDCWD, "/home/kas/.wine/dosdevices/hid#vid_6677&pid_8811#256&030061ea776600001188000000010000&0&0#{4d1e55b2-f16f-11cf-88cb-001111000030}", <unfinished ...>
But this is probably not the root cause of the problem, as at that time, the game (WINE) has already /dev/input/event18 open and reports correctly the dancepad vendor and product string.
So it seems that WINE mishandles the button events from the evdev interface.
FWIW, my dancepad is described by kernel in dmesg(8) output as follows:
[160087.156324] usb 2-3.4: Product: X-PAD, Extreme Dance Pad (http://www.ddr.cz) [160087.160390] input: WiseGroup.,Ltd X-PAD, Extreme Dance Pad (http://www.ddr.cz) as /devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3.4/2-3.4:1.0/0003:6677:8811.0008/input/input137 [160087.160609] hid-generic 0003:6677:8811.0008: input,hidraw0: USB HID v1.00 Joystick [WiseGroup.,Ltd X-PAD, Extreme Dance Pad (http://www.ddr.cz)] on usb-0000:00:14.0-3.4/input0
https://bugs.winehq.org/show_bug.cgi?id=52177
--- Comment #6 from Jan "Yenya" Kasprzak kas@yenya.net --- Created attachment 73884 --> https://bugs.winehq.org/attachment.cgi?id=73884 Output of jstest /dev/input/js1 (with s/\r/\n/g)
https://bugs.winehq.org/show_bug.cgi?id=52177
--- Comment #7 from Jan "Yenya" Kasprzak kas@yenya.net --- Created attachment 73885 --> https://bugs.winehq.org/attachment.cgi?id=73885 Output of evtest /dev/input/event18
https://bugs.winehq.org/show_bug.cgi?id=52177
--- Comment #8 from Jan "Yenya" Kasprzak kas@yenya.net --- In reply to comment #4:
2Rémi Bernon, thanks for many hints. What I tried so far:
- "wine control joy.cpl" can see my dancepad correctly. In the "Test joystick" tab, it displays 10 buttons (which is correct), and the point in the [X,Y] square moves as I press the first four buttons. Simultaneous button presses are correctly reported in the [Buttons] section, but obviously not in the [X,Y] square: left+right leads to the right input detected only, and for up+down only up movement is reported in the X-Y axes. Which is what I observe also in the game. However, the game does not see any of the other buttons at all.
- I downloaded and compiled sdl2-gamepad-mapper-v0.0.4 and tried to map my dancepad with it. It produced something like this:
030061ea776600001188000000010000,WiseGroup.,Ltd X-PAD, Extreme Dance Pad (http://www.ddr.cz),a:b1,b:b3,x:b0,y:b2,leftshoulder:b9,rightshoulder:b8,left...,
This is unusable as SDL_GAMECONTROLLERCONFIG environment variable content, as this variable uses comma for separating values, but the controller name itself has comma in its name. I guessed that the controller name (as opposed to GUID) is used only as a label, and shortened it to "WiseGroup" only.
- with the SDL_GAMECONTROLLERCONFIG environment variable set and exported in the Linux shell, "wine control joy.cpl" displayed more buttons (about 20), I was able to remap buttons by setting the variable to a different value and running wine control joy.cpl again, simultaneous button presses worked as expected, and there was no activity in the [X,Y] axis square at all.
- then I tried to run the "In The Groove" game with the SDL_GAMECONTROLLERCONFIG variable set - the controller did not work at all: I opened a "Configure input" menu and tried to map controller buttons to game inputs. This is done by selecting the desired input (up, down, left, right, back, and enter) with the keyboard arrow buttons, pressing Enter and then pressing the appropriate button on the controller. It recognized only "up" button of the controller, and reported it as "Joy1-Z-Up". But it did so only the first time, and no other button nor the same button was recognized further.
- I ran the game with WINEDEBUG=+hid,+rawinput,+dinput,+xinput,+input, both with and without the SDL_GAMECONTROLLERCONFIG variable set. I will attach the output (it is quite long, so I will make a tar.gz of it).
So it looks like Wine recognizes the controller (even without the SDL_GAMECONTROLLERCONFIG remapping), but presents it to the game in a different way than before in the WINE 5 times, and the application cannot handle it.
What else should I try? Thanks!
https://bugs.winehq.org/show_bug.cgi?id=52177
--- Comment #9 from Jan "Yenya" Kasprzak kas@yenya.net --- Created attachment 73891 --> https://bugs.winehq.org/attachment.cgi?id=73891 debugging info from WINE