My Thinkpad Status

Contents

Now that I think that I have my Thinkpad R51 running Linux nearly perfectly (read: supporting all hardware pieces), I want to share some experiences, tricks, and configurations. There are already numerous webpages dealing with "Linux on my Thinkpad", thus I will keep this short and to the point.

Most stuff is really well covered in the Thinkwiki: http://www.thinkwiki.org

ATI Radeon Mobility 9000

File: xorg.conf(16.39 kb; Sun, Sep/25/2005) download 'xorg.conf' to disk

I got both the radeonfb module as well as ATI's proprietary X driver fglrx working, but the latter is preventing me from safely suspending to disk (update: the newest versions are supposed to have preliminary suspend support, but I did not try that yet). Thus, I am using xorg's open source radeon driver, and everything is fine with that. (After all, I don't use OpenGL very often.) But I still have the configured fglrx "Device" section in my xorg.conf, it's just not used normally (i.e. not referenced in the "Screen" section). When I need hardware-accelerated OpenGL rendering, I simply change the reference to the Device "Radeon 250" in the Screen section to Device "Radeon 250 fglrx" and unload the radeon and drm kernel modules to allow the fglrx module to load.

Update

As noted somewhere below, I do not keep this page up-to-date with all my kernel updates anymore. Lately, I tried installing the fglrx driver with the latest 2.6.23.1 kernel, but X failed with "(EE) No device found". I remembered having read something about discontinued device support from ATI's side, so I checked and eventually found ATI's page on older driver versions, which explicitly states that 8.28.8 is the last driver version to support this card. Unfortunately, I could not get this latest working version to compile with the latest kernels. Some API changes are handled by Gentoo's patches (ati-drivers-2.6.19.patch and ati-drivers-2.6.20.patch from [portage]/x11-drivers/ati-drivers/files), and the UCS_RELEASE error could be fixed by including linux/ucsrelease.h, but some errors remained and I did not have the time to try harder.

See below for the X.org "Device" section I currently have in use.

With suspend-to-ram, my notebook suffered from a high power drain (around 5.7W!). That's a well known problem found on ThinkWiki and was attributed to the graphics card not being suspended. There is a script which checks if your notebook is affected, and the solution is to use a patched radeonfb driver (Update: The patch seems to have made it into the official kernel starting with version 2.6.18, so it's no longer needed). I am indeed using that now, and in contrast to my first experiences, it seems to be very stable with both suspend to disk and to ram. The power consumption went down to less than 400mW (additionally, I disabled wakeup-on-LAN with ethtool -s eth0 wol d), which means that the battery lifetime in ACPI sleep improved from the disappointing seven hours (with full battery!) to more than 110 (nearly five days). That's what I call satisfying. ;-)

Connecting an External Projector

Today, I tried to connect a 1024x768 beamer to my notebook. After all, I could already switch the resolution of my display from the supported 1400x1050 to any other with xrandr:

xrandr # displays supported resolutions
xrandr -s 2 # switches to 1024x768 for me

So, I figured it would probably boil down to xrandr -s 2 and connecting the device. Not much so! ;-) The image was totally distorted and ugly to the eyes.

The essence of my struggling is:

Making NumLock work again

Having configured the above graphics modes, I still could not switch between resolutions with [Ctrl][Alt][Kp+]/[Kp-] (at least not within KDE) since I could not use the numlock key. This is because on my thinkpad, NumLock is [Shift][ScrollLock] and the standard XKB shortcut for mouse emulation is [Shift][NumLock] (AFAIK KDE enables the standard XKB accessibility features). So what happens is that NumLock is kind of toggled, but always together with the mouse emulation (xev shows Pointer_EnableKeys as the performed event, the NumLock LED stays off, and the "keypad" keys [j],[k],[l],... are moving the mouse), and I cannot use the [Kp+]/[Kp-].

With xmodmap -pke | grep Pointer I found out that the following command helps:

xmodmap -e "keycode 77 = Num_Lock"

(It simply takes away the second meaning for keycode 77 + Shift.)

Networking / Roaming

I managed to make network roaming work like a charm for me. You can find many pages telling you how to do so, often offering scripts of varying length, generality, and use, so I will just tell you how I did it:

As you can see in the next section, I configured Fn-F3 to toggle the WLAN (note that you have to pass the -w cmdline switch to wpa_supplicant to make it wait for the device appearing). Thus, I can freely switch between WLAN and cable: When downloading something via WLAN, and I am not content with its speed, I walk over to the next cable and plug it it. Soon, I have a second route set up, and I can switch off WLAN with Fn-F3 (actually, I should give the cable a higher priority - stay tuned! ;-) ). The downloads in progress speed up without any connection breaking, and the same thing works the other way round, too! :-)

Global Key Bindings

File: acpi_default.sh(2241 bytes; Wed, Aug/31/2005) download 'acpi_default.sh' to disk
File: toggle_ipw2200(396 bytes; Wed, Sep/28/2005) download 'toggle_ipw2200' to disk
File: .tpbrc(216 bytes; Fri, Jan/06/2006) download '.tpbrc' to disk
File: ibm_button_callback(68 bytes; Thu, Aug/25/2005) download 'ibm_button_callback' to disk

Although I do not see the point of most of the extra keys on modern keyboards (like "WWW" or "Mail" keys which do not work under Linux), I put some effort into having sensible global shortcuts on my ThinkPad:

You might be interested in some of my config files (I most probably missed one, please tell me if so):

My Kernel

Since I already mentioned that I am using suspend-to-disk, I want to share some information about the patched kernel I have running:

This is the sequence of commands I used to unpack and patch my kernel:

tar xvjf linux-2.6.17.tar.bz2
rm -f linux && ln -s linux-2.6.17 linux
tar xvjf suspend2-2.2.7-for-2.6.17.tar.bz2
cd linux-2.6.17
../suspend2-2.2.7-for-2.6.17/apply
patch -p1 < ../fbsplash-0.9.2-r5-2.6.16.patch
patch -p1 < ../radeon-sleep.diff
File: config-2.6.13.2(44.85 kb; Tue, Nov/22/2005) download 'config-2.6.13.2' to disk

You can download my kernel .config file, but note that I am using it for several computers, and that it's not very optimized e.g. for small size, but contains a lot of drivers not being used on my thinkpad (much hotplugging stuff, just in case I'll attach one of those devices some day ;-p ). However, it's definitely a working configuration.

Note that I am using the tpm_acmel TPM driver (which AFAIK is the successor of tpmdd which is the successor of IBM's research implementation), and the nsc-ircc driver for fast IRDA (don't load it by hand, configure irattach to start with nsc-ircc instead of e.g. /dev/ttyS0 as parameter).

I am using the following additional drivers:

This is a list of the modules I let my system load at boottime:

The Modem

Until recently, I had slmodem installed (the Smart Link modem driver), and the daemon would happily start, setup a modem device, and tell me about no problems. Even, when I eventually tried to actually use the modem, I did not see any problems, but I would always get a NO DIALTONE answer from the modem as a reply to a ATDT command. I found some postings reporting similar problems in the WWW, but with no solution.

Finally, I found out that it's simply the wrong driver! With those winmodems, where 90% of the modem is the driver, this can go unnoticed for quite some time, and at least in my case, I did not find any suspicious messages. For example, here's the syslog output when I tried the slamr module:

slamr: SmartLink AMRMO modem.
slamr: probe 8086:24c6 ICH4 card...
ACPI: PCI Interrupt 0000:00:1f.6[B] -> Link [LNKB] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:00:1f.6 to 64
slamr: mc97 codec is CXT23
slamr: slamr0 is ICH4 card.

Some posting pointed to the scanModem shell script (available at the linmodems website), which is capable of identifying your modem. I found its output and the bunch of files it creates quite confusing, but at least it told me (after I found out that I have to run the unloading script before) that I obviously need the hsfmodem driver:

...
 The controller: 8086:24c6 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)1DB ICH4
 is capable of supporting soft modem chips from AT LEAST manufacturers:
...
Modem status     : PRA(GPIO) PRB(res) PRC(ADC1) PRD(DAC1) PRE(ADC2) PRF(DAC2) PRG(HADC) PRH(HDAC)
 Use a hsfmodem package from http://www.linuxant.com/drivers  for the Conexant soft modem.
 The modem has a Conexant codec: CXT
 and there support for the modem controller: 8086:24c6 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)1DB ICH4
...
  8086:24c6 is a Conexant HSF modem.
...

Unfortunately, the free version of the Linuxant driver does not support sending faxes, which is the only purpose why I would be interested in modem drivers at all. I would seriously consider spending $19 on the full version if I sent more than one fax a year though; the Linuxant people give very good reasons why they cannot offer a free driver and they seem to do a good job.

To summarize, this is c&p'ed wisdom from the scanModem output:

There are two mutually exclusive support possibilities:

  1. The modem may have a Conexant chipset requiring supported by an hsfmodem package from http://www.linuxant.com/drivers.
  2. Support through a low level ALSA modem driver, with intelligence provided by the slmodemd maintained by Sasha Kharposky.

Valid XHTML 1.0! Valid CSS!
This page was last modified: Saturday, November 17, 2007 hacker emblem