linux-surface icon indicating copy to clipboard operation
linux-surface copied to clipboard

Ghost touches since latest kernel upgrade and after resume from sleep

Open lviggiani opened this issue 4 years ago • 32 comments

Sine latest kernel upgrade, I'm experiencing ghost / fake input. For example, I'm typing in terminal and all the above text gets selected or I'm in Fireforx and suddenly the address bar gets focus and the on screen keyboard appears or the browser navigates backward etc This happens always and only when resuming from sleep

lviggiani avatar Mar 18 '21 17:03 lviggiani

dmesg.log jourlanctl.log

Also, sometimes after reboot, the touch screen won't work and in other cases by using the pen causes the gnome shell to crash (Wayland session)- I never experienced any of those issues in the past. Attached dmesg.log and journalctl.log refers to a non working touchscreen / pen after reboot. Prior to this reboot I was in a situation where after resume from sleep I was having ghost touches. I hope this helps

lviggiani avatar Mar 18 '21 17:03 lviggiani

Regarding the first issue: Does running sudo iptsd-reset-sensor stop the ghost touches? (You need the latest iptsd version for that, 0.4)

Regarding the second issue: It seems that iptsd starts, but then fails because the UAPI is not fully ready yet. /dev/ipts/[0-8] exist, but it fails to open /dev/ipts/9. It should be resolvable by having the iptsd service definition depend on /dev/ipts/15 instead of /dev/ipts/0. Interesting that noone ever hit this before... Your systemd must be cursed :P

StollD avatar Mar 18 '21 18:03 StollD

Hi, running sudo iptsd-reset-sensor seems to do the trick thanks! For the second issue, is it something I can tweak in systemd service file or is it something you need to do at source level?

lviggiani avatar Mar 19 '21 16:03 lviggiani

Also, after linux 5.11.7 the issue seems to be gone away. I'll keep trying in the next few days and close the issue is everything goes well

lviggiani avatar Mar 19 '21 17:03 lviggiani

For the second issue, is it something I can tweak in systemd service file or is it something you need to do at source level?

You can try changing all mentions of dev-ipts-0.device in /usr/lib/systemd/system/iptsd.service to dev-ipts-15.device. Then do a reboot and see if the issue still occurs.

StollD avatar Mar 20 '21 07:03 StollD

Also, after linux 5.11.7 the issue seems to be gone away. I'll keep trying in the next few days and close the issue is everything goes well

Unfortunately ghost touches are back, however sudo iptsd-reset-sensor works. Maybe it would be a good idea ti automatically execute it on resume?

lviggiani avatar Mar 20 '21 16:03 lviggiani

For the second issue, is it something I can tweak in systemd service file or is it something you need to do at source level?

You can try changing all mentions of dev-ipts-0.device in /usr/lib/systemd/system/iptsd.service to dev-ipts-15.device. Then do a reboot and see if the issue still occurs.

Thanks, I'm trying this now as it also happens (randomly) that the touchscreen stops working after resume. Let's see if that solves even this issue.

lviggiani avatar Mar 21 '21 17:03 lviggiani

Hi, unfortunately the thing is still unstable... today I got ghost touches after resume, I ran sudo iptsd-reset-sensor. The ghost touches disappeared but the touchscreen / pen stopped working as well :(

lviggiani avatar Mar 24 '21 07:03 lviggiani

I've also noticed that it seems to happen more frequently when you change power source while in sleep. For example, yesterday night I put the computer in sleep while running on battery then this morning I plugged get external power in before waking the computer up and I got the issue

lviggiani avatar Mar 24 '21 08:03 lviggiani

Hi, unfortunately the thing is still unstable... today I got ghost touches after resume, I ran sudo iptsd-reset-sensor. The ghost touches disappeared but the touchscreen / pen stopped working as well :(

Please post your dmesg.

Also, we cant really do anything about the ghost touches. The problem is that the touchscreen automatically calibrates itself sometimes, and we have no idea how to send it proper calibration data. The sensor reset is a mitigation that we figured out, but it doesnt solve the actual problem.

StollD avatar Mar 24 '21 10:03 StollD

Hi I have another bad news :( (sorry about that). On Arch after updating to gnome-desktop-40 (not full gnome 40 yet, only some "pieces" received so far), the touch screen is working whereas pen is not working. This is always reproducible. Attached is dmesg.log dmesg

Again.... very strange: after a few minutes after reboot, the pen started working. Tried three times (three reboots) and always got same behaviour

lviggiani avatar Mar 25 '21 20:03 lviggiani

I found other conditions that trigger this:

1. Static-electrified hand

https://user-images.githubusercontent.com/25646384/112932266-9cf5c980-90eb-11eb-8342-52c7ade47fec.mp4

I kept charging my body with static electricity while using the touchscreen. After a while, the touchscreen calibrates itself to produce ghost touches. You can do this with some hair + a balloon, a van de graaff generator, or an ionizing hair dryer.

When I stop doing that, the sensor calibration take a long time to return to normal. I think it's a bit faster when I ground myself on a faucet first.

This also affects the touchpad. The interference is expected though.

Do you experience the same pattern of ghost touches?

2. Resetting the sensor with a finger still pressed down

https://user-images.githubusercontent.com/25646384/112932273-9ebf8d00-90eb-11eb-9ff7-215f1a02a72f.mp4

(around 0:53 for when I reset it without touching it)

It seems like the sensor reset just throws away the calibration data and just recalculates them depending on what is happening on startup.

Are you using resuming from sleep by opening the touch cover as a lid? It might be pressing on the touchscreen a bit, causing the calibration to be different.

I've also noticed that it seems to happen more frequently when you change power source while in sleep [...]

What happens when you try the following experiment:

  1. Wake the computer from sleep
  2. Ensure the type cover is down
  3. Place one of your hands on a faucet or some other ground, and keep it firmly pressed there
  4. Move your other hand along the touchscreen with your other hand and try to wipe and go over the entire area
  5. Touch the metal on the back
  6. Lift both hands into the air
  7. Run sudo iptsd-reset-sensor without touching the touchscreen
  8. Wait 1 second
  9. Use the touchscreen again

Does the problem ever occur when you ground yourself and the touchscreen like this?

Also, we cant really do anything about the ghost touches

We could do something about them in multitouch mode. The simplest solution would be to assume the noise floor is higher, and subtract a larger value. This would be at the cost of ignoring lighter presses and losing accuracy. We could also tune the constants in libqzed to reduce the problem

danielzgtg avatar Mar 30 '21 04:03 danielzgtg

That's interesting! Actually it's been quite dry weather in the past few days (around 30% relative humidity). Today it's not happening, however the very first time I'll see the issue again I'll try the experiment and give a feedback. Thanks!

lviggiani avatar Mar 30 '21 17:03 lviggiani

I found other conditions that trigger this:

1. Static-electrified hand

video1.mp4

I kept charging my body with static electricity while using the touchscreen. After a while, the touchscreen calibrates itself to produce ghost touches. You can do this with some hair + a balloon, a van de graaff generator, or an ionizing hair dryer.

When I stop doing that, the sensor calibration take a long time to return to normal. I think it's a bit faster when I ground myself on a faucet first.

This also affects the touchpad. The interference is expected though.

Do you experience the same pattern of ghost touches?

2. Resetting the sensor with a finger still pressed down

video2.mp4

(around 0:53 for when I reset it without touching it)

It seems like the sensor reset just throws away the calibration data and just recalculates them depending on what is happening on startup.

Are you using resuming from sleep by opening the touch cover as a lid? It might be pressing on the touchscreen a bit, causing the calibration to be different.

I've also noticed that it seems to happen more frequently when you change power source while in sleep [...]

What happens when you try the following experiment:

1. Wake the computer from sleep

2. Ensure the type cover is down

3. Place one of your hands on a faucet or some other ground, and keep it firmly pressed there

4. Move your other hand along the touchscreen with your other hand and try to wipe and go over the entire area

5. Touch the metal on the back

6. Lift both hands into the air

7. Run `sudo iptsd-reset-sensor` without touching the touchscreen

8. Wait 1 second

9. Use the touchscreen again

Does the problem ever occur when you ground yourself and the touchscreen like this?

Also, we cant really do anything about the ghost touches

We could do something about them in multitouch mode. The simplest solution would be to assume the noise floor is higher, and subtract a larger value. This would be at the cost of ignoring lighter presses and losing accuracy. We could also tune the constants in libqzed to reduce the problem

Hi, Ive tried the proedure desiribed in this post and ghost touches stop but the touch screen stops working too

lviggiani avatar Apr 05 '21 11:04 lviggiani

I can also confirm that the issue only occurs when the external power is connected. Perhaps it introduces static electricity?

lviggiani avatar Apr 05 '21 16:04 lviggiani

I only have this issue on my SP4 when the Surface Typecover is attached and the tablet is plugged in. If I detach the keyboard, plug the tablet in, then put the tablet to sleep, it wakes up just fine every time. However, if the keyboard is attached prior to putting the tablet to sleep and plugging it in, once the tablet wakes, I get the touch screen issues described in this thread almost every time.

k4ever avatar Apr 20 '21 04:04 k4ever

I must admit, I have the same issue all the time. This led me to the action, to clean-install Manjaro after years of flawless usage. It was re-introduced the moment I installed the surface-kernel and it's add-ons. libwacom-surface is suspect to me, but this is esotheric.I have no idea.

Augustronic avatar Apr 29 '21 21:04 Augustronic

Btw, I am able to write this with my Bluetooth mouse switched off at boot.

Augustronic avatar Apr 29 '21 21:04 Augustronic

Other than that my Surface Book 2 is unusable in Manjaro. Having Windows alongside, everything is fine.

Augustronic avatar Apr 29 '21 21:04 Augustronic

I have the same issue on surface pro 4.

Bodhi-Teraguchi avatar May 17 '21 03:05 Bodhi-Teraguchi

Same here, but I have been having them for a lot longer.

fesdonomist avatar Jun 01 '21 11:06 fesdonomist

Hello everyone,

I can also confirm the problem. There is a lot of phantom movement and input even though neither the keyboard nor the pen is used. I'm using a SP4 with 16Gb Ram. You have to say that my device also has the flicker problem as soon as it gets very warm. The on-screen keyboard does not work either. There is a double click and missing entries. Unlike what is described, it does not feel very airy. I tested FEDORA34 and UBUNTU 04/20. Both the same problem. This means that the PEN and TOUCH options cannot be used.

dossidr avatar Oct 24 '21 07:10 dossidr

Hello everyone,

I can also confirm the problem. There is a lot of phantom movement and input even though neither the keyboard nor the pen is used. I'm using a SP4 with 16Gb Ram. You have to say that my device also has the flicker problem as soon as it gets very warm. The on-screen keyboard does not work either. There is a double click and missing entries. Unlike what is described, it does not feel very airy. I tested FEDORA34 and UBUNTU 04/20. Both the same problem. This means that the PEN and TOUCH options cannot be used.

Same device but the pen works, random clicks happen when not touching it and when holding my finger on it just goes haywire

MichelJonkman avatar Nov 17 '21 21:11 MichelJonkman

Sadly I can confirm this for my Surface Pro 4 with Manjaro.

Using sudo iptsd-reset-sensor stops the issue, but also disables the touchscreen completely. It starts works again after a reboot, but continues with the ghost touches. It does not matter if I plug in/unplug the power or the keyboard, it happens in any case.

The strange thing: sometimes (very rarely) after a reboot it does work for a few hours. But lately I could not use the touchscreen at all, even after many reboots.

dr-waterstorm avatar Dec 02 '21 07:12 dr-waterstorm

Same problem here on Surface Pro 2017 on Arch Linux.

MeisterLLD avatar Feb 05 '22 14:02 MeisterLLD

I do also have this issue on my Surface Pro 4 with latest kernel. Sometimes it is gone after a reboot and/or detaching and reconnecting power supply and/or keyboard. However, I have not yet discovered a pattern that is always fixing the issue. Often, I just have to disable touch via sudo iptsd-reset-sensor and live with it.

Though, if I boot to Windows the problem does not occur at all. Consequently, I guess that the induced static electricity is at least somehow handled in Windows, such that it is not problematic.

It would already be very beneficial if there is a way to enable touch again after it has been disabled via sudo iptsd-reset-sensor.

frederikb96 avatar Mar 25 '22 19:03 frederikb96

I found a way to improve my situation significantly. As reported in #389, it is possible to change the touch threshold in /etc/ipts.conf. I uncommented the line and tested values between 10 and 40. 10 let to the default result with ghost touches everywhere, and with 40 the touch was barely recognizable. However, 20 worked out really well for me, and it is much more usable this way, also way less accidental double taps. A reboot was necessary to apply the changes.

frederikb96 avatar Mar 25 '22 20:03 frederikb96

This worked for me.

gitnoob78 avatar Jul 09 '22 15:07 gitnoob78

FWIW, I too have this issue on an SP4, but editing /etc/ipts.conf's TouchThreshold to 18 worked for my device.

SeongGino avatar Aug 14 '22 06:08 SeongGino

I do also have this issue on my Surface Pro 4 with latest kernel. Sometimes it is gone after a reboot and/or detaching and reconnecting power supply and/or keyboard. However, I have not yet discovered a pattern that is always fixing the issue. Often, I just have to disable touch via sudo iptsd-reset-sensor and live with it.

Though, if I boot to Windows the problem does not occur at all. Consequently, I guess that the induced static electricity is at least somehow handled in Windows, such that it is not problematic.

It would already be very beneficial if there is a way to enable touch again after it has been disabled via sudo iptsd-reset-sensor.

I discovered that by using sudo systemctl stop iptsd.service and sudo systemctl start iptsd.service it is indeed possible to stop and start without rebooting.

However, sometimes it goes to a state where starting the service is always failing after 5s with Code=exited, status=237/KEYRING. In this case, only a reboot helps...

frederikb96 avatar Aug 25 '22 22:08 frederikb96