GNOME Bugzilla – Bug 574931
gnome-settings-daemon and gnome-display-properties slow down xserver when external monitor added
Last modified: 2009-03-19 18:48:52 UTC
Please describe the problem: I am reposting details of the bug report at (https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/339228), which has several strace logs toward the bottom. Please let me know if I should provide more information. Whenever I plugin an external flatscreen TV CPU use goes up, the mouse jumps around and performance becomes jerky. The external monitor flickers for a while and eventually gives up. Killing gnome-settings-daemon immediately causes the external monitor to display properly. Restarting gnome-settings-daemon or starting gnome-display-properties separately both cause the external monitor to stop displaying. When I tail the Xorg.0.log during these times there are spikes in messages about polling the connected monitors for their display sizes. Below I've included the text I wrote in comments to a similar bug (on Launchpad) (https://bugs.launchpad.net/ubuntu/+source/libxrandr/+bug/307306) that was eventually traced to gnome-settings-daemon and gnome-power-manager. On a Macbook 1,1 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03) Philips 42" LCD television === This g-s-d problem caused me to misinterpret a problem with dual-monitor displays. On a Macbook 1,1 whenever I plugged in a DVI-to-HDMI connector to a flatscreen television (using a TMDS-1 output on an intel card), on hotplug the machine would start to slow down. On coldplug and an unaltered xorg.conf it would attempt to load both displays but the flatscreen would start flickering on and off and eventually stop attempting to display anything. xrandr would show both active LVDS and TMDS-1 connections. Any attempt to use gnome-display-settings would only show a blank application window that could not be closed except by force quit. I had assumed that this was an issue directly with xserver-xorg-intel until I saw this bug: https://bugs.launchpad.net/ubuntu/+source/libxrandr/+bug/307306. As of today, killing gnome-settings-daemon immediately caused the flatscreen video to appear and slowness issues are gone. Trying to use gnome-display-settings immediately kills the display and shows the blank window again. Perhaps this points to xrandr and intel, or xrandr and dual-monitor auto-detection? Just to be clear, these are the same symptoms that Chousuke reported here: https://bugs.launchpad.net/ubuntu/+source/libxrandr/+bug/307306/comments/37. Running gnome-display-properties will cause the screen to go black until it's closed, regardless of whether g-s-d is running. A clean X session with g-s-d disabled at startup and briefly running gnome-display-properties is the same size as the current log. ProblemType: Bug Architecture: i386 DistroRelease: Ubuntu 9.04 Package: gnome-settings-daemon 2.25.92-0ubuntu4 ProcEnviron: PATH=(custom, user) LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gnome-settings-daemon Uname: Linux 2.6.28-8-generic i686 Steps to reproduce: 1. Start gnome-settings-daemon with TV plugged in OR 1. Plug in TV while gnome-settings-daemon is running OR 1. Start gnome-display-properties with TV plugged in Actual results: External displays flickers and then quits. CPU usage in Xorg is high, around 60%. Mouse jumps around. Expected results: Does this happen every time? Yes. Other information: When I strace g-s-d it sets up and forks. If I strace the pid there's a lot of stuff like this repeating: writev(3, [{"\226\t\3\0>\0\0\0[\276\0\0"..., 12}, {NULL, 0}, {""..., 0}], 3) = 12 select(4, [3], [], NULL, NULL) = 1 (in [3]) read(3, "\1|\335\3\4\0\0\0[\276\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\2\0\0\0\0\0\0"..., 4096) = 48 read(3, 0x84bf068, 4096) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=14, events=POLLIN}], 7, 0) = 0 (Timeout) The above is actually from the end of an strace on gnome-display-properties where it occurs as well.
The patch described here fixes my problem: https://bugs.launchpad.net/ubuntu/+source/libxrandr/+bug/307306/comments/23
I'm not sure that we can simply ignore events like that. We need to distinguish between the "give me the current screen state" API and the "refresh the screen state from the X server" API. That is, we need to make gnome_rr_screen_new() use XRRGetScreenResourcesCurrent() and gnome_rr_screen_refresh() use XRRGetScreenResources(). With that, we should be able to process events without reprobing, except for the following... We call XRRGetScreenSizeRange() and that also seems to generate a probe in the X server. That needs to be fixed in X.
On the other hand, we pay no attention to output properties right now, so it could be fine to ignore their events... Søren, what do you think?
Oof, duplicate, and the dupe has a patch. *** This bug has been marked as a duplicate of 568160 ***