Choppy Flash video in full-screen mode on Ubuntu

When I originally upgraded to Ubuntu 9.04 (Jaunty), I noticed that Flash video in full-screen mode was kind of choppy. I never took the time to debug this and instead worked around this by either not watching Flash videos in full screen mode, not watching Flash videos at all or using the excellent Youtube integration of Totem. However, today I did some research into the problem and found a bug in Launchpad, which solved the problem for me. It turns out that there is a bug affecting the Intel stack (in this case Intel stack means not necessarily an Intel graphics card, but Intel processor). The bug is a miscommunication between X.org and the Kernel, which results in a misconfiguration of the Memory Type Range Registers (MTRR) in the Kernel. The result is poor performance in video playback and everything that involves graphics in general. This bug has been fixed upstream and in Karmic. A fix for Jaunty has been developed, but is yet to be released.

You can test, if you are affected, by running cat /proc/mtrr on the command line. If you can’t see a line, which ends in write-combining you are most certainly affected by this. You can further check with lspci -vv and check the Region 0 memory range of your VGA adaptor. If you cant find that memory range in your mtrr file, you are probably affected.

Until the fix is released, one solution is to run this shell script as root after every restart of your X.org server. Warning: Audit any external file before you run it as root on your computer! The script should update the MTRR configuration of the Kernel with the correct settings. If you are affected by the bug, you will notice a slight improvement in overall graphics performance and the full-screen Flash videos should now play as originally intended.

Tags: , , , , , , , , ,

Shameless plug: If this post was useful to you, please consider buying yourself something from one of my Amazon stores: US store, UK store, FR store, DE store, CA store. If you're not into Amazon, why not donate something to GNOME, Mozilla or Wikipedia? Thank you!

8 Responses to “Choppy Flash video in full-screen mode on Ubuntu”

  1. Jan Girlich says:

    I ran across this blog entry when I was actually looking into the corruption of my ttys which were just totally blank when I switched to them via Ctrl+Alt+F[1-6]. Graphics performance is not too important for me, but the ttys are. And thankfully fixmtrr.sh also fixes the broken ttys.

    Thanks a lot for this blogpost!
    Jan

  2. abdulet says:

    Hey thanks for the post it solve my problem perfectly, i wal looking for this issue for long great!!!

  3. erick says:

    Thanks! been looking forever for this fix, altough karmic koala fixes this from kernel, so I guess next month we won’t need this anymore, thanks a lot anyway!

  4. kez says:

    You are a legend!! Was looking for ages for a fix for this and yours worked straight away. Thanks a million.

  5. Mark G says:

    Genius. Thanks very much for sharing.

  6. Mark H says:

    BRILLIANT!!!! this fixed the lag in flash streams as well in normal mode.
    9.04

    Thanks! I love Ubuntu so much and this makes my system work flawlessly.

  7. Maphusio says:

    Holy good god you are my friggin hero! works well w/ Ubuntu 10.10 ATi X1600

  8. Krys says:

    Hi!

    Thank you very much for figuring this out!

    Your script solved the same issue on my openSUSE 11.3 install (Flash 10, fglrx driver, ATI Radeon HD 2600, Core 2 Duo, HP Compaq 8510p laptop).

    Anyway, I have been looking for a long time for a solution to this, so thank you again! You rock! :)

Leave a Reply