Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVDEV Controller Issues #8733

Closed
ordovice opened this issue Aug 14, 2020 · 12 comments
Closed

EVDEV Controller Issues #8733

ordovice opened this issue Aug 14, 2020 · 12 comments

Comments

@ordovice
Copy link

Please do not ask for help or report compatibility regressions here, use RPCS3 Discord server or forums instead.

Quick summary

When attempting to use EVDEV controller support with a bluetooth 8bitdo SN30 controller (any of the modes), several keys do not map or bind properly.

Details

When attempting to use EVDEV controller support with a bluetooth 8bitdo SN30 controller (any of the modes), several keys do not map or bind properly.

When monitoring the keypresses with evdev, I am noticing multiple events being triggered on some of the keys that error. Additionally, keymappings are not present or have been commented out of https://github.com/RPCS3/rpcs3/blob/master/rpcs3/Input/evdev_joystick_handler.h

For example, the X key on the 8bitdo SN30 Pro sends the following:
Event: time 1597418091.634711, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1597418091.634711, type 1 (EV_KEY), code 307 (BTN_NORTH), value 1

BTN_NORTH is commented out of the handler.

Pressing the START button returns the following:
Event: time 1597418144.351272, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9000c
Event: time 1597418144.351272, type 1 (EV_KEY), code 315 (BTN_START), value 0

So even though BTN_START is defined, the GUI returns it as an ABS value of RZ+ when attempting to set it.

1. Please attach RPCS3's log.

Sample button presses from log
·! 0:48:54.275470 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 146
·! 0:48:54.282316 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ+ pressed with value 129
·! 0:48:54.282772 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 129
·! 0:48:54.288772 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 129
·! 0:48:54.452480 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 130
·! 0:48:54.454058 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 130
·! 0:48:54.455261 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 182
·! 0:48:54.457110 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 182
·! 0:48:54.457791 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 182
·! 0:48:54.479486 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 236
·! 0:48:54.479979 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 236
·! 0:48:54.486436 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 236
·! 0:48:54.487632 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 255
·! 0:48:54.489348 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 255
·! 0:48:54.489976 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 255
·! 0:48:54.607876 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 251
·! 0:48:54.608600 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 251
·! 0:48:54.609253 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 251
·! 0:48:54.623314 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 213
·! 0:48:54.625096 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 213
·! 0:48:54.625731 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 213
·! 0:48:54.647693 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 164
·! 0:48:54.649501 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 164
·! 0:48:54.650181 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 164
·! 0:48:54.662883 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 146
·! 0:48:54.663235 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 146
·! 0:48:54.687878 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 138
·! 0:48:54.688468 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 138
·! 0:48:54.702830 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button LZ+ pressed with value 128
·! 0:48:54.704798 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ+ pressed with value 128
·! 0:48:54.705667 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ+ pressed with value 128
·! 0:48:55.682281 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ+ pressed with value 128
·! 0:48:55.682326 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button Start pressed with value 255
·! 0:48:55.683549 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button Start pressed with value 255
·! 0:48:56.109845 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button Start pressed with value 255
·! 0:48:56.111079 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ+ pressed with value 128
·! 0:48:56.112288 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ+ pressed with value 128
·! 0:48:56.235460 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ+ pressed with value 128
·! 0:48:56.236683 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button Start pressed with value 255
·! 0:48:56.237899 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button Start pressed with value 255

4. Please provide comparison with real PS3.

Issue is with controller handling, not compared to a PS3 at this time.

5. Please provide your system configuration:

Architecture: x86_64
System: Linux 5.6.7
Available memory: 7288/7824 MB
OpenGL: 4.6 (Core Profile) Mesa 20.1.4
Vulkan: 1.2.131
Cpu model: Intel(R) Core(TM) i3-8109U CPU @ 3.00GHz

Please include.

  • Anything else you deem to be important
@Megamouse
Copy link
Contributor

BTN_NORTH is exactly the same button as BTN_X, that's why it is commented out (you cannot have two of the same values in a map).
This means that there is no issue with your buttons.

Your problem seems to be more an issue of shitty evdev drivers.
So you'll probably have to do this:
Fix for bad evdev axis

@Megamouse
Copy link
Contributor

try adding:

ABS_LZ: true
ABS_RZ: true

@ordovice
Copy link
Author

After changing values to true, I am still finding the wrong mapping values being presented (for example RZ- for Left Stick Up). Confirming via evtest that the left stick is ABS_X and ABS_Y and the right stick is ABS_RX and ABS_RY.

No matter what is pressed whether key or ABS returns the following in the log
·! 0:06:06.571699 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ- pressed with value 255
·! 0:06:06.575600 CFG: get_next_button_press: Evdev device 8Bitdo SN30 Pro button RZ- pressed with value 255

@ordovice
Copy link
Author

Additional note, this does not impact all modes of the SN30 Pro. When started in pro Controller mode with the positive axes settings, it allows this mode to be configured.

@Megamouse
Copy link
Contributor

Provide cababilty output for the controller (evdev buttons axis min max etc)

@Megamouse
Copy link
Contributor

The requested information will be logged in the next build (available sometime in the next 30 minutes or so) as soon as you try to setup your controller in the pad settings.
When you have the build, please try to configure the 8bitdo again, close RPCS3 and upload the log file here.

@SupervisedThinking
Copy link

SupervisedThinking commented Feb 28, 2021

I have the same issues with d2de8a8 and a SF30 PRO in Xinput mode with firmware v1.34. No matter what you try to map almost everything is mapped with RZ+ or RY+ or RX+ but when you run evtest you see that buttons are properly working.

RPCS3 Log sniplet:
https://pastebin.com/kq8LVhGn

evtest log:
https://pastebin.com/p8b90AFj

@Megamouse
Copy link
Contributor

obviously the xinput mode reports values in the positive axis range, so you either have to use the proper methods to adjust these ranges (see wiki) or you have to choose the other mode.
If the other mode also only reports positive axis values, then the driver is not implemented correctly and you basically have the option to report this to the author of the driver or to also use the fix mentioned in the wiki.

@SupervisedThinking
Copy link

Indeed this https://wiki.rpcs3.net/index.php?title=Help:Controller_Configuration#Analog_sticks_not_centered_with_evdev_pad_handler this option fixed the issue for even though it seems unrelated at first because all standard buttons like start or select had quirks too.

Just out of curiosity... why doesn't RPCS3 use SDL2 & already existing DBs like https://github.com/gabomdq/SDL_GameControllerDB because then mapping and configuration would be no deal at all.

@Megamouse
Copy link
Contributor

simply because noone tried to, probably, and the less 3rdParty stuff the better.
If drivers wouldn't suck, then there wouldn't be a problem anyway.

@Megamouse
Copy link
Contributor

I'll close this issue since it seems to be a driver issue and we already support a functionality to handle this.

@SupervisedThinking
Copy link

Even if drivers won't suck or have their shenanigans with the SDL2 gamecontroller db you just start and play. There is no configuration or else necessary. PPSSPP or PCSX2 just work out of the box without setting up a single button which makes life a lot easier if it comes to controller configs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants