vdpau not working (well) with Ubuntu12.04 Unity

Bug #993397 reported by bowser
208
This bug affects 45 people
Affects Status Importance Assigned to Milestone
Compiz
Fix Released
Undecided
Unassigned
Compiz Core
Fix Released
Undecided
Unassigned
NVIDIA Drivers Ubuntu
Fix Released
Undecided
Unassigned
Unity
Invalid
Undecided
Unassigned
compiz (Ubuntu)
Fix Released
Undecided
Unassigned
unity (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

vdpau works very poorly in Ubuntu 12.04 LTS on Unity3d. Same 1080p movies use around 6-10% of cpu in 11.04 and 11.10 shoots up to 50-60% of cpu usage in 12.04 with vdpau and mplayer (all under Unity 3d) . I have tried several nvidia drivers and the results are the same (Nvidia current 295.40, 295.20 and 295.33 32 bits) Videocard is Nvidia G105M

This seems to be a Unity rather than a Nvidia bug as cpu usage drops back to around 6 -10% for same movies in Gnome shell.

Revision history for this message
bowser (bwbernard-wong1) wrote :

Just upgraded the Nvidia driver to 302.07 (via xorg-edgers) Still the same, vdpau works perfectly in Gnome Shell but only semi working Unity 3d (without vdpau CPU usage ~100%, with vdpau cpu usage ~ 50-60% in Unity 3d, 6-10% in Gnome Shell,--and Unity3d for 11.04 and 11.10)

It seems that Unity3d in Precise is the culprit, so I have added that to affect package.

no longer affects: nvidia-drivers-ubuntu
Revision history for this message
bowser (bwbernard-wong1) wrote :
no longer affects: nvidia-graphics-drivers (Ubuntu)
Revision history for this message
bowser (bwbernard-wong1) wrote :

Found a partial fix. mplayer2 works normally with vdpau if 'sync to vbank' is disabled in both the ccsm (> OpenGL) and Nvidia Xserver Settings(under Xserver Xvideo Settings)

This is a partial fix because it doesn't work with xbmc(in Unity 3d cpu usage still at ~60% under vdpau, while it is ~6-10% in Gnome-Shell) Disabling sync to Vbank also has the side effect of the Compiz cube tearing while rotated (yeah, some of us still use it)

Revision history for this message
bowser (bwbernard-wong1) wrote :

Ok turns oyt disabling sync to vbank doesn't work in full screen.

Doug McMahon (mc3man)
Changed in unity:
status: New → Confirmed
Revision history for this message
Doug McMahon (mc3man) wrote :

See the same here though mplayr's cpu use isn't the issue, 2-4% vs. 1-2% in other sessions

What happens here is compiz use goes to 25 -30% & worse, X goes to 40 -50%. Additionally the whole system becomes sluggish & slow to respond, with some possibility of h tearing
By contrast Classic with effects does show a bit bit of an increase in compiz & X, to about 10 -15 % each, the system remains responsive

Much better here to just use xv & mt decoding on unity, total cpu use is a bit lower & no impact on system

( the 'best' clearly is Classic no effects, total system cpu use on same vid with vdpau is 5 % or less

Revision history for this message
bowser (bwbernard-wong1) wrote :

Hi, Doug McMahon,

Actually on my machine mlayer is using 50%-70% of cpu and Compiz uses about 15%. If disable sync to vbank then for movies not maximized cpu usage for mplayer is on single digit and Compiz about 5-6%, consistent with 11.04 under vdpau on the same machine.

After further trial and errors it appears that vdpau works perfectly in XBMC if 'undirect fullscreen windows' is checked in ccsm (cpu usage in single digit for full screen) but it still doesn't work for mplayer or mplayer2 (tried different versions from official repo, different ppas and compiling myself)

It seems that it is definitely a Compiz bug, I am surprised that not more people are affected. However there are several apparently related bugs filed against Compiz/Unity 3d and the Nvidia driver, it may be that this bug is just another manifestation of the same underlying issue.

I hope this get fixed soon. I really like Unity in 12.04 but having to log into a different Desktop to watch movie or use xv in Unity while I have a Nvidia card is just nonsensical. I will have to use Gnome Shell until this is fixed.

Revision history for this message
Piotr Skibinski (ppskibinski) wrote :

Hi

I have similar problem. Mplayer2 and Xorg are using about 20% CPU each during video playback.
It prints different errors when playing different movies, but usually the errors start to appear
after jumping back/forward using the arrow keys or switching to full screen. In mplayer movies don't
switch to full screen. HD movies have visible tearing.

The errors printed by mplayer2 look like below with several different function calls complaining about invalid handle.

[ vdpau] Error when calling vdp_output_surface_create: A catch-all error, used when no other error code applies.
...
[ vdpau] Error when calling vdp_presentation_queue_block_until_surface_idle: An invalid handle value was provided.
...
[ vdpau] Error when calling vdp_presentation_queue_block_until_surface_idle: A catch-all error, used when no other error code applies.
A: 302.8 V: 302.8 A-V: 0.000 ct: -0.000 0/ 0 9% 24% 1.8% 0 0
...
[ vdpau] Error when calling vdp_output_surface_destroy: An invalid handle value was provided.

I use fresh install of kubuntu 12.04 on lenovo T61 with NVidia quadro NVS and nvidia-current drivers installed.
nvidia-current-updates have some general problem working with my laptop.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu):
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
Changed in compiz:
status: New → Confirmed
Changed in compiz-core:
status: New → Confirmed
Revision history for this message
Franz (franz.pammer) wrote :

Hi

I have Upgraded from 11.10 to 12.04 (i386) and now
I have the same problem with VDPAU, when I play HD Movies it use 50-70% CPU!
On 11.10 it works fine!

I tested this with mplayer and XBMC (Standalone).

I also tested differnt Nvidia drivers, same effect on all Drivers
* Ubuntu 12.04 (nvidia-current 295.40-0ubuntu1)
* ppa:ubuntu-x-swat/x-updates (nvidia-current 295.53-0ubuntu1~precise~xup1)
* Manual Installed Driver NVIDIA-Linux-x86-302.07.run

Mplayer Output:
VO: [vdpau] 1920x800 => 1920x800 Planar YV12

Revision history for this message
Riccardo 'c10ud' (c10ud) wrote :

i'm watching dvb-t with VLC/vdpau with Unity 5.12 and i see compiz cpu usage is quite high.. see screenshot

http://postimage.org/image/j470awkjf/

Revision history for this message
bowser (bwbernard-wong1) wrote :

@c10ud

Vlc doesn't use vdpau (if you compile it yourself instead of install from the repo than it can use vdpau through vaapi, but very inefficiently) So it is not a proper test for this bug. mplayer and xbmc do use vdpau, when cpu usage is high for those two then there is a problem.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

In recent releases of the NVIDIA driver (around Ubuntu 12.04 onward), they disabled Sync to VBlank by default. Please try enabling it in nvidia-settings. You will have to log out and in again for it to take full effect on compiz.

Revision history for this message
Aurele Theriault (aureletheriault) wrote :

I am running 12.04 with nVidia-vdpau installed. In nVidia Settings, Sync to VBlank is enabled by default for BOTH xVideo and OpenGL. There is no such setting (that I can see) affecting vdpau.

When login in with session type Ubuntu-2d, CPU keeps near 0% usage when playing H.264 video at 1080p with uMPlayer configured with vdpau.

Problem happens ONLY when Compiz is running; same H.264 1080p video shows 40-60% CPU usage on all 4 CPU's.

Revision history for this message
Riccardo 'c10ud' (c10ud) wrote :

@bowser
VLC actually uses vdpau, or at least this is what it says. In order to enable support just install the nvidia proprietary driver, vdpau* packages and in VLC (codecs tab iirc) "enable GPU acceleration" or something like that. Restart VLC and you'll see in debug it's loading and using vdpau (unless it's lying...?).

That said i can easily provide more results with different apps but judging from the other comments i don't think there's a need (also, looks like it's the same for everyone here, so i guess it's easily reproducible provided you have an nvidia card).

@Daniel
I'll try, but still i think that compiz should handle this "automagically", it's not a weird scenario (also please note that in my screenshot the channel wasn't HD...if i watch HD channels they stutter, but i'd leave that out for now)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I agree completely that optimal performance should be achieved automagically. Just trying to suggest workarounds while we don't have time to fix everything in code (yet).

Revision history for this message
Riccardo 'c10ud' (c10ud) wrote : Re: [Bug 993397] Re: vdpau not working (well) with Ubuntu12.04 Unity

Yeah, sorry if my words sounded harsh, I didn't mean to (developer's life ;)).
Anyway, I saw the new unity branches and I hope they'll cover this "issue" too.
I will try your suggestion meanwhile.

2012/6/14 Daniel van Vugt <email address hidden>:
> I agree completely that optimal performance should be achieved
> automagically. Just trying to suggest workarounds while we don't have
> time to fix everything in code (yet).
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/993397
>
> Title:
>  vdpau not working (well) with Ubuntu12.04 Unity
>
> Status in Compiz:
>  Confirmed
> Status in Compiz Core:
>  Confirmed
> Status in NVIDIA Drivers Ubuntu:
>  New
> Status in Unity:
>  Confirmed
> Status in “compiz” package in Ubuntu:
>  Confirmed
> Status in “unity” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  vdpau works very poorly in Ubuntu 12.04 LTS on Unity3d. Same 1080p
>  movies use around 6-10% of cpu in 11.04 and 11.10 shoots up to 50-60%
>  of cpu usage in 12.04 with vdpau and mplayer (all under Unity 3d) . I
>  have tried several nvidia drivers and the results are the same (Nvidia
>  current 295.40, 295.20 and 295.33 32 bits)  Videocard is Nvidia G105M
>
>  This seems to be a Unity rather than a Nvidia bug as cpu usage drops
>  back to around 6 -10% for same movies in Gnome shell.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/compiz/+bug/993397/+subscriptions

Revision history for this message
Riccardo 'c10ud' (c10ud) wrote :

Update: I double-checked and i have Sync to VBlank enabled everywhere (nvidia-settings gl, xv, ccsm gl..), the screenshot remains valid.

greets

Revision history for this message
bowser (bwbernard-wong1) wrote :

Actually, on my machine DISABLING sync to vBlank(in both Nvidia settings and ccsm), not enabling it (which is enabled by default) partially works around the problem (it does not work for full screen), see my post #3

If furthermore, "undericted fullscreen windows" is checked in ccsm then vdpau works perfectly in XBMC but still not work for mplayer and mplayer2. But it has other side effects such as tearing for Desktop cube.

IIRC there is an option in KDE which disables Desktop compositing for fullscreen applications, I think something like that would probably solve the problem if available in Unity.

Revision history for this message
bowser (bwbernard-wong1) wrote :

@c10ud

Hi, I am aware of the 'enable gpu acceleration' option in vlc, but it never works. You have to compile vlc and ffmpeg with the proper options enabled for vaapi to work.

http://wiki.videolan.org/VLC_VAAPI

Moreover, the way VLC uses vdpau (through vaapi) is not efficient (see first paragraph of link above) so even if that is enabled cpu usage is still much higher than mplayer, mplayer2 and XBMC. VLC may have other nifty features, but it is not the best Linux mediaplayer if you watch a lot of HD videos IMO. If you have a vdpau enabled Nvidia card, mplayer usually works a lot better, and mplayer2 is the best.

Revision history for this message
Riccardo 'c10ud' (c10ud) wrote :

@Daniel:
Could be that it was running without plugins but trying your XDamageReport2 compiz branch did actually show a super-improvement with a vdpau HD channel running in VLC, frames looked smooth opposed to current stock window manager. (Half cpu for vlc, compiz cpu usage to 0).
I couldn't test more because without decorator it was really hard to use without the window decorator (too lazy to build everything), but if you can merge it soon and fire some early testing package I am eager to try it out better

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

c10ud, I'm not sure that branch will help in this case, but it might. I will have to install an NVIDIA card and do some testing with VDPAU before I can comment further.

Revision history for this message
Riccardo 'c10ud' (c10ud) wrote :

Further testing (newer compiz, newer unity) showed quite no difference: i think the seen improvement could have been consequence of compiz running without plugins (and Unity). The next hope is the regionalDamage patch ;)

Revision history for this message
ruslanas (ruslanas) wrote :

I have the same problem: After upgrade to 12.04 mplayer uses 20-40% instead of 2-5% CPU on older version 11.04 of ubuntu. Also mplayer plays movie not so smoothly like previously.

NVIDIA Geforce 9600, Core2Duo 2.33 GHz.

Revision history for this message
drabina (krzysiek-drobinski) wrote :

The same problem on Geforce GT 430
Huge CPU usage during 1080p playback. Tested using 295.40 and 295.59 drivers on KDE / XFCE / Unity from Precise

Revision history for this message
David Bartley (dtbartle) wrote :

I fixed this by running ccsm (you may need to sudo apt-get install compizconfig-settings-manager) -> OpenGL -> unchecking "Sync to VBlank".

Revision history for this message
bowser (bwbernard-wong1) wrote :

@David Bartley

Are you sure? I tried that already. unchecking 'sync to vBlank' doesn't work if video goes to fullscreen on my system. Can you check cpu usage in full screen?

Revision history for this message
drabina (krzysiek-drobinski) wrote :

@David Bartley
Disabled 'sync to vBlank' didn't help - still huge CPU usage.

Revision history for this message
aerickson (aerickson) wrote :

The beta Nvidia driver available on their website
(NVIDIA-Linux-x86_64-302.07.run) solved my high CPU usage issues.

Andy

On Wed, Jul 11, 2012 at 2:45 AM, drabina <email address hidden> wrote:
> @David Bartley
> Disabled 'sync to vBlank' didn't help - still huge CPU usage.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/993397
>
> Title:
> vdpau not working (well) with Ubuntu12.04 Unity
>
> Status in Compiz:
> Confirmed
> Status in Compiz Core:
> Confirmed
> Status in NVIDIA Drivers Ubuntu:
> New
> Status in Unity:
> Confirmed
> Status in “compiz” package in Ubuntu:
> Confirmed
> Status in “unity” package in Ubuntu:
> Confirmed
>
> Bug description:
> vdpau works very poorly in Ubuntu 12.04 LTS on Unity3d. Same 1080p
> movies use around 6-10% of cpu in 11.04 and 11.10 shoots up to 50-60%
> of cpu usage in 12.04 with vdpau and mplayer (all under Unity 3d) . I
> have tried several nvidia drivers and the results are the same (Nvidia
> current 295.40, 295.20 and 295.33 32 bits) Videocard is Nvidia G105M
>
> This seems to be a Unity rather than a Nvidia bug as cpu usage drops
> back to around 6 -10% for same movies in Gnome shell.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/compiz/+bug/993397/+subscriptions

Revision history for this message
funicorn (funicorn) wrote :

are you sure aerickson ?

I'm using 304.22 and the problem's still there.

Revision history for this message
aerickson (aerickson) wrote :

I had high CPU usage and I run XFCE... so I don't think it's Unity.

I'm running the older beta that I mentioned (304.22 seems newer), but
my CPU usage is definitely low. Here's a screenshot of XBMC playing a
1080p video using basically no CPU (the chip is a Intel(R) Core(TM)2
Quad CPU Q6600 @ 2.40GHz).

https://img.skitch.com/20120727-turfeqj5hmt3xky4emmkx6ymyf.jpg

Andy

On Thu, Jul 26, 2012 at 3:45 AM, funicorn <email address hidden> wrote:
> are you sure aerickson ?
>
> I'm using 304.22 and the problem's still there.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/993397
>
> Title:
> vdpau not working (well) with Ubuntu12.04 Unity
>
> Status in Compiz:
> Confirmed
> Status in Compiz Core:
> Confirmed
> Status in NVIDIA Drivers Ubuntu:
> New
> Status in Unity:
> Confirmed
> Status in “compiz” package in Ubuntu:
> Confirmed
> Status in “unity” package in Ubuntu:
> Confirmed
>
> Bug description:
> vdpau works very poorly in Ubuntu 12.04 LTS on Unity3d. Same 1080p
> movies use around 6-10% of cpu in 11.04 and 11.10 shoots up to 50-60%
> of cpu usage in 12.04 with vdpau and mplayer (all under Unity 3d) . I
> have tried several nvidia drivers and the results are the same (Nvidia
> current 295.40, 295.20 and 295.33 32 bits) Videocard is Nvidia G105M
>
> This seems to be a Unity rather than a Nvidia bug as cpu usage drops
> back to around 6 -10% for same movies in Gnome shell.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/compiz/+bug/993397/+subscriptions

Revision history for this message
bowser (bwbernard-wong1) wrote :

Still no change after recent update of Nvidia driver (xorg-edger), Compiz and Unity. Is there any chance that this will be fixed by 12.10. For this reason I am still using 11.04 on my main pc.

Revision history for this message
mirak (mirak-mirak) wrote :

for this reason i don't use unity 3D or gnome-shell, and will probably drop ubuntu

Revision history for this message
Matthew King (kingdom529) wrote :

I had the same problem immediately after updating from 11.10 to 12.04. I appreciate everyone's inputand tried every suggestion until reaching the inevitable conclusion that I needed to install and use gnome-shell. Thank you for continuing to work on this issue.
Matt

Revision history for this message
Mészáros Balázs (mbalazs81) wrote :

Same problem, only if compiz enabled, I use Linux Mint 13 MATE and nvidia card.

Revision history for this message
Eromatic (eromatic) wrote :

One workaround that seems to work for me under mplayer2 is to add option:

-vo vdpau:queuetime_windowed=0:queuetime_fs=0:fps=-1

(This is on Unity3d, Compiz, and nvidia driver 295.49. No disabling sync to vbank required.)

Revision history for this message
bowser (bwbernard-wong1) wrote :

Last chek this is still not fixed in 12.10 late beta. Is there any plan to do something about it? Instead of keep making Unity looks better why not spend some times to make it works better? I have not been able to use Unity on my main machine because of this bug.

Revision history for this message
Vorron (worron) wrote :

Same thing on xfce + compiz (Xubuntu 12.04).

Revision history for this message
pqwoerituytrueiwoq (pqwoerituytrueiwoq) wrote :

unable to reproduce
Nvidia 310.14
Xubuntu 12.10
Compiz 0.9.8.4
Linux 3.6.2 64 bit
vsync enablein in ccsm-> opengl, nvidia settings
detect refresh rate and unredirected fullscreen windows are checked (refresh rate is set at 30)

played video in smplayer, it is set to use vdpau

Revision history for this message
bowser (bwbernard-wong1) wrote :

vdpau works again in 12.10 final release with the xorg-edgers ppa. But it still doesn't work in 12.04, I will reinstall 12.04 in a week to see if it makes a difference.

Revision history for this message
bowser (bwbernard-wong1) wrote :

Ok, reinstalled 12.04 and upgraded the Nvidia driver with xorg-edgers, vdpau is working again. But compiz is consumming a lot of cpu cycle even when idle. The high cpu usage is not observed in 12.10 so it appears to be a Compiz bug which is fixed in 12.10 but have not been backported to 12.04 yet. A work around is to uncheck sync to Vbank in both Nvidia settings and ccsm 's OpenGL tab then compiz's cpu usage becomes normal again.

Revision history for this message
ed10vi (ed10vi86) wrote :

Every thing is working fine with nvidia driver 310.19 in Ubuntu 12.04.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

As per comment #41. The original reporter says the issue is fixed in Compiz 0.9.8 (12.10) but not Compiz Core 0.9.7 (12.04).

Changed in compiz:
status: Confirmed → Fix Released
Changed in unity:
status: Confirmed → Incomplete
Changed in compiz (Ubuntu):
status: Confirmed → Fix Released
Changed in unity (Ubuntu):
status: Confirmed → Incomplete
no longer affects: compiz/0.9.8
Revision history for this message
Mercer Rivière (vincentuq) wrote :

I have disabled compiz and occassionally see these problems, i.e. for example now.
So it's not compiz's fault

Changed in nvidia-drivers-ubuntu:
status: New → Confirmed
Revision history for this message
Mercer Rivière (vincentuq) wrote :

Oh, forgot to add: no Unity with me.
It must be driver+kernel's fault.

piotr zimoch (ebytyes)
Changed in nvidia-drivers-ubuntu:
status: Confirmed → Fix Committed
Changed in compiz-core:
status: Confirmed → Fix Released
Changed in nvidia-drivers-ubuntu:
status: Fix Committed → Fix Released
Changed in unity:
status: Incomplete → New
Changed in unity (Ubuntu):
status: Incomplete → New
Revision history for this message
Stephen M. Webb (bregma) wrote :

Reading through the comment history this seems to have been a combination of kernel, video driver, and compiz and it make no sense to continue to attribute it to Unity.

Changed in unity (Ubuntu):
status: New → Invalid
Changed in unity:
status: New → Invalid
Revision history for this message
Charly (rafis3) wrote :

I even tried nvidia 331 on 14.04 still the same problem goes in the loop after login and nothing on the screen iand vdpau hardware acceleration cant be enabled

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.