Lenovo ThinkPad X200

From ArchWiki
Revision as of 20:14, 26 December 2014 by Linrunner (talk | contribs) (Removed garbage: X200's do not beep and TLP does not do fan control)
Jump to: navigation, search

The Lenovo ThinkPad X200 is a wonderful high-quality laptop featuring a 12.1" widescreen WXGA monitor, an Intel Core 2 Duo processor (2.26 - 2.66GHz), an Intel Graphics Media Accelerator 4500MHD and up to 8GB of RAM whilst still maintaining impressive battery life.h

Configuration

Wireless

The ThinkPad X200 has a Intel PRO/Wireless 5100/5300 AGN wireless adapter, supported by linux-firmware.

If you experience connectivity problems such as a slow connection or aborts, especially when connected to a WPA2 Enterprise network, then try to load the iwlwifi module with the options 11n_disable=1, 11n_disable=2, swcrypto=1, bt_coex_active=0. There is no clear recommendation which of these options to be used as for some users 11n_disable=1 already solves the problem sufficiently, for others bt_coex_active=0. See Wireless_network_configuration#iwlwifi for more detailed instructions.

TrackPoint

See TrackPoint.

Fingerprint Reader

See fprint.

GRUB kernel parameter

Merge-arrows-2.pngThis article or section is a candidate for merging with GRUB.Merge-arrows-2.png

Notes: Doesn't belong here (Discuss in Talk:Lenovo ThinkPad X200#)

Many kernel parameters usually recommended in the past to increase performance and battery conservation are obsolete or already implemented in the kernel by default. As such the actual kernel line in /etc/default/grub can look very minimal:

GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=Linux zswap.enabled=1 zswap.compressor=lz4 resume=/dev/mapper/VolGroup00-Swap"

acpi_osi=Linux is required to make the mute button working and zswap.enabled=1 as well as zswap.compressor=lz4 will increase the speed on resume from hibernation.

Disable bluetooth at boot

See Power saving#Bluetooth.

Enable tap to select

Merge-arrows-2.pngThis article or section is a candidate for merging with TrackPoint.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Lenovo ThinkPad X200#)

You can enable the double click through tapping on your track point. Create the following file:

/etc/tmpfiles.d/enable-tap-to-select.conf
w /sys/devices/platform/i8042/serio1/press_to_select - - - - 1

Hard Disk shock protection

The ThinkPad X200 comes with an integrated 2-axis accelerometer providing the possibility of parking the hard drive's disk heads preventing from data loss due to heavy shocks. See HDAPS for details. It may be necessary to set correct invert parameter.

Mute button

If the mute button on your keyboard is not working, then be sure to add acpi_osi="Linux" to your boot parameter in /etc/default/grub.

GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=Linux"

Screen calibration

If you experience your stylus to be working very imprecisely, then you might need to calibrate it first. Install xinput_calibratorAUR and run the following command:

# xinput_calibrator --device "Serial Wacom Tablet WACf004 stylus"

After calibration you need to create the file called /etc/X11/xorg.conf.d/99-calibration.conf with the settings provided by xinput_calibrator.

Loading the correct ICC colour profile

Download x200.icc and move it to ~/.color/icc. Load the profile with xcalibAUR as follows:

$ /usr/bin/xcalib -d :0 ~/.color/icc/x200.icc

Screen rotation

The screen rotation hardware button does not work by default. First you have to assign this button to a free keycode. In order to find out an unused keycode, you can use the command xmodmap -pke | less.

/etc/systemd/system/setkeycodes.service
[Unit]
Description=Assign each hardware button to a free keycode on boot

[Service]
Type=oneshot
ExecStart=/usr/bin/setkeycodes 0x67 184 0x6c 185 0x68 186 0x66 187

[Install]
WantedBy=multi-user.target
Note: Commands like xmodmap, xev, showkey, dmesg, setkeycodes can help you. See Extra keyboard keys for details.

Then you can assign the script for screen rotation to that button.

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: In-code comments, see Help:Style (Discuss in Talk:Lenovo ThinkPad X200#)
/usr/local/bin/screen_rotation.sh
#!/bin/sh

# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.
rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"

# Using current screen orientation proceed to rotate screen and input tools.
case "$rotation" in
    normal)
    # rotate to the left
    xrandr -o left
    xsetwacom set "Serial Wacom Tablet WACf004 stylus" rotate ccw
    xsetwacom set "Serial Wacom Tablet WACf004 eraser" rotate ccw
    ;;
    left)
    # rotate to normal
    xrandr -o normal
    xsetwacom set "Serial Wacom Tablet WACf004 stylus" rotate none
    xsetwacom set "Serial Wacom Tablet WACf004 eraser" rotate none
    ;;
esac

The assignment of the keycode to the script depends on your desktop environment. For Gnome the assignment can be easily done in the Keyboard preferences of custom shortcuts.

If you are using another desktop environment (such as XFCE, LXDE, Fluxbox ...) you can always use the program xbindkeys.

Screen auto-rotation

The auto-rotation of the screen does not work by default. First you have to install the HDAPS package so as to get the values worked out by the integrated 2-axis accelerometer of the Thinkpad X200. Then the following script will enable you to use the accelerometer's data to automatically rotate your screen :

#!/bin/bash

# (To have the exact names of these devices you should type the command : xsetwacom --list devices )
stylus="Serial Wacom Tablet stylus" 
eraser="Serial Wacom Tablet eraser"

function rotate {
    if [ $# -lt 1 ]; then  # error ...
	exit 1 
    fi

    case "$1" in
        up)
            nextRotate="none"
            nextOrient="normal" ;;
        down)
            nextRotate="half"
            nextOrient="inverted" ;;
	right)
            nextRotate="ccw"
            nextOrient="left" ;;
	left)
            nextRotate="cw"
            nextOrient="right";;
    esac

    # Rotate the screen      
    xrandr -o $nextOrient

    # Rotate the tablet                      
    xsetwacom set "$stylus" Rotate $nextRotate
    xsetwacom set "$eraser" Rotate $nextRotate
}

while true; do
    # 1) We extract data about the actual position
    position=$(cat /sys/devices/platform/hdaps/position)
    x=$(echo $position | sed -n "s/(\([-0-9]*\),\([-0-9]*\).*)/\1/p") # most of time contained in [350,650]
    y=$(echo $position | sed -n "s/(\([-0-9]*\),\([-0-9]*\).*)/\2/p") # most of time contained in [-650,-350]

    # 2) We work out the x value (= left and right inclination) (always between 
    if [ $x -lt 400 ]; then
	rotate left
    elif [ $x -gt 600 ]; then
	rotate right
    fi
    
    # 3) We work out the y value (= front and back inclination)
    if [ $y -gt -400 ]; then
	rotate down
    elif [ $y -lt -600 ]; then
	rotate up
    fi

    # 4) wait before checking the value again
    sleep 0.5
done

Then you can run this script at the startup in order to make your screen automatically rotate when you need it. For instance, you can use the file ~/.fluxbox/startup on fluxbox, or the command : gnome-session-properties if you are using Gnome 3).

Power consumption and fan control

Note: There is a useful blog post describing possible measures to reduce power consumption of a X200T to almost 7 Watt.

Install the tlp package from AUR to enable extensive power consumption control.

See Power saving for additional tips.

Suspend to RAM / hibernate

Merge-arrows-2.pngThis article or section is a candidate for merging with #Troubleshooting.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Lenovo ThinkPad X200#)

See Suspend and hibernate. On rare occasions the backlight may not activate after resuming. See Problem with display remaining black after resume for possible workarounds.

Tips and tricks

Power consumption

Power consumption of an X200T can be reduced to as much as ~6.5W. This can be achieved by installing and configuring TLP and reduced monitor brightness. A detailed guide how to implement a simplistic power saving environment can be found here. Actual power consumption can be measured by Powertop and powerstat-gitAUR.

Troubleshooting

failed to execute '/usr/sbin/inputattach'

If you see the above error in your logs, copy /usr/lib/udev/rules.d/70-wacom.rules to /etc/udev/rules.d/70-wacom.rules and comment out SUBSYSTEM of inputattach.

System feels unresponsive

If your system feels unresponsive and lagging, you can try creating a file called /etc/modprobe.d/drm_kms.conf:

options drm_kms_helper poll=N

PM device: Resume from hibernation error: Failed to restore -19

This is likely to be related to the tpm_tis and tpm modules not being properly unloaded before hibernation. These modules are required by the device listed in the error as 00:0a:

# dmesg | grep 00:0a
[    0.377877] pnp 00:0a: Plug and Play ACPI device, IDs PNP0c31 (active)
[   10.746742] tpm_tis 00:0a: 1.2 TPM (device-id 0x1020, rev-id 6)
[   10.746751] tpm_tis 00:0a: Intel iTPM workaround enabled
[   10.866734] tpm_tis 00:0a: TPM is disabled/deactivated (0x6)

To unload the module create the following executable file called /usr/lib/systemd/system-sleep/tpm.sh, assuming the use of the systemd hibernation procedure:

#!/bin/sh
case $1/$2 in
  pre/*)
    echo "Going to $2..."
    modprobe -r tpm
    modprobe -r tpm_tis
    ;;
  post/*)
    echo "Waking up from $2..."
    modprobe tpm
    modprobe tpm_tis
    ;;
esac

mei_me 0000:00:03.0: suspend

If you are seeing this error, a workaround is to blacklist the mei and mei_me modules. More information can be found here.

pciehp 0000:00:1c.1:pcie04: Cannot add device at 0000:03:00

See #mei_me 0000:00:03.0: suspend.

Uhhuh. NMI received for unknown reason 30.

The Thinkpad X200 is known to report the following error on resume from hibernation or suspension:

Uhhuh. NMI received for unknown reason 30.
Dazed and confused, but trying to continue
Do you have a strange power saving mode enabled?

In this case you can disable the high precision event timer (HPET) by adding "nohpet" to your GRUB kernel parameter line.

High pitched noises

The X200(s) is prone to high pitched, low volume noises originating from the CPU, usually in low power scenarios.

One proved solution is to disable CPU power control in the BIOS.

For more information see [1].

See also