[SRU] On a laptop with NVIDIA graphics and touchscreen, touchscreen gets disabled after resume from suspend in Xorg session

Bug #2087831 reported by Kai-Chuan Hsieh
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mutter
Fix Released
Unknown
OEM Priority Project
In Progress
High
Yao Wei
mutter (Ubuntu)
Status tracked in Plucky
Noble
In Progress
Undecided
Yao Wei
Oracular
In Progress
Undecided
Yao Wei
Plucky
Fix Committed
Undecided
Yao Wei

Bug Description

[ Impact ]

 * When user using Ubuntu 24.04, 24.10 with NVIDIA GPU and touchscreen, touchscreen becomes unresponsive after suspend/resume.

 * This patch addresses the problem by synchronizing enabled state of touchscreen when the device adds into device mapper (which maps touchscreen and display).

[ Test Plan ]

 * Find a system which the above issue can be reproduced

 * Install updated mutter, restart the system and do suspend/resume in the desktop, the touchscreen should be active.

[ Where problems could occur ]

 * Touchscreen-related function might be broken.

 * Any SRU-related problems may happen.

[ Original report ]
The touchscreen has no function after suspend resume in Xorg session.
---
ProblemType: Bug
ApportVersion: 2.28.1-0ubuntu3.1
Architecture: amd64
CasperMD5CheckMismatches: ./.disk/casper-uuid-generic ./casper/initrd ./casper/minimal.standard.live.hotfix.size ./casper/minimal.standard.live.size ./casper/minimal.manifest ./casper/minimal.standard.manifest ./casper/minimal.standard.size ./casper/minimal.hotfix.size ./casper/minimal.standard.live.hotfix.squashfs ./casper/minimal.standard.hotfix.squashfs ./casper/minimal.standard.hotfix.size ./casper/minimal.hotfix.squashfs ./casper/minimal.standard.live.manifest ./casper/minimal.size ./boot/grub/grub.cfg
CasperMD5CheckResult: fail
CurrentDesktop: ubuntu:GNOME
DisplayManager: gdm3
DistributionChannelDescriptor:
 # This is the distribution channel descriptor for Ubuntu 24.04 for Dell
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-noble-hwe-20241111-227
DistroRelease: Ubuntu 24.04
InstallationDate: Installed on 2024-11-11 (0 days ago)
InstallationMedia: Ubuntu OEM 24.04.1 LTS "Noble Numbat" - Release amd64 (20241110)
NonfreeKernelModules: nvidia_modeset nvidia
Package: gnome-shell 46.0-0ubuntu6~24.04.5 [origin: unknown]
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 6.8.0-48.48-generic 6.8.12
RelatedPackageVersions: mutter-common 46.2-1ubuntu0.24.04.2
Tags: noble third-party-packages
Uname: Linux 6.8.0-48-generic x86_64
UnreportableReason: This does not seem to be an official Ubuntu package. Please retry after updating the indexes of available packages, if that does not work then remove related third party packages and try again.
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sudo users
_MarkForUpload: True

Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote : Dependencies.txt

apport information

tags: added: apport-collected noble third-party-packages
description: updated
Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote : GsettingsChanges.txt

apport information

Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote : ProcEnviron.txt

apport information

Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote : ShellJournal.txt

apport information

tags: added: jira-somerville-1244 oem-priority
summary: - touchscreen has no response after suspend resume in Xorg session
+ touchscreen has no response after resume from suspend in Xorg session
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: touchscreen has no response after resume from suspend in Xorg session

Please try a different Xorg shell to prove the problem is not GNOME. Please also verify the problem does not exist in Wayland sessions.

affects: gnome-shell (Ubuntu) → xserver-xorg-input-libinput (Ubuntu)
Changed in xserver-xorg-input-libinput (Ubuntu):
status: New → Incomplete
Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote :

The issue is not able to reproduce in Wayland.

Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

Trying to test with vanilla Xorg by stopping gdm3 and using Xorg by itself:

0. Install xterm since we are going to use it later.

1. Switch to tty3 by using Ctrl-Alt-F3
sudo systemctl stop gdm3
sudo Xorg &
DISPLAY=:0 xterm

2. Switch to blank Xorg session using Ctrl-Alt-F1, then in xterm run xev

Check touchscreen function: the cursor should follow the touch screen, and if touching the xev test region, xterm should display some messages.

3. Switch xev to background by Ctrl-Z then bg command, then suspend system:
systemctl suspend

4. Resume after a while and check touchscreen

On one of our DUTs, the issue is not reproducible with the above configurations.

Changed in xserver-xorg-input-libinput (Ubuntu):
status: Incomplete → New
Revision history for this message
loukangzhen (kangzhen) wrote :

May we have some progress, because this issue is blocking our factory shipping.

Revision history for this message
Alessandro Astone (aleasto) wrote :
Revision history for this message
loukangzhen (kangzhen) wrote (last edit ):

To #10, thanks for feedback.
But the issue you mentioned it's phenomenon is different with this one.

In lp:2063005, the touchscreen is responsive when touch it, and we have KB article on Ubuntu wiki to address it, so it is not shipping blocker.

But this issue is touch screen totally not respond after suspend and resume(before suspend it has response), it is more critical, we are not sure if the root cause is same as lp:2063005 ?

Revision history for this message
Alessandro Astone (aleasto) wrote :

So is this bug your only blocker for touchscreen on Xorg?

Revision history for this message
loukangzhen (kangzhen) wrote :

To #12
Yes, right.

Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

We found out that the touchscreen is disabled by libinput after suspend/resume:
Check the following properties (the touchscreen is id=10 for our DUT, see `xinput list`)

before suspend:
$ xinput list-props 10
Device 'CUST0000:00 0EEF:C003':
 [...snip...]
 libinput Send Events Mode Enabled (328): 0, 0

after suspend:
$ xinput list-props 10
Device 'CUST0000:00 0EEF:C003':
 [...snip...]
 libinput Send Events Mode Enabled (328): 1, 0

According to libinput documentation https://wayland.freedesktop.org/libinput/doc/latest/configuration.html, Send Events Mode is used to turn on/off the device input in libinput.

The touchscreen function can be re-enabled after suspend, by entering the following command:
  xinput set-prop 10 328 0 0

We are still unknown why the device is turned off after suspend.

Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

Furtuer investigation turned out that there's something to do with NVIDIA driver, that when starting suspend, the display would wake for a moment before really entering suspend.

When display is turned on or turned off, gnome-shell files an event to enable/disable touchscreen, so that the touchscreen cannot be activated erroneously. However, with above issue, when the display is awoken before suspend, gnome-shell enables the touchscreen and considered it enabled even after the suspend, when it is actually disabled. The state can be re-synchronized when the screen goes blank again (for example lock the screen, wait the screen to go blank and wake it back up)

This can be addressed in two ways:
* gnome-shell or mutter (unsure which) to add a workaround for nvidia driver issue
* nvidia to fix the screen wake before suspend issue

This issue cannot be reproduced on the same DUT when `prime-select intel` to force using only Intel GPU and in Xorg mode.

Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

This issue can be linked to Bug #1952823 for NVIDIA driver, except the different version.

Yao Wei (medicalwei)
summary: - touchscreen has no response after resume from suspend in Xorg session
+ On a laptop with NVIDIA graphics and touchscreen, touchscreen gets
+ disabled after resume from suspend in Xorg session
Revision history for this message
loukangzhen (kangzhen) wrote : Re: On a laptop with NVIDIA graphics and touchscreen, touchscreen gets disabled after resume from suspend in Xorg session

@Yao, thanks for the investigation.
As you know, the screen flicker when entering suspend exists for several years/generations, from this comment, it is not an issue. https://bugs.launchpad.net/somerville/+bug/2007387/comments/2

I also tried with same Nvidia driver version, this issue only happens on 24.04, not 22.04, nor 23.10. So looks like it's gnome changed behavior recently, and this should be root cause.

Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

On Ubuntu 23.10 VNP, could you confirm that NVIDIA driver is installed in the system?
They might be running on Nouveau especially the apt repository for 23.10 is now unavailable.

I can reproduce the issue on 23.10 after changing sources to old-releases.ubuntu.com, then install NVIDIA driver using ubuntu-drivers.

Revision history for this message
loukangzhen (kangzhen) wrote :

Sorry, my fault, after double check with old-releases source, I can reproduce on 23.10 and 23.04, but cannot reproduce on 22.10.

22.10: kernel version: 5.19.0-21-generic, nvidia driver version:535.54.03, gnome-shell version: 43.0
23.04: kernel version: 6.2.0-20-generic, nvidia driver version:535.146.02, gnome-shell version: 44.0

Seems the change happened between gnome-shell 43.0 and 44.0.

Revision history for this message
Yao Wei (medicalwei) wrote :

Note about enabling/disabling input on Mutter side, it is under `mutter/src/backends/meta-input-mapper.c:input_mapper_power_save_mode_changed_cb`

I will start tracing from there and see whether there's changes between GNOME versions.

Yao Wei (medicalwei)
Changed in xserver-xorg-input-libinput (Ubuntu):
status: New → Invalid
Changed in nvidia-graphics-drivers-550 (Ubuntu):
status: New → Invalid
Changed in gnome-shell (Ubuntu):
status: New → Invalid
Changed in xserver-xorg-input-libinput:
importance: Unknown → Undecided
status: Unknown → New
status: New → Invalid
affects: xserver-xorg-input-libinput → mutter
Changed in mutter:
importance: Undecided → Unknown
status: Invalid → Unknown
Yao Wei (medicalwei)
no longer affects: nvidia-graphics-drivers-550 (Ubuntu)
no longer affects: gnome-shell (Ubuntu)
Yao Wei (medicalwei)
Changed in mutter (Ubuntu):
status: New → In Progress
Changed in oem-priority:
status: New → In Progress
assignee: nobody → Yao Wei (medicalwei)
Changed in mutter (Ubuntu):
assignee: nobody → Yao Wei (medicalwei)
Changed in mutter:
status: Unknown → New
Revision history for this message
Yao Wei (medicalwei) wrote :
Changed in mutter (Ubuntu):
milestone: none → ubuntu-25.04
Changed in mutter:
status: New → Fix Released
Yao Wei (medicalwei)
summary: - On a laptop with NVIDIA graphics and touchscreen, touchscreen gets
+ [SRU] On a laptop with NVIDIA graphics and touchscreen, touchscreen gets
disabled after resume from suspend in Xorg session
Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

I filed a Salsa MR for noble and oracular (as mutter does not have MRE), and we should be waiting for next point release of GNOME 47 for fixing the issue in plucky:

noble: https://salsa.debian.org/gnome-team/mutter/-/merge_requests/138
oracular: https://salsa.debian.org/gnome-team/mutter/-/merge_requests/139

description: updated
Yao Wei (medicalwei)
Changed in oem-priority:
importance: Undecided → High
tags: added: fixed-in-mutter-48.beta fixed-upstream
Changed in mutter (Ubuntu):
status: In Progress → Fix Committed
no longer affects: xserver-xorg-input-libinput (Ubuntu)
Changed in mutter (Ubuntu Oracular):
assignee: nobody → Yao Wei (medicalwei)
milestone: none → oracular-updates
Changed in mutter (Ubuntu Noble):
milestone: none → noble-updates
assignee: nobody → Yao Wei (medicalwei)
Changed in mutter (Ubuntu Oracular):
status: New → In Progress
Changed in mutter (Ubuntu Noble):
status: New → In Progress
Revision history for this message
Vladimir Petko (vpa1977) wrote :

Hi,

I have unsubscribed sponsors as it seems that Ubuntu-specific fix for the stable releases is not yet available.

Best Regards,
 Vladimir.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes I sponsored the MR this week. Sorry I didn't notice the subscription here.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.