yshui / picom

A lightweight compositor for X11 with animation support
https://picom.app/
Other
4.08k stars 584 forks source link

Weird flickering ( 7.5 doesn't have this issues) #375

Open heelsleeh opened 4 years ago

heelsleeh commented 4 years ago

Platform

centos *

GPU, drivers, and screen setup

Environment

fvwm

picom version

vgit-df0be

[ 04/09/2020 20:33:46.316 parse_config_libconfig WARN ] vsync option will take a boolean from now on. "false" is interpreted as "false" for compatibility, but this will stop working soon [ 04/09/2020 20:33:46.316 session_init WARN ] This compositor has been renamed to "picom", the "compton" binary will not be installed in the future. Version: vgit-df0be

Extensions:

Misc:

Drivers (inaccurate):

NVIDIA

Configuration:

### Backend/performance options
backend = "glx";
vsync = "false";
unredir-if-possible = "true"
# (TODO: Clean up my notes about selecting a vsync implementation.)
### Shadow
active-opacity=1.000000;
shadow = true;
shadow-radius = 9;
shadow-offset-x = -8;
shadow-offset-y = -8;
shadow-opacity = 0.8;
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# "n:e:Panel",
shadow-exclude = [
"n:e:Notification",
"n:e:panel",
"class_g ?= 'albert'",
"class_g ?= 'slop'",
"class_g ?= 'ConkyBottom'",
"class_g ?= 'fcitx'",
"class_g = 'Firefox' && argb",
"class_g = 'chromium' && argb"
];

### Fading
fading = true;
fade-delta = 8;  # 30;
fade-in-step = 0.08;
fade-out-step = 0.08;
fade-exclude = [
"class_g = 'ConkyBottom'"
];

# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = false; opacity = 0.75; focus = true; };
};
// Paste your configuration here

Steps of reproduction

1.install picom from git master repo

  1. run poicom

Expected behavior

no flickering

Current Behavior

Weird flickering and get some errors below: [ 04/09/2020 20:35:19.466 x_fence_sync ERROR ] Failed to trigger the fence (X error 136 XSyncBadFence request 134 minor 15 serial 2027) [ 04/09/2020 20:35:19.466 paint_all ERROR ] x_fence_sync failed, xrender-sync-fence will be disabled from now on.

Stack trace

Other details

yshui commented 4 years ago

do you have a video or a screenshot?

heelsleeh commented 4 years ago

do you have a video or a screenshot? thanks for reply sample here : https://www.youtube.com/watch?v=pn6nqlVGzrc Happens when i move the mouse.

yshui commented 4 years ago

Can you give me more details about your GPU and drivers, etc?

heelsleeh commented 4 years ago

Can you give me more details about your GPU and drivers, etc? glxinfo -B name of display: :0 display: :0 screen: 0 direct rendering: Yes Memory info (GL_NVX_gpu_memory_info): Dedicated video memory: 4096 MB Total available memory: 4096 MB Currently available dedicated video memory: 3849 MB OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce GTX 770/PCIe/SSE2 OpenGL core profile version string: 4.6.0 NVIDIA 430.14 OpenGL core profile shading language version string: 4.60 NVIDIA OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 430.14 OpenGL shading language version string: 4.60 NVIDIA OpenGL context flags: (none) OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 430.14 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

yshui commented 4 years ago

Does this happen consistently? Or do you need to do something to trigger it?

heelsleeh commented 4 years ago

not consistently, no idea what triggert it, it just happens suddenly and never left until log out, i'll test it more see what can i found.
does it have some Tips to debug it ?

absolutelynothelix commented 4 years ago

well, if you pretend that 7.5 doesn't have this issue, you may use git bisect to find the commit that broke things

sardior commented 4 years ago

I ran into the same problem on Voidlinux, all I can add is that vsync seams to be disabled in addition to the flickering.

voidmann commented 4 years ago

Can confirm it's happening here too, Picom 8-2 on Archlinux.

absolutelynothelix commented 4 years ago

@sardior, @voidmann, 7.5 doesn't have this issue for both of you aswell?

voidmann commented 4 years ago

@voidmann, 7.5 doesn't have this issue for both of you aswell?

After testing for a few hours it doesn't seem to have the issue on picom-7.5-3

sardior commented 4 years ago

@sardior, @voidmann, 7.5 doesn't have this issue for both of you aswell?

Thats right, picom-7.5_1 does not have this issue.

CompaqDisc commented 4 years ago

Can confirm similar artifacts with picom 8-2 on Arch, 7.5-3 does not have this issue. OpenGL renderer string: AMD Radeon RX 5700 XT (NAVI10, DRM 3.36.0, 5.6.11-arch1-1, LLVM 10.0.0)

absolutelynothelix commented 4 years ago

can someone do git bisect from 7.5 to 8.0 to find the commit that introduced this issue?

CompaqDisc commented 4 years ago

It looks like this may have been introduced in 93f0d80572e47a1297dbf1af18a4ef498fa0bfe2 I can confirm that setting use-damage = false resolved the issue in my instance.

Does anyone else have luck with this option?

ghost commented 4 years ago

It looks like this may have been introduced in 93f0d80 I can confirm that setting use-damage = false resolved the issue in my instance.

Does anyone else have luck with this option?

It seems like it fixed it for me as well. Thanks!

maximeplante commented 4 years ago

It looks like this may have been introduced in 93f0d80 I can confirm that setting use-damage = false resolved the issue in my instance.

Does anyone else have luck with this option?

Seems like it worked for me too!

absolutelynothelix commented 4 years ago

@yshui, looks like use-damage is the cause. i also found similiar discussion in #242 and #237. any ideas?

sardior commented 4 years ago

Withuse-damage = false it works for mee too. Also my vsync problem is probably unrelated, setting xrender-sync-fence = true fixed that part for me.

diffficult commented 4 years ago

Running XFCE on Arch with NVIDIA drivers, run into que same error. It would make certain parts of the windows/desktop flicker sometimes. Most noticeable on stuff that used some kind of transparency (some of my terminals or windows and top bar).

So far use-damage= false seems to be doing the trick since I haven't seen any flickering on any element.

Nevermind, had to revert back to 7.5_3

kpa28-git commented 4 years ago

I'm using arch/nvidia/bspwm and use-damage = false fixed my window flickering problem as of now. I also had vertical "twitching" when opening pdfs in zathura - as if someone was quickly spazzing the up and down scroll keys. No idea why a compositor affected zathura in that way, but the problem is fixed now.

adworacz commented 4 years ago

Jumping on with my own version of this bug report:

Videos of issues: vid1 vid2

After messing around with several options, the following seemed to fix it for me (while still allowing for the default use-damage=true)

  1. xrender-sync-fence=true <-- this appeared to fix the issue I showed in the videos above
  2. --experimental-backends (when starting picom) <-- this fixed different flicker I encountered when popping rofi open while playing a video in Flowblade.

Summary of config:

# Disable Shadows
shadow = false;

### Disable Fading
fading = false;

### Backend/performance tuning
backend = "glx";
# setting to false, as screen tearing in Firefox videos seems better. 
#unredir-if-possible = true;
unredir-if-possible = false;
refresh-rate = 0;
vsync = true;
dbe = false;
# Set to empty to disable
#invert-color-include = [ ];
glx-copy-from-front = false;

# Fixes "Failed to trigger the fence" issues
# on my GTX 1660
# Removes a lot of artifacting.
xrender-sync-fence = true;

#### Window specific configuration
detect-client-leader = true;
detect-client-opacity = true;
detect-transient = true;
focus-exclude = [ "class_g = 'Cairo-clock'" ];
mark-wmwin-focused = true;
mark-ovredir-focused = true;

(wintypes below here...)

For context here's a sample of my inxi output:

System:
  Kernel: 5.4.40-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0
  Desktop: bspwm 0.9.7-10-g2ffd9c1 info: polybar dm: LightDM 1.30.0
  Distro: Manjaro Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: ROG STRIX TRX40-E GAMING v: Rev 1.xx
  serial: <filter> BIOS: American Megatrends v: 0902 date: 03/17/2020
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master 2S
  serial: <filter> charge: 55% (should be ignored) rechargeable: yes
  status: Discharging
Memory:
  RAM: total: 62.73 GiB used: 2.25 GiB (3.6%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Topology: 24-Core (3-Die) model: AMD Ryzen Threadripper 3960X bits: 64
  type: MT MCP MCM arch: Zen L2 cache: 12.0 MiB bogomips: 364260
  Speed: 2193 MHz min/max: 2200/3800 MHz boost: enabled Core speeds (MHz):
  1: 2193 2: 2198 3: 2195 4: 2196 5: 2193 6: 2193 7: 2194 8: 3590 9: 2051
  10: 2050 11: 2195 12: 2195 13: 2193 14: 2196 15: 2195 16: 2196 17: 2192
  18: 2275 19: 2016 20: 2015 21: 2196 22: 2193 23: 2192 24: 2195 25: 2196
  26: 2195 27: 2078 28: 2194 29: 2197 30: 2193 31: 2194 32: 2197 33: 2196
  34: 3594 35: 2195 36: 2053 37: 2053 38: 2194 39: 2194 40: 2192 41: 2194
  42: 2194 43: 2194 44: 2194 45: 2040 46: 2195 47: 2197 48: 2194
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1 bmi2
  bpext cat_l3 cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy
  constant_tsc cpb cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total cqm_occup_llc
  cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid f16c flushbyasid fma
  fpu fsgsbase fxsr fxsr_opt ht hw_pstate ibpb ibs irperf lahf_lm lbrv lm mba
  mca mce misalignsse mmx mmxext monitor movbe msr mtrr mwaitx nonstop_tsc nopl
  npt nrip_save nx osvw overflow_recov pae pat pausefilter pclmulqdq pdpe1gb
  perfctr_core perfctr_llc perfctr_nb pfthreshold pge pni popcnt pse pse36 rdpid
  rdrand rdseed rdt_a rdtscp rep_good sep sev sha_ni skinit smap smca sme smep
  ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 stibp succor svm svm_lock syscall tce
  topoext tsc tsc_scale umip v_vmsave_vmload vgif vmcb_clean vme vmmcall
  wbnoinvd wdt xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves
Graphics:
  Device-1: NVIDIA TU116 [GeForce GTX 1660] vendor: Gigabyte driver: nvidia
  v: 440.82 bus ID: 01:00.0 chip ID: 10de:2184
  Display: x11 server: X.Org 1.20.8 driver: nvidia resolution: 3440x1440~100Hz
  OpenGL: renderer: GeForce GTX 1660/PCIe/SSE2 v: 4.6.0 NVIDIA 440.82
  direct render: Yes
diffficult commented 4 years ago

Jumping on with my own version of this bug report:

Videos of issues: vid1 vid2

Looks similar to my flickering issues. I'm experiencing random flickering on terminal text, doesn't matter if the terminal is using transparency or not or which terminal it is (st, xfce4-terminal, alacritty, kitty, etc).

Also getting that weird object flickering, not limited to a specific window, but certain elements, even in webpages on Chromium, Brave and Firefox.

I will later on try your settings and report back. Thanks for posting the videos. @adworacz

Mange commented 3 years ago

I've been plagued with this issue for a fairly long time (never realized that picom could've been the cause; I thought it was my WM). After testing with just --experimental-backends the flickering seems to have disappeared completely (but I've only tried a handful of hours for now, but I usually got the issue at least 3 times per hour before).

I did not need to change anything else in my config.


My symptoms were: Flickering window borders which could only be stopped by focusing another window on the same screen, or opening a new window if no other window was available, then switching back again.

af7567 commented 3 years ago

It looks like this may have been introduced in 93f0d80 I can confirm that setting use-damage = false resolved the issue in my instance.

Finally found this thread after months of weird flickering :) and use-damage = false seems to fix it for me too. I had the problem very frequently when using xfreerdp to connect to Windows servers. At first I thought it was something with RDP but then it started happening in terminals and menus too. It appears to start switching between 2 different buffers of the window with a random time interval and the only way to stop it is to either do something to force that part of the window to change and hope it's OK, or change focus away from the affected window and back again.

I am using Openbox 3.6.1, xorg-1.20.9 on Slackware64-current with an Nvidia GTX970. The Nvidia drivers were always kept recent.

jlindgren90 commented 3 years ago

I have serious flickering issues starting with 93f0d80572e47a1297dbf1af18a4ef498fa0bfe2 here too.

I can open a new bug report or provide more details if it's helpful. Short summary is:

It may be something nvidia-related as I didn't see the same issue on an intel-only system.

yshui commented 3 years ago

Does this happen if you set use-damage = true in 7.5?

jlindgren90 commented 3 years ago

Does this happen if you set use-damage = true in 7.5?

Yes, for me 7.5 also has the same issue if I set use-damage = true.

yshui commented 3 years ago

@jlindgren90 do you know what's the earliest version with this problem? does compton itself have this problem if you set glx-swap-method = "buffer-age"?

jlindgren90 commented 3 years ago

Yes, compton has the same issue with glx-swap-method = "buffer-age".

yshui commented 3 years ago

Can others help confirm if compton with glx-swap-method = "buffer-age" has this problem for them as well? And please include your driver information.

liskin commented 3 years ago

I can no longer reproduce this no matter what version of compton/picom I use. I tried downgrading xserver-xorg-core to what I had when #237 was reported and still can't reproduce it. I'm guessing the issue is somewhere else, but I don't know where. (Also, I've heard that some people experienced the same issue with just the builtin TearFree compositor of xf86-video-intel, without any picom/compton.)

yshui commented 3 years ago

@liskin What driver do you use?

liskin commented 3 years ago

@yshui modesetting

jlindgren90 commented 3 years ago

It may be specific to the modesetting driver. I don't see the same flickering with the proprietary nvidia driver on the same system.

edit: Okay, I spoke too soon. The flickering isn't as bad, and is different, but is definitely still there with the nvidia driver. It seems to be limited to specific windows now and looks like old frames are being shown. For example, the status bar in Geany blinks back and forth between "line 4/5" and "line 5/5" after I move the text cursor -- timed with the cursor blink period.

yshui commented 3 years ago

Can you record this bug happening with the --monitor-repaint option? I'd like to know if the damage region is correct or not. If we can rule out the damage region being wrong, then this is probably a driver bug.

yshui commented 3 years ago

@jlindgren90 do you have dual GPU? (i.e. NVIDIA Optimus)

jlindgren90 commented 3 years ago

@yshui Yes and no? The laptop has two GPUs (intel + nvidia), but I currently have Optimus disabled in the BIOS and am using only the nvidia card.

I see don't see the issue with the xrender backend (only with glx). And with glx apparently --monitor-repaint does not work.

Here is what the flickering looks like in Geany. It definitely looks to me like two frames are being swapped, and one is out-of-date:

https://user-images.githubusercontent.com/1244737/104082951-715bf500-5208-11eb-9073-0027fcb8db35.mp4

jlindgren90 commented 3 years ago

The xr_glx_hybrid backend also seems free of the flicker issue (and has working vsync) so I'm switching to that for now.

yshui commented 3 years ago

@jlindgren90 Can you try --monitor-repaint --experimental-backends?

rauldipeas commented 3 years ago

@jlindgren90 Can you try --monitor-repaint --experimental-backends?

I'm facing this problem and aparently this option solved it.

More than 3 hours without flickering.

jlindgren90 commented 3 years ago

--experimental-backends (with backend = "glx";) seems to fix the issue for me too. So the problem seems to be specific to the old glx backend.

CPU usage is much improved too. Xorg was using 20% with the old glx backend and use-damage = "false";. Now it is 3% in the same test scenario.

@yshui Can I buy you a beer or something? Your work on picom is excellent, and much appreciated!

yshui commented 3 years ago

So there could be a bug with damage in the legacy backends then.

Probably not worth fixing at this point.

rauldipeas commented 3 years ago

In fact, flickering happen eventually, using use-damager = "false" it's ocurring with less frequency, maybe there's something more to do.

I'm getting it one time at day, or somedays not.

jlindgren90 commented 3 years ago

Okay I'm still seeing some occasional flickering of old frames here too, with --experimental-backends. I think less frequently than before. I noticed it in xfce4-terminal (scrolling) and in LibreOffice Calc (filling cells) most recently.

jlindgren90 commented 3 years ago

@yshui I can semi-reliably reproduce this still in LibreOffice Calc with --experimental-backends, by filling cells. I can see the cells get filled correctly for a split second, and then they go blank again until some other repaint is triggered. Sometimes they can flicker between filled and blank several times.

Adding --monitor-repaint makes the issue disappear, but shows that filling cells triggers a repaint of the whole spreadsheet area, shortly (~100 ms?) followed by a repaint of the toolbar.

Removing --experimental-backends and switching to the xr_glx_hybrid backend seems to solve the issue.

jlindgren90 commented 3 years ago

I just tested next and this seems to be fixed since cbe34158f3a364ff87bce948c787e0383e0b0c54. The "XSyncBadFence" error mentioned in the original issue description is gone since that commit too.

dm17 commented 1 year ago

Dealt with this for way too long and none of the fixes seemed to work. --experimental-backends doesn't seem to exist in picom anymore.

Anyway, switching to xcompmgr fixed this 7mo old issue for me.