Open univrsal opened 1 year ago
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
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.
Strange that the buttons are swapped, I assume they're fine in the gamepad test program (linked in the issue description)?
Strange that the buttons are swapped, I assume they're fine in the gamepad test program (linked in the issue description)?
Indeed it is working, Y is Y and X is X.
yeah It's something with simd headers clashing with sdl2, debug builds don't have that issue for some reason
I'm glad that you know the reason for this, because I honestly thought it was just some weird quirk of my system and didn't want to mention it. When you say "debug builds," how are you building it differently? (as in, is there a way for me to modify it so I can build a debug build, and maybe I can help figure out the issue this way)
yeah It's something with simd headers clashing with sdl2, debug builds don't have that issue for some reason
I'm glad that you know the reason for this, because I honestly thought it was just some weird quirk of my system and didn't want to mention it. When you say "debug builds," how are you building it differently? (as in, is there a way for me to modify it so I can build a debug build, and maybe I can help figure out the issue this way)
Just the normal cmake debug target, i.e. cmake -S <path to git repo> -DCMAKE_BUILD_TYPE=Debug
You can also do what I did for the CI builds and tamper with the headers that cause the issue, but I wouldn't recommend that: https://github.com/univrsal/input-overlay/blob/master/.github/scripts/.build.zsh#L182-L183
Yeah, I wouldn't want to actually mess with library headers; that sounds like a lost cause.
I will try and see what's different in the debug build, though; my guess is that there might be some extra include flags that conflict, but we'll see. Not sure if I'll get to this over the weekend or not, but I'll share what I find if I find anything.
On Arch, makepkg will default to x86-64 arch which result in the wall of errors with intrinsics. Adding -msse4.1 work around the problem.
Where did you add that?
It's a compile flag for GCC. For makepkg, you'd have to add it into /etc/makepkg.conf
in the CFLAGS and CXXFLAGS. Alternatively I think it's better to change -march=x86-64 to -march=native so it can take full advantage of your hardware.
So I guess set(CMAKE_CXX_FLAGS "-march=native")
should do the trick
I see what's going on: OBS is defining things that are defined in standard intrinsincs headers because they aren't included yet and compiler flags indicate that they aren't available. And then SDL include the file <immintrin.h>
which include all intrinsics headers regardless of flags. I think what OBS is doing is wrong but to fix it, including SDL before obs headers should work.
Strange that the buttons are swapped, I assume they're fine in the gamepad test program (linked in the issue description)?
Indeed it is working, Y is Y and X is X.
I figured it out. Since the scroll wheel and right mouse button are switched on linux I switched keycodes 2 and 3. That should only happen for mouse button elements, but I did it for all elements so the gamepad codes 2 and 3 where also switched. Should be fixed with 4cb687f16b99067aaefbf016796aefb35c58ced2
So I guess
set(CMAKE_CXX_FLAGS "-march=native")
should do the trick
You shouldn't force it in your source. For a packager, it would cause issues as binaries packages are expected to target an architecture which isn't always to one of the machine compiling. Ideally it should have the widest compatibility by default. Also it won't work for msvc.
Well windows never had the issue to begin with. I'll just leave it the way it is for now.
Went from dpad not working to everything not working now. New issue?
nah just post the full log here, ideally while running obs with --verbose
Try the a6d212fb1306835dd9743e12cee908147a63df17 commit. Ideally with only one gamepad connected first. I already heard that multiple seem to cause issues.
I only have one connected, not sure why it's detecting two. jstest only shows one.
Might be that it first thinks it's an xbox 360 gamepad and then identifies it as an xbox one gamepad. I'll try and see if I can find another gamepad so I can reproduce the bug
I don't know if my issue is in anyway related to this. I'm using a GuliKit gamepad over Bluetooth. It's recognized as an XBox One controller but the only inputs that are shown are the left trigger and right trigger. None of the others light up or move. Is there anything I can provide you in terms of logs? Should I create another issue for this?
Edit: Maybe as a side-note: With your SDL2 implementation, everything is recognised as it should be.
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
Previous gamepad issues:
294
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