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

Controls remapping not working when Switch Pro Controller is connected #3142

Closed
jndev opened this issue Apr 14, 2017 · 42 comments
Closed

Controls remapping not working when Switch Pro Controller is connected #3142

jndev opened this issue Apr 14, 2017 · 42 comments

Comments

@jndev
Copy link

jndev commented Apr 14, 2017

When the Switch Pro Controller is connected, I'm unable to remap controls for it or for any other connected controllers. OpenEmu 2.0.5, macOS 10.12.3.

@clobber
Copy link
Member

clobber commented Apr 14, 2017

@clobber clobber closed this as completed Apr 14, 2017
@jndev
Copy link
Author

jndev commented Apr 14, 2017

I read your link and disabled all potential sources of interference but the problem persists. I don't encounter it with OpenEmu 2.0.4.

@clobber
Copy link
Member

clobber commented Apr 14, 2017

This isn't happening for other users that have the Switch controller, so it has to be something listed in the guide. Also, you should update to 2.0.5. You will first want to clear out your bindings file if you already have pre-existing mappings for the Switch controller, though.

@dbmrq
Copy link

dbmrq commented Nov 9, 2017

This isn't happening for other users that have the Switch controller

This is happening to me as well. The predefined controls seem good enough though… the worst part is that the left analog doesn't seem sensible enough though, I push it all the way and Mario (on Super Mario 64) walks really slowly, as if I were doing it very lightly. :/

@dbmrq
Copy link

dbmrq commented Nov 9, 2017

I just found #3102, that's exactly what I'm experiencing, sorry.

As for the original issue, I deleted OpenEmu and its Application Support directory, restarted the computer and installed it all over again. When I opened it the problem was still there. Then I opened Super Mario 64 and it crashed. I opened it again and now the mapping works just like it should. 🤷‍♂️

@dbmrq
Copy link

dbmrq commented Nov 9, 2017

Also I'm sorry to bring this up here, but the #3102 issue is locked… couldn't we just allow the users to input their own values to the axis multiplier (instead of hardcoding 80) when configuring a N64 controller? I thought of just giving it a go and opening a PR, but I'm not sure if you'd consider merging it, so I thought I'd ask before going through the trouble. Either way thank you for your work with OpenEmu, it's awesome. :)

Edit: or let the user choose a value to "amplify" the axis value, getting it closer to 1.0 before multiplying by 80… anyway, you get what I mean. Now that I'm thinking about it, couldn't we just check if the controller is a nintendo controller on changeAnalogEmulatorKey, and if it is we'd increase the value parameter before calling didMoveN64JoystickDirection? We'd just have to know how much to increase it, but if we can't I think it wouldn't hurt to let the user pick a value to multiply the input and try it out until he gets optimal results.

@clobber
Copy link
Member

clobber commented Nov 16, 2017

@dbmrq Both of the Nintendo analog gamepads that we support (Wii U Pro and Switch Pro) have abnormal values for their ranges, because they aren't made for PC use in the first place. We appear to not be getting the full range and I've even read that the plastic around the sticks blocks part of it (#1748). Worse yet, the analog ranges can be different from controller-to-controller and even vary stick-to-stick on the same controller! So the long term solution is some kind of built-in calibration method for these gamepads. That isn't happening soon.

However, if we can find an optimal value to use for normalizing the range we can implement an acceptable short-term fix in two possible ways:

  1. Store the range or offset values in a new key for OEControllerNintendoSwitchProController in https://github.com/OpenEmu/OpenEmu/blob/master/OpenEmu/Controller-Database.plist which will then have to be read and applied somewhere in the input system in OpenEmu-SDK.

  2. Or implement custom device handler classes for both Wii U Pro and Switch Pro to normalize the ranges there, sort of like what we did for the Wiimote https://github.com/OpenEmu/OpenEmu-SDK/blob/master/OpenEmuSystem/OEWiimoteHIDDeviceHandler.m

Either way, the majority of the work will be happening in OpenEmu-SDK where the input system lives. I do not have a Switch Pro controller to test with, so if you are up to this task then by all means go for it.

@dbmrq
Copy link

dbmrq commented Nov 16, 2017

@clobber Alright, my objective C is not that great and this seems a little out of my league, but I'll try to figure it out little by little. Thank you for your help!

@clobber
Copy link
Member

clobber commented Nov 16, 2017

@dbmrq Please try the following test build with your Switch Pro controller:

  1. Download https://transfer.sh/H33NE/OpenEmu-inputtest.zip

  2. Pair/connect your Switch Pro controller.

  3. Open the test build.

  4. Open Console.app, go to the search filter box at the top and type openemu, then click Clear.

  5. Then go back to OpenEmu and move your left analog stick in a full circle a couple times, making sure you fully touch the edges of the side of the plastic ring as far as it can go.

  6. Go back to Console.app and select all of that output, paste it into a gist and link it back here.

  7. Go back to Step 4 and do the exact same steps again but this time do it for the right analog stick instead.

This will help me determine the real maximum range of this device and then I can probably fix it.

@dbmrq
Copy link

dbmrq commented Nov 16, 2017

@clobber As soon as I clear the console it gets populated again with seemingly random values, even if I'm not touching the controller. Here are the results anyway: https://gist.github.com/dbmrq/09bd1c763f92d220fdb36830088d4ee7

There are a few spots when the values go from 5 digits to 4, like line 666 and below, line 975 and below and so on. I imagine those are the times when I was rotating the sticks, but I'm not sure.

Thanks again. :)

@dbmrq
Copy link

dbmrq commented Nov 16, 2017

Looking a little closer I imagine the values from around 30000 to 37000 are a sort of deadzone, when the stick is actually still.

If I hold it to the left I get values around 10000 intermittently:

padrão	15:07:34.563955 -0200	OpenEmu	min 0 value: 10080 max 65535
padrão	15:07:34.577815 -0200	OpenEmu	min 0 value: 32608 max 65535
padrão	15:07:34.577855 -0200	OpenEmu	min 0 value: 10064 max 65535
padrão	15:07:34.607819 -0200	OpenEmu	min 0 value: 32640 max 65535
padrão	15:07:34.607861 -0200	OpenEmu	min 0 value: 29487 max 65535
padrão	15:07:34.607888 -0200	OpenEmu	min 0 value: 10080 max 65535
padrão	15:07:34.608905 -0200	OpenEmu	min 0 value: 33967 max 65535
padrão	15:07:34.608946 -0200	OpenEmu	min 0 value: 29535 max 65535
padrão	15:07:34.608972 -0200	OpenEmu	min 0 value: 10064 max 65535
padrão	15:07:34.622812 -0200	OpenEmu	min 0 value: 33951 max 65535
padrão	15:07:34.622855 -0200	OpenEmu	min 0 value: 29599 max 65535
padrão	15:07:34.622882 -0200	OpenEmu	min 0 value: 10080 max 65535

If I hold it to the right I get values around 52000 intermittently:

padrão	15:10:34.880545 -0200	OpenEmu	min 0 value: 33967 max 65535
padrão	15:10:34.880587 -0200	OpenEmu	min 0 value: 29423 max 65535
padrão	15:10:34.880613 -0200	OpenEmu	min 0 value: 53232 max 65535
padrão	15:10:34.894485 -0200	OpenEmu	min 0 value: 29439 max 65535
padrão	15:10:34.894551 -0200	OpenEmu	min 0 value: 52144 max 65535
padrão	15:10:34.924293 -0200	OpenEmu	min 0 value: 51904 max 65535
padrão	15:10:34.925548 -0200	OpenEmu	min 0 value: 29471 max 65535
padrão	15:10:34.925589 -0200	OpenEmu	min 0 value: 51712 max 65535
padrão	15:10:34.939410 -0200	OpenEmu	min 0 value: 33983 max 65535
padrão	15:10:34.939452 -0200	OpenEmu	min 0 value: 29487 max 65535
padrão	15:10:34.939479 -0200	OpenEmu	min 0 value: 50944 max 65535

If I hold it up I get values around 9600:

padrão	15:11:41.360077 -0200	OpenEmu	min 0 value: 9583 max 65535
padrão	15:11:41.360105 -0200	OpenEmu	min 0 value: 36896 max 65535
padrão	15:11:41.389887 -0200	OpenEmu	min 0 value: 32624 max 65535
padrão	15:11:41.389931 -0200	OpenEmu	min 0 value: 9599 max 65535
padrão	15:11:41.389960 -0200	OpenEmu	min 0 value: 36912 max 65535
padrão	15:11:41.391133 -0200	OpenEmu	min 0 value: 32640 max 65535
padrão	15:11:41.391176 -0200	OpenEmu	min 0 value: 9615 max 65535
padrão	15:11:41.405128 -0200	OpenEmu	min 0 value: 9583 max 65535
padrão	15:11:41.405170 -0200	OpenEmu	min 0 value: 36880 max 65535
padrão	15:11:41.435065 -0200	OpenEmu	min 0 value: 33967 max 65535
padrão	15:11:41.435106 -0200	OpenEmu	min 0 value: 9599 max 65535
padrão	15:11:41.435134 -0200	OpenEmu	min 0 value: 36912 max 65535
padrão	15:11:41.436132 -0200	OpenEmu	min 0 value: 9631 max 65535

And if I hold it down, around 59000:

padrão	15:12:59.195503 -0200	OpenEmu	min 0 value: 59231 max 65535
padrão	15:12:59.195530 -0200	OpenEmu	min 0 value: 34800 max 65535
padrão	15:12:59.196669 -0200	OpenEmu	min 0 value: 59247 max 65535
padrão	15:12:59.210596 -0200	OpenEmu	min 0 value: 32608 max 65535
padrão	15:12:59.210664 -0200	OpenEmu	min 0 value: 34816 max 65535
padrão	15:12:59.240619 -0200	OpenEmu	min 0 value: 32640 max 65535
padrão	15:12:59.240705 -0200	OpenEmu	min 0 value: 59231 max 65535
padrão	15:12:59.240736 -0200	OpenEmu	min 0 value: 34800 max 65535
padrão	15:12:59.241834 -0200	OpenEmu	min 0 value: 59215 max 65535
padrão	15:12:59.255834 -0200	OpenEmu	min 0 value: 35328 max 65535
padrão	15:12:59.285564 -0200	OpenEmu	min 0 value: 59183 max 65535

This is just holding the left stick in one direction at a time. The gist has the full results with me making full circles. Let me know if there's anything else I can do.

@clobber
Copy link
Member

clobber commented Nov 16, 2017

Thanks. No need to evaluate all the numbers, I'm just going to pull out the maximum and the minimum from you doing full circles. I also need one for the right stick too please.

Edit: and yes it is going to spam values, because the device is constantly sending axis data even when still.

@dbmrq
Copy link

dbmrq commented Nov 16, 2017

Sorry, it's in the gist too, but it got confusing. Here's left and right.

@clobber
Copy link
Member

clobber commented Nov 16, 2017

Okay so from your data we have:

left stick:
min 8752
max 59567

right stick:
min 7376
max 60287

Quite the difference between the sticks. As you can see the Switch Pro does not give us its full range - the minimum never reaches anywhere near 0 and the max never reaches near 65535. This is why Mario walks and never runs :P

Would you be willing to do one more test like this? I want to be absolutely sure these are the minimum and maximum values for both sticks. If you do it again, this time rotate the sticks slowly and make sure you are doing full, complete circles so that you are pushing the analog sticks as far as they can go in all directions, hitting the plastic edge of the ring it sits in. Do maybe 5 rotations.

@dbmrq
Copy link

dbmrq commented Nov 16, 2017

Here you go: left and right. I did 5 slow rotations anti-clockwise, centered the stick and did 5 more rotations clockwise for each side.

@clobber
Copy link
Member

clobber commented Nov 16, 2017

Thanks! Wow these differed quite a bit from the first results too.

left stick:
min 8319
max 59631

right stick:
min 7728
max 58767

All this output spam in Console is annoying and hard to parse, plus we may be missing some values. In a few hours, I'm going to clean up the logging so that it will only output the min/max value after you are done rotating your sticks and press a button on the gamepad. I'll let you know when it's ready and upload a new build so you can test again.

@dbmrq
Copy link

dbmrq commented Nov 16, 2017

Ok then, thanks. :)

@clobber
Copy link
Member

clobber commented Nov 16, 2017

@dbmrq Okay I've put together a much more accurate and streamlined test which doesn't require you to copy and paste massive lines or repeat steps. Here's all you have to do:

  1. Download the revised test build https://transfer.sh/HUOQu/OpenEmu-inputtest5.zip

  2. Pair/connect your controller.

  3. Open the test build.

  4. Open Console.app, go to the search filter box at the top and type openemu, then click Clear.

  5. Go back to OpenEmu and move your left analog stick in a full circle several times, making sure you fully touch the edges of the side of the plastic ring as far as it can go. Then do the same for the right analog stick.

  6. Press "Button A" on your controller.

  7. Go back to Console.app and copy all of that output and paste it back here. You will see:

------begin axis log------
blah
blah
blah
------end axis log------

@dbmrq
Copy link

dbmrq commented Nov 16, 2017

Alright, I gave it a few tries:

padrão	20:25:03.232572 -0200	OpenEmu	------begin axis log------
padrão	20:25:03.232628 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	20:25:03.235797 -0200	OpenEmu	left  analog axis min: 8768 max: 60159
padrão	20:25:03.238790 -0200	OpenEmu	right analog axis min: 7280 max: 60335
padrão	20:25:03.238828 -0200	OpenEmu	------end axis log------
padrão	20:27:53.709462 -0200	OpenEmu	------begin axis log------
padrão	20:27:53.709499 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	20:27:53.717829 -0200	OpenEmu	left  analog axis min: 8752 max: 60335
padrão	20:27:53.725496 -0200	OpenEmu	right analog axis min: 7248 max: 60335
padrão	20:27:53.725534 -0200	OpenEmu	------end axis log------
padrão	20:28:53.695436 -0200	OpenEmu	------begin axis log------
padrão	20:28:53.695490 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	20:28:53.696583 -0200	OpenEmu	left  analog axis min: 8752 max: 60351
padrão	20:28:53.697493 -0200	OpenEmu	right analog axis min: 7408 max: 59679
padrão	20:28:53.697528 -0200	OpenEmu	------end axis log------
padrão	20:29:59.427739 -0200	OpenEmu	------begin axis log------
padrão	20:29:59.427778 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	20:29:59.428984 -0200	OpenEmu	left  analog axis min: 8720 max: 60223
padrão	20:29:59.430119 -0200	OpenEmu	right analog axis min: 7424 max: 59695
padrão	20:29:59.430156 -0200	OpenEmu	------end axis log------

Often the results showed up in the console before I pressed any buttons though, I was just moving the right stick, paying attention not to press anything by accident, and those lines would appear.

@clobber
Copy link
Member

clobber commented Nov 16, 2017

Thanks! That definitely looks better from the results we saw before. I'm seeing much lower minimum and higher maximum range values reached.

Often the results showed up in the console before I pressed any buttons though

Yep, any button you press including the analog "stick" buttons and the shoulders/triggers will make that output appear because they are all actual HID buttons. Sorry, I should have mentioned that. When I make a build for general testing for people in issue #3102 I will fix it so only pressing "Button A" on the gamepad triggers the logging.

@clobber
Copy link
Member

clobber commented Nov 16, 2017

Actually, I just fixed that now in case you would like to verify that only pressing Button A will log the axis output. Here's the build: [removed]

@clobber
Copy link
Member

clobber commented Nov 16, 2017

Whoops, just realized that build won't pull data for the right-stick axis. Here is a corrected build: https://transfer.sh/116OzR/OpenEmu-inputtest4.zip

Just want to see if only pressing "A" logs the data.

@dbmrq
Copy link

dbmrq commented Nov 16, 2017

Yep, now the results only show up if I press A. :)

@clobber
Copy link
Member

clobber commented Nov 17, 2017

Great. Now for hopefully our last test, see if this build fixes movement in games like Mario 64 and Zelda: https://transfer.sh/pmHQb/OpenEmu-n64fix.zip

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

It's definitely playable and a lot better than before, but when Mario moves backwards or to the left he moves slightly faster than forward or to the right. I think moving right is the slowest now. It's not that bad, but still noticeable.

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

I don't know if this is relevant or helpful, but Dolphin has these images showing the position of the sticks and you can see that, when resting in their natural position, they show up a little off-center:

captura de tela 2017-11-16 as 23 07 38

The left stick seems to be a little to bottom right, and the right stick seems to be a lot closer to the top.

@clobber
Copy link
Member

clobber commented Nov 17, 2017

It's definitely playable and a lot better than before, but when Mario moves backwards or to the left he moves slightly faster than forward or to the right.

Hrm okay. Sounds like I may need to lower the maximum range a bit more then. I set it to 60000 because it seemed you were able to reach that, but perhaps I should try 59000. Either that, or we need to go more granular and do min/max ranges for each individual axis.

The left stick seems to be a little to bottom right, and the right stick seems to be a lot closer to the top.

Yep, I experience that too with my DualShock 4. Unfortunately these analog gamepads aren't the best of quality despite their premium prices.

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

Since the normal position is already off center I guess my controller is reaching 6000 when going left, but not when going right (in the Dolphin image there's less space for the stick to travel form the little dot to the right edge than from the dot to the left edge). I'm afraid 59000 will still not cut it, since, like I mentioned here, holding the stick left gives me values around 59000, but holding it right only goes as far as about 52000.

Maybe setting the maximum range to 52000 wouldn't be that bad though? Using version 2.5.2 of the Mupen64Plus core works reasonably well for me, and I assume it's using values way above the real input for all sides. With 2.5.2 the problem is the opposite, the sticks are too sensitive and sometimes Mario will start walking slowly even if I'm not touching the controller, but that's still better than him not going fast enough.

@clobber
Copy link
Member

clobber commented Nov 17, 2017

I'm afraid 59000 will still not cut it, since, like I mentioned here, holding the stick left gives me values around 59000, but holding it right only goes as far as about 52000.

We can't rely on that data. Both analog sticks were spamming console at once and you can be sure that outputs were getting dropped, so we weren't getting the full or accurate story there. If we really want to see the per-axis ranges then I need to modify my code a bit to account for that, which I may do later.

Using version 2.5.2 of the Mupen64Plus core works reasonably well for me, and I assume it's using values way above the real input for all sides. With 2.5.2 the problem is the opposite

You confused me there. But I think you are saying the older version of Mupen64Plus works for Mario 64, but I can assure you that input will be broken in other games because we were not passing correct values based on the N64 gamepad range limit. As for Mario sometimes walking if you are not touching the controller, I think I probably know the reason for that. So far the changes I made were to just test a specific range and I didn't do any bounds checking to limit and scale the actual analog value currently being sent. I still need to adjust that. Testing all this is a bit difficult for me because I don't have a Switch Pro controller.

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

Yes, I imagine that data isn't very reliable, but I thought it could still be suggestive, since the difference between right and left matches the Dolphin image and my tests with Mario 64.

Also I know the older version of Mupen64Plus can cause other problems, but I thought they'd be related to the values being interpreted as way higher than they actually are (since the value is multiplied by INT8_MAX instead of 80). So maybe setting the maximum range to just a little lower than it has to be (like around 53000) wouldn't be that bad, I thought in the worst case scenario the sticks would be a little too sensitive and get to the maximum range before actually touching the sides. That's not a real solution, of course, I just thought it could work temporarily until there's a better way to handle this.

Anyway, this was already a big improvement, and you don't have to look into it right now, of course, I just wanted to help however I could. If you need me to perform any other tests I'll be glad to help out.

@clobber
Copy link
Member

clobber commented Nov 17, 2017

Okay, so this is another test build that will log the ranges for each individual axis. Maybe give us a better idea if there is a serious difference in ranges (hope not!): https://transfer.sh/HUOQu/OpenEmu-inputtest5.zip

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

Here you go, two different attempts:

padrão	03:19:21.934504 -0200	OpenEmu	------begin axis log------
padrão	03:19:21.934597 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	03:19:21.935490 -0200	OpenEmu	left  analog X axis min: 8784 max: 53536
padrão	03:19:21.936409 -0200	OpenEmu	left  analog Y axis min: 12879 max: 60111
padrão	03:19:21.937266 -0200	OpenEmu	right analog X axis min: 7280 max: 52128
padrão	03:19:21.938118 -0200	OpenEmu	right analog Y axis min: 12911 max: 59951
padrão	03:19:21.938138 -0200	OpenEmu	------end axis log------
padrão	03:20:45.665997 -0200	OpenEmu	------begin axis log------
padrão	03:20:45.666095 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	03:20:45.666994 -0200	OpenEmu	left  analog X axis min: 8784 max: 53408
padrão	03:20:45.667909 -0200	OpenEmu	left  analog Y axis min: 12127 max: 60239
padrão	03:20:45.668804 -0200	OpenEmu	right analog X axis min: 7248 max: 52160
padrão	03:20:45.669606 -0200	OpenEmu	right analog Y axis min: 14047 max: 59951
padrão	03:20:45.669627 -0200	OpenEmu	------end axis log------

@torque
Copy link
Contributor

torque commented Nov 17, 2017

default	21:39:56.242522 -0800	OpenEmu	------begin axis log------
default	21:39:56.242684 -0800	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
default	21:39:56.246567 -0800	OpenEmu	left  analog X axis min: 7008 max: 57424
default	21:39:56.249932 -0800	OpenEmu	left  analog Y axis min: 8143 max: 61167
default	21:39:56.252709 -0800	OpenEmu	right analog X axis min: 7984 max: 57872
default	21:39:56.255362 -0800	OpenEmu	right analog Y axis min: 8271 max: 59839
default	21:39:56.255396 -0800	OpenEmu	------end axis log------

e: for a more complete picture, here are the approximate zero positions of the axes (sampled without moving the sticks)

default	21:45:09.667269 -0800	OpenEmu	------begin axis log------
default	21:45:09.667611 -0800	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
default	21:45:09.668208 -0800	OpenEmu	left  analog X axis min: 32688 max: 32752
default	21:45:09.668655 -0800	OpenEmu	left  analog Y axis min: 34783 max: 34863
default	21:45:09.669079 -0800	OpenEmu	right analog X axis min: 34128 max: 34192
default	21:45:09.669464 -0800	OpenEmu	right analog Y axis min: 32127 max: 32207
default	21:45:09.669518 -0800	OpenEmu	------end axis log------

@clobber
Copy link
Member

clobber commented Nov 17, 2017

Wow. Okay I was worried that ranges would vary from device to device, but not that bad. I like the look of @torque's numbers, as they don't differ so much and it makes it easy to hack in some default ranges. But @dbmrq, your y-axis numbers are way off! If it were my device, I'd probably return it to the store for another one as that looks somewhat defective (please don't take that the wrong way, just an honest opinion based on observing the output).

Although maybe it's not so much of a problem when using it on the Switch with its calibration option. But if you are using it primarily for PC gameplay, I'd return it for a new one either way. Also, just so we are clear, are you running any kind of input modifier software in the background that could be affecting the values? Just wanted to check.

Anyway @dbmrq, based on your new output I put together a new test build for N64 that maybe improves Mario's movement. Let me know. https://transfer.sh/ltZ7z/OpenEmu-n64fix2.zip (Note: This is only modified for the left analog stick x/y-axes at the moment).

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

Wow, that really is a big difference. Unfortunately I don't think I can return it, but your latest build works alright. Sometimes Mario moves even if I'm not touching the controller, but I can live with that. I hope it works fine with the Switch, I didn't get mine yet actually, I just got the controller to warm up until then. It works pretty much perfectly with Dolphin, so I'll try not to lose hope. Thank you for your help!

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

Wow! I started googling general problems with the Pro Controller's calibration and read something about issues with the bluetooth connection, interferences and so on. So I tried the test with the controller wired in via USB, the results were even crazier!

padrão	04:56:49.789971 -0200	OpenEmu	------begin axis log------
padrão	04:56:49.790031 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	04:56:49.791056 -0200	OpenEmu	left  analog X axis min: 9392 max: 57056
padrão	04:56:49.792060 -0200	OpenEmu	left  analog Y axis min: 8159 max: 65535
padrão	04:56:49.793051 -0200	OpenEmu	right analog X axis min: 16 max: 55920
padrão	04:56:49.794004 -0200	OpenEmu	right analog Y axis min: 9343 max: 65535
padrão	04:56:49.794039 -0200	OpenEmu	------end axis log------

For the first two attempts that "right analog X axis min" was 16… then I disconnected the controller, connected it again and gave it a third try:

padrão	05:01:05.107780 -0200	OpenEmu	------begin axis log------
padrão	05:01:05.107882 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	05:01:05.108742 -0200	OpenEmu	left  analog X axis min: 9376 max: 56656
padrão	05:01:05.109545 -0200	OpenEmu	left  analog Y axis min: 8719 max: 59839
padrão	05:01:05.110435 -0200	OpenEmu	right analog X axis min: 7696 max: 55872
padrão	05:01:05.111279 -0200	OpenEmu	right analog Y axis min: 9039 max: 59071
padrão	05:01:05.111333 -0200	OpenEmu	------end axis log------

Also the controls seem to be working perfectly well, even the problem with Mario moving all by himself is gone.

At least that makes me think these issues are not about the actual hardware of the controller, but maybe something related to the driver, I don't know. 🤷‍♂️

@clobber
Copy link
Member

clobber commented Nov 17, 2017

Very interesting. I've seen issues resolved before with removing the device in Bluetooth preferences and re-pairing it. As far as I know, the Switch Pro will not operate (send/receive) inputs while plugged in to USB (it's strictly for charging), so you may be seeing some kind of garbage HID output being reported from IOKit.

maybe something related to the driver

There is no driver unless you have manually installed something or are using third party input modifier software. The gamepad should be working as a standard Bluetooth HID-compliant device.

So which build are you using to play Mario with, and are you using it via Bluetooth?

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

Oh, ok, when I plug the controller it automatically connects via Bluetooth again. So I must have been using it via Bluetooth without realizing it. If I plug it in and then disconnect it on the Bluetooth pref pane, OpenEmu crashes (but apparently there's no reason to do that; I just thought I'd let you know).

On my previous tests I disconnected the controller and connected it back again many times, that didn't seem to change the results that much. After plugging it in the difference was drastic, as you could see. I never actually removed it from the Bluetooth pref pane, just disconnected and connected back again.

I left it plugged in overnight and now I unplugged it and gave it another try, the results are still along those lines:

padrão	13:23:29.535354 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	13:23:29.536138 -0200	OpenEmu	left  analog X axis min: 9392 max: 57184
padrão	13:23:29.536944 -0200	OpenEmu	left  analog Y axis min: 8271 max: 59695
padrão	13:23:29.537667 -0200	OpenEmu	right analog X axis min: 7744 max: 55968
padrão	13:23:29.538409 -0200	OpenEmu	right analog Y axis min: 9391 max: 59263
padrão	13:23:29.538432 -0200	OpenEmu	------end axis log------

I tried playing Mario with the last three builds you uploaded here (https://transfer.sh/HUOQu/OpenEmu-inputtest5.zip, https://transfer.sh/ltZ7z/OpenEmu-n64fix2.zip and https://transfer.sh/pmHQb/OpenEmu-n64fix.zip), now everything seems to be working perfectly well on all of them. :)

@clobber
Copy link
Member

clobber commented Nov 17, 2017

Just to clarify in case I need to recommend those steps to anyone else that sees weird range values, you just plugged in the controller and unplugged it and that resolved the range, or were there steps with you connecting/disconnecting with Bluetooth too? Could you list it out step by step like 1), 2), ... ? That would make it easier for someone to follow. Also, was that the first time you plugged in the device to a PC? How did you normally charge it?

So Mario moves fine in inputtest5 build too? There are no changes to the code besides the logging, so if it works there that would mean it also works fine on vanilla OpenEmu 2.0.5. I'm curious so let me know.

@dbmrq
Copy link

dbmrq commented Nov 17, 2017

Oh, I'm sorry, I had multiple versions of the Mupen64Plus core and I mixed them up, I was using 2.5.2. Now I tried 2.5.3:

  • inputtest5 and vanilla 2.0.5 still don't work .
  • With n64fix Mario still walks a little slower when going forward or to the right, but now it's even less noticeable – the game is playable, it's just a little annoying.
  • n64fix2 is almost perfect. Sometimes Mario will walk really slowly to the right when not touching the controller (his legs move, but he pretty much stays put), but it doesn't always happen.

What I did, as far as I recall, was:

  1. Go to the Bluetooth pref pane
  2. Right click the Pro Controller and select "Disconnect"
  3. Plug the controller via USB
  4. Open the test build and run the test (with the controller still plugged in), which then gave me that crazy 16 result for the "right analog X axis min"
  5. Unplug the controller and repeat from step 1, which gave me the most reasonable results.

The stick position reported in Dolphin also changed, in case that matters:

captura de tela 2017-11-17 as 16 20 07


After writing this I tried the steps above one more time. When I plugged the controller in it would still show up as disconnected and trying to play Mario would make OpenEmu crash. I unplugged it and plugged it in again, and then it connected via Bluetooth (without me doing anything, I just plugged it in). I tried playing Mario again and the experience was the same as described above. I ran the tests again and the results changed a bit, especially for the "left analog Y axis min":

padrão	16:38:46.887080 -0200	OpenEmu	------begin axis log------
padrão	16:38:46.887188 -0200	OpenEmu	manstr: Unknown prodstr: Pro Controller vid: 1406 pid: 8201
padrão	16:38:46.887727 -0200	OpenEmu	left  analog X axis min: 9408 max: 56928
padrão	16:38:46.888266 -0200	OpenEmu	left  analog Y axis min: 7775 max: 59647
padrão	16:38:46.888772 -0200	OpenEmu	right analog X axis min: 7728 max: 55536
padrão	16:38:46.889278 -0200	OpenEmu	right analog Y axis min: 9039 max: 59199
padrão	16:38:46.889313 -0200	OpenEmu	------end axis log------

And the position reported on Dolphin was different yet again:

captura de tela 2017-11-17 as 16 44 20


Edit: I forgot to answer about the charging. I bought the controller about 10 days ago, charged it by connecting it to the computer and used it for a couple of hours every day. The battery was still fine, so I didn't charge it again until yesterday, when I plugged it in just to see if it had any influence on the test's results.

@alexgodlex
Copy link

Hey does that problem is solved now ?

I tried to plug the switch controler but the buttons doesn't seem mapped so well (tried with Neo Geo games)

@codingncaffeine
Copy link

I'm not sure if there was an update recently but diagonals are gone entirely for my left analog stick
for my switch controller. I was AMAZED at how good this controller worked out of the box without any configuration necessary. But now all of the sudden the D-Pad is mapped by default and when I manually map the left analog stick I don't diagonals.

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

No branches or pull requests

6 participants