Bitcoin donations are welcome:14snQXeLcnJtWUduKZ6rC2MHdPYrYar1Tw

Wednesday, June 10, 2009

Tweaking Flash CPU usage in Linux

Update 22.12.2009
Great news has arrived just before Christmas. Adobe has released a new version of flash which finally gives us linux users what seems to be a proper improvement of the flash plugins capabilities in full screen mode. At least I am experiencing GREAT improvement when viewing flash videos in fullscreen. On my 3,5 year old laptop I can finally view HD videos on youtube in fullscreen without any problems.

The new version I am talking about is 10.0.42.34. The changelog can be viewed here. The 10.1 version is also in progress, but stay away from it if you are a linux user. Nothing new there for us, and I'm not even sure it has the latest linux tweaks available.

So, try to keep track that you always have the latest version of flash available, this you can easily do here. Downloading the latest version can be done here. Download the .tar.gz version. To install: Open up firefox/swiftfox and type about:plugins in the adressbar. Check where your current libflashplayer.so is located, and replace it. Make sure you do not have multiple installations of the plugin.

Important for INTEL graphics users:
Remember to have at least version 2.8.0 of xorg-x11-drv-intel, because:
* Fri Aug 07 2009 Kristian HÃgsberg - 2.8.0-4
- Add dri2-page-flip.patch to enable full screen pageflipping.
Fixes XKCD #619.


Old post with tweaks:
Last few days I've had a lot of problems regarding flash video in Linux. So I've spent a lot of time trying to tweak my browsers to work better. Here's my quickstep guide to getting flash working more or less "ok" in Linux. There is still a lot to be done for the flash developers making it work more flawless under Linux.

1.) Make sure you have the plugin for firefox, iceweasel og swiftfox. Check this by typing about:plugin in the address bar. If there are multiple instances of the same flash driver, remove them. Make sure you have the latest version, which at the moment (10th June 2009) shall be: Shockwave Flash 10.0 r22. If you have multiple drivers do a updatedb & locate libflashplayer.so in bash. Restart the browser when you are done.
2.) Cpu frequency stepping can be another problem. If you have powernowd or cpufreq installed make sure they are working proper. I had big problems with cpufreq only using 1ghz of my cpu although I had another 883mhz available. Check cpufreq-info and make sure:
A) current policy: frequency should be within 1000 MHz and 1.83 GHz.
Check that the upper frequency is correct.
B) The governor "ondemand" may decide which speed to use.
Make sure you are using the ondemand governor.
C) Now we are gonna tweak this so your computer will utilize your full cpu when viewing flash videos:
C.1) Stop cpufreq: /etc/init.d/cpufreqd stop
C.2) Edit your /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold and set it to 30. This will make your computer utilize your full cpu once the cpu usage climbs above 30%. You can always tweak this one to another setting if you want.
C.3) Start cpufreq: /etc/init.d/cpufreqd start
3.) We need flash to use your gfx card for the rendering, also known as hardware rendering. Flash uses Opengl in order to do this. Open aptitude, and remove _all_ opengl related packages, and then reinstall the following packages with it's dependencies:
libgl1-mesa-glx
libgl1-mesa-dev

Now try again :)

Please post more tips if you got any. No registration required.

Monday, June 8, 2009

Slow Firefox and High Xorg CPU usage in Debian

So, due to some of the latest updates my desktop experience in Linux got considerably damaged. Everything was suddenly much slower and I almost felt for crushing my computer. The solution was close though. I did a google search for "firefox cpu slow debian 2009", and my first hit was my solution. But please read on here..

The root of the problem was obviously a missing line in the xorg.conf file which tells the graphics card what acceleration method to use. Please read M-x Kelsin's solution on this right here.. After you have done this simply go into a shell as root and restart kdm:
/etc/init.d/kdm stop (WARNING!! you will now exit your GUI! So write down the rest, or simply do a restart and you can skip the rest in this section)
now you will get a login prompt. Log in as root and start kdm again:
/etc/init.d/kdm start

Now everything shall be back to normal. BUT I have another tip for you on how to speed up your browsing experience. Install Swiftfox. What is Swiftfox? It's a version of firefox compiled for specifically use in Linux. It has less memory usage and a noticable better performance. Another neat advantage in my opinion is that you always get the latest version. Now for example I am running 3.5b4 in stead of a way older iceweasel(firefox) version which is in the apt libraries for the Debian Testin version. Since the firefox/swiftfox/iceweasel betas are pretty stable anyway, this is just an advantage in my opinion.

Updating is pretty easy, and swiftfox will automaticly use your default bookmarks, plugins and so on which you already have in firefox/iceweasel. To install edit your /etc/apt/sources.list and add the following line:
deb http://getswiftfox.com/builds/debian unstable non-free
Next type:
apt-get update
apt-get install swiftfox-prescott
Notice there is also a i686 version and a athlon64 version available. (apt-cache search swiftfox).

And you are done :) To run swiftfox type: /usr/bin/swiftfox