Thinkpad T61

From Blue-IT.org Wiki

Revision as of 10:24, 12 October 2010 by Apos (talk | contribs) (Pulseaudio warnings)

Introduction

Thinkpad T61 mit Ubuntu.jpeg

After using a very old Thinkpad R31 for a very long time and having a lot of trouble using this machine with linux, I decided to renew my Thinkpad experience with a newer and faster model. What i am writing about in this article is only about when some troubles occurred or I liked to modify something - in my opinion - for better usage.

I bought this used T61 device at lap-works.de with a rest guaranty of 1 1/2 years (lenovo) which is pretty good.

What should I say: inserted Ubuntu 10.04, installed it and everything worked out of the box! Theres nothing more to say. This machine is awesome, the keyboard smooth as used to be for a Thinkpad, the Trackpoint is my favorite and the Thinklight my friend, when just a candle is flickering around in the room ...

And of course, one of the best features of newer Thinkpads is the coffee spill ability. It really works - unfortunately I had to test it with real coffee ...

T61 - coffee spill ability.jpg

Machine description

  • Model: Lenovo ThinkPad T61, model 6457BK3
  • BIOS: ThinkPad BIOS 7LETC6WW (2.26 ), EC 7KHT24WW-1.08
  • Processor: Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz, Intel 64 Technology, Enhanced Intel SpeedStep® technology1, Intel Dynamic Acceleration, Execute Disable Bit, Virtualization Technology, 800MHz system bus and 4MB shared L2 cache
  • Memory: Lenovo 2 x 2GB (PC2-5300 667MHz DDR2), dual-channel capable, two 200-pin SO-DIMM sockets
  • Display: 15.4" (391mm) WSXGA+ (1680x1050) color, anti-glare, 200 nits, 16:10 aspect ratio, 500:1 contrast ratio
  • Graphics: NVIDIA® Quadro® NVS 140M, PCI Express® x16, 128MB memory, TurboCache, DVI pass-through support to optional Advanced Mini Dock or Advanced Dock
  • PC Card: One slot (Type I, Type II), CardBus 32-bit
  • Multicard Reader 4-in-1 reader: MultiMediaCard, Memory Stick® PROTM, Secure Digital, xD-Picture CardTM
  • Ports: Three USB 2.0, DB-15 (external VGA monitor), RJ-11 (modem), RJ-45 (ethernet), IEEE 1394 FireWire 400 (4-pin connector; 1394a-2000 standard)
  • Wireless: 11a/b/g wireless4, ThinkPad 11a/b/g Mini PCIe Adapter
  • Bluetooth: Bluetooth 2.0 wireless, USB 2.0 interface via ICH8M, LED indicator
  • Ethernet: Gigabit ethernet, Intel 82566MM Nineveh (PHY), PCIe x1 (GLCI), PXE
  • Audio: High Definition (HD) Audio, AD1984JCP codec / stereo speakers, 1 watt / volume up, down, mute buttons / internal microphone, microphone input jack, headphone jack
  • EIDE DVD±RW DVD burner, Ultrabay Slim Burner (41N5643), dual-layer, removable from Ultrabay Slim
  • HDD: Hitachi SATA HTE723232L9A360 320 GB / 7200 UPM
  • Akku: Noname 12Cell (!) 10400 mAmpH (does NOT fit into a docking station - which i don't use)

Operating System

Ubuntu Logo

Please visit the page Ubuntu Desktop for my actual configuration.

Touchpad and Trackpoint

T61 - Pointing devices.jpg

For configuring the pointing devices I am using GPointing

sudo apt-get install gpointing-device-settings

I turn off the touchpad completely. This also disables the functionality of the FN+F8 Button (which indeed does not really work, because the touchpad enables itself after a certain time).

For the trackpoint I always enable the very useful emulation of the mousewheel (keep pressing the middle keypad while using the trackpoint).

Sound

This machine uses an intel hda chip ( see Thinkwiki AD1984).

> lspci -v
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
       Subsystem: Lenovo Device 20ac
       Kernel driver in use: HDA Intel
       Kernel modules: snd-hda-intel
> head -n 1 /proc/asound/card0/codec* 
Codec: Analog Devices AD1984
> zcat /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz
[...]
AD1984
======
  basic	default configuration
  thinkpad	Lenovo Thinkpad T61/X61
  dell_desktop	Dell T3400
[...]


Module configuration

I modified the configuration of the snd-hda-intel module to be loaded correctly via alsa configuration file:

> sudo vim /etc/modprobe.d/alsa-base.conf

[...]
options snd-intel8x0m index=-2 model=thinkpad
[...]

Pulseaudio warnings

Update Ubuntu 10.10

Problem seems to be resolved. But pulseaudio seems to write a lot of messages into syslog. So you can leave the log-level on "error".

Ubuntu 10.04

The system uses pulseaudio. I get some strange errors in dmesg:

[...]
Sep 26 12:16:41 server pulseaudio[1430]: ratelimit.c: 121 events suppressed
Sep 26 13:04:03 server pulseaudio[1430]: ratelimit.c: 120 events suppressed
Sep 26 13:07:28 server pulseaudio[1430]: ratelimit.c: 116 events suppressed
[...]

The system runs without any problems, so to get rid of this known bug I did the following:

> sudo vim /etc/pulse/daemon.conf

[...]
; log-target = auto
; log-level = notice
log-level = error
[...]

Then close all audio applications (!) and restart pulseaudio als normal (!) user (not root):

> pulseaudio -k

Bluethooth

Hardware switch for radio devices

T61 - radio switch.jpg

I don't use bluetooth often but it works quite well. For me most of the time it should be turned off for power saving and security reasons.

But if i switch the hardware button in front of my thinkpad - for both wlan and bluetooth - off and on, both devices come up again. The following procedure disables bluetooth by default, yet it does not disable the bluetooth device. So it is easy to switch it on via the gnome bluetooth icon. But be warned: this also disables toggling bluetooth via FN-F5!

Despite using TLP (thinkpad linux powersaving scripts) this hack is necessary to get rid of reactivated bluetooth when using the hardware switch.

The bluethooth device is from Broadcom and attached to the usb bus:

> udevadm monitor --udev
UDEV  [1285453647.905188] remove   /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/bluetooth/hci0 (bluetooth)
> udevadm info --attribute-walk --path=/sys/bus/usb/devices/3-1/3-1\:1.0
 looking at device '/bus/usb/devices/3-1/3-1:1.0':
   KERNEL=="3-1:1.0"
   SUBSYSTEM=="usb"
   DRIVER=="btusb"
   ATTR{bInterfaceNumber}=="00"
   ATTR{bAlternateSetting}==" 0"
   ATTR{bNumEndpoints}=="03"
   ATTR{bInterfaceClass}=="e0"
   ATTR{bInterfaceSubClass}=="01"
   ATTR{bInterfaceProtocol}=="01"
   ATTR{modalias}=="usb:v0A5Cp2110d0100dcE0dsc01dp01icE0isc01ip01"
   ATTR{supports_autosuspend}=="1"

Prevent bluetooth on system boot

You can achieve this either by using TLP (thinkpad linux powersaving scripts) OR adding a simple line into /etc/rc.local:

> vim /etc/rc.local

echo disable > /proc/acpi/ibm/bluetooth

Prevent bluetooth when using the hardware switch

Again: the usage of TLP (thinkpad linux powersaving scripts) will not hinder bluetooth from coming up again, when reenabling the radio devices with the hardware switch. This also is the case when usaging FN+F5 .

Edit a custom udev rule

> vim /etc/udev/rules.d/10-disable-initial-T61-bluetooth

# Broadcom Bluetooth T61
SUBSYSTEM=="usb", KERNEL=="3-1:1.0", ACTION=="add", RUN+="/path/to/bin/disable_bluetooth"

Edit the according "bluethooth-disable" skript and make it runnable:

> vim /path/to/bin/disable_bluetooth

#!/bin/sh
echo disable  > /proc/acpi/ibm/bluetooth
> chmod 755 /path/to/bin/disable_bluetooth

Reload udev:

> sudo service udev reload && sudo udevadm trigger

Wlan Problems

I encountered some problems on Ubuntu Lucid / 10.04.1 64bit and 10.10 with my wlan and had some strange errors in dmesg:

Failed to get channel info ...

> dmesg
[...]
iwl3945 0000:03:00.0: Failed to get channel info for channel 100 [0]
iwl3945 0000:03:00.0: Failed to get channel info for channel 104 [0]
iwl3945 0000:03:00.0: Failed to get channel info for channel 108 [0]
iwl3945 0000:03:00.0: Failed to get channel info for channel 112 [0]
[...]

According to this opensuse bug i filed a solution in Ubuntu Bug #340418:

Add a new file to /etc/modprobe.d/:

> sudo vim /etc/modprobe.d/options-iwl3945.conf

options iwl3945 disable_hw_scan=0

For testing purpose do

> sudo rmmod -f iwl3945 && sudo modprobe iwl3945 disable_hw_scan=0

Wrong country DRCA

> dmesg
[...]
cfg80211: Leaving channel 5170 MHz intact on phy2 - no rule found in band on Country IE
cfg80211: Leaving channel 5180 MHz intact on phy2 - no rule found in band on Country IE
cfg80211: Leaving channel 5190 MHz intact on phy2 - no rule found in band on Country IE
[...]

Look at dmesg like this:

> dmesg | grep cfg | grep country
[...]
cfg80211: Calling CRDA for country: GB
cfg80211: Received country IE:
[...]

To set the right country for your card (here GB) you have to install the program iw

> sudo apt-get install iw

Then you can manually do

> sudo iw reg set GB

and you'll see in dmesg:

cfg80211: Regulatory domain changed to country: GB

To automate this process you can write a so called dispatcher script for network manager (according to [1] and [2]):

vim /etc/NetworkManager/dispatcher.d/01changeCRDA

and add

#!/bin/sh
INTERFACE=$1
ACTION=$2
CODE="GB" 

if [ "$ACTION" = "up" -a "$(echo $INTERFACE|grep wlan)" ];then
       iw reg set ${CODE}
fi

Now, if you switch on your radio devices via FN+F5 or the hardware switch, bluetooth will be disabled emediately.

HDAPS

HDAPS (harddisk active protection system) can be easily achieved via a special kernel module:

> sudo apt-get install tp-smapi-dkms hdapsd

Then reboot the machine for the hdaps device to be created.

For temporarily check if everything works you can do:

> sudo modprobe tp-smapi && sudo /etc/init.d/hdapsd restart

Save power

Some people say there is a big difference running on battery with Win* and Linux. This is indeed the case, but I can live with that. I am more interested in a stable system than in running 10 minutes more or less on battery ;)

Suspend and Hibernation

Generally works out of the box. There are only some drawbacks concerning the wlan and the integrated card reader (Ricoh chipset).

Hibernation is working, but it takes a very long time to resume. The laptop seams to freeze for a long time, then beeps two times and resumes. The whole procedure takes about 3 minutes which is far more than shutting down the machine. But it works!!!

Suspend is no problem at all, but to avoid troubles I did the following:

Wlan and cardreader drivers

Wlan might not recover reliably. So it is necessary to reload the driver. Problems also accur, when a SD-Card is placed in the memory slot. It will hinder suspend or hibernation.

Putting these modules into the corresponding file will solve this issues ;)

> sudo vim /etc/pm/config.d/00sleep_module

SUSPEND_MODULES="$SUSPEND_MODULES iwl3945 usb_storage sdhci sdhci_pci"
Update ubuntu 10.10

Don't remove iwl3945 any more, or suspend will not work / hang:

> sudo vim /etc/pm/config.d/00sleep_module

SUSPEND_MODULES="$SUSPEND_MODULES usb_storage sdhci sdhci_pci"

Running virtual machines (VirtualBox)

When you are running a virtual machine inside ubuntu and you are going to suspend or hibernate the notebook it leaves your (virtual!) machine unusable! So we have to add a script that ensures, that a virtual machine is set either into pause mode (supend) or is saved to disk (hibernation).

> sudo vim /etc/pm/sleep.d/90virtualbox 

#!/bin/sh
#
# 90vbox: scan for active virtual machines and pause them to avoid seizing on host suspend

if ( ps aux |grep VirtualBox | grep -v grep )
then
for USR in "$(ps aux |grep VirtualBox |grep -v grep |cut -f1 -d' '| uniq)"; do
     case "$1" in
         suspend)
         for VMS in "$(su - $USR -c 'VBoxManage list runningvms | egrep ^\"*\" | cut -d"\"" -f2 | sed s/\"//g')"; do
             su - $USR -c "VBoxManage controlvm \"$VMS\" pause"
         done
         ;;

         hibernate)
         for VMS in "$(su - $USR -c 'VBoxManage list runningvms | egrep ^\"*\" | cut -d"\"" -f2 | sed s/\"//g')"; do
             su - $USR -c "VBoxManage controlvm \"$VMS\" savestate"
         done
         ;;

         thaw|resume)
         for VMS in "$(su - $USR -c 'VBoxManage list runningvms | egrep ^\"*\" | cut -d"\"" -f2 | sed s/\"//g')"; do
         su - $USR -c "VBoxManage controlvm \"$VMS\" resume"
         done
         ;;

         *) exit $NA
         ;;
      esac
done
fi
> sudo chmod 755 /etc/pm/sleep.d/90virtualbox

TLP

I am using now the more convenient way with Thinpad Linux Powermanagement for Ubuntu (TLP) which is pretty forward.

Please have a look at their webpage and ppa (german) for more information.

sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tp-smapi-dkms smartmontools

For configuration issues please visit this section on the (german) website.

Things I changed in the configuration file:

> vim /etc/default/tlp

1. Because of a disturbing clicking sound of the Intel HDA Sound card

SOUND_POWER_SAVE=0

This will be probably fixed in Alsa 0.23 (Ubuntu 10.10).

Update: Not fixed in 10.10!

2. Don't use the power off function for the Ultrabay in battery mode, because the dvd does not come up always:

BAY_POWEROFF_ON_BAT=0 # which is default

3. However the problem with the bluetooth hardware switch as noticed above is not obsolete.

Manual power saving setting

If you don't like to use TLP you can use the following entries in /etc/rc.local [3]

# Laptop Mode
echo 2 > /proc/sys/vm/laptop_mode
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 3000 > /proc/sys/vm/dirty_expire_centisecs

# SATA Link Power
for i in /sys/class/scsi_host/host* ; do 
        [ -f $i/link_power_management_policy ] && echo "min_power" >  $i/link_power_management_policy
done

# Intel HDA Powersave makes trouble with permanent and
# disturbing clicking sound (asla 0.22 / Ubuntu 10.04) 
# alsa 0.23 will probably solve this 
#echo 1 > /sys/module/snd_hda_intel/parameters/power_save
#echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller 

# USB Suspend
for i in /sys/bus/usb/devices/*/power ; do
	if [ -f $i/autosuspend ]; then
		echo "0" > $i/autosuspend 
		echo "auto" > $i/level
	fi
done

I will test it ... and see if it fits over time ...

--Apos 11:23, 29 September 2010 (CEST)

Update

After testing: these entries are absolute obsolete when using TLP. Works flawlessly in Ubuntu 10.04 and 10.10.

--Apos 15:42, 11 October 2010 (CEST)

Nvidia and Plymouth bootscreen

See: Nvidia and Plymouth bootscreen

Links