Thursday, March 26, 2009

TPFand - cool down

I had experienced this under Windows too: my T60p got very, very hot at times (CPU > 85°C) . Sometimes it would even exceed 100°C causing the lot to just switch off with an emergency halt. Boom; black screen and take a break for 30 minutes to let things cool down.

I found out that the BIOS (or other hw controlling software) didn't manage the fan properly. It would just sit there, humming peacefully and slowly while internals must have resembled hell in TP by then. The I found the Notebook Hardware Control (NHC) software suite. Execellent piece of work in which you could set tresholds for various part temperatures (CPU, GPU, etc.). It would spin up the fan, keeping temperatures inside agreeable or manageable at least.

Hardware issue, you say? Yes, that was what the helpdesk thought as well. My motherboard, cpu fan and gpu unit all have been replaced at least two times each. Never got any better. And I did truthfully install each and every BIOS/firmware upgrade Lenovo brought out; so that couldn't be it either.

Okay, so I had it working on Windows, now Linux. I found out the other day that CPU temperatures could easily reach 85°C or higher with the fan back in its lazy mode humming peacefully again. Something had to be done again.

So I found Thinkpad Fan Control and it does exactly what NHC did as well: you can set custom tresholds from where the fan will spin up or down. Vey easy and very well working, for me. Temperature never goes beyond 80°C anymore!

But, you got to know one thing about tpfand: if any of the settings are left to hw_ctrld (Hardware Controlled), then it seems that it will always hw_ctrl your fan, regardless of your settings. So I recommend you remove all hw_ctrld settings and replace them with a real value (=percentage).

There are two sensor you will want to watch:
Sensor 0 is your CPU which gets hot if you don't look out ;-)
Set tresholds to: < 50°C off, 50 < 30% < 58, 58 < 45% < 65, 65 < 60% < 70, 70 < 75% < 75, 75 < 90% 80, 80 < 100% < 85, 85> full
Sensor 3 is your GPU (ATI FireGL5200), which can get even hotter...
Set tresholds too: <50°C off, 50<15%<55, 55<30%<65, 65<45%<75, 75<60%<78, 78<75%<80, 80<90%<82, 82<100%<85, 85> full
Set all other thresholds too: <50°C off, 50°C> full
Under advanced set 'Hysteric' to 4 and minimum delay to 2.5 seconds.
(all temperatures in °C; please pay attention as tpfand can also show them in °F)

And then you'll have a quiet machine that won't get too hot but doesn't spin up at every temp spike either. Good for your ears and lifespan of your TP!

Tuesday, March 24, 2009

Get a better Second Life (on Linux)

Every now and then I go into Second Life. Just to browse around or attend my companies information sessions. I really like those; active and useful content delivery in a new environment... quite inspiring actually.

But, when I switched to Linux I found that the official Second Life viewer for Linux isn't too swell. It's slow, hicky and sticky. Like you're walking in a world drenched in melasses; it's just no fun anymore.

But there's an alternative for Linden Labs viewer, one that's quite a bit better performing on Linux. And it comes with an update server, so you get you're frequent updates as well.

Hah, the name you ask. Well, it's the Open Metaverse viewer. Have a look or get a second life first ;-)

Flawless video playback with Compiz

Maybe you have experienced, like me, that video playback isn't as flawless as it could be. I experienced frequent framedrops, stutterings and flashing windowparts when playing video full screen. I tried Totem-GStreamer and MPlayer but neither made any difference. Then I tried the many different rendering types MPlayer packages (X11shm, OpenGL, et cetera) to no avail.

I had a suspect though: Compiz. Changing the Desktop Effects to none - effectively shutting down Compiz - turned full screen video playback back to normal; no more hick ups, framedrops or anything. But toggling Compiz on and off isn't a solution. It's a workaround and thus feels wrong. So, I had to dig through the Internet to find a solution.

Many, many forums, blogs, bug-sites and other websites have been written full on this problem. Especially the combination Compiz - ATI fglrx cards seem to experience the video playback problems. I found many "solutions", ranging from adapting Xorg.conf with custom settings to fiddling with the aticonfig tool. However, judging from the comments on these "solutions", they seemed to work for only small parts of the populus and certainly not for the majority.

As I didn't want to mess up my system with complicated sets of script alterations of which I wouldn't be able to keep track of after a couple of rounds trying, I decided that I'd either have to go with the Compiz-shutdown-workaround or have to come up with something else. Shutting down Compiz isn't too complicated if you use the Compiz Fusion Icon in the system tray but it also changes your desktop appearance. Especially if you use things like the Avant Windows Manager like I do as this relies on a composited desktop.

But first I thought to go through the CompizConfig settings. This is easily found through System->Prefferences. Looking at each option, I tried to predict what it would do. I must admit that many aren't too obvious and the tooltips aren't very explicit either.

Under the "Tools" header I found "Video Playback". Now, I haven't got the foggiest on what that does or is expected to do, but I figured it might conflict with proper video playback in other software. So I toggled that off and retried full screen video playback. And... tataaa... it worked fine; as if Compiz wasn't running!

I haven't seen this solution anywhere else, so I am wondering if others experience toggling this setting to off solves their problems. If it does (or doesn't), please leave a comment for others. Thx!

Important update: You will have to close windows that are frequently updated or switch to a clear desktop in order to avoid the underlying windows to flash black boxes through your video. E.g. I have to close all active screenlets when I watch video, as these are updated every few seconds and flash through the full screen video.

Monday, March 23, 2009

Play DVD from harddrive

This is one of those things you can spend hours on figuring out:

You got a backup of a DVD on your harddisk; simply a directory with the AUDIO_TS and VIDEO_TS directories in it where the DVD data is stored. You got MPlayer installed and you want to watch the video. How do you do that? MPlayer doesn't support playing from harddrive out-of-the-box like many Windows based players nowadays do.

Well, you basically got two options; one laborous and one easy one (if you can remember the syntax ;-):
  1. Create and iso filesystem from the directory tree the DVD is stored in with mkisofs, mount the iso image and fire up MPlayer to watch the content;
  2. Use this command and you're off immediately:
    # mplayer -dvd-device /home/chuck_norris/wherever/ dvd://1
This post is also ment to be an easy to find reminder for myself...

Wednesday, March 18, 2009

Upgrading Open Office to the latest version

Because the Open Office developers didn't make it in time for the Intrepid Ibex release to make available the 3.0 packages, we are stuck with Open Office 2.4... or are we?

On Softpedia I found an excellent tut with plenty screenshots on how to upgrade (yes! upgrade not deinstall 2.4, install 3.0.1, loose all the configs changes, etc.) your Open Office to 3.0.1.

So, run on over to:

Worked like a charm for me!

Friday, March 13, 2009

Blueproximity on your Thinkpad

I was pointed at a nifty app for my laptop: Blueproximity.

The firm I work for requires every employee to lock his/her laptop with a screensaver/lock whenever you walk away from it. Most firms do nowadays. And every now and then comliance checks are carried out.

Last week we had some compliance officers on our floors and I tend to forget to lock my machine up when I go for a coffee. Soo... I could use something to automate that process for me.

The usual thing you'd do is set up a screensaver timer based upon keyboard/mouse activity. But when you're on a conference call or just talking to someone, it would lock up whenever you didn't want it to.

Furthermore, a laptop can't tell when you walk away to lock up for you, so the 30 minutes interval you had set for the screensaver lock kicked in just 14 minutes and 27 seconds late for the compliance officer check...

But... you're laptop can tell if you've gone away. It can even tell if you've walked away more than, say, 7 meters for more than 10 seconds and lock up for you. And upon you're return, say if you get closer than 4 meters for a second, unlock you're machine again for you.

How, you ask? With Blueproximity (available for you through synaptic). Pair your telephone through bluetooth to your laptop and your laptop will be able to tell if you've gone or jst returned and lock/unlock your laptop for you.

One caveat though: always wear your phone close to you and don't leave it next to your laptop when you do get a coffee...

Thursday, March 12, 2009

Trackpoint scrolling

I was so used to being able to scroll through web pages and texts using the middle mouse button and the trackpoint on Windows, I was delighted to find that it is possible to have this on Linux too!

From the Thinkwiki:

Modern distributions like Ubuntu 8.10 and Fedora 10 use HAL to configure the input devices. You should no longer make changes to xorg.conf as by default Xorg (through the evdev driver) will let the kernel now handle input devices.

But before you get started on this you should make sure you have all the updates applied from your distro vendor as both Ubuntu 8.10 and Fedora 10 require some additional fixes that you will need.

vertical scrolling

By default the middle mouse button is that, a middle mouse button, which in Linux is used for the Paste operation.

But you can configure it to act in the same way as in Windows, such that you can use it for vertical scrolling (keep the button pressed and move the TrackPoint up and down to scroll). To accomplish this create the file /etc/hal/fdi/policy/mouse-wheel.fdi as root with the following content:

<match key="info.product" string="TPPS/2 IBM TrackPoint">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>

<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>

After this reboot, or restart the hal service and Xorg. You can validate the settings with lshal.

Eye Candy - running Avant Window Navigator 0.3.2

I know, I know, it's considered eye candy but I must say that in this case it is practical eye candy. Not for not Apple chose a window navigator to which AWN is akin like a twin, so it must be good in the literal and aesthetical sense of the word. I especially like the numerous applets and plugins available, so I can choose whatever I like.

Intrepid Ibex is equiped with the 0.2.6 version of AWN, but like always: I thought the latest version had way more functionality and extras, so I wanted that. The upgrade process is manual and quite easy if you take note of the following:

If you have AWN 0.2.6 installed, you should remove that completely (using synaptic and search for packages called 'AWN' and 'Avant'). Check these packages for complete removal (so including configuration!) and apply it your system. Now the old AWN manager is gone from the system.

Then add these lines to a new file/etc/apt/sources.list.d/reacocard-awn.list:

deb intrepid main
deb-src intrepid main

Using Synaptic you can now check the files in the source and select all the Avant Window Manager files you think you might need (here's where you decide which applet packs are installed as well).

Then apply this to your system and voilĂ , you're good to go! If some odd behaviour shows: just restart X (CTRL-ALT-Backspace); if AWN doesn't show up at all, you probably don't have Desktop Effects enabled (which is a prereq.)

I'm using the 'Black Gloss' theme from as it has that nice Apple look. Got to hand it to Steve Job's guys: they do know what looks good... And I fiddled a bit with the settings to make it a bit smaller than default.

One more thing on AWN which wasn't too clear to me at first:
If you want to add starters by dragging them from the Cairo Menu or any of the panels: drag them directly on top of the AWN bar itself! You can rearrange them later using the AWN Manager (System -> Preferences). I found myself dragging the starters into the manager window, which just doesn't work...

Wednesday, March 11, 2009

Enabling Hard Disk Protection (HDAPS) on Intrepid

Having that much success with enabling suspend/resume yesterday I was getting bold tonight: I wanted to have the built Thinkpad hard disk protection working too.

There's a lot to be found on this particular topic through Google and the Thinkpad wiki, with solutions ranging from recompiling the kernel, new HDAPSD code to be compiled yourself, alternate TP_Smapi modules, switching to userspace modules and everything in between.

Fact is that a little thing went wrong when porting kernel modules from previous versions of Ubuntu to Intrepid Ibex; alledgedly some were forgotten in the proces. In particular the hdaps_ec module as reported here.

As Intrepid Ibex is, at the time of writing, using kernel 2.6.27-11-generic there still is a need for modules. However, from kernel 2.6.28 onwards tp_smapi and a correctly working HDAPS should be available in any stock kernel.

Having gotten that far, I decided it was prolly best to forget about hard disk protection for the time being. Ubuntu 9.04 (Jaunty Jackalope) is due in a few weeks - april 23rd is the foreseen due date for the final release - and just go from there on. It really is a can of worms you're opening once you try to get hdasp working...

Bit of a disapointment actually, to be honest. I was quite eager to try the knock-knock script to lock/unlock my Thinkpad (and other commands by just knocking on your TP) or the anti-theft alarm based upon the accelerometer ;-)

Tuesday, March 10, 2009

There is light at the end of the tunnel! :: Enabling sleep/resume

What a lot of searching this particular thing has cost me... and it all seems so simple: close the lid (or press Fn/F4) and the machine goes to sleep. Open it up and it wakes up again.
Right... not straight away, because the awakening always resulted in a black screen and the need to just reboot the whole thing.

At first I found postings about fiddling with power management settings (pm deamon), changing options in /etc/default/acpi-support, but that all wasn't it. Then I found a lot of postings on other machines than a Lenovo laptop or my T60p in particular that experienced the same problems. It all seemed to be related to two things: the AMD graphics card (a FireGL 5200 in my case) and Compiz...

Knowing what to look for, I found Dave Hay's blog; a friend and very knowledgeable colleague of mine who found the solution! (And, reportedly, this works on other machines as well).
Dave, in turn, had found a "solution" (work-around is the proper definition here) for this problem as posted by Dave Abrahams here.

Dave has created two scripts:
1. a script ( /etc/pm/sleep.d/00compiz-fglrx ) to kill compiz during the suspend process, and restart it on resume;
2. A second script ( /etc/pm/config.d/50compiz-fglrx-noclear ) is used to stop the Change Foreground Virtual Terminal ( chvt ) command from running until compiz is killed ( to be more specific, it "blacklists" the default /usr/lib/pm-utils/sleep.d/00clear script from running on resume, thus preventing the chvt command from being run ).

And these two scripts magically solved my sleep/resume problem!
These scripts can be found here (Dave Abrahams repository, where he maintains them).

Here are some short intructions on how to install these scripts. If my directions arn't clear, you can cross reference them with Dave Hay's instructions on his blog.

1. download the script files
2. copy them to their respective directories
3. make both scripts executable by setting the execute bit to them. E.g.:
# sudo chmod +x /etc/pm/sleep.d/00compiz-fglrx
4. reboot
5. done!

If needed, you can enable logging on the /etc/pm/sleep.d/00compiz-fglrx script by setting a value to the parameter LOG_FILE_NAME e.g. LOG_FILE_NAME='/home/your_username/suspend.log'.

This newly-created logfile, along with /var/log/pm-suspend.log should help determine the cause of the problem.

Thanks to Dave Hay I managed to get this working (I use it a lot). And with WICD (see my previous post) I have no problems with the wireless network connection hanging over a sleep/resume cycle!

PS. I did copy/paste some of Dave Hay's work in here; thx Dave! ;-)

Monday, March 09, 2009

Getting Wifi to work properly

One of the first things I ran into, was getting Wifi to work properly. The T60p I got is equiped with the Atheros 5212 chipset and this particular chipset imposes some problems on the Linux platform in general; Ubuntu 8.10 no exception.

One of the things I found was that the Gnome Network Manager didn't enable me with enough config options, to change some of the deeper settings. But also the proprietary driver that comes with Intrepid Ibex isn't working as it should.

However, there are some very good alternatives out there which can help you to get Wifi working as designed. At this point I would like to refer you to a website I found, which describes the whole process in detail and it worked marvelously for me.

So, check out Patrick Wardrop's website and get going!

One of the most appealing things of Patrick's posting is the fact that he replaced the Gnome-Network-Manager with WICD and boy, am I happy with that!

Sunday, March 08, 2009

My Hardware config

Thought it be good to introduce my system to you, so you can see what these posts are tested on/related to:

I got an IBM/Lenovo Thinkpad T60p. The official specs:
T2600(2.16GHz), 2GB RAM, 100GB 7200rpm HD, 14.1in 1400x1050 LCD, 256MB ATI FireGL V5200, CDRW/DVDRW, Atheros 5212 - 802.11abg wireless, Bluetooth/Modem, 1Gb Ethernet, UltraNav, Secure chip and harddisk protection.

All posts in this blog are, for now, based on this setup. But maybe it'll still be worth something to someone out there..

First week

This week I started working with Ubuntu for the very first time.
Having worked with Fedora, Suse en RHEL, it was somewhat of first as well working with a Debian based version of Linux.

But... to my surprise it all went very smoothly. I'll be writing up my experiences here at this blog on getting hardware and other stuff to work. Maybe someone else can benefit too and doesn't have to invent the wheel all over again.