chjj / compton

A compositor for X11.
Other
2.24k stars 502 forks source link

Is Intel HD 4000 a better choice than NVS 5400m,when using compton to eliminate screen tearing? #237

Closed iviirai closed 9 years ago

iviirai commented 9 years ago

Hi, My laptop is using nVIDIA Optimus technology,but I can disable one of them in bios,so I have 3 choice: 1) Hybrid mode.(needs bumbee-nvidia to get drivers of 2 graphic cards work right) 2) nVIDIA mode.(It's my current choice). 3) Only use Intel integrated card.

Here's the story: I use bspwm as my WM and debian 7.6 as my OS, when I swap two windows,there might be screen tearing (without compton) or flickering(with compton) in right window. I tested both nouveau and nVIDIA driver, and I also tested different compton/backend+vsync combinations including xr-glx-hybrid,there was no difference,screen tearing still happened.

BTW,video play allways works fine,no screen tearing,it only happened when I swapped two TERMINAL windows.

So, maybe it's a window manager problem?Or maybe it's typical nVIDIA problem,that I could use integrated card to make compton works better.

Thanks.

richardgv commented 9 years ago

So, what you get is "flickering" instead tearing when compton is running? Could you please describe the appearance of the "flickering"? Like, the desktop becomes visible for a very short moment? It might be useful if you could provide a screencast/video showing the issue.

The cause of flickering could be quite distant from the cause of tearing, and the fact that you get tearing with an uncomposited screen doesn't necessarily mean the flickering you get when composited is related to it. Some types of flickering might indicate your system is not able to process it fast enough. In my case I'm able to see flickering if I swap windows too fast, for example (and it happens in the window on right side but not the one on left side, as well!). compton (or any other compositors) may increase the delay especially if you have VSync enabled. And considering the fact you do not see tearing during video playback (which where most people have problems in), it's not necessarily a issue of VSync.

And, sorry for my lacking of knowledge about tiling WMs: By "swap windows" did you mean bspc window -s last (which is mapped to super + apostrophe by default)?

maybe it's a window manager problem?

Possibly yes, for a flickering issue (too slow when swapping windows), and usually no for tearing, I suppose.

Or maybe it's typical nVIDIA problem,that I could use integrated card to make compton works better.

I don't really know which of them, Intel IGPs or nVidia cards, are more prone to exhibit tearing issues: I've seen quite a few reports about both. "Flickering" is rare for both, however.

iviirai commented 9 years ago

Thanks Richard.

I'm planning to try other tiling WMs like herbstluftwm and spectrwm, see if different implementations will lead to different results :-) Sorry I don't have a screencast/video showing that issue 'cause I've uninstalled BSPWM already,but I can discribe it: 1) Yes,by "flickering" I mean exactly the desktop under right window become visible for a very short moment."flickering" isn't quite accurate I guess, since it's not constantly flickering, it's just push button-->Right window disappers-->Right window redraw-->done......once window redraw is done, everything seems normal. 2) Left window become dark at the same time.But if I don't enable opacity in compton,because of the dark theme of the terminal,this can't possibly be observed. 3) It's just happend when I use two terminals(xterm and urxvt).If one window is a terminal,the other one is some different application,flickering will never happen. 4) Window split ratio has big influence on "flickering", 50/50 is worse than 55/45.The right window is flickering/vanishing every time I swap two equal size terminal windows, but not that offen if these two windows are not equal in size. 5) If I disabled compton, just a slice of right window would vanish(and desktop became visible), and the "slice" was in random position, maybe bottom,maybe middle or top.

I use super + {_,shift + }{h,j,k,l} bspc window -{f,s} {left,down,up,right} to swap window.

BTW,I tried integrated video card, the same result.

richardgv commented 9 years ago

@A1phaZer0:

It looks like what happens when your system is a bit slow to handle all the changes in time, and the largest delay probably lies in the application or X. Composition may make things worse, as what I stated above, but not all problems lie in the compositor (probably more in X) and it's rare, hard to avoid (on slow systems), and hard to diagnose. Maybe it's possible for a compositor to at least visually reduce the artifact by somehow reusing the old window contents? But I'm not too interested in looking deeply into such problems.

Maybe you could try do a system-wide profiling when swapping windows, try other terminal applications, other WMs, and probably other compositors to see if you would get any luck, though.

iviirai commented 9 years ago

@richardgv

Hi,I tested herbstluftwm with compton, no more "flickering" when swapping windows. :-)

richardgv commented 9 years ago

Oh, I see. Should the issue be closed now?

iviirai commented 9 years ago

OK. Thanks by the way. @richardgv