Installing Ubuntu 8.04 (Hardy Heron) on a ThinkPad T61p

From ThinkWiki
Revision as of 09:53, 15 September 2008 by Sgla1 (Talk | contribs) (Screen brightness control)
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
    • No Microphone
  • 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)
  • Microphone/Sound In
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, make sure the are updated as explained in the Display/Video section, and 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.

Internal Microphone/Microphone Input Jack

The microphone is muted out of the box. In order to enable it, double click on the the speaker icon in the task bar or run $ gnome-volume-control. Under File > Change Device, select "Capture: ALSA PCM on front:0 (AD198x Analog) via DMA (PulseAudio Mixer)" and set the master slider to about 75%. Make sure that the mute and recording buttons below the slider do not show red Xs.

Go back to the Change Device menu and select "HDA Intel (Alsa mixer)". Then go to the edit menu and select preferences. In the window that opens, make sure that the boxes for Capture, Capture1, and both instances of Input Source. The Volume Control panel should now have four tabs: Playback, Recording, Switches and Options. In the options tab, select Internal Mic for the internal microphone or Mic for the mic input jack for both Input sources. As far as i can tell, the second one down doesn't seem to actually do anything. Now in the recording tab you can mute Capture 1 and adjust the sensitivity of the mic with the Capture slider. You can use Sound Recorder in Applications > Sound & Video to test out your settings.

In the past, I have spent a fair amount of time messing with the PulseAudio settings on this install, so it would be great if someone with a relatively unaltered install could verify these instructions and post a confirmation. The main thing I did before was follow the PulseAudio howto here: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support Chazchaz101 11:05, 8 September 2008 (CEST)

Kubuntu KDE 4.1 on the t61p

What works?

What does not work?

  • Screen brightness control
  • Volume control buttons

Screen brightness control

There is a known bug in Kubuntu/KDE 4.1 which causes acpi_fakekey information to be lost. This in turn breaks the /etc/acpi/video_brightnessdown.sh and video_brightnessup.sh scripts. See https://bugs.launchpad.net/ubuntu/+source/kdeutils-kde4/+bug/223643

Here's a workaround: change the above scripts as follows:

root@t61p:/etc/acpi# cat video_brightnessdown.sh
#!/bin/bash
brightness=$(cat /sys/class/backlight/acpi_video1/actual_brightness)
new_brightness=$[brightness-1]
echo $new_brightness > /sys/class/backlight/acpi_video1/brightness

root@t61p:/etc/acpi# cat video_brightnessup.sh
#!/bin/bash
brightness=$(cat /sys/class/backlight/acpi_video1/actual_brightness)
new_brightness=$[brightness+1]
echo $new_brightness > /sys/class/backlight/acpi_video1/brightness