Installing Ubuntu 8.04 (Hardy Heron) on a ThinkPad T61p

From ThinkWiki
Revision as of 07:58, 5 September 2008 by Chazchaz101 (Talk | contribs) (Display / Video: Add explanation for why EnvyNG/Most recent drivers are needed)
Jump to: navigation, search

What works out of the box?

  • Wireless (Intel 3945ABG or 4965AGN)
    • Only tested G mode
    • LED not working yet. Known issue in kernel driver.
  • Wired LAN
  • Video (VESA)
    • Hardware Drivers panel offers to install NVidia proprietary drivers on first boot
  • Touchpoint and Trackpad
    • Including scroll at the right side of the pad
  • Optical drive
    • Optiarc AD-7910A
  • Sound card
    • Microphone not yet tested
  • Memory card reader
    • Only tested SD (non-HC) cards. Didn't take locked (read-only) cards.
  • Control buttons/Hotkeys
    • Volume control buttons
    • Screen brightness control
    • Thinklight control
    • WLAN/BT/OFF toggle
    • Media player control
  • Some ACPI features
    • Battery status, power graphs and history
    • Lid states and events
    • LCD brightness adjustment on power source
    • Only tested with a single 6-cell battery

What needs some tweaks?

  • Suspend-to-RAM (Standby, Suspend)
TODO
HDAPS (harddrive protection system)

What doesn't work at the moment?

  • Suspend-to-Disk (Hibernate)
  • Wireless LAN power/activity LED

Display / Video

To enable 3D acceleration, the proprietary NVidia driver must be installed. The first time you boot into Ubuntu, you should get an alert asking if you want to install the binary driver. If not, it can be installed from the Hardware Drivers panel at System --> Administration --> Hardware Drivers.

If you want more options for configuring your video card than is provided by the Ubuntu control panels, you can install the NVidia Control Panel with

$ sudo apt-get install nvidia-settings

which will add the NVidia X Server Settings panel to the Administration menu.

Alternately, more recent versions of the NVidia driver and Control Panel can be installed using EnvyNG (envyng-gtk in Synaptic). Simply start it up (System Tools --> EnvyNG) and ask it to install the NVidia driver. Using the most recent binary drivers, or at least ones more recent that those installed by the Hardware Drivers panel, is required for proper Suspend functionality.

Unfortunately, there are some annoying bugs in the NVidia driver. The most annoying one is that after resuming from suspend, you will often get a blank white screen. To get past it, simply type in your password and press enter, and you will be returned to your desktop. Fortunately, Ubuntu has released a workaround for this bug, so it should go away once you update all your packages to the latest versions.

Another problem is that the driver does not report the correct refresh rate to Compiz, resulting in rough animation. To fix this, install the compizconfig-settings-manager package, then go to System --> Preferences --> Advanced Desktop Effects Settings. Click on General Options, go to the Display Settings tab, uncheck the Detect Refresh rate box and drag the Refresh Rate slider to 60. Also, check the Sync To VBlank box.

Next, Compiz animations are also choppy due to NVidia's PowerMizer feature, which slows down the GPU to conserve power when it is not in use. This works well for 3D games which constantly use 3D acceleration, but poorly for Compiz which uses the GPU in small bursts. To solve this problem, I made a couple of shell scripts which keep the GPU at its highest speed while running on AC power. The first one is named "powermizer-loop" and does most of the work:

#!/bin/sh

while true; do
    
    powerstate=`cat /proc/acpi/ac_adapter/AC/state | awk '{print $2}'`
    
    if [ $powerstate = "on-line"  ]; then
       nvidia-settings -q all > /dev/null
    fi
    sleep 25;
done

The second is named "powermizer-off" and starts up powermizer-loop when I log in, ensuring that only one copy runs at a time:

#!/bin/sh

killall powermizer-loop
~/powermizer-loop &

I put both of these scripts in my home directory and made them executable by doing:

chmod 755 powermizer-loop powermizer-off

Then to make powermizer-off run on login, I opened System --> Preferences --> Sessions, clicked on Add, and entered the command "/home/argilo/powermizer-off".

Of course, performance still suffers when running on battery, but hopefully NVidia will fix this problem in a future version of their driver.

One final bug is that EDID (Extended Display Identification Data) is misdetected, which causes problems with font sizes and greatly reduces the number of resolutions available in the NVidia X Server Settings application. (For example, I was unable to set my laptop's screen to 1024x768 for use with a projector during a presentation.) To correct this problem, I added the following lines to /etc/X11/xorg.conf in the "Screen" section:

Option "UseEdidDpi" "FALSE"
Option "DPI" "96 x 96"
Option "UseEdidFreqs" "FALSE"
Option "HorizSync" "40-70"

The first two lines fix the font size issue, and the last two lines fix the resolution problem. I'm not sure if the 40-70 values are actually correct, since I just took them from someone else's xorg.conf, but they seem to work.

NVidia seems to have corrected the EDID misdetection bug in the latest version of their driver, but it's not available in Hardy and I'm not aware of any easy way to install it.

Suspend

Suspend is supposed to work out of the box if you're not using the Nvidia binary drivers. If you are using them, the following instructions will fix suspend to ram. Suspend to disk (hibernate) is not working at this time.

NOTE!
These instructions worked on the T61p with type numbers 6460, 6457 (and perhaps 6465). It may also work with other type numbers.

To get suspend to ram working, you need to edit a configuration file, which apparently has some bad information in it.

$ gksudo gedit /usr/share/hal/fdi/information/10freedesktop/20-video-quirk-pm-lenovo.fdi

Find the following section:

     ...
     <!-- T61 (8895), intel card 32bit works with S3_MODE, but 64bit needs VBE_MODE 
	      T61p (6460), does not work with the NVidia driver-->
     <match key="system.hardware.product" prefix_outof="6457;6460;6465">
	<merge key="power_management.quirk.s3_bios" type="bool">true</merge>
	<merge key="power_management.quirk.vbemode_restore" type="bool">true</merge>
     </match>

     <!-- These Thinkpads don\'t need a quirk: 6459 (T61p), 7664 (T60) see s2ram -->
     <match key="system.hardware.product" prefix_outof="6459;7664;8918">
	<merge key="power_management.quirk.none" type="bool">true</merge>
     </match>

     <!-- Lenovos non-ThinkPads -->
     ...

Remove the 6457;6460; from the <match key="system.hardware.product" prefix_outof="6457;6460;6465"> line and add the following lines right before the <!-- Lenovos non-ThinkPads --> line:

     <match key="system.hardware.product" prefix_outof="6457;6460">
	<merge key="power_management.quirk.s3_bios" type="bool">false</merge>
	<merge key="power_management.quirk.vbemode_restore" type="bool">true</merge>
     </match>

Based on Bug #235284 in hal-info (Ubuntu)

On (at least) the 6457 model you'll need the latest binary Nvidia graphics drivers (173.14.09 at time of writing for Envy) to be able to resume from suspend. Additionally I have to switch to the X terminal manually by pressing alt+F7. The sleep LED will blink for a while after resume, but will stop eventually and the wireless devices will be switched back on. You may experience some resetting of the display when that happens. Just move the cursor to regain your desktop. N.B. This does not seem to occur when waking after a long time of sleep.

Bluetooth

If installed, bluetooth must be enabled with the command:

$ echo enable | sudo tee /proc/acpi/ibm/bluetooth

Replace enable with disable to turn it off.

You can now connect devices by following the instructions at Ubuntu Help Bluetooth Setup page

NOTE!
On (at least) the 6457 model the Bluetooth and Wireless LAN toggle button (Fn+F5) seems to work fine. Be aware of the additional hardware switch at the front of the machine. This needs to be in the green setting.