Showing posts with label thinkpad. Show all posts
Showing posts with label thinkpad. Show all posts

Wednesday, March 26, 2008

Thinkpad X61 Wireless and Ubuntu

At last I have resolved a long-standing gripe with Ubuntu on my ThinkPad X61.

Months ago, soon after installing Gutsy Gibbon, I found that my wireless card initially worked well. But a few minutes later, my connection was dead, and I could only restore it by unloading the iwl4965 driver, reloading it, and reconnecting to my access point. Unfortunately, after an indeterminite amount of time the problem would reoccur.

I experimented a little and discovered that by instructing my wireless router to accept anything only 802.11g, the problem vanished. When away from home and using other wireless networks, occasionally my connection would spuriously disconnect. Fortunately, the wireless networks I usually frequent somehow never cause this bug to manifest.

Yesterday my wireless connection was unbearably flaky, and several times, even reloading the driver proved fruitless. I finally decided to look for a proper solution.

Typing dmesg revealed that every time the connection dropped, a message similar to the following would be logged:
[  154.652000] wlan0: No ProbeResp from current AP 04:11:46:fe:24:b0 - assume out of range
Googling for "iwl4965 no proberesp" shows that many others have had the same trouble. Some pages were unanswered bug reports, and others contained discussion where the consensus was to reload the kernel module as a workaround. Happily, before long I stumbled across a FAQ for the ThinkPad T61 that describes a permanent fix, which I'll repeat:
  1. Download the latest iwlwifi microcode
  2. Replace /lib/firmware/2.6.22-14-generic/iwlwifi-4965-1.ucode.
  3. Reload iwl4965 module
The new microcode banished my wireless woes, and the dreaded "No ProbeResp" no longer appears in the logs.

Now I'm left with one remaining significant complaint: the graphics driver. My i965 mostly behaves but there are minor annoyances involving compiz, and major ones involving Wine. I'll leave this for another time.

Monday, March 17, 2008

xrandr

In the old days, to get the external VGA output working on my laptop in X, or even switch resolutions, I'd have to edit an overly complex configuration file and restart X. Nowadays, I use the X Resize and Rotate Extension via xrandr, which is considerably more convenient. I like to control displays through the command-line interface. I find typing the full command cumbersome, so I use this simple script instead:
#!/bin/bash
case "$1" in
left)
xrandr --output VGA --auto --left-of LVDS
;;
right)
xrandr --output VGA --auto --right-of LVDS
;;
up)
xrandr --output VGA --auto --above LVDS
;;
down)
xrandr --output VGA --auto --below LVDS
;;
big)
xrandr --output VGA --mode 1600x1200 --above LVDS
;;
off)
xrandr --output VGA --off
;;
*)
xrandr --output VGA --auto --same-as LVDS
;;
esac

Saturday, March 15, 2008

Thinkpad X61 Volume Buttons

I tried in vain to get the brightness adjustment keys to work, but at least the volume up and down buttons were easy to handle. They trigger bona fide X key events, so I added a couple of lines to .xbindkeys:
"amixer -c 0 set PCM 1dB+"
XF86AudioRaiseVolume

"amixer -c 0 set PCM 1dB-"
XF86AudioLowerVolume

Thursday, November 8, 2007

Linux on a Thinkpad X61

My X31 which I repaired a while ago died again. This time I think the system board is gone, as there are no signs of life. Nothing I do, even plugging in a power cord (and I tried several), will make any of the LEDs light up. It is functionally equivalent to a brick.

I decided to purchase a Thinkpad X61 instead of a replacement system board. I chose to stick with the Thinkpad X series for several reasons. For starters, Thinkpads endure. Well, apart from my X31, though it still outlived other brands I've tried. I even have an old Thinkpad 240 that's still running strong.

Another reason is that I want a good balance of small footprint and performance. I went through a phase long ago where I thought the biggest baddest laptop that money could buy was the right choice, but after trying it once, I discovered clunkiness destroys half the appeal of a laptop, and furthermore, a cheap desktop with accessories will give a much better computing experience.

But most importantly, Thinkpads have a good track record with Linux support. Nonetheless, I did a few quick Google searches to confirm that this was the case for the X61. Happily there are many results.

My X61 arrived last month, and with Vista installed by default. Vista is astoundingly bad. Not only is it slow, but every few actions, everything grinds to a halt until I handle some dialog box about giving permission to some process or other.

I suppose some effort was put into making the interface look slicker, but there is also plenty of extraneous rubbish that serve only as visual distractions and annoyances. Perhaps Microsoft is not entirely to blame, as some of the pop-ups are plastered with the Lenovo logo.

In any case, my new system was unusable. I had to escape from Vista. It had been a long time since I had last installed Linux, as once setup correctly, there's rarely a reason to reinstall. I spent some time learning about the latest installation methods.

Network Installation

There's no need to prepare a floppy, CD or any other kind of removable media. Visit http://www.goodbye-microsoft.com/ from any version of Windows, including Vista, and you can have Debian up and running within minutes.

Note UNetbootin is a similar program for Ubuntu, but Vista support is still in the works.

There was one small hiccup. The Debian-installer loader ran fine, but a reboot brought be back to Vista (taking forever to load of course). After further research I discovered that I had to mess with the BCDEDIT program to set a nonzero delay so I could actually select Debian from the Vista boot menu.

Then deja vu. I was reminded of the first time I tried installed a Linux desktop: back then, it must have taken me a day to get sound working, and another for the network.

The wireless didn't work. Neither did the sound. The "vesa" graphics driver performed badly: switching back to text mode resulted in a blank screen. This system is too new for Debian.

I had read success stories using the development version of Ubuntu ("Gutsy Gibbon"), and a few unsuccessful attempts at getting the wireless working I figured I'd switch.

I tried to do so with UNetbootin (run from Debian) but I must have screwed something up because I was left with an unbootable system: the Grub bootloader had taken over the master boot record, and was somehow configured badly. To salvage the situation, I used a PXE network boot, and from a menu option I installed Gutsy.

The wireless network card (Intel 4965) worked out of the box, as did the "intel" video driver for X windows. Back when I first tried this, and before Gutsy was officially released, sound didn't work and I had to download and compile the development version of ALSA's "hda_intel" driver to rectify this. But the latest version works out of the box.

Various buttons such as the brightness and volume controls have no effect, but if I were so inclined, I could fix this by scripting commands with the aid of the ibm-acpi package.

Mission Accomplished

My laptop is now usable. Not only that, but it is orders of magnitude faster and smoother than any other system I use. I have more to say, but rather than delay this post yet again, I'll save the material for future articles.

Monday, July 23, 2007

Elective Thinkpad X31 Surgery

My trusty IBM Thinkpad X31 that Stanford bought me in 2003 has taken everything I've dished at it with only a couple of cracks in the case to show for it. At least, until recently. One awful afternoon, after hitting the power button I was briefly greeted with the message "Fan error" before it shut itself off. No amount of coaxing would bring it back.

My desktop is truly ancient, dating back to the last millennium, so I had grown accustomed to doing most tasks on my laptop instead. The first task was to retrieve my data, which is easily achieved with a SATA/IDE to USB adapter. Only one screw needs to be removed to retrieve the hard drive.

I was tempted to take the easiest but most expensive path: shell out for whatever passes for the best of the Thinkpad X series these days. But although working in industry means this remedy wouldn't sting as much as in my student days, it also means I don't spend as much time on my own machines. Now there's other things I'd prefer to get for that kind of money. Similarly, I didn't want to pay for it to be serviced.

My only recourse was to attempt a repair myself. The Lenovo webpage about servicing the Thinkpad X31 spooked me a little. What's going on in that diagram? Do I have to take it apart into a hundred pieces just to replace a fan? The table suggesting that fan replacements should not be undertaken by end users wasn't encouraging either. With a heavy heart, I ordered a 67P1443 fan anyway.

When it arrived, enthusiasm and impatience triumphed and I took out every screw I could see, but the fan remained elusive. Eventually I regained some sense, and Googled for "thinkpad x31 disassembly". The first result contained a links leading to the official Thinkpad X31 hardware maintenance manual. I should have known. What isn't online these days?

Fan replacements turn out to be almost trivial. After removing the battery and hard drive, I only had to remove the four clearly indicated keyboard screws, and then slide the keyboard out. Underneath, I discovered the reason for the fan error. Nestled in the fan blades was a tiny piece of foam, sticky on one side and rose-tinted on the other. A pink pad in my Thinkpad.



I suspect that the fan is still operational, but since I had a new one and had already removed the five screws securing it, I replaced it anyway. Also, it's easier to apply thermal paste to a new fan than clean and reapply to an old one.

The tougher part was figuring out where the pink pad belonged. There was another one in there somewhere that also looked like it had been slightly dislodged. I settled on pressing both of them against some metal frame in the center, where I presume they work best as shock absorbers.



Soon after I received my laptop I wrote a webpage about Linux on a Thinkpad X31. Only when I started blogging did I realize it would be much easier (for me at least!) to maintain with blog posts, and that's probably what I'll do in the future if I have more to add. Sure, it's nice to have all information in one place, but this can be approximated through appropriate use of tags. Furthermore, the dates on each post may also give the reader some idea of how relevant it is.