Animations aren't smooth when sync to vblank is enabled
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| Compiz |
Fix Released
|
Undecided
|
Compiz Linaro Team | ||
| Ubutter |
Fix Released
|
Undecided
|
Unassigned | ||
| compiz (Ubuntu) |
Fix Released
|
Undecided
|
Daniel van Vugt | ||
Bug Description
WORKAROUND (PREFERRED):
1. Run ccsm
2. Go to Workarounds
3. Enable "Force full screen redraws (buffer swap) on repaint"
WORKAROUND (RELIABLE):
1. Run ccsm
2. Go to OpenGL
3. Disable "Sync To VBlank"
ORIGINAL DESCRIPTION:
When "Sync to Vblank" is enabled in the OpenGL section of the CompizConfig Settings Manager (the default setting for precise) animations, specially minimize and maximize animations, aren't smooth and stutter a lot. Moving windows, or entering the Expo mode are smooth though.
Disabling "Sync to Vblank" CompizConfig Settings Manager solves the problem. However, glxgears still informs that it is "running synchronized to the vertical refresh" so I am not sure what the "Sync to Vblank" options actually does.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: unity 5.12-0ubuntu1.1
ProcVersionSign
Uname: Linux 3.2.0-24-generic x86_64
NonfreeKernelMo
.tmp.unity.
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
CompizPlugins: [core,composite
CompositorRunning: compiz
CrashDB: unity
Date: Thu May 24 21:32:03 2012
DistUpgraded: Fresh install
DistroCodename: precise
DistroVariant: ubuntu
DkmsStatus:
bcmwl, 5.100.82.38+bdcom, 3.2.0-23-generic, x86_64: installed
bcmwl, 5.100.82.38+bdcom, 3.2.0-24-generic, x86_64: installed
virtualbox, 4.1.12, 3.2.0-22-generic, x86_64: installed
virtualbox, 4.1.12, 3.2.0-23-generic, x86_64: installed
virtualbox, 4.1.12, 3.2.0-24-generic, x86_64: installed
EcryptfsInUse: Yes
GraphicsCard:
Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 02) (prog-if 00 [VGA controller])
Subsystem: Hewlett-Packard Company Device [103c:1436]
Advanced Micro Devices [AMD] nee ATI Madison [Radeon HD 5000M Series] [1002:68c1] (rev ff) (prog-if ff)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120301)
MachineType: Hewlett-Packard HP ENVY 14 Notebook PC
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: unity
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/01/2011
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: F.26
dmi.board.
dmi.board.name: 1436
dmi.board.vendor: Hewlett-Packard
dmi.board.version: 59.24
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.chassis.
dmi.modalias: dmi:bvnHewlett-
dmi.product.name: HP ENVY 14 Notebook PC
dmi.product.
dmi.sys.vendor: Hewlett-Packard
version.compiz: compiz 1:0.9.7.8-0ubuntu1
version.ia32-libs: ia32-libs 20090808ubuntu36
version.libdrm2: libdrm2 2.4.32-1ubuntu1
version.
version.
version.
version.
version.
version.
version.
version.
Related branches
- Daniel van Vugt: Approve
- Sam Spilsbury: Approve
- Tim Penhey: Pending requested
- Alan Griffiths: Pending requested
- jenkins: Pending (continuous-integration) requested
-
Diff: 16838 lines (+7498/-4718) 104 files modifiedapicmake/CMakeLists.txt (+2/-0)
cmake/CompizCommon.cmake (+12/-0)
cmake/CompizPlugin.cmake (+14/-10)
cmake/FindCompiz.cmake (+1/-1)
cmake/FindOpenGLES2.cmake (+51/-0)
cmake/base.cmake (+3/-0)
cmake/plugin_extensions/CompizOpenGLFixups.cmake (+22/-0)
include/core/wrapsystem.h (+8/-0)
plugins/CMakeLists.txt (+30/-0)
plugins/animation/CMakeLists.txt (+3/-5)
plugins/animation/include/animation/animation.h (+1/-1)
plugins/animation/include/animation/animeffect.h (+3/-3)
plugins/animation/include/animation/grid.h (+0/-2)
plugins/animation/src/animation.cpp (+85/-27)
plugins/animation/src/grid.cpp (+25/-258)
plugins/animation/src/private.h (+3/-3)
plugins/annotate/src/annotate.cpp (+149/-71)
plugins/blur/CMakeLists.txt (+12/-12)
plugins/clone/src/clone.cpp (+0/-5)
plugins/compiztoolbox/src/compiztoolbox.cpp (+5/-18)
plugins/copytex/src/copytex.cpp (+9/-0)
plugins/cube/include/cube/cube.h (+9/-6)
plugins/cube/src/cube.cpp (+85/-80)
plugins/decor/src/decor.cpp (+29/-27)
plugins/decor/src/decor.h (+2/-2)
plugins/expo/CMakeLists.txt (+4/-8)
plugins/expo/src/expo.cpp (+256/-111)
plugins/expo/src/expo.h (+3/-4)
plugins/ezoom/src/ezoom.cpp (+118/-52)
plugins/grid/src/grid.cpp (+108/-53)
plugins/imgsvg/src/imgsvg.cpp (+9/-6)
plugins/imgsvg/src/imgsvg.h (+2/-1)
plugins/kdecompat/src/kdecompat.cpp (+7/-22)
plugins/mag/src/mag.cpp (+102/-73)
plugins/mag/src/mag.h (+2/-0)
plugins/neg/src/neg.cpp (+33/-106)
plugins/neg/src/neg.h (+3/-6)
plugins/obs/src/obs.cpp (+8/-7)
plugins/obs/src/obs.h (+1/-1)
plugins/opengl/CMakeLists.txt (+14/-4)
plugins/opengl/compiz-opengl.pc.in (+1/-1)
plugins/opengl/include/opengl/doublebuffer.h (+39/-0)
plugins/opengl/include/opengl/fragment.h (+0/-125)
plugins/opengl/include/opengl/framebufferobject.h (+104/-0)
plugins/opengl/include/opengl/matrix.h (+2/-0)
plugins/opengl/include/opengl/opengl.h (+441/-73)
plugins/opengl/include/opengl/program.h (+75/-0)
plugins/opengl/include/opengl/programcache.h (+51/-0)
plugins/opengl/include/opengl/shadercache.h (+100/-0)
plugins/opengl/include/opengl/texture.h (+5/-0)
plugins/opengl/include/opengl/vector.h (+3/-3)
plugins/opengl/include/opengl/vertexbuffer.h (+130/-0)
plugins/opengl/opengl.xml.in (+15/-0)
plugins/opengl/src/doublebuffer/CMakeLists.txt (+31/-0)
plugins/opengl/src/doublebuffer/src/double-buffer.cpp (+76/-0)
plugins/opengl/src/doublebuffer/tests/CMakeLists.txt (+24/-0)
plugins/opengl/src/doublebuffer/tests/test-opengl-double-buffer.cpp (+98/-0)
plugins/opengl/src/fragment.cpp (+0/-1146)
plugins/opengl/src/framebufferobject.cpp (+221/-0)
plugins/opengl/src/matrix.cpp (+54/-0)
plugins/opengl/src/paint.cpp (+472/-443)
plugins/opengl/src/privatefragment.h (+0/-54)
plugins/opengl/src/privates.h (+101/-13)
plugins/opengl/src/privatetexture.h (+32/-0)
plugins/opengl/src/privatevertexbuffer.h (+149/-0)
plugins/opengl/src/program.cpp (+262/-0)
plugins/opengl/src/programcache.cpp (+175/-0)
plugins/opengl/src/screen.cpp (+938/-154)
plugins/opengl/src/shadercache.cpp (+246/-0)
plugins/opengl/src/texture.cpp (+152/-22)
plugins/opengl/src/vector.cpp (+2/-2)
plugins/opengl/src/vertexbuffer.cpp (+634/-0)
plugins/opengl/src/window.cpp (+65/-83)
plugins/resize/src/resize.cpp (+84/-31)
plugins/resizeinfo/src/resizeinfo.cpp (+45/-27)
plugins/resizeinfo/src/resizeinfo.h (+2/-1)
plugins/ring/src/ring.cpp (+19/-37)
plugins/ring/src/ring.h (+1/-1)
plugins/scale/src/scale.cpp (+10/-17)
plugins/scaleaddon/src/scaleaddon.cpp (+51/-21)
plugins/scaleaddon/src/scaleaddon.h (+2/-2)
plugins/scalefilter/src/scalefilter.cpp (+1/-6)
plugins/screenshot/src/screenshot.cpp (+47/-20)
plugins/shift/src/shift.cpp (+95/-98)
plugins/shift/src/shift.h (+1/-1)
plugins/staticswitcher/src/staticswitcher.cpp (+156/-64)
plugins/staticswitcher/src/staticswitcher.h (+5/-3)
plugins/switcher/src/switcher.cpp (+45/-42)
plugins/text/include/text/text.h (+2/-1)
plugins/text/src/text.cpp (+53/-24)
plugins/thumbnail/src/thumbnail.cpp (+301/-118)
plugins/thumbnail/src/thumbnail.h (+3/-1)
plugins/wall/src/wall.cpp (+60/-46)
plugins/wall/src/wall.h (+1/-1)
plugins/water/src/shaders.h (+200/-0)
plugins/water/src/water.cpp (+281/-801)
plugins/water/src/water.h (+33/-63)
plugins/water/water.xml.in (+26/-2)
plugins/wobbly/src/wobbly.cpp (+20/-176)
plugins/wobbly/src/wobbly.h (+0/-1)
plugins/workarounds/src/workarounds.cpp (+14/-0)
plugins/workarounds/src/workarounds.h (+4/-0)
plugins/workspacenames/src/workspacenames.cpp (+4/-8)
plugins/workspacenames/src/workspacenames.h (+1/-1)
- BootDmesg.txt Edit (57.6 KiB, text/plain; charset="utf-8")
- BootLog.gz Edit (806 bytes, application/x-gzip)
- CurrentDmesg.txt Edit (35.1 KiB, text/plain; charset="utf-8")
- Dependencies.txt Edit (7.0 KiB, text/plain; charset="utf-8")
- DpkgLog.txt Edit (445.9 KiB, text/plain; charset="utf-8")
- GconfCompiz.txt Edit (36.8 KiB, text/plain; charset="utf-8")
- LightdmLog.txt Edit (3.0 KiB, text/plain; charset="utf-8")
- Lspci.txt Edit (13.1 KiB, text/plain; charset="utf-8")
- Lsusb.txt Edit (365 bytes, text/plain; charset="utf-8")
- MonitorsUser.xml.txt Edit (5.5 KiB, text/plain; charset="utf-8")
- ProcCpuinfo.txt Edit (3.4 KiB, text/plain; charset="utf-8")
- ProcEnviron.txt Edit (274 bytes, text/plain; charset="utf-8")
- ProcInterrupts.txt Edit (2.2 KiB, text/plain; charset="utf-8")
- ProcModules.txt Edit (3.0 KiB, text/plain; charset="utf-8")
- UdevDb.txt Edit (143.9 KiB, text/plain; charset="utf-8")
- UdevLog.txt Edit (318.0 KiB, text/plain; charset="utf-8")
- UnitySupportTest.txt Edit (597 bytes, text/plain; charset="utf-8")
- XorgLog.txt Edit (33.7 KiB, text/plain; charset="utf-8")
- XorgLogOld.txt Edit (35.1 KiB, text/plain; charset="utf-8")
- Xrandr.txt Edit (3.0 KiB, text/plain; charset="utf-8")
- xdpyinfo.txt Edit (9.7 KiB, text/plain; charset="utf-8")
This sounds like a regression of bug 930192. That bug is still fixed, but overall rendering performance in Ubuntu 12.04 has regressed still when using Unity. I believe this is a problem with the unityshell plugin because performance becomes fast again if I (briefly) disable Unity.
In the mean time, please try this potential workaround:
1. Run ccsm
2. Go to Workarounds
3. Enable "Force full screen redraws (buffer swap) on repaint"
I think I forgot to mention, this bug would be totally fixed by a fix for bug 901097, which I hope we will complete before 12.10.
Daniel, I tried your workaround. It appears to work, approximately the same as disabling sync to vblank, but I am not completely sure. It is not easy to measure smoothness. Is there a way to quantify the smoothness of the animations (something like a fps counter for example)?
However, even if it works as well as disabling sync to vblack, what is the advantage of your workaround? In CCSM, it has a warning saying that it will cause "a massive increase in GPU and CPU usage" which is a problem for me as I am frequently working on battery. Also, disabling sync to vblank does not appear to have any adverse effects (no tearing or other visual artifacts). As I said in the bug description, even after disabling sync to vblank glxgears says it is "running synchronized to the vertical refresh", so I assume that unity is also synchronized to the vertical refresh, is this true? If so, what does "disable sync to vblank" do?
Nicolás,
Yes, there is an FPS counter in the Benchmark plugin, which is part of package: compiz-
Just install that package. Though you might need to change the key combination for it (ccsm) before you can get it to appear.
The advantage of the workaround is that it uses a different rendering method, which is able to "offload" the waiting for vsync from the CPU to the GPU. That allows the CPU to prepare new frames faster and hand them over to the GPU early, held until it's time to show them on the monitor.
If disabling sync to vblank makes no visible difference for you then that usually means your driver has a setting forcing it on or off regardless of the application/compiz settings. This is common and all drivers are different unfortunately, with different defaults.
Sync-to-vblank is different between apps (glxgears), the compositor (compiz) and the graphics driver. At every stage, the lower level is allowed to virtualize the vblank event so the next level up still thinks it's happening even if it's not. Thus applications like glxgears might think that they are syncing to vblank, but they actually won't unless it's enabled in the next level down (compiz), and the level below that (the driver).
Daniel, thanks for your answer.
I'll try the FPS counter when I have access to my Ubuntu laptop.
There is something I still don't fully understand though. Apparently, my graphics drivers (Intel Ironhide) forces sync to vblank because, even with it disabled in CCSM, glxgears maxes out at 60fps saying it is synchronized to the vertical refresh rate. So, disabling vblank in CCSM shouldn't do anything, should it? If it doesn't do anything why is it improving the smoothness of the animations?
Nicolás, there is a direct relationship between the application (glxgears) and the driver too. So the application gets throttled by the driver at 60Hz. And it *might* closely match the monitor vblank timing. However in the end, compiz is responsible for rendering everything on the screen. So you shouldn't expect apps to be tear-free unless sync to vblank is enabled in compiz too.
Daniel, I tried the FPS counter, but I think there is something wrong with it. It oscillates between 5 and 30 fps, most of the time staying close to the low 10's even if the desktop is smooth.
For know I will re-enable sync to vblank with your workaround and test it in the day to day usage. I never found any tearing in any app with sync to vblank disabled, though. It may be that it is to small to be noticeable, but I have noted it in other PCs with different graphics drivers (most notably, Nvidia cards).
Nicolás, it is correct for the compiz frame rate to be low when the desktop is not too busy. And even zero when idle. It's designed to only render frames when something is changing.
Maybe this is of interest for you.
I have noticed that suddenly compiz/unity is much smoother. My observation is not about FPS but more about how frequent the frames make it on screen. Video playback in xbmc is much smoother with 25FPS (monitor at 50Hz).
In the past I had every few seconds stuttering but now it seems to be gone.
I am not 100% sure but the proposed mesa update in combination with proposed unity made the difference for me.
I changed no settings in unity or compiz.
xserver-
libgl1-mesa-dri: 8.0.2-0ubuntu3.1
unity: 5.12-0ubuntu1.1
compiz: 1:0.9.7.8-0ubuntu1
linux: 3.4.0-030400-
Achim: you appear to be using the "Ubuntu-X team" ppa (https:/
I, too, have this ppa enabled and I also found it improves the performance a bit. I guess that this bug is somehow related to the power of the graphics card used and the new driver improves things for Intel graphics. In fact, I recently installed precise in a SandyBridge laptop and the animations are smoother in that laptop than in mine (Ironhide-based).
Fix committed into lp:compiz at revision 3320
This bug was fixed in the package compiz - 1:0.9.8.0-0ubuntu1
---------------
compiz (1:0.9.
* debian/control, debian/rules:
- enable gles on armel and armhf
- use dh-translations rather than custom code
[ Sam Spilsbury ]
* Enable OpenGL ES building
- Refresh debian/
- Remove non-ported plugins from compiz-plugins
- Add FindOpenGLES2.cmake to compiz-dev
[ Timo Jyrinki ]
* New upstream release.
- Code to make compiz work on GLES. This includes several changes
to the compiz API. (LP: #201342) (LP: #901097) (LP: #1004251)
(LP: #1037710)
- Draft first 0.9.8.0 NEWS and bump VERSION
* debian/
- Remove, obsoleted by the upstream GLES work
* Disable plugins that don't work on pure GLES on armhf/armel:
- bench, firepaint, mblur, showmouse, splash, showrepaint, td, widget
-- Sebastien Bacher <email address hidden> 2012年8月31日 22:59:50 +0200