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

[Input] Final Fixes (MMJOY + evdev) #3817

Merged
merged 8 commits into from
Dec 21, 2017
Merged

Conversation

Megamouse
Copy link
Contributor

@Megamouse Megamouse commented Nov 30, 2017

@flash-fire
Copy link
Contributor

If this is actually your last PR for this, I promise to shave my head.

@Megamouse Megamouse changed the title [Input/MMJOY] Final Fixes [WIP] [Input/MMJOY] Final Fixes Dec 1, 2017
@Megamouse Megamouse force-pushed the volley branch 7 times, most recently from d2a58a2 to 4286bfd Compare December 1, 2017 16:06
@Megamouse Megamouse changed the title [WIP] [Input/MMJOY] Final Fixes [Input/MMJOY] Final Fixes Dec 1, 2017
@Megamouse Megamouse changed the title [Input/MMJOY] Final Fixes [Input] Final Fixes (MMJOY + evdev) Dec 1, 2017
@Megamouse Megamouse changed the title [Input] Final Fixes (MMJOY + evdev) [WIP] [Input] Final Fixes (MMJOY + evdev) Dec 2, 2017
@Megamouse Megamouse changed the title [WIP] [Input] Final Fixes (MMJOY + evdev) [Input] Final Fixes (MMJOY + evdev) Dec 2, 2017
@Psycho-A
Copy link

Psycho-A commented Dec 2, 2017

Will be plans to implement a mouse axis as some of gamepad's analog sticks? It would be great in the end! :)

@Psycho-A
Copy link

Psycho-A commented Dec 2, 2017

Found first bugs with this PR.
Keyboard now is totally buggy. I binded Shift as R1 button, and WASD to Left stick, and now I can't control WASD keys when shift is pressed. Probably the same thing happen with some other buttons too. Also, low fps now borns wild input lags with button stucking, f.e. my character was forced to move left when left direction on stick were released during low fps.

@Megamouse Megamouse force-pushed the volley branch 2 times, most recently from 2a225ac to f1c14e4 Compare December 2, 2017 21:04
@Megamouse
Copy link
Contributor Author

try again @Psycho-A

@Psycho-A
Copy link

Psycho-A commented Dec 3, 2017

@Megamouse
works well as before.

@Megamouse Megamouse force-pushed the volley branch 2 times, most recently from be2d56c to 25f66e2 Compare December 4, 2017 23:45
@toccata10
Copy link
Contributor

Hi Megamouse,
A bit of testing with the evdev part:
*with this PR: ok for an xbox360 controller. Vibrations are cool too.

With my custom stick:
*on master: works fine except that the analog axis are reversed: it's ok on the config window, but when in a game: if I press up, it goes down. If I press right, it goes left.
Correct in gui window, wrong in games:
selection_043

Workaround: I press left to register right input in the config window.
Dpad is perfect.
Incorrect in gui window, correct in games:
selection_044

So, while not perfect, it's very easy to configure.

*on PR: I can't register LX-, neither LY-: it always registers LZ+
So it seems like LX- and LY- are not captured.
Knowing that with an evtest, this is my output (so if I don't press anything, the gui always captures a LZ+):

Event: time 1512561543.089711, -------------- SYN_REPORT ------------
Event: time 1512561543.097704, type 3 (EV_ABS), code 2 (ABS_Z), value 133
Event: time 1512561543.097704, -------------- SYN_REPORT ------------
Event: time 1512561543.105706, type 3 (EV_ABS), code 2 (ABS_Z), value 132
Event: time 1512561543.105706, -------------- SYN_REPORT ------------
Event: time 1512561543.113707, type 3 (EV_ABS), code 2 (ABS_Z), value 131
Event: time 1512561543.113707, -------------- SYN_REPORT ------------
Event: time 1512561543.121721, type 3 (EV_ABS), code 2 (ABS_Z), value 133
Event: time 1512561543.121721, -------------- SYN_REPORT ------------
Event: time 1512561543.129712, type 3 (EV_ABS), code 2 (ABS_Z), value 132

Sometimes, when I look at the analog deadzones diagram, there's a big offset for the center point. That's my picture after pressing the "restore defaults" (and moving the stick doesn't magically centers the rest point):
configure evdev_046

If I press on the filter noise button, it outputs this:

E HLE: Evdev Calibration: Added axis [ 5 = RZ+ ] to blacklist. Value = 127
E HLE: Evdev Calibration: Added axis [ 3 = RX+ ] to blacklist. Value = 127
E HLE: Evdev Calibration: Added axis [ 2 = LZ+ ] to blacklist. Value = 135
E HLE: Evdev Calibration: Added axis [ 1 = LY+ ] to blacklist. Value = 127
E HLE: Evdev Calibration: Added axis [ 0 = LX+ ] to blacklist. Value = 127

which is perfect for registering my buttons, but of course, doesn't allow me to input joystick signals anymore.
Suggestion: a multiselection drop-down box called "Axis Blacklisting" in which we can disable the problematic axis by ticking them instead of the "Filter noise" button.

Hope it's detailled enough to help you.

@Megamouse
Copy link
Contributor Author

I'll add min and max size to the log.
You can do so as well if you know how to see what the range is.
If it is non negative then the problem is clear

@Megamouse
Copy link
Contributor Author

Axis are checked by ranges from negative to positive space while triggers are checked by 0+ range.

So if your axis has 0+ range it will be handled as trigger.

I could do a button like "handle trigger axis" to whitelist those axis and handle them accordingly

@Megamouse
Copy link
Contributor Author

I added min and max to the log message in order to make sure I'm doing the right thing next

@LuismaSP89
Copy link

LuismaSP89 commented Dec 10, 2017

@Megamouse I opened an issue with input gamepad, (#3924) i don´t know if this is related with your work in this PR.

BTW, this issue happens in master build and with the latest build (artifact) of this PR in appveyor.

@Psycho-A
Copy link

Psycho-A commented Dec 13, 2017

When will this be merged? Keyboard on Windows is still broken on Master builds as I described it above.

@LuismaSP89
Copy link

@Psycho-A Be patient, every PR needs a lot of testing and pass all checks. It's better to be sure that it doesn't break things.

@toccata10
Copy link
Contributor

toccata10 commented Dec 13, 2017

Checking for the extreme values, I added this in your code:

case EV_ABS:
	{
		auto& dev = device.device;
		int min = libevdev_get_abs_minimum(dev, code);
		int max = libevdev_get_abs_maximum(dev, code);
std::cout <<"code EV_ABS "<< code<< "max " << max <<  std::endl;
std::cout << "code EV_ABS "<< code<<"min " << min <<  std::endl;

Here are the outputs:
xbox 360:

code EV_ABS 1max 32767
code EV_ABS 1min -32768
code EV_ABS 0max 32767
code EV_ABS 0min -32768
code EV_ABS 0max 32767
code EV_ABS 0min -32768
code EV_ABS 4max 32767
code EV_ABS 4min -32768

DragonRise:

code EV_ABS 2max 255
code EV_ABS 2min 0
code EV_ABS 2max 255
code EV_ABS 2min 0
code EV_ABS 2max 255

@toccata10
Copy link
Contributor

I never tested with 2 joysticks after the nice GUI PR. On Linux, the 2nd stick is not usable: it's detected in the Configuration>Pads menu, but it's not detected in the game.
The log shows only "Opened joystick: 'Microsoft X-Box 360 pad' at /dev/input/event20 (fd 23)", never the 2nd one (on event19).
What works is:
*one player on evdev
*the other one on keyboard
May I suggest that in the Configuration>Pads menu, the evdev number appears (ex: Microsoft X-Box 360 pad (event19) and Microsoft X-Box 360 pad (event20) ) ? That could avoid some confusion with multiple contollers.
My log with 2 xbox sticks connected.
RPCS3.log-2sticksPb.gz
The last working version was:
rpcs3-v0.0.4-2017-11-23-7d3a528-8931_linux64 (just before the Gui configuration merge).

@Megamouse
Copy link
Contributor Author

Megamouse commented Dec 18, 2017

@toccata10 try this change please

image

edited image

@toccata10
Copy link
Contributor

this renders rpcs3 very unstable (it segfaults).

@@ -319,6 +319,8 @@ class PadHandlerBase
protected:
static const u32 MAX_GAMEPADS = 7;

std::array<bool, MAX_GAMEPADS> last_connection_status{{ false, false, false, false, false, false, false }};
Copy link
Contributor

@elad335 elad335 Dec 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use bitset instead?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 7 boolean values? Seriously?

@toccata10
Copy link
Contributor

Commenting the return std:.. line and adding a continue works: I tested with 2 xbox sticks and it works fine.

and some minor commenting
@Nekotekina Nekotekina merged commit 106de04 into RPCS3:master Dec 21, 2017
@Megamouse Megamouse deleted the volley branch December 23, 2017 18:01
@Asinin3
Copy link
Contributor

Asinin3 commented Dec 24, 2017

This Pull Request broke Catherine for me and another user with DS3 and DS4. After going to the title screen it won't let you load a game or open the configuration menu. You can move the cursor/selection up and down but pressing X won't do anything.

Edit fixed with new PR that was merged.

@spyropt
Copy link

spyropt commented Dec 26, 2017

This broke NPUB30034 Super Street Fighter 2 Turbo HD using mmjoystick x is not working in the game
everything else appears to work moving up and down
tried the latest build and its the same

@MDAshcreator

This comment was marked as off-topic.

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

Successfully merging this pull request may close these issues.