linux-surface / linux-surface

Linux Kernel for Surface Devices
4.53k stars 202 forks source link

Firefox does not detect touch input after sleep #1402

Open brokoli18 opened 2 months ago

brokoli18 commented 2 months ago

I have a fairly strange bug when I use firefox, when I first boot the system everything works without a problem, however after sleep (I think) only firefox does not detect any touch input. All other applications I try still work. I would have to restart firefox to get touch to work.

Now I think that this is after sleep, but again I am pretty sure that sometimes my laptop will sleep and firefox will still work, but then sometimes it will sleep and I get the above issue. Perhaps its due to the fact that sleeping for longer makes it go into a deep sleep?

I am using wayland on my system and start firefox with wayland enabled too (MOZ_ENABLE_WAYLAND=1). Is there something else I need to do to get touchscreen working properly?

Environment

`dmesg` output I am not sure if this log is relevant but this is what I have in dmesg after 1 sleep. ``` [Mon Mar 18 11:33:51 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: Stopping IPTS [39/1483] [Mon Mar 18 11:33:51 2024] intel_pch_thermal 0000:00:14.2: CPU-PCH is cool [31C] [Mon Mar 18 11:33:53 2024] pcieport 0000:00:1c.0: Intel SPT PCH root port ACS workaround enabled [Mon Mar 18 11:33:53 2024] pcieport 0000:00:1d.0: Intel SPT PCH root port ACS workaround enabled [Mon Mar 18 11:33:53 2024] surface_acpi_notify MSHW0091:00: rqst: device is suspended, not executing [Mon Mar 18 11:33:53 2024] surface_acpi_notify MSHW0091:00: ETWL(0x01, 0x02): RQST(2, 13, 1) error: 5 [Mon Mar 18 11:33:53 2024] surface_acpi_notify MSHW0091:00: rqst: device is suspended, not executing [Mon Mar 18 11:33:53 2024] surface_acpi_notify MSHW0091:00: ETWL(0x01, 0x02): RQST(2, 13, 1) error: 5 [Mon Mar 18 11:33:53 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: Starting IPTS [Mon Mar 18 11:33:53 2024] OOM killer enabled. [Mon Mar 18 11:33:53 2024] Restarting tasks ... [Mon Mar 18 11:33:53 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: IPTS EDS Version: 1 [Mon Mar 18 11:33:53 2024] done. [Mon Mar 18 11:33:53 2024] random: crng reseeded on system resumption [Mon Mar 18 11:33:53 2024] input: IPTS 045E:001F Touchscreen as /devices/pci0000:00/0000:00:16.4/0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04/0000:045E:001F.0006/input/input63 [Mon Mar 18 11:33:53 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: IPTS running in event mode [Mon Mar 18 11:33:53 2024] input: IPTS 045E:001F as /devices/pci0000:00/0000:00:16.4/0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04/0000:045E:001F.0006/input/input64 [Mon Mar 18 11:33:53 2024] PM: suspend exit [Mon Mar 18 11:33:54 2024] hid-generic 0000:045E:001F.0006: input,hidraw2: HID v0.00 Device [IPTS 045E:001F] on [Mon Mar 18 11:33:54 2024] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915]) [Mon Mar 18 11:33:54 2024] input: IPTS Touch as /devices/virtual/input/input65 [Mon Mar 18 11:33:54 2024] input: IPTS Stylus as /devices/virtual/input/input66 [Mon Mar 18 11:33:54 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: Stopping IPTS [Mon Mar 18 11:33:55 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: Starting IPTS [Mon Mar 18 11:33:55 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: IPTS EDS Version: 1 [Mon Mar 18 11:33:55 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: IPTS running in poll mode [Mon Mar 18 11:33:58 2024] mwifiex_pcie 0000:01:00.0: info: trying to associate to bssid dc:d9:ae:b2:2f:4d [Mon Mar 18 11:33:58 2024] mwifiex_pcie 0000:01:00.0: info: associated to bssid dc:d9:ae:b2:2f:4d successfully [Mon Mar 18 11:35:35 2024] mwifiex_pcie 0000:01:00.0: info: successfully disconnected from dc:d9:ae:b2:2f:4d: reason code 3 [Mon Mar 18 11:35:35 2024] PM: suspend entry (s2idle) [Mon Mar 18 11:35:35 2024] Filesystems sync: 0.019 seconds [Mon Mar 18 11:35:35 2024] Freezing user space processes [Mon Mar 18 11:35:35 2024] Freezing user space processes completed (elapsed 0.265 seconds) [Mon Mar 18 11:35:35 2024] OOM killer disabled. [Mon Mar 18 11:35:35 2024] Freezing remaining freezable tasks [Mon Mar 18 11:35:35 2024] Freezing remaining freezable tasks completed (elapsed 0.002 seconds) [Mon Mar 18 11:35:35 2024] printk: Suspending console(s) (use no_console_suspend to debug) [Mon Mar 18 11:35:35 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: Stopping IPTS [Mon Mar 18 11:35:35 2024] intel_pch_thermal 0000:00:14.2: CPU-PCH is cool [31C] [Mon Mar 18 11:35:41 2024] pcieport 0000:00:1c.0: Intel SPT PCH root port ACS workaround enabled [Mon Mar 18 11:35:41 2024] pcieport 0000:00:1d.0: Intel SPT PCH root port ACS workaround enabled [Mon Mar 18 11:35:41 2024] surface_acpi_notify MSHW0091:00: rqst: device is suspended, not executing [Mon Mar 18 11:35:41 2024] surface_acpi_notify MSHW0091:00: ETWL(0x01, 0x02): RQST(2, 13, 1) error: 5 [Mon Mar 18 11:35:41 2024] surface_acpi_notify MSHW0091:00: rqst: device is suspended, not executing [Mon Mar 18 11:35:41 2024] surface_acpi_notify MSHW0091:00: ETWL(0x01, 0x02): RQST(2, 13, 1) error: 5 [Mon Mar 18 11:35:41 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: Starting IPTS [Mon Mar 18 11:35:41 2024] OOM killer enabled. [Mon Mar 18 11:35:41 2024] Restarting tasks ... [Mon Mar 18 11:35:41 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: IPTS EDS Version: 1 [Mon Mar 18 11:35:41 2024] done. [Mon Mar 18 11:35:41 2024] random: crng reseeded on system resumption [Mon Mar 18 11:35:41 2024] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: IPTS running in event mode [Mon Mar 18 11:35:41 2024] input: IPTS 045E:001F Touchscreen as /devices/pci0000:00/0000:00:16.4/0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04/0000:045E:001F.0007/input/input67 [Mon Mar 18 11:35:41 2024] input: IPTS 045E:001F as /devices/pci0000:00/0000:00:16.4/0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04/0000:045E:001F.0007/input/input68 [Mon Mar 18 11:35:41 2024] hid-generic 0000:045E:001F.0007: input,hidraw1: HID v0.00 Device [IPTS 045E:001F] on [Mon Mar 18 11:35:41 2024] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915]) [Mon Mar 18 11:35:41 2024] PM: suspend exit [Mon Mar 18 11:35:41 2024] input: IPTS Touch as /devices/virtual/input/input69 ```
codechipped commented 1 month ago

@brokoli18 I apologize that what I'm about to give you isn't very useful. But the whole sleep/hibernate being buggy on the SL5s has been a thing (for over a year now). Edit: I just wanted to mention that this was not meant or said out of frustration or anything. I can't imagine something in crazy intermittent as these issues are easy to hunt down. I have nothing but gratitude for everyone who's been working on this project. Like stated, I've had this laptop for over a year now and it runs great 99% of the time.

Good news is, I've only had the fake shutdown/potential fire hazard situation occur once and this is only the second time I have run into issues with hibernate/sleep. Though, I don't run into it unless I'm I'm only experiencing that if I run a session in Gnome.

brokoli18 commented 1 month ago

Thanks for your response @codechipped . I have also had some general weirdness with sleep in the past, and not just with the surface kernel. However I have never seen just 1 application have this problem, the iptsd driver restarts back up fine and works in general and Ive had no instances of the tablet not actually going to sleep (recently). I was just wondering if tehre is perhaps another flag passed to firefox (or other wayland applications) that could help with this issue

plp13 commented 1 week ago

I have a similar problem on a Surface Laptop 4 running Arch Linux + Wayland + Gnome.

In my case, touchscreen stops working for all open windows, not just Firefox. Also, libinput debug-events shows touch events whenever I touch inside any of those windows, even though the windows themselves don't respond to said events.

Like in your case, shutting down and restarting an application restores touch support for it. And Gnome's shell doesn't seem to be affected by this problem at all.

I found that issuing the following will restore touch support for all running apps:

sudo rtcwake -m freeze -s 1

Does this work for you, as well?

brokoli18 commented 1 week ago

@plp13 I wanted to test your command but when I use my device recently the touchscreen has been working even after sleep. Perhaps a newer kernel has fixed it? I will keep an eye on it and if it happens again will try that