Poor video playback performance with radeon driver and compositing

Bug #852554 reported by TJ Rosene
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity-2d
Invalid
High
Unassigned
unity-2d (Ubuntu)
Invalid
High
Unassigned

Bug Description

I have three test machines running up-to-date 11.10 Unity 2D (32 bit). All three have issues with video in that the video lags way behind the sound. The videos actually look like they are being played in slow-motion.

When these test machines were running 11.04, 10.10, and 10.04, watching video was not an issue and they could perform the task flawlessly.

These three test machines are running on-board generic Intel graphics, nothing special requiring any sort of special drivers (ATI, Nvidia, etc.), at least up to this point. I've never had to install special drivers for these machines.

I should also mention that it doesn't matter what video format (.avi, mpeg, Flash), nor what video player (Flash Player, Banshee, VLC, MPLayer), the video always lags behind the sound — like everything is in slow motion.

 *-display
       description: VGA compatible controller
       product: Radeon Mobility M7 LW [Radeon Mobility 7500]
       vendor: ATI Technologies Inc
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 00
       width: 32 bits
       clock: 66MHz
       capabilities: agp agp-2.0 pm vga_controller bus_master cap_list rom
       configuration: driver=radeon latency=66 mingnt=8
       resources: irq:11 memory:e0000000-e7ffffff ioport:3000(size=256) memory:c0100000-c010ffff memory:c0120000-c013ffff
Linux tj-ThinkPad-T41 3.0.0-11-generic #18-Ubuntu SMP Tue Sep 13 23:29:47 UTC 2011 i686 i686 i386 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu oneiric (development branch)
Release: 11.10
Codename: oneiric

TJ Rosene (teejay17)
tags: added: 2d bug unity
Changed in unity-2d:
importance: Undecided → Critical
Changed in unity-2d (Ubuntu):
importance: Undecided → Critical
Changed in unity-2d:
milestone: none → 4.10
Revision history for this message
Alberto Mardegan (mardy) wrote :

Hi TJ, and thanks for reporting this bug!
Could you please try to play a video in a different session than Unity2D (such as Unity 3D, Ubuntu classic or GNOME -- whatever works :-) )?

Then, if you open the gconf-editor and navigate to apps/metacity/general/, what value has the compositing_manager key? You could also try to toggle it, restart the session, and see if the situation improves (remember then to bring it back to its original value).

This should help us debug the issue.

Changed in unity-2d:
status: New → Incomplete
Revision history for this message
TJ Rosene (teejay17) wrote :

No problem with the bug reporting; glad I can help in some small way.
As far as logging into 3D, that's a no go. On this machine, Ubuntu defaults to 2D period (on 11.04 I had the "classic" interface — a classic interface that let me play videos, I may add ;) ). Anyway, joking aside, GNOME 3 also won't work/won't install.
So what I've done on top of this set up is:

sudo apt-get install lubuntu-desktop

And wouldn’t you know it, watching videos in Lubuntu just works, all video formats, all players.
So then I logged back into Unity 2D. As far as the compositing_manager key, first I had to install gconf-editor from the repos. Then, in Unity 2D, compositing_manager key was set to “False.” I switched it to “true,” logged out, and logged back in again. Watching a video in VLC doesn’t go into “slow-motion” mode, but it drops frames like mad and the video is pretty much unwatchable. Banshee and Gnome Mplayer, however, are still in slow-motion — clear, no frames dropped, but playing at a fraction of the speed it should.
So then I went and toggled the manager back to “false” and now the videos now play glitch free and without a problem in Unity 2D — in all the media players. I should also add that I didn’t log out and back in after toggling back to “false”; it was more of a what-the-heck try it and see moment.

So what I'm doing right now is waiting for the updates to finish installing on a second test machine (same laptop, but with 512 megs of ram instead of a gig) and I will toggle compositing_manager key without installing another UI (Lubuntu) to see what happens. I will post the results when this is done.

Revision history for this message
TJ Rosene (teejay17) wrote :

On the second test machine, compositing_manager was set to "true" by default (I guess installing Lubuntu on the other machine may have set it to "false" before I had a chance to check).
I set compositing_manager to "false" on this second machine, and now it plays videos fine across the board on all media players -- even with its measly 512 megs of ram.

Changed in unity-2d:
milestone: 4.10 → 4.12
Changed in unity-2d:
status: Incomplete → New
Changed in unity-2d:
milestone: 4.12 → 4.14
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unity-2d (Ubuntu):
status: New → Confirmed
Revision history for this message
Alberto Mardegan (mardy) wrote :

Thanks TJ for the infos.
I'm asking you some more, as I don't seem to be able to reproduce the issue here.

- If you turn the compositing_manager to true again, do the problem reappear?

- You mentioned in the first post that you had Intel graphics; but the bug report tool claims you have an ATI radeon mobility. Can you please clarify? Also, are you using any of the closed source drivers (e.g., fglrx)?

- Is your laptop connected to the A/C power? I wonder if it's sluggish because of some power saving mode.

- If you run "top" while watching a video, do you see other processes eating a good part of CPU power, besides the player? And how much CPU power is taken by the player itself?

- If you run the player as fullscreen (from the very beginning), does the situation improve?

Revision history for this message
TJ Rosene (teejay17) wrote :

- If you turn the compositing_manager to true again, do the problem reappear?

Yes, after turning on the compositing_manager back on, the problem reappears

- You mentioned in the first post that you had Intel graphics; but the bug report tool claims you have an ATI radeon mobility. Can you please clarify? Also, are you using any of the closed source drivers (e.g., fglrx)?

That was my mistake. I’ve never had problems with video/graphics on this machine, so I always assumed it was an Intel chipset. However, after digging deeper, these test machines do have ATI graphics. I am not using any closed graphics drivers; everything is stock.

- Is your laptop connected to the A/C power? I wonder if it's sluggish because of some power saving mode.

All laptops are connected to AC. I’ve even removed the batteries to see if that may be an issue, but it is still sluggish.

- If you run "top" while watching a video, do you see other processes eating a good part of CPU power, besides the player? And how much CPU power is taken by the player itself?
I don’t think the reading is accurate (probably because the system is freezing up), but it says VLC is using 6% CPU (although it is “sleeping”)

Here’s the rundown of the most memory-intensive while watching the video full-screen in VLC with compositing_manager on “true”:
vlc: 6% cpu, memory 32.5 mb
ubuntuone-syncdaemon 0% cpu, memory 20.2 mb
unity-2d-places 0% cpu, memory 12.8 mb
metacity 0% cpu, memory 7.7 mb
unity panel service 0% cpu, memory 7.6 mb
applet.py 0% cpu, memory 7.5 mb
zeitgeist-daemon 0% cpu, memory 7.4 mb

Interestingly, all these are listed as “sleeping”

- If you run the player as fullscreen (from the very beginning), does the situation improve?

Fullscreen from the very beginning is even worse than attempting in “small screen”; it almost freezes up the computer completely, and when I press escape or try to close the video, it takes at least a minute to respond.

Revision history for this message
Michał Sawicz (saviq) wrote :

@TJ I'd try with fglrx, that will probably help. The radeon drivers probable aren't performant enough to play videos in a composited env.

Revision history for this message
TJ Rosene (teejay17) wrote :

I tried the fglrx driver and it works. I can play videos now in full-screen, which is good.
I guess I will have to get used to installing this driver, instead of running "stock."
So is this issue still considered a bug? It is a result of Unity 2d now being default, as I never had this video trouble in classic Gnome; right out of the box, Unity doesn't work for everything.
I'm interested in seeing what you all think.
Cheers!

Changed in unity-2d:
milestone: 4.14 → none
tags: added: compositing
summary: - Unity 2D Video Lags Everywhere
+ Poor video playback performance with radeon driver and compositing
Changed in unity-2d:
importance: Critical → High
status: New → Confirmed
Changed in unity-2d (Ubuntu):
importance: Critical → High
Revision history for this message
madbiologist (me-again) wrote :

It looks like Michal was correct in comment #7. One thing that might improve the performance of the open-source radeon drivers slightly in the latest upstream 3.0.18 kernel is this patch:

commit a674b8b3e345496a96aec389446650455b2fdfa1
Author: Alex Deucher
Date: Tue Jan 3 09:48:38 2012 -0500

    drm/radeon/kms: disable writeback on pre-R300 asics

    commit 28eebb703e28bc455ba704adb1026f76649b768c upstream.

    We often end up missing fences on older asics with
    writeback enabled which leads to delays in the userspace
    accel code, so just disable it by default on those asics.

    Reported-by: Helge Deller
    Reported-by: Dave Airlie
    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie
    Signed-off-by: Greg Kroah-Hartman

Revision history for this message
madbiologist (me-again) wrote :

A PPA of kernel 3.0.18 is available at http://kernel.ubuntu.com/~kernel-ppa/mainline/

Revision history for this message
madbiologist (me-again) wrote :

If the upcoming Ubuntu 12.10 "Quantal Quetzal" pulls in version 6.14.4 of the open-source radeon driver, released on 28 March 2012 (or the just-released 6.14.5 version), you might get a small performance improvement on your old Radeon Mobility 7500 due to the implementation of KMS tiling. KMS tiling was already supported on newer Radeon hardware.

You can monitor the driver git snapshot dates at https://launchpad.net/ubuntu/+source/xserver-xorg-video-ati

Changed in unity-2d:
status: Confirmed → Invalid
Changed in unity-2d (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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