Xdcv: Changing display scale setting and reverting it fails

Bug #2020782 reported by Fabio Augusto Miranda Martins
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mutter (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Daniel van Vugt
Kinetic
Fix Released
Undecided
Unassigned
Lunar
Fix Released
Undecided
Unassigned
Mantic
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

When running GNOME on the Xdcv X11 server, changing the display scale in Settings and then clicking 'Revert Settings' instead of 'Keep Changes' does not revert the settings.

[ Test Plan ]

Very complicated; see comment #8.

[ Where problems could occur ]

In the list of available graphics modes in Xorg sessions on jammy only (an equivalent fix already exists in later Ubuntu releases).

[ Original Description ]

 * Anything else you think is useful to include
 * Anticipate questions from users, SRU, +1 maintenance, security teams and the Technical Board
 * and address these questions in advance
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.

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

Although Mustafa says he's not well-versed, he's way smarter than me :) So his comment#26 seems to be much more relevant than what I have to say, but I'd like to reply to Daniel's comment#24/25 anyway:

I saw the details you mentioned on comment #16, and I also have fractional scaling turned off. By "having it off" I'm assuming this [1] is enough, right?

Also, I noticed that by previous pasteboard wasn't too clear in showing the problem when I use 42.5-0ubuntu1vv5. I want to clarify that I get a screen as if I had 3 monitors side by side, but all in the same "client monitor". If you try to maximize the application, it picks one of the "screens" and maximizes to it, as we can see here [2].

Even without changing the fractional scale or scale setting, just by having the 42.5-0ubuntu1vv5 packages installed, I get this "triple monitor in 1" situation when I boot my VM. I had to reinstall the original packages from our archives in order to fix this. Also, I just want to make sure you're aware that these are the *mutter* packages that I have installed:

ubuntu@jammy-dcv:~$ sudo dpkg -l | grep mutter
ii gir1.2-mutter-10:amd64 42.5-0ubuntu1 amd64 GObject introspection data for Mutter
ii libmutter-10-0:amd64 42.5-0ubuntu1 amd64 window manager library from the Mutter window manager
ii mutter-common 42.5-0ubuntu1 all shared files for the Mutter window manager

i.e. Just want to make clear that I don't have the "mutter" package installed, but the ones above.

Back to your comment, iiuc, the "Impossible to set scaling on crtc 65 to 1.000000, error id 2" means that we're trying to use some incomplete RandR implementation in Xdcv. Isn't it the fractional scaling, that was effectively removed from your 42.5-0ubuntu1vv5 package? In this case, doesn't the errors showing up means that we're still trying to use something that isn't properly implemented in Xdcv?

Just for my own information, what's the difference between the vv5 and vv4 builds?

Tested with vv4 in a VM:

ubuntu@jammy-dcv:~$ sudo dpkg -l | grep mutter
ii gir1.2-mutter-10:amd64 42.5-0ubuntu1vv4 amd64 GObject introspection data for Mutter
ii libmutter-10-0:amd64 42.5-0ubuntu1vv4 amd64 window manager library from the Mutter window manager
ii mutter-common 42.5-0ubuntu1vv4 all shared files for the Mutter window manager

As soon as I installed it in my VM, I got that "triple monitor" situation again, and then I realized it's really just what you had described, that it automatically enables these other monitors. I can disable them and get back to 1 single monitor. With vv4, I can apply the scale 200% [3] and then revert it, but then it changes my resolution to 800x600.

After realizing that, I went back to the vv5 package and re-tested and I notice it's the same behavior as in vv4. After installing it automatically enables all 4 monitors, I have to manually disable them and keep just 1. Then I test the scale to 200% + revert and it does revert, but also changes my resolution to 800x600.

I can't really test that in Workspaces, because when it enables the extra monitors, I'm no longer able to...

Read more...

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

> I saw the details you mentioned on comment #16, and I also have fractional scaling
> turned off. By "having it off" I'm assuming this [1] is enough, right?

For safety's sake I would recommend having Fractional Scaling disabled before you log in, or logging in again after disabling it. Because it's common in gnome-shell for some settings to only be fully actioned on startup.

> i.e. Just want to make clear that I don't have the "mutter" package installed, but
> the ones above.

That's fine, Ubuntu does not use "mutter". We only use "libmutter" so it's a common point of confusion. The source package name for both is "mutter".

> Isn't it the fractional scaling, that was effectively removed from your
> 42.5-0ubuntu1vv5 package? In this case, doesn't the errors showing up means that
> we're still trying to use something that isn't properly implemented in Xdcv?
> Just for my own information, what's the difference between the vv5 and vv4 builds?

It's vv4 that has no fractional scaling, and vv5 reintroduced fractional scaling leaving only the "zero Hz" fix in vv5.

The 3 unused monitors turning on is a side-effect of the "zero Hz" fix working. I can't tell if it's a bug or a feature right now. If it is a bug then it might be a bug in the Settings app or in mutter.

Separately, the fact that the client goes blank on Workspaces but not in a VM might be a bug in Workspaces itself or a bug in the DCV client. Although I want to treat these remaining issues as separate it seems pretty clear that avoiding turning on the unused virtual monitors should solve them all...

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

Try logging into a non-GNOME Xorg session on Workspaces if you can. Then use the 'xrandr' command to set a mode to turn on one of the unused virtual monitors. If that causes the DCV client to go blank then we have proven it's not mutter's fault.

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

I've also tested the "vv5" package in a fresh VM and can confirm that zero hz is now supported, and now facing the same scenario where multiple monitors are automatically enabled.

Another issue that still stands is the "config history" issue I've mentioned. If you exclusively change the resolution from gnome display settings, it can apply a new resolution and revert to a previous config (via the timeout prompt) without any issue. But when the resolution is changed via the NICE DCV client's options (or via `xrandr` for that matter), mutter does not register that resolution change in `config_history`, and cannot revert back to the previous config when prompted. This is reproducible with just the default gnome desktop environment and the `xrandr`

The reproducer is as follows:

(assume that the initial resolution is 1920x1080)

- Set a resolution via `xrandr`, e.g. (1366x768)
- Open gnome display settings, and try to set the resolution to 1024x768
- Press "revert back" when prompted
- The resolution will not go back to 1366x768 as it should and will stay at 1024x768

I've debugged this and noticed that gnome display settings use mutter's org.gnome.Mutter.DisplayConfig DBus interface and calls ApplyMonitorsConfig for resolution changes, whereas neither NICE DCV nor xrandr does that, so mutter is not notified about the change.

I guess this will need a separate issue.

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

> Try logging into a non-GNOME Xorg session on Workspaces
> if you can. Then use the 'xrandr' command to set a mode
> to turn on one of the unused virtual monitors. If that
> causes the DCV client to go blank then we have proven
> it's not mutter's fault.

I did test that with a Cinnamon session and confirmed it. I basically did:

xrandr --output VNC-output-1 --auto

and it immediately goes to a blank screen

OK, so saying out loud my understanding of this issue so far, so as to check it's correct. The problems are:

- Fractional scaling is supported in RandR 1.3 or newer
- Xdcv reports its RandR version is 1.6, but when you try to use fraction scaling it errors (error id 2)
- The corruption bug 1924689 may be caused by the fractional scaling patch (or a side effect of the "error id 2"?)
- Xdcv is reporting a bogus refresh rate
- There's a "config history" issue identified by Mustafa in comments #26 and #30

What we've been doing now to try to narrow it down is:

A - The "Zero Hz" fix is basically loosening mutter to accept zero-Hz, as this is the bogus refresh rate being reported by Xdcv
B - vv4 fix = no fractional scaling + "zero Hz" fix
C - vv5 fix = re-adds fractional scaling + "zero Hz" fix

And out of it, we've confirmed in local VM / Workspaces tests that

1 - Without fractional scaling patch (vv4) / with fractional scaling disabled, we can't reproduce the "Failed to restore previous configuration: Invalid mode" / "Impossible to set scaling on crtc" errors
2 - The "Zero Hz" fix causes a side-effect of enabling the unused monitors (tbd if this is a bug)
2a. If you manually disable 3 monitors (keeping only one) and then try to apply / revert 200% scale, it errors [1] and sets resolution back to 800x600
3 - When enabling unused monitors in Workspaces, we get a blank screen (which I've confirmed through cinnamon / xrandr that it must be a problem with the Workspaces client when enabling a monitor)

For the "zero Hz" problem, if I understand correctly, it is a bogus issue without a noticeable impact in usage. On the other hand, due to the "zero Hz" fix introducing problems 2 and 2a above, I'm skeptical on validating that avoiding fractional scaling fixes our issue (item 1 above).

If the "zero hz" issue is really just bogus, should we try a "vv6" build completely disabling fractional scaling for the Xdcv use case (on apply and revert), but not including the "zero hz" fix? This way we would be able to validate item 1 above (even if we see the zero hz bogus messages, which we can ignore for now). If this succeeds, we can investigate the item 3 above separately, so we can then re-introduce the "zero hz" fix.

[1] https://pastebin.ubuntu.com/p/Xtyfvb3CV2/

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

There's no need for a vv6 "completely disabling fractional scaling" because that's the first thing we already tried in vv1 and it didn't work as mentioned in comment #11. If you want to test it again then see https://launchpad.net/~vanvugt/+archive/ubuntu/mutter/+build/26236293

> I did test that with a Cinnamon session and confirmed it. I basically did:
> xrandr --output VNC-output-1 --auto
> and it immediately goes to a blank screen

Cinnamon might not be the best test case because it used to be based on mutter. We need to test a desktop environment that has no relation to mutter to confirm that's a bug in the DCV viewer/server. Or any simple X session with a legacy window manager?

> - Fractional scaling is supported in RandR 1.3 or newer
> - Xdcv reports its RandR version is 1.6, but when you try to use fraction scaling it errors (error id 2)

I want to say that's an Xdcv bug but by chance I am working on NVIDIA right now and find it returns the same errors from xrandr --scale or --transform. Yet somehow fractional scaling still works on NVIDIA!? This might not matter because so far this issue has not stopped us from progressing on the main revert bug 2020782.

> - The corruption bug 1924689 may be caused by the fractional scaling patch (or a side effect of the "error id 2"?)

Maybe, not sure. It won't take much effort to confirm if the same mutter corruption bug occurs without the fractional scaling patch. But it's also a separate bug so I would prefer to keep that conversation separate.

> - Xdcv is reporting a bogus refresh rate

That's an Xdcv bug which is probably also intentionally a design feature. I think it should be fixed in Xdcv because this design will break other compositors like it has broken mutter. Technically correct compositor behaviour would be to render at 0Hz, which would not be usable ;) So Xdcv probably should be changed to avoid the same problem occuring in other desktop environments.

> - There's a "config history" issue identified by Mustafa in comments #26 and #30

The config history raised by Mustafa in comment #30 should be treated as an enhancement request and logged elsewhere (https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues) to avoid confusing this bug. That enhancement only makes sense to virtual machines running Xorg sessions.

I want to keep this bug focussed on the failure to revert because the conversation gets too complex otherwise. And also to avoid the expectation that multiple bugs should be fixed under a single bug number.

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

Also apologies - I don't have time to work on this bug every day. I expect to get back to it some time next week.

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

Hi Daniel,

Thanks again, and I totally agree that we need to focus on the revert resolution issue in this LP bug. I wasn't willing to discuss the other issues here, but to summarize my understanding so far, so as to make sure we are on the same page.

Also, I tested "xrandr --output VNC-output-1 --auto" to enable another monitor using Budgie and Xfce (I believe none of them use mutter), and I can't reproduce the "blank screen". It doesn't really do anything, but also doesn't reproduce the blank screen issue.

This is what I see in Xfce:

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

And Budgie:

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

My previous suggestion (patch with zero hz fix + no fractional scaling) was because I thought vv1 was also exposed to the issue you mentioned on comment #19 ("fractional scaling patch is trying to implement the revert using fractional scaling"), but I guess not, and it still fails with the "Invalid mode 800x600 (-nan)" errors, which is the zero hz issue, and led us to vv2 and then vv4.

So, the current situation is that either with vv4 (zero hz patch + no fractional scaling) OR vv5 with fractional scaling disabled (zero hz patch included) we get to the situation where the extra monitors are automatically enabled and the resolution is changed to 800x600:

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

And IIUC this is what needs to be investigated next.

And no need to apologize if not able to respond this daily, completely understandable and you're already doing a lot for this bug. Thank you very very much for that!

I'll also be OoO for the next couple of days, back on Monday anyway.

Cheers,
Fabio Martins

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

Those logs from Xfce and Budgie look surprising to me. They don't prove that the DCV viewer/server bug doesn't exist there because they seem to have failed to turn on VNC-output-1. So the bug probably still exists in DCV viewer/server but hasn't been triggered yet. Maybe you need to select the 800x600 resolution mode explicitly instead of --auto?

The only relevant error messages in that last log are from the fractional scaling patch, where basically this is failing:

  xrandr --output VNC-output-0 --scale 1x1

which as mentioned above I thought was a bug in Xdcv and now in the proprietary NVIDIA driver too. But since the latter works, and we have been able to progress without fixing this, I think we can ignore those messages:

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

Also, the other messages in that last log are unrelated this bug. So basically the last log above (hopefully) contains no messages relating to anything we need to fix here. It does contain unrelated issues though: bug 1857392 and bug 2007742

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

Daniel,

A few items to make sure I'm on the same page:

1. So, IIUC, you're saying that the "final fix" should be the vv5 package, which contains the fix to the zero hz bug (loosening mutter to accept zero-Hz, as this is the bogus refresh rate being reported by Xdcv) + the caveat for AWS to either fix Xdcv or never try to enable Fractional scaling in the instance (details in your comment#16), is that so?

2. Regarding your comment on bug 1857392 and bug 2007742 being present, iiuc they do not have a noticeable impact (other than spamming the log).

3. Also, I need to mention that I went ahead and tried once more the vv5 package on a AWS Workspace, and I can no longer reproduce the blank screen. Now I see these logs [1] and the scale does get reverted from 200% to 100%.

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

4. If 1 above is correct, then where (if anywhere) we are going to investigate the situation where vv5 causes the other monitors to get automatically enabled?

Regards,
Fabio Martins

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

1. No I don't think vv5 is the final fix, which is why the upstream fix is marked as Draft still: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3062

2. Correct. Those "logspam" bugs are just noise and can be ignored: https://bugs.launchpad.net/ubuntu/+bugs?field.tag=logspam

3. It's not impossible the blank screen is a mutter bug, but we still need to see it happening on a desktop that's not mutter-based :) I believe all of the remaining log messages in https://pastebin.ubuntu.com/p/JpVsjbQzsQ/ can be ignored for this bug.

4. I think that's the blocker here for bug 2020782. I have more ideas but not enough time to test them yet.

Revision history for this message
Ignacio Casal Quinteiro (nacho-resa) wrote :

About the following issue we can definitely take a look at it.

> - Xdcv is reporting a bogus refresh rate

That's an Xdcv bug which is probably also intentionally a design feature. I think it should be fixed in Xdcv because this design will break other compositors like it has broken mutter. Technically correct compositor behaviour would be to render at 0Hz, which would not be usable ;) So Xdcv probably should be changed to avoid the same problem occuring in other desktop environments.

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

Ignacio, if Xdcv ever wants to support Fractional Scaling, I believe you will also need to look at the details shared by Daniel in his comment #16. Otherwise, even if we fix the zero hz issue, you will be able to change/revert scale, but will also need to make sure fractional scaling is disabled.

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

Daniel,

Regarding 3 (the blank screen issue when enabling a monitor): I can confirm that the issue happens when you're using Workspaces client 5.9.0.4129 (Windows client version) and no longer happens (even with Xdcv + Gnome) in 5.10.0.4196.

And, by checking the client release notes [1]:

"Resolved black screen issue when using multiple monitors with Ubuntu WorkSpaces"

[1] https://docs.aws.amazon.com/workspaces/latest/userguide/amazon-workspaces-windows-client.html#windows-release-notes

Regards,
Fabio Martins

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

Great! I didn't think the black screen issue was caused by Ubuntu.

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

Looking at this again, I'm now testing an even smaller patch (named vv6):

@@ -92,6 +92,9 @@ calculate_xrandr_refresh_rate (XRRModeIn
   float h_total;
   float v_total;

+ if (xmode->hTotal == 0 || xmode->vTotal == 0)
+ return 0.0f;
+
   h_total = (float) xmode->hTotal;
   v_total = (float) xmode->vTotal;

and it seems it still has the same problem. The interesting thing about this is that the patch is now so small that it shows the remaining problem (other virtual monitors automatically turned on) is not a bug in my patch but is a pre-existing bug somewhere.

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

Also the virtual monitors turning on at revert stops happening if you get your config file (~/.config/monitors.xml) to a state where the secondary monitors are explicitly listed as <disabled>. So there is a difference between the default mutter config when monitors.xml doesn't exist, and when they are explicitly disabled by the config file.

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

I can reproduce "other monitors getting turned on at Revert" using upstream Mutter on Xorg. Seems it's something of a feature because Mutter only supports:

 (a) An explicit monitor layout in ~/.config/monitors.xml ; or
 (b) An implicit monitor layout where everything gets turned on and arranged linearly.

There is no third option:

 (c) A detected monitor layout from xrandr when ~/.config/monitors.xml doesn't exist yet (no config ever applied yet).

So I can see this being low priority to upstream and it probably only matters to Xdcv, but it is an upstream Mutter bug/feature.

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

In the absence of ~/.config/monitors.xml (meaning the user has never pressed the 'Keep Changes' button), Mutter will start up in a linear layout with all monitors turned on. I think you can sometimes see this on Xdcv login (and always see it on Xorg login), but for some reason the secondary monitors quickly turn off again for Xdcv. But Mutter only remembers turning on all monitors and so that's the config it will revert to when you click 'Revert Settings'.

I don't think it's worth the effort to engineer entirely new xrandr detection logic in Mutter to solve this for Xdcv only. It would be significant work and take a long time to implement, for a very narrow use case. Instead I'd recommend either:

  (a) Modifying Xdcv to never connect virtual monitors you don't want to see, until the user virtually connects them. Because any sensible desktop environment will try to turn on all monitors as the default configuration.; or
  (b) Installing a default ~/.config/monitors.xml in which unused monitors are in the <disabled></disabled> section. You can draft such a file using the Settings GUI and clicking 'Keep Changes'.

So that part is now an enhancement request, not a bug. If anyone still wants it implemented then please mention it at: https://gitlab.gnome.org/GNOME/mutter/-/issues

As for the original bug 2020782 here, that's solved by upstream merge request: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3062

Revision history for this message
Ignacio Casal Quinteiro (nacho-resa) wrote :

I think this is good enough Daniel. Thanks!

tags: removed: xrandr-scaling
Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :

Thank you very much for the great job narrowing this, Daniel!

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

We only just noticed a similar fix was upstreamed already in mutter 43.0:
https://gitlab.gnome.org/GNOME/mutter/-/commit/16af2e407b49cd4464935a6f9b4efdc32f1339e5

Changed in mutter (Ubuntu Kinetic):
status: New → Fix Released
Changed in mutter (Ubuntu Jammy):
status: New → In Progress
Changed in mutter (Ubuntu Lunar):
status: New → Fix Released
Changed in mutter (Ubuntu Mantic):
status: In Progress → Fix Released
Changed in mutter (Ubuntu Jammy):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mutter (Ubuntu Mantic):
assignee: Daniel van Vugt (vanvugt) → nobody
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
description: updated
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Fabio, or anyone else affected,

Accepted mutter into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in mutter (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :

I've tested the mutter packages from -proposed in an AWS Workspace:

https://pastebin.ubuntu.com/p/9Yvgfs7yZr/

And I'm able to successfully change the scale to 200% and then revert the setting.

The following messages are logged when changing to 200%:

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

And then when you try to revert:

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

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Fabio, just to be clear, could you be specific about what version of Ubuntu you were using and what version of mutter you had installed?

If this update has fixed the issue here, you can also change the bug tag from verification-needed-jammy to verification-done-jammy

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Actually, we're uploading a new version to jammy-proposed 42.9-0ubuntu3 so you can wait and test that version.

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

OK, thanks for the information. The one I had tested was 42.9-0ubuntu2 with Jammy. I'll test again when 42.9-0ubuntu3 is available in -proposed.

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hello Fabio, or anyone else affected,

Accepted mutter into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed-jammy
removed: verification-done-jammy
Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :
Download full text (4.5 KiB)

Hi,

Thank you for the package in -proposed.

I just tested Ubuntu 22.04 and I can confirm it fixes the issue.

First, used 22.04 with the current mutter version available in jammy-updates:

user0@U-2RVWD6LKXR3GE:~$ sudo apt-cache policy mutter-common libmutter-10-0 gir1.2-mutter-10
mutter-common:
  Installed: 42.9-0ubuntu1
  Candidate: 42.9-0ubuntu1
  Version table:
 *** 42.9-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
libmutter-10-0:
  Installed: 42.9-0ubuntu1
  Candidate: 42.9-0ubuntu1
  Version table:
 *** 42.9-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
gir1.2-mutter-10:
  Installed: 42.9-0ubuntu1
  Candidate: 42.9-0ubuntu1
  Version table:
 *** 42.9-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

And I do hit the error when trying to revert after changing the scale:

Jul 18 09:40:39 U-2RVWD6LKXR3GE gnome-shell[3186]: Failed to use linear monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
Jul 18 09:40:39 U-2RVWD6LKXR3GE gnome-shell[3186]: Failed to use fallback monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
Jul 18 09:40:39 U-2RVWD6LKXR3GE gnome-shell[3186]: Impossible to set scaling on crtc 59 to 1.000000, error id 2
Jul 18 09:40:40 U-2RVWD6LKXR3GE gnome-shell[3186]: Xlib: extension "DPMS" missing on display ":1".

Then, I upgraded to package from -proposed:

user0@U-2RVWD6LKXR3GE:~$ sudo apt-cache policy mutter-common libmutter-10-0 gir1.2-mutter-10
[sudo] password for user0:
mutter-common:
  Installed: 42.9-0ubuntu3
  Candidate: 42.9-0ubuntu3
  Version table:
 *** 42.9-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     42.9-0ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     42.0-3ubuntu2 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
libmutter-10-0:
  Installed: 42.9-0ubuntu3
  Candidate: 42.9-0ubuntu3
  Version table:
 *** 42.9-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     42.9-0ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     42.0-3ubuntu2 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
gir1.2-mutter-10:
  Installed: 42.9-0ubuntu3
  Candidate: 42.9-0ubuntu3
  Version table:
 *** 42.9-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
   ...

Read more...

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Fabio, or anyone else affected,

Accepted mutter into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-jammy
removed: verification-done verification-done-jammy
Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :
Download full text (4.6 KiB)

I just tested Ubuntu 22.04 and I can confirm it fixes the issue.

First, used 22.04 with the current mutter version available in jammy-updates:

user1@U-20CG3JVH1ALS3:~$ sudo apt-cache policy mutter-common libmutter-10-0 gir1.2-mutter-10
[sudo] password for user1:
mutter-common:
  Installed: 42.9-0ubuntu1
  Candidate: 42.9-0ubuntu1
  Version table:
 *** 42.9-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
libmutter-10-0:
  Installed: 42.9-0ubuntu1
  Candidate: 42.9-0ubuntu1
  Version table:
 *** 42.9-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
gir1.2-mutter-10:
  Installed: 42.9-0ubuntu1
  Candidate: 42.9-0ubuntu1
  Version table:
 *** 42.9-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

And I do hit the error when trying to revert after changing the scale:

Jul 24 17:03:37 U-20CG3JVH1ALS3 gnome-shell[3048]: Failed to use linear monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
Jul 24 17:03:37 U-20CG3JVH1ALS3 gnome-shell[3048]: Failed to use fallback monitor configuration: Invalid mode 800x600 (-nan) for monitor 'unknown unknown'
Jul 24 17:03:37 U-20CG3JVH1ALS3 gnome-shell[3048]: Impossible to set scaling on crtc 59 to 1.000000, error id 2
Jul 24 17:03:38 U-20CG3JVH1ALS3 gnome-shell[3048]: Xlib: extension "DPMS" missing on display ":1".

Then, I upgraded to package from -proposed:

user1@U-20CG3JVH1ALS3:~$ sudo apt-cache policy mutter-common libmutter-10-0 gir1.2-mutter-10
[sudo] password for user1:
mutter-common:
  Installed: 42.9-0ubuntu4
  Candidate: 42.9-0ubuntu4
  Version table:
 *** 42.9-0ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     42.9-0ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     42.0-3ubuntu2 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
libmutter-10-0:
  Installed: 42.9-0ubuntu4
  Candidate: 42.9-0ubuntu4
  Version table:
 *** 42.9-0ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     42.9-0ubuntu1 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     42.0-3ubuntu2 500
        500 http://sa-east-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
gir1.2-mutter-10:
  Installed: 42.9-0ubuntu4
  Candidate: 42.9-0ubuntu4
  Version table:
 *** 42.9-0ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     42.9-0ubuntu1 500
...

Read more...

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for mutter has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package mutter - 42.9-0ubuntu4

---------------
mutter (42.9-0ubuntu4) jammy; urgency=medium

  * Add Revert-data-udev-Don-t-disable-KMS-modifiers-on-newer-i91.patch
    to fix rendering failures on older kernels (5.15) when run on newer
    hardware (Intel Alder Lake). (LP: #2026887)

mutter (42.9-0ubuntu2) jammy; urgency=medium

  * Add clutter-frame-clock-Avoid-rapidly-toggling-dynamic-max-re.patch to
    avoid cursor stutter (LP: #2023766)
  * Add backends-x11-Return-zero-Hz-instead-of-nan-Hz-for-incompl.patch
    so that incomplete graphics mode definitions are reported as having a
    refresh rate of 0 Hz instead of -nan Hz. This also fixes the behaviour
    of the 'Revert Settings' button (LP: #2020782)

 -- Daniel van Vugt <email address hidden> Thu, 13 Jul 2023 08:15:36 -0400

Changed in mutter (Ubuntu Jammy):
status: Fix Committed → Fix Released
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.