input-overlay
input-overlay copied to clipboard
Gamepad issues
I've just finished some tests with SDL2, and it seems like I could replace the gamepad library with it. Before I do that, it would be good to have some people test SDL2 with their game pads to see if the mappings are working. SDL2 is used in a lot of games so I assume there shouldn't be any issues. I've attached the SDL2 gamepad test.
sdl2.gamepadtest.zip
Holding shift will show the back of the controller with additional buttons.
I'll also close all gamepad related issues and we'll just use this issue to collect information regarding gamepads.
SDL2 tests so far
- No crash with spacemouse (#208)
- PS3, PS4 and PS5 seem to work fine (#286, #253, #191)
- Xbox One and Xbox elite also work (#241, #195, #183, #175)
- Xbox 360 should also work, linux requires xboxdrv to get the dpad working (disables haptic feedback for some reason though)
Previous gamepad issues: #294
- LT + RT should be representable with buttons (Not an issue with mappings, but rather something I'd need to change in input overlay)
- There should be an option for a "capture" or "share" button alongside the "guide" button since newer controllers also have this button. Not super important, but, might as well be a thing. (I assume SDL2 has this)
#286, #253 Should be fixed when using SDL2 #260 Should work with SDL2, if not I won't spend any additional time on this for now #208 Apparently a crash with the gamepad library, should be fixed when using SDL2. #195, #191 Mapping/ D-Pad issue should be fixed with SDL2 #183 SDL2 should support xbox one gamepads just fine #175 More mapping issues once again SDL2 should handle them correctly #241 Another dpad issue #116 General issue with gamepad being detected #213 Razer Rajiu not being detected, apparently that is a controller, so sdl will most likely handle it just fine. #196 DirectInput implementation seemed to have caused stalls (probably waiting for a mutex)
Semi related issues: #285 The incorrect position of the analog sticks is an issue with the library using different value ranges for linux and windows #199 The binding tab will be removed as sdl2 should take care of correct bindings
seems to work fine for me, even with everything else connected
seems to work fine for me, even with everything else connected
Thanks for testing, since your issue was a crash we'll have to see if the problem was really fixed once I switch the plugin to sdl
I don't think that testing via WINE would be a fair test of how the native Linux SDL performs, but SDL2 stuff works perfectly on my system and I think porting to SDL2 would probably fix all my issues.
Would be happy to help test anything or provide some code changes as well depending on what's needed.
FWIW, since Nintendo Switch controller support is relatively new on Linux, a lot of things don't properly support it (mapping the buttons wrong under the assumption it's just an Xbox controller), although SDL2 actually does support it correctly.
I don't think that testing via WINE would be a fair test of how the native Linux SDL performs, but SDL2 stuff works perfectly on my system and I think porting to SDL2 would probably fix all my issues.
Would be happy to help test anything or provide some code changes as well depending on what's needed.
FWIW, since Nintendo Switch controller support is relatively new on Linux, a lot of things don't properly support it (mapping the buttons wrong under the assumption it's just an Xbox controller), although SDL2 actually does support it correctly.
You can compile the program yourself if you want, it's just https://github.com/univrsal/SDL/blob/main/test/testgamecontroller.c which is part of the sdl2 tests
You can compile the program yourself if you want, it's just https://github.com/univrsal/SDL/blob/main/test/testgamecontroller.c which is part of the sdl2 tests
Tested in Linux with a PS3, PS4, and PS5 controller, seems to work fine on all.
I can test it for Xbox and Xbox Elite controllers later today or tomorrow. Additionally, I will also submit new preset/design for the Xbox controller.
You can compile the program yourself if you want, it's just https://github.com/univrsal/SDL/blob/main/test/testgamecontroller.c which is part of the sdl2 tests
Tested in Linux with a PS3, PS4, and PS5 controller, seems to work fine on all.
The ps4 and ps4 controller have a touch pad, right? Did sdl2 detect any input when you used them? (There probably won't be any visualization since the display uses an xbox gamepad, but maybe the console window shows something). Also did the button with the playstation logo work?
I can test it for Xbox and Xbox Elite controllers later today or tomorrow. Additionally, I will also submit new preset/design for the Xbox controller.
Can you also test if the guide button and the additional buttons work?
Can you also test if the guide button and the additional buttons work?
Sure, will do.
All buttons (including Guide) work. And I don't have controller with Share button, so couldn't test that. Sticks register direction correctly, but stick coordinates are all over the place, or at least it is hard to get consistent numbers, but perhaps it is just the internal thing as overlay always shows correct direction.
All buttons (including Guide) work. And I don't have controller with Share button, so couldn't test that. Sticks register direction correctly, but stick coordinates are all over the place, or at least it is hard to get consistent numbers, but perhaps it is just the internal thing as overlay always shows correct direction.
Thanks for testing. I assume there's a way to convert the axis values if the interface shows the movements correctly.
The ps4 and ps4 controller have a touch pad, right? Did sdl2 detect any input when you used them? (There probably won't be any visualization since the display uses an xbox gamepad, but maybe the console window shows something).
Yes, as you said, no visual indicator. (I had to filter out the gyro \ accelerometer lines via ./testgamecontroller 2>&1 | grep -v "gyro\|accelerometer"
, for any other Linux user looking to pull out useful output.) This was as quick a straight press on the touchpad on a PS5 controller as possible. Note that only the first line and the 'button touchpad release' had to do with me pressing down, the rest is all 'We see a finger!' output. It's very spammy.
INFO: Controller 5 button touchpad pressed
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 button touchpad released
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.49, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.49, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.49, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.50, 1.00
INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.50, 1.00
INFO: Controller 5 touchpad 0 finger 0 released at 0.85, 0.50, 0.00
Also did the button with the playstation logo work?
Yes. It showed as the giant center button in the picture (output indicated the 'guide' button), and the microphone mute button was reflected in the button just under that (the 'misc1' button).
Unrelated to the rest, since people were talking about switch controllers, I found an off-brand pro version I had in the house, and it works as expected. Y and X are swapped visually, but report correctly, the same as B and A, since Nintendo and Microsoft seem to have reversed positioning on those compared to each other.
Edit: I forgot the switch controller had buttons on the back / bottom. These do not seem to report anything at all when pressed.
The ps4 and ps4 controller have a touch pad, right? Did sdl2 detect any input when you used them? (There probably won't be any visualization since the display uses an xbox gamepad, but maybe the console window shows something).
Yes, as you said, no visual indicator. (I had to filter out the gyro \ accelerometer lines via
./testgamecontroller 2>&1 | grep -v "gyro\|accelerometer"
, for any other Linux user looking to pull out useful output.) This was as quick a straight press on the touchpad on a PS5 controller as possible. Note that only the first line and the 'button touchpad release' had to do with me pressing down, the rest is all 'We see a finger!' output. It's very spammy.INFO: Controller 5 button touchpad pressed INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 button touchpad released INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.47, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.48, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.49, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.49, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.49, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.50, 1.00 INFO: Controller 5 touchpad 0 finger 0 moved to 0.85, 0.50, 1.00 INFO: Controller 5 touchpad 0 finger 0 released at 0.85, 0.50, 0.00
Also did the button with the playstation logo work?
Yes. It showed as the giant center button in the picture (output indicated the 'guide' button), and the microphone mute button was reflected in the button just under that (the 'misc1' button).
Thanks for the feedback. I assume that the movement is limited to values between 0 and 1. So I guess input overlay could visualize and forward that via the websocket server. The swapped X/Y are a bit annoying, but the preset for the switch can just switch (hah) them, alternatively it seems like there is an option to change this in sdl
Unrelated to the rest, since people were talking about switch controllers, I found an off-brand pro version I had in the house, and it works as expected. Y and X are swapped visually, but report correctly, the same as B and A, since Nintendo and Microsoft seem to have reversed positioning on those compared to each other.
Edit: I forgot the switch controller had buttons on the back / bottom. These do not seem to report anything at all when pressed.
Are those extra buttons also on a normal switch pro controller? If not it's probably an issue with SDL assuming that it is a switch pro controller
I assume that the movement is limited to values between 0 and 1.
Correct. Touchpad values on the PS5 touchpad seem to be 0.00 through 1.00 on the X and Y axis, with a Z value that seems to always be '1.00' when the touchpad's being touched, and '0.00' as the very last value as the touch pad is released. (You can see that in my output above.) No indication that I can see that the Z value is ever anything other than a binary value besides it being shown as having a decimal point. 0.00 0.00
is the top-left coordinates, 1.00 1.00
is the bottom-right. I can test the PS4 controller if you want, but I suspect it's the exact same given everything else is.
Also, while it only lists 'finger 0' above, it looks like the touchpad can register two fingers (0 and 1) at the same time.
Are those extra buttons also on a normal switch pro controller?
I don't see anything that looks similar on the pictures of a real switch pro controller, so I guess not. I have no idea what they're for, but since it's an off-brand and doesn't exist on the official pro controller and they're not registering in SDL, I doubt it's worth caring about.
Correct. Touchpad values on the PS5 touchpad seem to be 0.00 through 1.00 on the X and Y axis, with a Z value that seems to always be '1.00' when the touchpad's being touched, and '0.00' as the very last value as the touch pad is released. (You can see that in my output above.) No indication that I can see that the Z value is ever anything other than a binary value besides it being shown as having a decimal point.
0.00 0.00
is the top-left coordinates,1.00 1.00
is the bottom-right. I can test the PS4 controller if you want, but I suspect it's the exact same given everything else is.
The code references the third value as pressure
so maybe it could technically be in between 0 and 1 just not with playstation controllers.
I assume that the movement is limited to values between 0 and 1.
Correct. Touchpad values on the PS5 touchpad seem to be 0.00 through 1.00 on the X and Y axis, with a Z value that seems to always be '1.00' when the touchpad's being touched, and '0.00' as the very last value as the touch pad is released. (You can see that in my output above.) No indication that I can see that the Z value is ever anything other than a binary value besides it being shown as having a decimal point.
0.00 0.00
is the top-left coordinates,1.00 1.00
is the bottom-right. I can test the PS4 controller if you want, but I suspect it's the exact same given everything else is.Also, while it only lists 'finger 0' above, it looks like the touchpad can register two fingers (0 and 1) at the same time.
Are those extra buttons also on a normal switch pro controller?
I don't see anything that looks similar on the pictures of a real switch pro controller, so I guess not. I have no idea what they're for, but since it's an off-brand and doesn't exist on the official pro controller and they're not registering in SDL, I doubt it's worth caring about.
Those buttons probably have to be assigned to mimick another face or shoulder button, which is non-standard for the base model of controlers for microsoft, sony, and nintendo, so no need to worry. I would assume that if theyre assigned, SDL2 would show the mimicked button being activated and not those back buttons, but not something I think would be a deal breaker for people.
I don't think that testing via WINE would be a fair test of how the native Linux SDL performs, but SDL2 stuff works perfectly on my system and I think porting to SDL2 would probably fix all my issues. Would be happy to help test anything or provide some code changes as well depending on what's needed. FWIW, since Nintendo Switch controller support is relatively new on Linux, a lot of things don't properly support it (mapping the buttons wrong under the assumption it's just an Xbox controller), although SDL2 actually does support it correctly.
You can compile the program yourself if you want, it's just https://github.com/univrsal/SDL/blob/main/test/testgamecontroller.c which is part of the sdl2 tests
Are there build instructions for this?
Are there build instructions for this?
Clone the repo and change directory to it.
mkdir build
cd build
cmake -DSDL_TESTS=ON ../
cmake --build .
testgamecontroller
should now be inside the test
subdirectory. If you've got a gyroscope in your controller and you want to verify output on the command line, you might want to filter the gyroscope info out with something like ./testgamecontroller 2>&1 | grep -v "gyro\|accelerometer"
, it's super spammy.
https://github.com/univrsal/input-overlay/issues/241 Another dpad issue
Seems like the main dpad issue imo. Dpad being POV-hat seems to be the standard going forward. Previous version worked with this paradigm, if I recall correctly something about that library used an "is_hat" boolean to distinguish pov hat situations.
Have you tried the gamepad test program?
I'm on linux so I can't use the attachment, but it's the sdl2-gamepad branch?
the test program is part of the sdl2 tests, but the branch should also work if you want to test the plugin with sdl2. It doesn't build on ubuntu for some reason though
https://github.com/univrsal/input-overlay/actions/runs/4166499103 Contains a windows and linux build using sdl2 for gamepad input. The presets in the master branch should be updated to use the new keycodes. If you have presets that you've made yourself you can just load them in the config tool and then export it again to convert it to the new keycodes.
@univrsal I'm on Arch, when I try to build that commit I get pages of errors. Same with latest master. Pacman reports installed version is 5.0.0.r9.g05b175f-1.
yeah It's something with simd headers clashing with sdl2, debug builds don't have that issue for some reason
XBOX 360 Controller Not Working properly UNDER OBS: leftshoulder,rightshoulder,x,y,a,b,start,back NOT WORKING in input-overlay object dpad,left and right stick,button rightstick,button leftstick, axis righttrigger,axis lefttrigger WORKING NORMALLY
- Issue present in xinput mode. DirectInput mode not working at all.
- tested 2 different controllers (different models) same issue.
- sdl2.gamepadtest.zip Working PERFECTLY
- Gamepad Bindings under inputoverlay configuration responding properly
- browser ojbect configured with https://gamepadviewer.com/ working flawlessly with same controllers.
- Same problem in ALL presets (dualsense, gamecube,gamepad etc) Thanks in advace with your precious help.
Did you test it with the test program?
i wrote "sdl2.gamepadtest.zip Working PERFECTLY" trying to be as complete as possible. sorry for bothering but i really have no more ideas
no worries, I missed that. If the test program works the next release should fix the issues
Anybody who wants can try the new gamepad and network backend with this. If there's no more bugs I'll close this issue.
Xbox elite controller 2 here: Y and X buttons are swapped using the gamepad
preset. Swapping them in the profile was simple enough.