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

Switch pro controller right pad too sensitive #7

Open
justinjustin7 opened this issue Oct 18, 2019 · 16 comments · May be fixed by #32
Open

Switch pro controller right pad too sensitive #7

justinjustin7 opened this issue Oct 18, 2019 · 16 comments · May be fixed by #32

Comments

@justinjustin7
Copy link

Hovering my finger over the right pad registers an input.

@greggersaurus
Copy link
Owner

It might be possible to address this, but it will take a deeper understanding of the trackpad than I currently have.

For details see https://github.com/greggersaurus/OpenSteamController/blob/master/Firmware/OpenSteamController/src/trackpad.c (specifically function trackpadGetLastXY()) to observe what the process is like for taking the data from the trackpad and converting it to X/Y positions. There are some exits in that function that occur because a finger is not detected in the vicinity of the trackpad, but I'm not sure how to fine tune this at the moment...

@MatthewCerza
Copy link

Agreed, it's basically unusable. It's so close to being good, but the sensitivity of the right stick just kills it.

@2bndy5
Copy link

2bndy5 commented Apr 9, 2020

you could alter the firmware to implement these functions from the Cirque examples. Available options for setAdcAttenuation() are here, and Cirque recommends ADC_ATTENUATE_2X for curved overlays. Default value used at Power-On-Reset is ADC_ATTENUATE_1X.

EDIT: Ignore this, and skip to next comment

@2bndy5
Copy link

2bndy5 commented Apr 9, 2020

oops didn't realize that the firmware was using AnyMeas mode... Previous comment was concerning Relative and Absolute mode.

Try changing the second argument to the function call on this line I realize its already at the lowest gain, but you could play with these values and see if it helps. Note the term gain is synonomous with the term attenuation which means loss of signal, so a higher value might lessen the sensitivity.

I'm still working on mastering AnyMeas mode as there is literally no documentation on it from Cirque

@2bndy5
Copy link

2bndy5 commented Apr 10, 2020

I opened a topic on the cirque forums about using AnyMeas mode on the trackpads, and I promptly got a helpful response. See the last paragraph of this reply as a guideline for tweaking the configurations for AnyMeas mode. I recommend reading the whole post and possibly contributing if you think of other questions.

@R-Nukem
Copy link

R-Nukem commented Jul 11, 2020

Great project. I really appreciate all the work that has gone into this.

I have a potential workaround for the right pad issue, though I've been unsuccessful in building the firmware with the workaround that my switch recognizes. I have built the existing firmware successfully with no changes, but with the fairly simple change outlined below my switch no longer recognizes the controller, despite LPCXpresso showing no errors.

The basic problem is the sensitivity of the right pad. For the games I own the right analog stick is not used that frequently. I would suggest only detecting the input with a click of the pad, similar to the left pad --> d-pad functionality.

Please correct me if I am wrong in any of my understanding or execution here:
Line 1342-1347 of usb.c is the section of code that determines the function of the right pad.

// Have Right Trackpad act as Right Analog:
	trackpadGetLastXY(R_TRACKPAD, &tpad_x, &tpad_y);
	controllerUsbData.statusReport.rightAnalogX = convToPowerAJoyPos(tpad_x, 
		0, TPAD_MAX_X/2, TPAD_MAX_X);
	controllerUsbData.statusReport.rightAnalogY = convToPowerAJoyPos(
		 TPAD_MAX_Y - tpad_y, 0, TPAD_MAX_Y/2, TPAD_MAX_Y);

Line 1309 is tracking the clicking of the left pad to filter the d-pad input, with the d-pad code inside this if function

	if (getLeftTrackpadClickState()) {

        }

Using this framework it should be fairly simple to wrap the code for the right trackpad in a similar if statement to filter its input in the same way:

	if (getRightTrackpadClickState()) {
		
		trackpadGetLastXY(R_TRACKPAD, &tpad_x, &tpad_y);
		controllerUsbData.statusReport.rightAnalogX = convToPowerAJoyPos(tpad_x, 
			0, TPAD_MAX_X/2, TPAD_MAX_X);
		controllerUsbData.statusReport.rightAnalogY = convToPowerAJoyPos(
			 TPAD_MAX_Y - tpad_y, 0, TPAD_MAX_Y/2, TPAD_MAX_Y);
	}

I have been unsuccessful in making this work, however.
Just wanted to give my 2 cents, and see if anyone had a suggestion for implementing this idea.

@mgueji
Copy link

mgueji commented Oct 26, 2020

I would suggest only detecting the input with a click of the pad, similar to the left pad --> d-pad functionality.

I was about to suggest the same, I don't know why it's not working, I can't test it because I haven't got LPCXpresso in my computer.

PS:
Maybe something to do with line 1288?
controllerUsbData.statusReport.rightAnalogClick = getRightTrackpadClickState();

Should we use another key to work as rightAnalogClick before using it as way to enable the right trackpad?

PS2:
can someone try with getRightGripState() or getLeftGripState()? as they aren't needed in Switch anyways.

PS3:
The left grip button is used for the screenshot button if I'm not wrong but the right one should be free.

@gaycomputers
Copy link

Has anyone solved this?

@franchettium
Copy link

franchettium commented May 5, 2021

Dunno how many of you are still interested in this, but I've modified a portion of usb.c starting from line 1342:

if (getRightGripState()) {

	trackpadGetLastXY(R_TRACKPAD, &tpad_x, &tpad_y);

	controllerUsbData.statusReport.rightAnalogX = convToPowerAJoyPos(tpad_x,

			0, TPAD_MAX_X/2, TPAD_MAX_X);

		controllerUsbData.statusReport.rightAnalogY = convToPowerAJoyPos(

			 TPAD_MAX_Y - tpad_y, 0, TPAD_MAX_Y/2, TPAD_MAX_Y);

}

else{

	trackpadGetLastXY(R_TRACKPAD, &tpad_x, &tpad_y);

	controllerUsbData.statusReport.rightAnalogX = 0x80;

	controllerUsbData.statusReport.rightAnalogY = 0x80;

}

this code makes the right joystick stay neutral until the right grip gets pressed. When you press the right grip, the right touchpad starts acting again as the right joystick.
I've messed with trackpad.c for a couple hours trying to reduce the trackpad's sensitivity to no avail.

@marxjohnson
Copy link

marxjohnson commented Dec 31, 2021

I've succeeded in building modified firmware in 2 configurations: one that activates the right pad when the right grip is held, the other that activates it when the right pad is pressed, and re-maps the right grip to provide the "right stick click" input. I've attached them here in case other people find them useful.

I also tried tweaking the suggested parameters from the cirque forums thread to lower the sensitivity, but it didn't make a noticeable difference, so maybe something else is required.

OpenSteamController_RightGripToggle.bin.zip
OpenSteamController_RightPadToggle.bin.zip

@2bndy5
Copy link

2bndy5 commented Dec 31, 2021

I also tried tweaking the suggested parameters to lower the sensitivity, but it didn't make a noticeable difference, so maybe something else is required.

Thanks for reporting this. AnyMeas mode on these trackpads is rather undocumented. Any other tweaking might involve real-time calibration (which uses a matrix of 48-uint16_t data - IIRC)...

@arxanas arxanas linked a pull request Jun 5, 2022 that will close this issue
@arxanas
Copy link

arxanas commented Jun 5, 2022

I got a reasonable solution in #32. Tap detection itself seems to work fine in my testing in Smash Bros.

However, even without my patch, using trackpad monitor on my dev firmware build seems to indicate significant dead zones for my controller. Here's the actual ranges of values I can seem to produce:

Left X Left Y Right X Right Y
Min ~160 <0 ~170 <0
Max ~1150 >650 ~1170 >650

So I can't press the trackpad to the extremes of the x-axis (not too relevant for actual use), and there are dead zones on the extremes of the y-axis. Actually, I think there are small dead zones on the x-axis as well, and they just don't register as values <150 or >1150.

In practice, this means that thumb movements need to be restrained to the center of the trackpads to get high degrees of accuracy for competitive play. This is less important for the right trackpad (the tilt/smash stick), but very important for the left trackpad (which I've set to be the left analog stick, instead of using the left joystick — the D-pad is mostly useless for Smash).

@2bndy5
Copy link

2bndy5 commented Jun 5, 2022

@arxanas You may need to compensate your z-axis calc for the curved overlay on the trackpad. Also, the datasheet recommends clamping the X/Y axes (for reliability) to

  • 64 ≤ y ≤ 1472 (from 0 ≤ Y ≤ 1535)
  • 128 ≤ x ≤ 1920 (from 0 ≤ X ≤ 2047)

Hope that helps.

EDIT: The above ranges are for the trackpad's Absolute Mode. Obviously this is different for AnyMeas mode, but you get the idea.

@mgueji
Copy link

mgueji commented May 3, 2023

I got a reasonable solution in #32. Tap detection itself seems to work fine in my testing in Smash Bros.

However, even without my patch, using trackpad monitor on my dev firmware build seems to indicate significant dead zones for my controller. Here's the actual ranges of values I can seem to produce:
Left X Left Y Right X Right Y
Min ~160 <0 ~170 <0
Max ~1150 >650 ~1170 >650

So I can't press the trackpad to the extremes of the x-axis (not too relevant for actual use), and there are dead zones on the extremes of the y-axis. Actually, I think there are small dead zones on the x-axis as well, and they just don't register as values <150 or >1150.

In practice, this means that thumb movements need to be restrained to the center of the trackpads to get high degrees of accuracy for competitive play. This is less important for the right trackpad (the tilt/smash stick), but very important for the left trackpad (which I've set to be the left analog stick, instead of using the left joystick — the D-pad is mostly useless for Smash).

Hi, do you mind to share the binary for this if you still have it?

@arxanas
Copy link

arxanas commented Jun 7, 2023

@mgueji unfortunately, I do not have the binary on hand, and even if I did, I applied several other customizations which would make it likely unusable for you. You can view and download the source code at https://github.com/arxanas/OpenSteamController/tree/pro-trackpad and build it use the instructions at https://github.com/greggersaurus/OpenSteamController/tree/master/Firmware#building

@arxanas
Copy link

arxanas commented Aug 7, 2023

@mgueji I posted my builds at #32 (comment).

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 a pull request may close this issue.

10 participants