Xdcv: Changing display scale setting and reverting it fails

Bug #2020782 reported by Fabio Augusto Miranda Martins
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mutter (Ubuntu)
In Progress
Undecided
Daniel van Vugt

Bug Description

In Amazon Workspaces running Ubuntu 22.04, when attempting to change the Scale in the Gnome Display settings, if you click on a different scale (i.e. changing from 100% to 200%) and hitting apply, it will bring up a prompt asking if you want to keep or revert the changes and there will be a timer of 20 seconds. If you try to revert the changes (either by letting the timer expire or by clicking the "revert" button), we will hit one of the following two behaviors:

1 - The setting won't revert and will keep scaled

2 - gnome-shell will show some error messages in syslog and the display will be "corrupted", where the only window you are able to click is the display setting and if you try to drag it, it will leave a "blur" throughout the window (per discussions, this seems to be https://launchpad.net/bugs/1924689)

For both situations, changing the display resolution (i.e. going into and out of full screen in the workspaces client) will fix the issue

When hitting situation 1, syslog shows:

May 17 17:33:10 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to restore previous configuration: Invalid mode 1920x1080 (19.958942) for monitor 'unknown unknown'

When hitting situation 2, syslog shows:

May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to restore previous configuration: Invalid mode 1920x984 (19.895834) for monitor 'unknown unknown'
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to use stored monitor configuration: Invalid mode 1920x984 (19.895834) for monitor 'unknown unknown'
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to use linear monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to use fallback monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: Impossible to set scaling on crtc 59 to 1.000000, error id 2
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: Xlib: extension "DPMS" missing on display ":1".
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: Object St.Label (0x557090d07de0), has been already disposed — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: == Stack trace for context 0x557090bee180 ==
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: #0 557093f00e68 i /<email address hidden>/appIcons.js:1349 (2cdac32b2e20 @ 105)
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: #1 557093f00dd8 i /<email address hidden>/dash.js:42 (2cdac32a5d80 @ 27)
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: #2 557093f00d58 i resource:///org/gnome/shell/ui/dash.js:545 (20c3e0d20970 @ 24)
May 17 17:31:24 U-1AZMIM8SIPZ6I gnome-shell[3030]: JS ERROR: TypeError: monitor is null#012_updateWorkAreaBox@resource:///org/gnome/shell/ui/overviewControls.js:58:26#012_init/<@resource:///org/gnome/shell/ui/overviewControls.js:51:45

Sometimes the stack trace isn't shown, but the symptom is the same:

May 17 18:31:39 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to restore previous configuration: Invalid mode 1920x984 (19.895834) for monitor 'unknown unknown'
May 17 18:31:39 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to use stored monitor configuration: Invalid mode 1920x984 (19.895834) for monitor 'unknown unknown'
May 17 18:31:39 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to use linear monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
May 17 18:31:39 U-1AZMIM8SIPZ6I gnome-shell[3030]: Failed to use fallback monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
May 17 18:31:39 U-1AZMIM8SIPZ6I gnome-shell[3030]: Impossible to set scaling on crtc 59 to 1.000000, error id 2
May 17 18:31:40 U-1AZMIM8SIPZ6I gnome-shell[3030]: Xlib: extension "DPMS" missing on display ":1".

I'm unable to reproduce the problem if I manually install ubuntu-desktop and use the Nice DCV Server (as used by Workspaces) by following the steps from (using the xorg-x11-drv-dummy):

https://docs.aws.amazon.com/dcv/latest/adminguide/setting-up-installing-linux.html

One relevant difference is that Workspaces uses a custom X11 server /usr/bin/Xdcv, instead of /usr/lib/xorg/Xorg, and they have the following process being started:

/usr/bin/Xdcv -output 800x600+0+0 -output 800x600+800+0 -output 800x600+1600+0 -output 800x600+2400+0 -enabledoutputs 1 vt2 -displayfd 3 -auth /run/user/541001128/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtswitch -verbose 3

I'm also unable to reproduce the problem using xrdp + Xorg.

While discussing this with the desktop crew, it was mentioned that we see the same problems in
Xorg. And to a much lesser extent some issues in Wayland too when changing scales.

mutter and gnome-shell versions being used:

$ sudo apt-cache policy mutter-common
mutter-common:
  Installed: 42.2-0ubuntu1
  Candidate: 42.5-0ubuntu1
  Version table:
     42.5-0ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
 *** 42.2-0ubuntu1 100
        100 /var/lib/dpkg/status
     42.0-3ubuntu2 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
$ sudo apt-cache policy gnome-shell
gnome-shell:
  Installed: 42.4-0ubuntu0.22.04.1
  Candidate: 42.5-0ubuntu1
  Version table:
     42.5-0ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
 *** 42.4-0ubuntu0.22.04.1 100
        100 /var/lib/dpkg/status
     42.0-2ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :
Download full text (8.6 KiB)

Also tested with mutter-common 42.5-0ubuntu1 and gnome-shell 42.5-0ubuntu1:

fabiomirmar@U-1JSKZM4R9U78P:~$ sudo apt-cache policy mutter-common
[sudo] password for fabiomirmar:
mutter-common:
  Installed: 42.5-0ubuntu1
  Candidate: 42.5-0ubuntu1
  Version table:
 *** 42.5-0ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     42.0-3ubuntu2 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
fabiomirmar@U-1JSKZM4R9U78P:~$ sudo apt-cache policy gnome-shell
gnome-shell:
  Installed: 42.5-0ubuntu1
  Candidate: 42.5-0ubuntu1
  Version table:
 *** 42.5-0ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     42.0-2ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

And I have the same issue.

When I apply the scale change I see:

May 25 13:30:21 U-1JSKZM4R9U78P systemd[2514]: vte-spawn-11c0b6cb-a094-4eee-9cbf-7a694348f00a.scope: Consumed 1.272s CPU time.
May 25 13:30:21 U-1JSKZM4R9U78P systemd[2514]: gnome-terminal-server.service: Consumed 1.231s CPU time.
May 25 13:30:25 U-1JSKZM4R9U78P gnome-shell[2862]: Impossible to set scaling on crtc 59 to 0.615385, error id 2
May 25 13:30:25 U-1JSKZM4R9U78P gnome-shell[2862]: Window manager warning: Scalig CRTC 59 at 0.615385 failed
May 25 13:30:25 U-1JSKZM4R9U78P gnome-shell[2862]: Xlib: extension "DPMS" missing on display ":1".
May 25 13:30:25 U-1JSKZM4R9U78P gnome-shell[2862]: Missing logical monitor, using scale 1
May 25 13:30:26 U-1JSKZM4R9U78P gnome-shell[2862]: Xlib: extension "DPMS" missing on display ":1".
May 25 13:30:26 U-1JSKZM4R9U78P gnome-shell[2862]: Missing logical monitor, using scale 1
May 25 13:30:26 U-1JSKZM4R9U78P gnome-shell[2862]: Spurious clutter_actor_allocate called for actor 0x55a6ef3a4ba0/<dashtodockContainer>[<Gjs_ubuntu-dock_ubuntu_com_docking_DashToDock>:0x55a6ef3a4ba0] which isn't a descendent of the stage!
May 25 13:30:26 U-1JSKZM4R9U78P gsd-color[2980]: could not find device: property match 'XRANDR_name'='VNC-output-0' does not exist
May 25 13:30:26 U-1JSKZM4R9U78P gsd-color[2980]: could not find device: property match 'XRANDR_name'='VNC-output-1' does not exist
May 25 13:30:26 U-1JSKZM4R9U78P gsd-color[2980]: could not find device: property match 'XRANDR_name'='VNC-output-2' does not exist
May 25 13:30:26 U-1JSKZM4R9U78P gsd-color[2980]: could not find device: property match 'XRANDR_name'='VNC-output-3' does not exist
May 25 13:30:26 U-1JSKZM4R9U78P gsd-color[2980]: could not find device: property match 'XRANDR_name'='VNC-output-0' does not exist
May 25 13:30:26 U-1JSKZM4R9U78P gsd-color[2980]: could not find device: property match 'XRANDR_name'='VNC-output-1' does not exist
May 25 13:30:26 U-1JSKZM4R9U78P gsd-color[2980]: could not find device: property match 'XRANDR_name'='VNC-output-2' does not exist
May 25 13:30:26 U-1JSKZM4R9U78P gsd-color[2980]: could not find device: property match 'XRANDR_name'='VNC-output-3' does not exist
May 25 13:30:26 U-1JSKZM4R9U78P gnome-shell[2862]: Can't update stage views actor <u...

Read more...

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

While I do see a couple of bugs when changing display scale on Xorg, I don't see the "Failed to restore previous configuration" that is the main subject here. So it sounds like this is only occurring on Xdcv.

tags: added: jammy xrandr-scaling
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Marco is the author of the Xrandr fractional scaling support patch so he might have some immediate ideas. I figure a lot of this is going to be affected by that patch even if you're only trying to use integer scaling.

Changed in mutter (Ubuntu):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fabio, please try building mutter without the fractional scaling patch. So just delete:

  ubuntu/x11-Add-support-for-fractional-scaling-using-Randr.patch

from debian/patches/series.

That should retain support for integer scaling, but will tell us if the fractional scaling patch is causing this bug as a side effect.

Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :

Hi Daniel,

I'm not with the SEG team and I would need assistance from someone building that and providing the debs or a ppa. I've also subscribed Mustafa, from SEG, to this bug, as he's assisting me investigating this issue.

Regards,
Fabio Martins

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

Here's a PPA containing the change to test:

https://launchpad.net/~vanvugt/+archive/ubuntu/mutter

Revision history for this message
Mustafa Kemal Gilor (mustafakemalgilor) wrote :

I'm still able to reproduce the bug with the PPA installed. I'll investigate this further and share my findings.

Revision history for this message
Mustafa Kemal Gilor (mustafakemalgilor) wrote (last edit ):

Reproducer:

-- Grab a fresh Ubuntu 22.04 VM, then install NICE DCV Server & NICE Xdcv --

# Exit graphical mode
sudo systemctl isolate multi-user.target
# Install `ssh` & import id (optional)
sudo apt -y install openssh-server
ssh-import-id <your-lp-id>
# Disable wayland
sudo sed -i "s/WaylandEnable=True/WaylandEnable=false/" /etc/gdm3/custom.conf
# Install NICE DCV Server & Nice XDCV
cd /tmp
wget https://d1uj6qtbmh3dt5.cloudfront.net/NICE-GPG-KEY
gpg --import NICE-GPG-KEY
wget https://d1uj6qtbmh3dt5.cloudfront.net/2023.0/Servers/nice-dcv-2023.0-15065-ubuntu2204-x86_64.tgz
tar -xvzf nice-dcv-2023.0-15065-ubuntu2204-x86_64.tgz
cd nice-dcv-2023.0-15065-ubuntu2204-x86_64
sudo apt -y install ./nice-dcv-server_2023.0.15065-1_amd64.ubuntu2204.deb
sudo apt -y install ./nice-xdcv_2023.0.547-1_amd64.ubuntu2204.deb
# Add "dcv" user to "video" group:
sudo usermod -aG video dcv
# Start dcv server:
sudo systemctl start dcvserver
# Create a session:
sudo dcv create-session my-test-session --owner=test

-- client --
# Install NICE DCV client and connect to the dcv host
wget https://d1uj6qtbmh3dt5.cloudfront.net/2023.0/Clients/nice-dcv-viewer_2023.0.5483-1_amd64.ubuntu2204.deb
dpkg -i nice-dcv-viewer_2023.0.5483-1_amd64.ubuntu2204.deb
dcvviewer https://<vm-ip>:8443#my-test-session

# Then, try to change the display scale, and click "revert settings", the session should freeze
# gnome-shell log should contain similar log messages to the following:
May 30 15:59:03 test-2 gnome-shell[4906]: Failed to restore previous configuration: Invalid mode 3840x1352 (59,963089) for monitor 'unknown unknown'
May 30 15:59:03 test-2 gnome-shell[4906]: Failed to use linear monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
May 30 15:59:03 test-2 gnome-shell[4906]: Failed to use fallback monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
May 30 15:59:03 test-2 gnome-shell[4906]: Impossible to set scaling on crtc 59 to 1,000000, error id 2

Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :

I also tested Daniel's mutter package with:

sudo add-apt-repository ppa:vanvugt/mutter
sudo apt update
sudo apt upgrade

And rebooted the Workspace just in case.

I know Mustafa mentioned he was still able to reproduce the issue. In my case, I wasn't but on the other hand, I can't do the action that would allow me to reproduce it.

When I go to display settings, I don't have an option to change the scale, but I do have the option to enable "Fractional Scaling", but if I enable it, I don't have an apply button to enable it, so this never gets enabled and doesn't get to a situation where I can change/revert the scale to see if I would be able to reproduce the issue or not.

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

I'm guessing your desktop resolution might have been too low for other scaling factors to be offered? It varies according to the screen resolution. Maybe also according to the (virtual) hardware's reported DPI.

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

Confirmed:

* The client window needs to be larger to get different scaling factors offered. If the desktop resolution is too low then none will be offered.

* I can reproduce the failure to revert. I DON'T get the error messages in the log though. This suggests Xdcv returned SUCCESS on the revert for me, even when it fails to revert. Obviously it's returning a failure when you do see the error messages.

* I can still reproduce the failure to revert when using the PPA version 42.5-0ubuntu1vv1 (fractional scaling support removed, so using integer scaling).

Conclusions/theories:

* The failure to revert (this bug) is an upstream mutter bug. It still happens without our fractional scaling patch. That might make debugging easier, although if Xdcv is returning success on the revert (which explains the lack of error messages for me) then there would be nothing further to debug in mutter. We need to confirm.

* The corruption bug 1924689 may still be caused by the fractional scaling patch. Not sure.

Tips:

* If you're stuck in 200% mode without enough screen space to change it back, you can:
  - With fractional scaling disabled: resize the dcvviewer window and that will make it revert to 100%.
  - With fractional scaling enabled: resize the Settings window top edge and then use the mouse wheel to scroll down.

summary: - Changing display scale setting and reverting it, causes gnome-shell to
- error with "Failed to restore previous configuration" and other error
- messages
+ Xdcv: Changing display scale setting and reverting it fails
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This is interesting:

> Impossible to set scaling on crtc 59 to 1.000000, error id 2

Error 2 is BadValue and I can reproduce similar on the command line:

$ xrandr --output VNC-output-0 --scale 1x1 # or 2x2, 0.5x0.5

This works in Xorg but seems to always fail in Xdcv with error BadValue (2). And the same with:

$ xrandr --output VNC-output-0 --filter nearest # or bilinear

Works in Xorg but not in Xdcv.

So fractional scaling failing is expected on Xdcv, but I don't think those functions are historically needed for integer scaling. Only our fractional scaling patch tries to use them unconditionally for integer scaling. So that's both a unique failure to the fractional scaling patch and also not its fault -- failing to change the scaling matrix is a failure on the Xdcv side.

In summary we should probably only be trying to fix the fractional scaling OFF case here. Because that's probably the only mode that Xdcv can handle in theory.

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

Also "Invalid mode 800x600 (-nan)" seems to be originating from Xdcv as you can see it in xrandr output (800x600 0.00Hz). Xdcv is reporting a bogus refresh rate but also Xdcv accepts that bogus refresh rate in manual mode changes using the xrandr command. So it looks like mutter needs to be loosened to accept zero-Hz.

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

I've made a new patch to try:

https://launchpad.net/~vanvugt/+archive/ubuntu/mutter/+build/26240021

but can't tell if it's helping because after I installed it, the bug stopped happening. Then after I uninstalled it, the bug still stopped happening.

Changed in mutter (Ubuntu):
assignee: Marco Trevisan (Treviño) (3v1n0) → nobody
Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :

Thanks for the investigation Daniel.

Indeed my inability to change the scale with the first patch was due to low resolution in my client machine.

Interesting enough, I tried reproducing this in a Local VM with Xdcv (with just regular mutter packages, straight from our archives, no PPA), and I'm unable to reproduce the problem when I disable fractional scaling. I'm able to change to 200% and then revert properly.

Given that I'm unable to reproduce there, I went back to an AWS Workspace and installed your new 42.5-0ubuntu1vv2 package and I'm still able to reproduce the problem when reverting it:

May 31 20:17:42 U-3JQHCWI1WR5QW geoclue[2660]: Service not used for 60 seconds. Shutting down..
May 31 20:17:42 U-3JQHCWI1WR5QW systemd[1]: geoclue.service: Deactivated successfully.
May 31 20:17:43 U-3JQHCWI1WR5QW gnome-shell[3188]: Failed to use linear monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
May 31 20:17:43 U-3JQHCWI1WR5QW gnome-shell[3188]: Failed to use fallback monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
May 31 20:17:43 U-3JQHCWI1WR5QW gnome-shell[3188]: Impossible to set scaling on crtc 59 to 1.000000, error id 2
May 31 20:17:43 U-3JQHCWI1WR5QW gnome-shell[3188]: Xlib: extension "DPMS" missing on display ":1".
May 31 20:17:43 U-3JQHCWI1WR5QW gsd-color[3358]: could not find device: property match 'XRANDR_name'='VNC-output-0' does not exist
May 31 20:17:43 U-3JQHCWI1WR5QW gsd-color[3358]: could not find device: property match 'XRANDR_name'='VNC-output-1' does not exist
May 31 20:17:43 U-3JQHCWI1WR5QW gsd-color[3358]: could not find device: property match 'XRANDR_name'='VNC-output-2' does not exist
May 31 20:17:43 U-3JQHCWI1WR5QW gsd-color[3358]: could not find device: property match 'XRANDR_name'='VNC-output-3' does not exist
May 31 20:17:43 U-3JQHCWI1WR5QW gsd-color[3358]: could not find device: property match 'XRANDR_name'='VNC-output-0' does not exist
May 31 20:17:43 U-3JQHCWI1WR5QW gsd-color[3358]: could not find device: property match 'XRANDR_name'='VNC-output-1' does not exist
May 31 20:17:43 U-3JQHCWI1WR5QW gsd-color[3358]: could not find device: property match 'XRANDR_name'='VNC-output-2' does not exist
May 31 20:17:43 U-3JQHCWI1WR5QW gsd-color[3358]: could not find device: property match 'XRANDR_name'='VNC-output-3' does not exist

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

Yes I think when using Xdcv we just need to make sure fractional scaling is ALWAYS DISABLED and ignore any bugs that occur if it is enabled, for the time being. :(

While Xdcv reports its RandR version is 1.6, when you try to actually use it (you can test with xrandr --scale or --transform) it will report BadValue which is the cause of:

  Impossible to set scaling on crtc 59 to 1.000000, error id 2

And our fractional scaling patch does try to do the right thing - it queries the RandR version and only enables when the reported version is at least 1.3. Since Xdcv reports version 1.6 and returns errors instead of implementing the feature, it's Xdcv at fault there and we have no easy way to work around it either. Just keep fractional scaling always disabled is what I would recommend. The fractional scaling patch is possibly also at fault for not cleanly recovering from the unexpected RandR errors, but this error message:

  Impossible to set scaling on crtc 59 to 1.000000, error id 2

suggests that it's the recovery/revert that's failing due to the incomplete RandR implementation in Xdcv. So actually I can't imagine how the fractional scaling patch could do better without Xdcv getting fixed first. Just disable fractional scaling I say.

I think I have been able to hit the bug without fractional scaling but it might have been some residue on the mutter side if it was started with fractional scaling enabled. So please check again:

 1. Disable fractional scaling.
 2. Log out of gnome-shell and restart the test session.
 3. Try to change the scale between 100% and 200% again.
 4. If the bug still occurs then please repeat with:
    https://launchpad.net/~vanvugt/+archive/ubuntu/mutter/+build/26240021

Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :

I was getting some inconsistent and confusing results on my tests, so I decided to start from scratch with a fresh VM (qemu) and also a fresh Workspace (AWS).

In a freshly installed Jammy VM (on qemu, not AWS), out of the box we have factional scaling disabled, so I tried changing scale to 200% and I do hit the error (but the scale DOES change):

https://pastebin.ubuntu.com/p/yVwnmqbTTJ/

When I try to revert, I hit the error again and gnome freezes:

https://pastebin.ubuntu.com/p/nYpqJDmr5x/

I then upgraded the packages in the PPA:

sudo add-apt-repository ppa:vanvugt/mutter
sudo apt update
sudo apt upgrade

Rebooted the VM

When I still hit the error both when trying to change the scale to 200% (still does change it, though):

https://pastebin.ubuntu.com/p/V7MmKCjc4W/

And also when trying to revert it (gnome freezes):

https://pastebin.ubuntu.com/p/dbWZFQGr9t/

Package versions:

https://pastebin.ubuntu.com/p/c4WsgPVnxr/

Also did the same tests with a fresh Workspace:

Tested the very same thing in a Workspace:

Out of the box fractional scaling is disabled, so I tried changing scale to 200% and I hit the error (but it does change):

https://pastebin.ubuntu.com/p/gSZ5rfm7vF/

When I try to revert, I hit the error and then it causes the problem reported in https://launchpad.net/bugs/1924689:

https://pastebin.ubuntu.com/p/NHY62YvxCG/

(So both Workspaces and local VM hit the same problem, but when reverting Workspaces will hit LP#1924689 and the local VM will freeze gnome)

I then rebooted the Workspace without upgrading any package and tried the same steps again, and I still have the same problem.

I then upgraded the packages in the PPA:

sudo add-apt-repository ppa:vanvugt/mutter
sudo apt update
sudo apt upgrade

Rebooted the Workspace, and I still hit the error both when trying to change the scale to 200% (still does change it, though):

https://pastebin.ubuntu.com/p/977wzx6sxW/

And when I try to revert:

https://pastebin.ubuntu.com/p/D2VZv2J7QV/

Packages:

https://pastebin.ubuntu.com/p/mDKy4wWyWZ/

So, unless I'm missing something, apparently the same problem happens with fractional scaling disabled and also with the packages from the PPA.

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

Yeah I know, mentioned in comment #11:

> * I can still reproduce the failure to revert when using the PPA version 42.5-0ubuntu1vv1 (fractional scaling support removed, so using integer scaling).

What I was trying to say in comment #16 is not that fractional scaling was the cause of this bug, but that it will trigger Xdcv bugs we can't fix. So all testing of this bug should be done with fractional scaling disabled.

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

Oh actually the logs you provided in comment #17 suggest that the fractional scaling patch is trying to implement the revert using fractional scaling (which will fail on Xdcv) even when the feature is disabled. So it sounds like I need to make a new PPA revision that has both the changes of vv1 and vv2 combined...

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

Nevermind, "vv3" still has the bug. BTW, it seems to reproduce more reliably if you delete ~/.config/monitors.xml before logging in.

Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: New → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Upstream fix proposed:
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3062

You can test it in:
https://launchpad.net/~vanvugt/+archive/ubuntu/mutter/+build/26285012

Caveat:
The Settings app seems to want to turn on the three unused (usually off) virtual monitors when revert succeeds. I think this is a bug in the Settings app but am not sure. It might also be fixed upstream already because it doesn't happen on Xorg for newer Ubuntu releases. For the moment I'm treating it as a separate bug anyway.

Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :

Hi Daniel,

Thanks again.

Tested 42.5-0ubuntu1vv5

When I apply the 200% scale:

https://pastebin.ubuntu.com/p/MfS9vpT6KB/

When I revert it:

https://pastebin.ubuntu.com/p/SHtvrXyPkY/

And then I get this situation (possibly due to what you mentioned on the settings app attempting to enable the 4 monitors):

https://pasteboard.co/kLUbb5XWlwAQ.png

The tests above were in a qemu VM in my laptop + DCV. I also tested it in an AWS Workspace and I believe the situation is similar. When I change scale to 200%:

https://pastebin.ubuntu.com/p/DgkB3rngvj/

When I revert it:

https://pastebin.ubuntu.com/p/H4nJC4MmKW/

And the screen in the Workspaces client gets all blank and there's no place to click. Even if I try to resize the client screen (which would force Xdcv to change the resolution) I can't get back to the workspace. Only way to fix it is to close and reopen the client.

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

The only relevant log messages I can see there are:

  Impossible to set scaling on crtc 65 to 1.000000, error id 2
  Window manager warning: Scalig CRTC 65 at 1.000000 failed

which is a bug in Xdcv as detailed in comment #16. Remember to keep fractional scaling turned off.

To see if it's possible to work around that bug, you might like to try the "vv4" build:

  https://launchpad.net/~vanvugt/+archive/ubuntu/mutter/+build/26284941

I'm not yet sure that log message and the Xdcv bug that causes it is critical to fixing this bug 2020782 though.

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

BTW, what does this command return in an AWS Workspace? Any different to the VM?

  xrandr --verbose

Revision history for this message
Mustafa Kemal Gilor (mustafakemalgilor) wrote :

Hello Daniel,

I've also been debugging this issue and noticed something weird while reproducing it. It seems that resizing the screen via resizing the NICE DCV client does not invoke the `meta_monitor_config_manager_set_current` method, so the current config and the history are untouched.

Let's say we have an initial resolution of QxZ@T hz, sf 1(scale factor). The NICE DCV client screen resize changes it to WxH@F sf 1.5, but libmutter still thinks the screen is at QxZ@T sf 1. At this point,
 `xrandr` output no longer shows QxZ@T hz as a supported resolution. When the user tries to change the scale, the change is registered as both the resolution change and the scale change as per the perspective of "libmutter", and if the user proceeds to accept this configuration, everything is fine because the Xdcv already lists `WxH@F` as a supported resolution, but if not (i.e. user tries to revert back to the previous) it fails because QxZ@T hz is no longer on the supported resolution set.

Therefore, I think one of the problems we're facing here is libmutter/Xdcv being out-of-sync when the screen resolution is changed via the NICE DCV client. I'm currently looking into how we can reflect the client resolutions to libmutter (I'm not well-versed in mutter codebase so progressing a little bit slow)

I'll continue to post my findings as I progress.

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.