Auto-rotate is not working properly when system is booted up while not in its regular orientation

Bug #1850886 reported by Grace Icay
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNOME Shell
New
Undecided
Unassigned
OEM Priority Project
Confirmed
Medium
Bin Li
gdm
New
Undecided
Unassigned

Bug Description

[RELEASE VERSION]
Description: Ubuntu 18.04.3 LTS
Release: 18.04

[PACKAGE VERSION]
linux-oem:
  Installed: 4.15.0.1057.61
  Candidate: 4.15.0.1057.61
  Version table:
 *** 4.15.0.1057.61 500
        500 http://jp.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     4.15.0.1004.2 500
        500 http://jp.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

[EXPECTED OUTPUT]
Upon boot up with auto-rotation enabled, display should show the proper screen orientation of the system accordingly

[ACTUAL OUTPUT]
Auto-rotation is not working properly when system is booted up while not in its regular orientation

[STEPS]
1. Make sure auto-rotation is enabled on the system
2. Before turning the system on, put it on tablet mode, with the inverted landscape rotation (the top part/the part with the camera is adjacent to the surface). The system should follow this orientation when the login screen appears.
3. Login to the system
4. Switch to the clam shell mode. The display suddenly becomes inverted/the opposite direction of the expected output.
5. Switch back to the tablet mode. The display also ends up being inverted/in the opposite direction of the expected output

[REMARKS]
*Using WHL
*The system seems to be setting the orientation according to the orientation during boot up

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: linux-oem 4.15.0.1057.61
ProcVersionSignature: Ubuntu 5.0.0-1024.27-oem-osp1 5.0.21
Uname: Linux 5.0.0-1024-oem-osp1 x86_64
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Nov 1 14:23:14 2019
DistributionChannelDescriptor:
 # This is the distribution channel descriptor for the OEM CDs
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-sutton-bionic-amd64-20190722-12+sutton-dijkstra-bionic-amd64+iso
InstallationDate: Installed on 2019-07-25 (98 days ago)
InstallationMedia: Ubuntu 18.04 "Bionic" - Build amd64 LIVE Binary 20190722-05:40
SourcePackage: linux-meta-oem
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Grace Icay (gicay) wrote :
Revision history for this message
Bin Li (binli) wrote :

Grace,

 Thanks for your report. I could reproduce this issue.
 And I found the screen position is right, I could open the Nautilus, click the top-right corner to active the menu, but the display is invert. It should be a bug. I need spend more time on it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-meta-oem (Ubuntu):
status: New → Confirmed
Revision history for this message
Bin Li (binli) wrote :

I did more debug. I found in the GNOME desktop the dbus message is correct.

When I boot up from bottom-up mode, the value of net.hadess.SensorPorxy.AccelerometerOrientation is "bottom-up", after that, I change to normal mode, I found the value is "normal". But the screen is totally revert.

I tried to use xrandr to rotate the screen.
$ xrandr --output eDP-1 --rotate inverted

Although the screen show correctly, but I found the mouse and touch screen is still keep inverted.

I thought this issue is not related to kernel, cause we could got correct value from AccelerometerProxy, I doubt the gnome-shell could handle it correctly.

Thanks!

Revision history for this message
Bin Li (binli) wrote :

I doubt the gnome-shell couldn't handle it correctly. :)

Revision history for this message
Bin Li (binli) wrote :

It's a generic bug, I reproduced it on 18.04.3 with 5.0.0-32 kernel.

Revision history for this message
Grace Icay (gicay) wrote :

Hi Bin Li,

Thanks for the updates. Could you specify a target date for the bug fix?

Thank you!

Revision history for this message
Bin Li (binli) wrote :

Grace,

I tried the latest gnome-shell 3.34.1 on 5.2.0 kernel, this issue is fixed. So I thought the upstream already met this issue before.

I will need more time to find the root cause and patches.

It's a little hard to have a target date for me to resolve this issue, it also depends the people from the ubuntu desktop team, I will do my best and hope find related patches at this week.

Thanks!

Revision history for this message
Grace Icay (gicay) wrote :

Hi Bin,

Ok, I'll take note of this. Thank you very much!

Rex Tsai (chihchun)
affects: linux-meta-oem (Ubuntu) → oem-priority
Changed in oem-priority:
importance: Undecided → Medium
assignee: nobody → Bin Li (binli)
Revision history for this message
Bin Li (binli) wrote :

Today I tried the gnome-shell 3.30 and mutter 3.30, I could reproduce this issue. And the mutter did handle the display things, so it should be related to mutter.

It's a similar issue in below link, it says 3.32.1 don't have below issue. I will verify it.

https://gitlab.gnome.org/GNOME/mutter/issues/514

The code changed a lot from 3.28 to 3.32, I need more time to debug it.

Revision history for this message
Grace Icay (gicay) wrote :

Hi Bin,

Can I please get an update on the status of this bug?

Thank you very much.

Revision history for this message
Bin Li (binli) wrote :

@Grace,

 We discussed with PM, this issue is lower priority, we will report a upstream bug for it first.
 I also tried to read the source code and structure of mutter, need more time to debug it.
 Thanks!

Revision history for this message
Grace Icay (gicay) wrote :

Hi Bin,

Thanks for the update! This is noted.

Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Grace Icay (gicay) wrote :

Hi Bin,

I read in the issue's comment that it may not be related to mutter. Does this mean the bug is not affected by Gnome Shell? Or is this still subject for further checking?

Revision history for this message
Bin Li (binli) wrote :

Grace,

 Might be gnome-shell, but I prefer to the mutter, we need further checking. Thanks!

Revision history for this message
Bin Li (binli) wrote :

I debugged it, found that by default it will use gdm-wayland-session in greeter UI.

/usr/lib/gdm3/gdm-wayland-session gnome-session --autostart /usr/share/gdm/greeter/autostart

After login the system, it will use the gdm-x-session, so this might be the root cause.

When I try to disable Wayland in gdm3, this issue is fixed, because it will use gdm-x-session all the time.

cat /etc/gdm3/daemon.conf
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

Revision history for this message
Grace Icay (gicay) wrote :

Hi Bin,

Thanks for your update. Will you be forwarding this bug to the people concerned with gdm to find a permanent fix?

Revision history for this message
Jason Yen (jasonyen) wrote :

Copy the comment from mutter bug.

I debugged it, found that by default it will use gdm-wayland-session in greeter UI.
/usr/lib/gdm3/gdm-wayland-session gnome-session --autostart /usr/share/gdm/greeter/autostart
After login the system, it will change to use the gdm-x-session, so this might be the root cause.
When I try to disable Wayland in gdm3, this issue is fixed, because it will use gdm-x-session all the time. So it might be a gdm3 issue.
cat /etc/gdm3/daemon.conf
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

Revision history for this message
Grace Icay (gicay) wrote :

Hi Jason,

Will you be forwarding this bug to the people concerned with gdm to find a permanent fix? Or should we simply apply the given debug methods on our system?

Additionally, will there be any affected drivers, or is this simply related to the greeter UI?

Revision history for this message
Bin Li (binli) wrote :

@grace,

 This is not a real fix, so we couldn't just disable it in upstream, it's just a workaround. Thanks!

Revision history for this message
Grace Icay (gicay) wrote :

@Bin,

I see. I'll just await for further updates on this then. Thank you very much!

Rex Tsai (chihchun)
Changed in oem-priority:
importance: Medium → High
Rex Tsai (chihchun)
Changed in oem-priority:
importance: High → Medium
Revision history for this message
Grace Icay (gicay) wrote :

Bug has also been observed in 18.04.04 LTS, 19.10 and 20.04 (daily build)

Rex Tsai (chihchun)
tags: added: oem-priority
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.