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

DisableOnStylus does not disable all touch inputs #166

Open
sound-friend opened this issue Aug 2, 2024 · 14 comments
Open

DisableOnStylus does not disable all touch inputs #166

sound-friend opened this issue Aug 2, 2024 · 14 comments

Comments

@sound-friend
Copy link

Hey all! Just got a SP7, installed Arch (EndeavourOS) with the linux-surface kernel, as well as iptsd for note taking.
It seems that I'm having trouble with palm rejection. I checked both here and the linux-surface issues, and read there was two things I could fix this:

  1. Calibrate iptsd. I have done this twice and while it made a difference, it was really perfect, and
  2. Set DisableOnStylus to true.

I've set option 2 to true, however it still seems like it's picking up on occasional touch input. Originally I thought it was just my palm, but I've also tested this with the setup described below:
I used my left hand (I'm left handed) to draw on the screen without that hand touching. With my right hand, I tapped the screen repeatedly. Below is the results of my tests. This was one constant line of drawing.
image
I've checked other issues and it doesn't seem like anyone else has this exact same issues, so I'm wondering if anyone knows how to fix this.

For refernce, the device is a Surface Pro 7 with an i3 and 4GB RAM. The pen I am using is a Wacom Bamboo Ink (although I'm getting a Surface Pen soon). I am using GNOME 46 and kernel 6.9.9 (arch surface kernel). Let me know what else you need!

@sound-friend
Copy link
Author

After some further testing, it seems to mostly happen when lots of pressure is applied to the screen (hence why a palm would make it happen).

@sound-friend sound-friend changed the title DisableOnStylus is not disable all touch inputs DisableOnStylus does not disable all touch inputs Aug 2, 2024
@sound-friend
Copy link
Author

Did some more testing. Set the touch's disabled to true and ran the same test, which came out to the same result above. Is there any way I would be able to figure out what sort of input is happening at that time?

@Ramen-LadyHKG
Copy link

I'd similar experience on my Surface Pro 5 running Fedora Gnome

@sound-friend
Copy link
Author

just received the official surface pen and can confirm that it happens with that as well. in the meantime im rocking a latitude 5290 which has its palm rejection working flawlessly out of the box. ill keep the surface around for support however

@ECO1AI
Copy link

ECO1AI commented Aug 6, 2024

it seems for some reasons config file /etc/iptsd.conf is ignored by IPTSD.

in my case, tried :
disable touch=true
DisableOnStylus = true
DisableOnPalm = true

there is touch, and there is touch with stylus and palm

sudo journalctl -p 3 -xb looks good and so dmesg

the only issue that i see is:

ithc 0000:00:10.6: invalid dma rx data! channel 1, buffer 6, size 641: 03 00 00 00 d0 07 00 00 00 00 00 00 01 00 00 0>
 ithc 0000:00:10.6: DMA RX timeout/error (try decreasing activeltr/idleltr if this happens frequently)

after running sudo journalctl -p 3 -x
this could be due to TLP

no indication of an error related to ignoring config file

@xieve
Copy link

xieve commented Sep 24, 2024

Edit: This is caused by NixOS/nixpkgs#344002

Not sure if this is the same issue or not, for me, DisableOnStylus does not work at all.
Screencast

Here, I first started drawing with the stylus, then using my right hand to pan the canvas via touch with one contact point.

I'm using a Surface Pro 9 with a Slim Pen 2. Application is RNote, although I had the same issue in the Excalidraw plugin for Obsidian.

I have confirmed that Touchscreen.Disable works as expected. I'm not sure if Touchscreen.DisableOnPalm works, since my palm rejection hasn't been good yet. I have calibrated my device.

@wvffle
Copy link

wvffle commented Sep 30, 2024

@sound-friend I'm experiencing similar issue.

The SP7 I am working on has a glass screen cover which might be the reason for my issues.

When I have a hand on my screen, a straight line is drawn as a dashed or even dotted line despite never raising the tip of the stylus from the screen.

I've tested it with evdev and when I have my hand on the screen, the IPTSD virtual device is sending BTN_TOUCH with value of 0 followed by a value of 1 after a fraction of a second. The ABS_PRESSURE also follows that pattern. If there are ABS_X or ABS_Y events between the flips, the drawn line would be dashed, as the driver sends an information that I've moved the pen mid-air.

I've added debounce logic to the driver with a timeout of 0.07s. After those changes, everything seems to work fine. The 0.07s is a value that is good enough for me. It does not seem to affect my writing and my original issue almost does not happen.

I've published the changes in a fork that I am not planning to make a PR for. My workaround seems hacky, is specific to the issue I am having and is using values that work for me and the device I am working on. The real issue may be with the hardware or the wacom driver and if so, should be fixed there. If the maintainers decide to merge it or build on top of it, I won't object though.

Having that said, if you want to test the fork for yourself, here it is: https://github.com/wvffle/iptsd

@ECO1AI
Copy link

ECO1AI commented Oct 2, 2024

I've published the changes in a fork that I am not planning to make a PR for. My workaround seems hacky, is specific to the issue I am having and is using values that work for me and the device I am working on.

if you are willing:
you could add ifdefined to that logic and add an option to the config file.
this way it becomes a feature with changeable parameters (might require some work, but should be doable)
in any case, i appreciate your work and i am going to try it

@ECO1AI
Copy link

ECO1AI commented Oct 2, 2024

@sound-friend @Ramen-LadyHKG does disabling touch also disables stylus or limits its functionality?

@StollD
Copy link
Member

StollD commented Oct 2, 2024

The SP7 I am working on has a glass screen cover which might be the reason for my issues.

Have you tried lowering this value? https://github.com/linux-surface/iptsd/blob/master/etc/iptsd.conf#L157 If the "signal strength" from the stylus is less than this, the signals are ignored and the virtual stylus will emit a lifted event.

it seems for some reasons config file /etc/iptsd.conf is ignored by IPTSD

Could you please post your iptsd.conf?

@wvffle
Copy link

wvffle commented Oct 3, 2024

Have you tried lowering this value? https://github.com/linux-surface/iptsd/blob/master/etc/iptsd.conf#L157 If the "signal strength" from the stylus is less than this, the signals are ignored and the virtual stylus will emit a lifted event.

It might be good to add descriptions to those options. Unfortunately, lowering the value does not resolve my problems. I've tested values 25, 15 and 1 and in every single case it behaved identically.

As @ECO1AI suggested, I've added a LiftTimeout config option under [Stylus] section to my fork, so others do not need to recompile it.

@ECO1AI
Copy link

ECO1AI commented Oct 6, 2024

The SP7 I am working on has a glass screen cover which might be the reason for my issues.

thanks for reminding me
i also have a protective class installed on my screen
what i have understood is that i need to re-calibrate heat-map;
since touch become unresponsive till i touch the metallic body of the surface where my thumb is detected but not consistent specially when i slide my thumb. smaller contact area's are barely recognized.

Could you please post your iptsd.conf?

here you go:
this is the output of cat /etc/iptsd.conf > iptsd.txt
iptsd.txt

is there anyway of visualizing heat-map in real time?
or even a way to debug raw input

@ECO1AI
Copy link

ECO1AI commented Oct 15, 2024

@wvffle
try this config file and tell me what changed in touch:
iptsd.txt
it should help alot

@NXTler
Copy link

NXTler commented Oct 30, 2024

Has there been a fix for this issue?

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

7 participants