Bug 188946 - vdpau doesn't work correctly with kwin compositing enabled
Summary: vdpau doesn't work correctly with kwin compositing enabled
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-06 09:28 UTC by Mamy Ratsimbazafy
Modified: 2009-12-11 08:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mamy Ratsimbazafy 2009-04-06 09:28:15 UTC
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    Unlisted Binary Package

Distribution : Archlinux, kernel 2.6.29
KDE 4.2.2 from the kdemod team
GPU : nvidia 9300M GS with the stable 180.44 driver
CPU : Core 2 Duo 2Ghz
mplayer compiled from svn revision 29148 with vdpau support
Sample video file : Terminator Salvation trailer (x264 1920x800)

When playing this file using mplayer with -vo vdpau -vc ffh264vdpau, no compositing enabled, conky reports the following CPU usage :
mplayer 2.5% and X 0.50%

with compositing enabled:
X 24% to 30%
mplayer 8% to 10%
kwin 6% to 8%

For reference, kwin without video and compositing enabled takes 0.1% CPU, sometimes up to 7.5%. (seems random)

Playing the same file without vdpau (mplayer -vo vdpau -vc ffh264) + compositing gives:
mplayer 35% to 40% CPU usage
kwin 7%
X 2%

without vdpau (mplayer -vo vdpau -vc ffh264) and without compositing:
mplayer 35% to 40% CPU
kwin and X takes less than 0,1%

according to this thread on nvidia forum http://www.nvnews.net/vbulletin/showthread.php?t=129789 , it may be because kwin doesn't use direct rendering even when it is checked in the options.
This thread is also related but unanswered : http://forum.kde.org/kwin-and-vdpau-t-38516.html
Comment 1 lucas 2009-04-06 10:43:54 UTC
Trying enabling "direct rendering" in the advanced settings and restarting KWin from a terminal with `KWIN_DIRECT_GL=1 kwin --replace &`.
Comment 2 Mamy Ratsimbazafy 2009-04-06 10:59:47 UTC
Same result as before.
I have the following lines in the console, so i suppose direct rendering is ok :
kwin(32228) KWin::Extensions::init: Extensions: shape: 0x "11"  composite: 0x "4"  render: 0x "a"  fixes: 0x "40"          
kwin(32228) KWin::CompositingPrefs::detect: glx version is  1 . 3                                                          
Xlib:  extension "Generic Event Extension" missing on display ":0.0".                                                      
kwin(32228) KWin::CompositingPrefs::detectDriverAndVersion: GL vendor is "NVIDIA Corporation"                              
kwin(32228) KWin::CompositingPrefs::detectDriverAndVersion: GL renderer is "GeForce 9300M GS/PCI/SSE2"                     
kwin(32228) KWin::CompositingPrefs::detectDriverAndVersion: GL version is "3.0.0 NVIDIA 180.44"                            
kwin(32228) KWin::CompositingPrefs::detectDriverAndVersion: XGL: no                                                        
kwin(32228) KWin::CompositingPrefs::detectDriverAndVersion: Detected driver "nvidia" , version "180.44"                    
kwin(32228) KWin::CompositingPrefs::applyDriverSpecificOptions: nvidia >= 173.14.12, enabling compositing                  
kwin(32228) KDecorationPlugins::loadPlugin: kwin : path  "/usr/lib/kde4/kwin3_bespin.so"  for  "kwin3_bespin"              
kwin(32228) KWin::Extensions::init: Extensions: shape: 0x "11"  composite: 0x "4"  render: 0x "a"  fixes: 0x "40"          
kwin(32228) KWin::Extensions::init: Extensions: shape: 0x "11"  composite: 0x "4"  render: 0x "a"  fixes: 0x "40"          
kwin(32228) KWin::Workspace::setupCompositing: OpenGL compositing                                                          
kwin(32228) KWin::SceneOpenGL::initBufferConfigs: Drawable visual (depth  24 ): 0x "49"                                    
kwin(32228) KWin::SceneOpenGL::initBufferConfigs: Drawable visual (depth  32 ): 0x "64"                                    
kwin(32228) KWin::SceneOpenGL::initBuffer: Buffer visual (depth  24 ): 0x "47"                                             
kwin(32228) KWin::SceneOpenGL::selfCheck: Compositing self-check passed.                                                   
kwin(32228) KWin::SceneOpenGL::SceneOpenGL: DB: true , TFP: true , SHM: false , Direct: true
Comment 3 lucas 2009-04-06 11:07:39 UTC
The last line of your output says you are using direct rendering.

Also KWin uses loose texture binding on nVidia cards so that's not the problem either.
Comment 4 Martin Flöser 2009-12-06 19:37:02 UTC
My mplayer version is still too old to test it, but since the report there are new NVIDIA versions which might have fix it. So is this still an issue?
Comment 5 Mamy Ratsimbazafy 2009-12-10 23:54:23 UTC
The behaviour now is much better (nvidia 190.42 and kwin from KDE SC 4.3.4)
kwin uses around 5 to 6.5% of my cpu. X uses 3,5 to 7% while mplayer uses less than 3% when I play some vdpau-accelerated movie with compositing enabled. (For reference I have a Core 2 Duo 2Ghz)
Comment 6 Martin Flöser 2009-12-11 08:44:54 UTC
Thanks for the infor. Given these numbers and the fact that we have not worked on this bug I assume it was a problem of the NVIDIA driver.