Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compton 90% cpu usage at blank screen idle #92

Closed
siyia2 opened this issue Jan 24, 2019 · 7 comments
Closed

Compton 90% cpu usage at blank screen idle #92

siyia2 opened this issue Jan 24, 2019 · 7 comments

Comments

@siyia2
Copy link

siyia2 commented Jan 24, 2019

Platform

gentoo/debian

GPU, drivers, and screen setup

ryzen 2200u vega 3 single screen laptop

Environment

xfce4 4.12.5

Compton version

latest from git

Compton configuration:

# Shadow
shadow = true;
no-dnd-shadow = true;
no-dock-shadow = true;
clear-shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
shadow-opacity = 0.5;
# shadow-red = 1.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
shadow-exclude = [
	"name = 'Notification'",
	"class_g = 'VirtualBox'",
	"class_g = 'Chromium'",
	"class_g = 'Conky'",
	"class_g ?= 'Notify-osd'",
	"class_g = 'Cairo-clock'",
	"! name~=''",
	"_GTK_FRAME_EXTENTS@:c"
];
# shadow-exclude = "n:e:Notification";
# shadow-exclude-reg = "x10+0+0";
# xinerama-shadow-crop = true;

# Opacity
menu-opacity = 0.87;
inactive-opacity = 1.0;
# active-opacity = 0.8;
frame-opacity = 0.95;
inactive-opacity-override = false;
alpha-step = 0.06;
# inactive-dim = 0.2;
# inactive-dim-fixed = true;
# blur-background = true;
# blur-background-frame = true;
#blur-kern = "3x3box";
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
# blur-background-fixed = true;
#blur-background-exclude = [
#	"window_type = 'dock'",
#	"window_type = 'desktop'",
#	"_GTK_FRAME_EXTENTS@:c"
#];

opacity-rule = [ "80:class_g = 'XTerm'" ];
#opacity-rule = [ "80:class_g = 'UXTerm'" ];
#opacity-rule = [ "99:class_g = 'VirtualBox'" ];

# Fading
#fading = true;
#fade-delta = 10;
#fade-in-step = 0.03;
#fade-out-step = 0.03;
#no-fading-openclose = true;
# no-fading-destroyed-argb = true;
#fade-exclude = [
#];

# Other
backend = "glx";
#backend = "xrender";
mark-wmwin-focused = true;
mark-ovredir-focused = true;
# use-ewmh-active-win = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 60;
vsync = "opengl-mswc";
#vsync = "opengl";
#dbe = false;
paint-on-overlay = true;
sw-opti = true;
unredir-if-possible = true;
# unredir-if-possible-delay = 5000;
unredir-if-possible-exclude = [ "class_g = 'smplayer'",
"class_g = 'firefox'","class_g = 'Medieval2'" ];
focus-exclude = [ "class_g = 'Cairo-clock'" ];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
# resize-damage = 1;

# GLX backend
glx-no-stencil = true;
glx-copy-from-front = false;
glx-use-copysubbuffermesa = true;
glx-no-rebind-pixmap = true;
#glx-swap-method = "undefined";
glx-use-gpushader4 = true;
#xrender-sync = true;
#xrender-sync-fence = true;

# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; };
};

Steps of reproduction

Let lightdm lock screen at idle after a few minutes compton gets at 90% cpu usage

Expected behavior

1-2% cpu usage at idle

Current Behavior

90% cpu usage at idle

Stack trace

Other details

i use amd and mesa 18.3.2 also laptop has an additional amd dedicated gpu

@yshui
Copy link
Owner

yshui commented Jan 24, 2019

@siyia2 Does this only happen when you are at the lock screen?

@siyia2
Copy link
Author

siyia2 commented Jan 24, 2019

no it happens after screen is blank and goes to sleep

@yshui
Copy link
Owner

yshui commented Jan 24, 2019

@siyia2 I might know where the problem is. In you config file, can you try change sw-opti=true to sw-opti=false, and see if that solves your problem?

@siyia2
Copy link
Author

siyia2 commented Jan 24, 2019

ok will do and post back

@siyia2
Copy link
Author

siyia2 commented Jan 24, 2019

wow i think that did the trick!i also changed opacity = 0.75; to opacity = true; in my wintypes,compton cpu usage at idle is 1% now, is this a bug?

@yshui
Copy link
Owner

yshui commented Jan 24, 2019

@siyia2 Yep, this is a bug. Might still take some time for me to find the root cause. In the meantime, just avoid using sw-opti. I doubt the option actually does anything nowadays.

@siyia2
Copy link
Author

siyia2 commented Jan 24, 2019

ok thx!

@siyia2 siyia2 closed this as completed Jan 24, 2019
@yshui yshui reopened this Jan 24, 2019
@yshui yshui closed this as completed in 5e49ab0 Jan 25, 2019
yshui added a commit that referenced this issue Jan 30, 2019
Previously, compton fails to stop draw_idle in some cases when sw_opti
is enabled.

sw_opti is a feature that limits the draw frequence to vblank frequence.
It adds a delay to drawing when the screen is updated more frequently
than the vblank frequence. However when the delay is not used (i.e. the
screen is updated infrequent enough), compton will start drawing the
frame directly without using the delay. And specically in this case,
compton will fail to stop the draw_idle, causing a callback to be called
once per loop of the mainloop, resulting in high CPU usage.

Fixes #92

Signed-off-by: Yuxuan Shui <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants