Thursday, March 25, 2010

to fix ubuntu speedstepping

For some reason my laptop decided to start scaling the processor back to the slowest possible frequency even when I was on AC power and running cpu intensive workloads.

I scanned for cpufreq modules in the kernel using
$lsmod | grep cpufreq


And I found nothing. I attempted to insert speedstep-centrino or acpi-cpufreq as a kernel module and found there were no modules to be loaded.
[~]$ sudo modprobe speedstep-centrino
FATAL: Module speedstep_centrino not found.

[~]$ sudo modprobe acpi-cpufreq
FATAL: Module acpi_cpufreq not found.



At this point I started looking at bug reports and user forums and I found the following:
* speedstep-centrino appears to be deprecated in favor of acpi-cpufreq
* acpi-cpufreq is actually compiled as part of the 2.6.31 ubuntu kernel so there is no module to load
* Ubuntu 10.x may revert to using acpi-cpufreq as a module but thats not confirmed
* cpufreqd and powernowd are userspace speed stepping daemons
* Ubuntu prefers powernowd but my system had cpufreqd installed
* hal (hardware abstraction layer) also has a speed step controller that no one talks about.

The last point is the one that tripped me up. I think the behavior I was seeing was hal getting confused when I would suspend the laptop, change from running on battery to AC, and then restart the laptop. The hald-addon-cpufreq daemon was doing speed stepping by setting min cpu = max cpu = target frequency. Which means switching the governors didn't do anything.

On the advice of a hal configuration bug report I found I removed the 10-cpufreq.fdi file I found in /usr/share/hal/fdi/policy/10osvendor/10-cpufreq.fdi and restarted the computer.

Removing the hal cpu controller, powernowd, cpudyn, and cpufreqd finally removed every last bit of automated control over my cpu speed stepping. I have cpufrequtils installed which gives me the ability to view and change cpu max, cpu min, and cpu governor manually. After the headache of trying to figure out why my cpu frequency randomly changed I think I'll stick with a system I can control.

Monday, February 8, 2010

flash followup

Apparently fixing flash on Karmic Ubuntu is easier and harder than I thought. I messed with various profile setting for a long while and still couldn't get GDK_NATIVE_WINDOWS to stick in all cases. It looks like gnome makes a habit of launching things outside of the context of the parent process.

I have everything working correctly now, but it took wrapping the firefox and prism executable with a one liner to set the environment variable

[~]$ cat /usr/bin/firefox
#!/bin/sh
GDK_NATIVE_WINDOWS=1 exec firefox-bin $@


That was enough to get it working again. Hopefully this saves someone some time.

Monday, February 1, 2010

how to fix flash in Ubuntu Karmic

This has been annoying me for a while now. I wasn't able to hit half of the buttons in flash games, youtube, or GrooveShark while running karmic. I figured an update in flash broke my system but it turns out the problem runs a bit deeper.

Gnome decided to enable client side rendering in their GTK windows. This allows for quicker and cleaner redraws when doing special effects. I happen to run fluxbox so I didn't notice anything in the switch. Eclipse users might be familiar with this since Eclipse hasn't handled the change yet. I stole most of this fix from their boards.

You can disable this new client side rendering using the environment variable GDK_NATIVE_WINDOWS=1.

My trouble was that it was impossible to get that variable to set anywhere in my config. I edited .profile (which is frowned on), .bash_profile (which is cheating since the variable won't make it into the window manager), /etc/environment (which sets it on a system level), and ~/.pam_environment (which sets it at a user level). None of these solutions would actually get the environment variable to stick.

Flash forward a frustrating half an hour of trial and error and I realized I started up the gnome-settings-daemon in my fluxbox startup script. I put a sleep after the gnome-settings-daemon and appended the GDK_NATIVE_WINDOWS assignment and everything started working. Turns out gnome-settings-daemon was hiding the environment variable changes. I have no idea how to reconfigure the setting daemon so I'm currently letting the hack stand (1 second delay and all).

Long and short of it: Add the line "export GDK_NATIVE_WINDOWS=1" to your startup files (any that I mentioned above) and keep in mind the gnome-settings-daemon might decide to squash them.

Hopefully that will spare you some troubles

Friday, May 1, 2009

how to improve graphics on a t60p running Jaunty (xorg 1.6 + radeaon)

Brian commented a few times on my last Jaunty post with some helpful advice. ATIRadeon Wiki posts the driver options for your xorg.conf file. Xorg 1.5 and up can run without the xorg.conf file by automatically guessing drivers and monitors, but it doesn't selected the tuned options all the time.

After my upgrade headaches I cleared the xorg file and started fresh, but I didn't think to add in the device options. I followed the wiki and performance is better, but not stellar. Compiz is still slow and multiple windows running transparency will bring the system to its knees. But its not all bad news. Fluxbox is finally acting the way it used to (desktop switches are quick, windows move without lag)

I still need to try out the radeon HD driver to see if that adds anything. For now I'll happily use fluxbox with Brian's tweaks and be content with it getting the job done.

PS: Brian, I wanted to visit your blog but your profile is blocked. Thanks again for the help

Thursday, April 30, 2009

how to change ktimetracker systray icon

My recent switch from gnome to fluxbox has been a happy improvement save one small detail. I had really gotten used to using the gnome-panel applets but I didn't want to muddy up fluxbox with the gnome-panel (even though you can run it as a subset). Long story short I found there was no good way to run gnome-panel applets without running gnome-panel and I started to look for new applications to fill the void.

Enter ktimetracker. ktimetracker is a handy kde application that can be run standalone. It offers a simple way to create tasks and track time against them. As an added bonus, the system tray icon for ktimetracker animates a clock moving when ktimetracker is tracking time against a task. The only downside is that the icon was small and it was hard to tell when it was animated and when it was stopped.

I found the icons used in the system tray as a bunch of xpms (active-icon-*.xpm) in /usr/share/kde4/apps/ktimetracker/pics . I figured if I changed the icons and restarted ktimetracker I'd be able to see the new system tray icon, but I was only partially right.

I replaced the icons and the system tray didn't change until I had rebooted the system a few time. I still have no idea why it switched (or why it didn't switch immediately) but at least I know where I can go to customize it.

Tuesday, April 28, 2009

why you should avoid putting Ubuntu Jaunty on a t60p

I excitedly installed the newest version of Ubuntu on my t60p and found out the following unfortunate facts.

1) The t60p (and many other tSeries laptops) have the Mobility FireGL V5250 video card
2) Catalyst (ATI driver) delayed the delivery of the 9.3 driver to cram as much function into it as they could. The reason they did this was because 9.3 was the final driver to support the Mobility FireGL V5250 video card along with a plethora of other cards. (Full list of unsupported cards here)
3) Ubuntu Jaunty makes use of xorg-xserver 1.6 which only supports the 9.4+ version of the Catalyst ATI driver

All this ends up meaning that the warning Jaunty throws when you try to update with an Mobility FireGL V5250 video card means a lot more than there will be degraded graphics after the update. The only driver that will work with xorg-xserver 1.6 is the Radeon opensource driver for ATI cards.

I'm a big fan of opensource, but the Radeon driver are just not ready for primetime. There is no 2d acceleration which means all the compositing and pretty graphics are gone. Since switching to Jaunty and the Radeon drivers I've noticed a serious drop in performance doing standard things like moving windows and switching desktops.

On the upside: moving away from the Catalyst drivers (fglrx) re-enabled suspend / resume on my laptop. I've also started using fluxbox again (http://www.fluxbox.org).

The only noticeable update from Ibex to Jaunty has been the network manager and the new libnotify. The NetworkManager does a pretty good job of making sure I'm connected anyway it can connect me. The new libnotify insert message snippets into the pidgin and xchat notifications I get (which is nice).

If you are happy with Ibex, stay with Ibex until the radeon driver improves or someone backports support for the Catalyst 9.3 fglrx driver into xorg-xserver 1.6.

Tuesday, January 20, 2009

how to stretch standard definition broadcasts on a charter digital tuner

I recently bought a nice HD tv that was without a QAM tuner. QAM tuners are what allow you to watch the free HD channels while your TV is connect to cable. You can learn more about QAM at wikipedia.

I got a digital tuner box (also known as a set top box) from charter so I could get access to the HD channels. The box worked like a charm but it displayed all standard definition programming as a 16:9 feed with black bars on the side. My TV couldn't zoom or stretch the signal since it was already in 16:9.

There were no options on the remote or in the charter menu that would set the display size. After some poking I found the User Guide for DCH6200 which is the set top box I had.

All the output options for the box are hidden in a secret menu you access by shutting off the box and hitting the menu button in rapid succession. Once the hidden menu is up you can select 480p to send standard definition as a 480p signal that the TV can stretch or display however you'd like.

Its a shame that the menu is hidden and charter didn't send the user manual with the box, but it works pretty well now that I know what I'm doing.