TC1100

From LQWiki
Jump to: navigation, search

The HP/Compaq TC1100 is a Tablet PC. It has quite a few devices crammed into its small form factor. Getting them all to work in Linux can be quite a task, but the situation is constantly improving.

General

Using a recently-updated distribution with a 2.6-series kernel is recommended. Ubuntu and Debian work pretty well. Wired ethernet, full-resolution graphics, sound, PCMCIA, USB and top-side buttons should work by default. Wireless networking works by default on Ubuntu 7.10, but not on Debian due to missing firmware (see below). Most of the tablet's devices can be made to work, so installing Linux on it is feasible. There are no reports of keyboard position sensor working.

The following table summarizes the level of support for the TC1100's devices, in a desktop installation of Ubuntu 8.10. The situation is similar for Debian Etch.

  • Green means that the device works by default with absolutely no configuration.
  • Yellow means that packages may need to be installed and/or configuration files will need to be edited.
  • Red means serious modifications are needed to get it to work, such as recompiling some packages.
  • Black means that no one has written software to handle it.

 

Device Note Ubuntu 9.04 openSUSE
Graphics card nVidia GeForce4 420 Go 32MB, equivalent to a GeForce 4 MX. The open source nv driver allows the nominal 1024x768 LCD resolution, but won't provide accelerated graphics. ok ok
Accelerated graphics Binary-only drivers from nVidia are required. Installation is very simple. driver install (Jockey) driver install (YaST)
Video switch This is the recessed button next to the power button. It has a glyph that resembles a monitor. It should swap the display(s) with an attached monitor. It emits keycode 151 when pressed, so it can be mapped to an arbitrary script using xbindkeys. some config not tested
VGA connector It's below the wired ethernet jack, under the door. Can be used to hook up a secondary monitor or to give presentations with a projector. ok (after installing driver) ok
ACPI: Screen brightness The ability to adjust the screen brightness. This is hardwired to the rocker via WMI commands, rather than properly implemented with ACPI, so standard brightness control tools won't work. by default needs cryptic commands not by default
ACPI: Battery status 39960mWh Lithium Ion battery. ok** unreliable
ACPI: Suspend to RAM The ability to suspend the system to RAM. some config not by default
ACPI: Hibernate The ability to suspend the system to the hard disk. some config not by default
ACPI: Thermal Zone Thermal Zone is an ACPI feature to monitor CPU and motherboard temperatures. ok not tested
ACPI: Fan control The ability to control fan speed. Not possible in Windows, probably the fans are controlled directly by BIOS. unsupported not tested
ACPI: Power button This is the slider on the upper left corner of the display. It initiates a log-out/shutdown dialog in GNOME. ok not tested
Side buttons They are labeled "Q", "tab", and "esc". They are next to the video switch. The "tab" and "esc" buttons work as expected, but the Q button won't do anything by default. ok not tested
Jog button It's the rocker + depression button on top of the display, next to the side buttons. It causes scrolling when rocked, and is like pressing "enter" when pressed down. ok not tested
Wacom tablet buttons These are three spots on the face of the tablet which can be activated with the stylus to perform certain functions. They are near the door that covers the ethernet and VGA connectors. driver patch not tested
Wacom tablet stylus Using the stylus as an extended input device in XInput-aware applications like GIMP and Inkscape. The stylus needs to be configured in those applications. ok not tested
Wacom tablet pointer Using the stylus as a pointer in X ok ok
Keyboard orientation It's the sensor in the keyboard witch signals turning of the rotation disk. **** not by default
Wired ethernet Broadcom 440x 10/100. Its jack is below the modem jack, under the door. ok ok
Wireless ethernet Mostly Intel PRO/Wireless 2100 or 2200, some tablets have Atheros ABG ok*** ok
Wireless power Ability to turn the wireless card on and off. This also turns the Bluetooth adapter on and off. ok not tested
Bluetooth Built-in Bluetooth adapter support. The adapter is turned on along with the wireless ethernet card. ok not tested
Infrared port Fast IrDA port. It's located at the corner next to the power plug. ok not tested
Modem Agere Systems AC'97 Modem. Its jack is below the USB ports, under the door. not tested not tested
USB ports On the left side under the door. ok ok
PC card slot Texas Instruments PCI-1620 CardBus Controller. It's on top of the left side, near the power button. ok not tested
SD Card reader Texas Instruments PCI-1620 UltraMedia. It's above the little door, behind the PC card slot. unsupported* not by default
Sound Conexant AC-Link Audio, detected and supported by snd_intel8x0. Jacks are on the right side of the display. ok ok

(*) The card reader is integrated with the PCMCIA controller, which is Texas Instruments PCI1620. Some people having the same controller in different machines have reported some success. The typical procedure involves ripping firmware from the Windows driver, decrypting it, and using unofficial drivers to load it.

(**) Non-original Chinese replacement batteries may need to be re-inserted after charging to full, otherwise they show 0% charge. It is the fault of the battery though, original batteries work normally.

(***) The wireless adapter's firmware, being non-free software, is not included by default in Debian. See below for instructions on installing it. Power management of the WiFi interface will require the WMI driver.

(****) Attaching and detaching the keyboard seems to be interpreted as Thermal Zone events. It may be possible to correct this by tweaking acpid configuration files.

The devices

NVIDIA accelerated graphics

In Ubuntu 8.10 and later, just use the Hardware Drivers utility to install the binary NVIDIA drivers which give you accelerated graphics. Note that the headers package (usually linux-headers-generic) must be installed, otherwise the automatic driver build on restart will fail. The installer will take care of setting up xorg.conf for you.

sudo m-a get,build,install nvidia should work on other Debian-based systems, provided you have the package module-assistant installed.

You can now configure X for the "nvidia" driver. For all features to work correctly, you must add two lines in the Device section of xorg.conf. Edit it using e.g. gksu gedit /etc/X11/xorg.conf and add the following two lines:

Section "Device"
    Identifier      "Configured Video Device"
    Driver  "nvidia"
    Option  "NoLogo"        "True"
    Option  "RandRRotation" "True"
    Option  "NvAGP"         "1"
EndSection

The first will enable dynamic rotation, while the second will allow your computer to suspend properly.

WMI driver

The WMI functionality (turning the wireless card on/off and regulating the screen brightness) is supported in kernels 2.6.25 and later. Kernels before 2.6.23 have another legacy interface, while kernels 2.6.23 and 2.6.24 don't have this driver at all. This means that Ubuntu 8.04 can't use the WMI functionality unless a kernel upgrade is made. Ubuntu 8.10 works without further configuration.

For power management commands, see the Appplication Tips section.

Stylus

The stylus lets you use the TC1100 as a Wacom tablet. Starting with Ubuntu 9.04, the stylus is detected and usable as a pointer out of the box. There may be an issue with the tablet right-click (with the stylus button held down) being recognized as a middle click; to correct it, put this file in /etc/hal/fdi/policy/wacom.fdi

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="serial">
      <match key="@info.parent:pnp.id" contains_outof="WACf005">
        <append key="info.capabilities" type="strlist">input</append>
        <merge key="input.x11_options.Button2" type="string">3</merge>
      </match>
    </match>
  </device>
</deviceinfo>

Stylus buttons

The stylus-activated buttons on the left side of the display are supported in Ubuntu 9.10 (Karmic Koala). With 9.04 and below, they they can made to work as mouse buttons using a small patch. The instructions below are for Ubuntu, but they should work on any Debian-based distribution - just execute the commands prefixed by sudo as root and without the sudo prefix.

  • First, download the Linux Wacom drivers source. Download the build dependencies as well
mkdir ~/src && cd ~/src
apt-get source wacom-tools
sudo apt-get build-dep wacom-tools
  • Apply the TC1100 stylus buttons patch (for this example it should be saved in your home directory with the filename "wacom.patch"), and build a modified Debian package. The dch -i command increments the Debian changelog and is optional.
cd wacom-tools-0.8.2.2/linuxwacom
patch -p1 < ~/wacom.patch
cd /usr/src/wacom-tools-0.8.2.2
dch -i
debuild -uc -us -b

After that, install the built packages. There are two of them built by the debuild command: One is called wacom-tools_(version).deb and the second one xserver-xorg-input-wacom_(version).deb.

patch should output something like "patching file src/xdrv/wcmISDV4.c" or "Hunk #1 succeeded (offset 5)". debuild will take care of configuring and building the modified packages. After installing them, restart X. In Ubuntu 9.04 the Ctrl+Alt+Backspace combination doesn't work; switch to another virtual terminal using Ctrl+Alt+F2, login and then execute sudo /etc/init.d/gdm restart - this will restart the X server. (You can enable the combination using dontzap --disable, but it still needs an X restart to take effect.)

  • In a terminal, run the event testing program xev. Position the cursor over the small window and try pressing the stylus buttons. The terminal should indicate that there are ButtonPress and ButtonRelease events. The rotate button is mouse button 30, journal - mouse button 31 and input panel - mouse button 32.

See the section "Application Tips" for an explanation on how to make these buttons do something useful.

Display Features

Rotation

To support display rotation, do the following:

  • Install wacom-tools. Ubuntu Gutsy and later has the required version in its repository. For Debian Etch you have to download a more recent version from the Linux Wacom Project's website. Also see the above section if you are interesten in making the stylus buttons work.
  • Install the NVIDIA binary driver. Make sure you changed xorg.conf to enable dynamic rotation.

Once you are set up, rotation can be accomplished via these terminal commands:

xrandr -o left
xsetwacom set stylus rotate ccw
xsetwacom set cursor rotate ccw

To get back to normal:

xrandr -o normal
xsetwacom set stylus rotate none
xsetwacom set cursor rotate none

See the Application Tips section for information on how to bind these commands to the stylus-activated rotate button.

Brightness

You can turn on brightness regulation on and off with:

echo 0 > /sys/devices/platform/tc1100-wmi/jogdial
echo 1 > /sys/devices/platform/tc1100-wmi/jogdial

(Yes, 0 turns brightess regulation on). While brightness regulation is on, you can adjust it using the jog dial at the top of the tablet. This small script pops up a message box while the brightness regulation is on, which can be closed by pressing the jog dial down. You can bind it to a button or place in some pop-up menu.

#!/usr/bin/env bash

if [[ ! -f /sys/devices/platform/tc1100-wmi/jogdial ]]; then
   zenity --info --text="This kernel does not have TC1100 WMI support."
   exit 1
fi

echo 0 > /sys/devices/platform/tc1100-wmi/jogdial
zenity --info --text="Use the jog dial to adjust the brightness. Press OK when done."
echo 1 > /sys/devices/platform/tc1100-wmi/jogdial

exit 0

Display TwinView

The official nVidia drivers are capable of driving two monitors. One is the tablet's LCD, and the other is anything attached to the 15 pin external VGA port. By default this port is a mirror of the LCD, but it can be used to create a larger desktop.

The best way to adjust the TwinView setup is to install the package nvidia-settings, which provides an easy to use GUI to adjust TwinView and Digital Vibrance settings.

Sound

The Intel sound card works out of the box with recent Debian and Ubuntu releases. The only confusing issue you may encounter is that the built-in speakers are not turned off when a headphone jack is plugged in. This is because headphone volume is independent from master volume. To correct this in GNOME, do the following:

  • Right-click on the volume control icon in the panel and click on Open Volume Control.
  • From the menu choose Edit->Preferences.
  • Tick the checkbox Headphone Jack Sense and close the menu.
  • Go to the Switches tab and enable Headphone Jack Sense.

Now the speakers should turn off when you plug in a headphone jack.

Side buttons

There are several buttons on top of the tablet, labeled "Q", "tab", etc. The Esc and Tab buttons generate escape and tab keycodes, so their role is fixed, and it would require some tricks to remap them. The jog dial generates codes 99 (Prior, PgUp) for left, 105 (Next, PgDn) for right and 35 (Return) for press. The Q button generates the keycode 159 (0x9F). It can be assigned to run an arbitrary program or script using xbindkeys. By binding it to xvkbd invoked with the -text parameter, you can also emulate arbitrary keypresses - see the xvkbd manual for details. In GNOME, you can also use System->Preferences->Keyboard Shortcuts to assign the buttons to some common things. For an equivalent of the Q Menu on Windows, see Application Tips.

Hibernate and suspend to RAM

With Ubuntu 8.10 hibernate and suspend work out of the box. If you install the binary NVIDIA driver, you have to add the NvAGP option to xorg.conf (see the relevant section).

Other devices

The system reports temperature information from ACPI by default. To view it, use:

cat /proc/acpi/thermal_zone/THRM/temperature

In addition, special steps may need to be taken for the following:

  • Infrared port - drivers are present in the stock kernel and load automatically. If it does not work, make sure you have it enabled in BIOS. Application support is rather flimsy though.
  • Secure Digital card reader - This is based on the Texas Instruments PCI1620 chipset, and is very hard to get working, because it is completely undocumented. Cheap USB-based card readers will work without problems, so they are currently a better option.
  • Modem - should probably be handled by snd_intel8x0m, not tested. There's little use for it nowadays.

Application Tips

Onscreen Keyboard at Login

Ubuntu users from 6.10 on can use the OnBoard virtual keyboard at the login prompt. It works better with Ubuntu 8.04 and later, because setting the keyboard's position and size at the command line is supported.

  • Make sure that you are using the "plain" or "plain with face browser" (recommended) option from the System->Administration->Login Window menu item. Themed login windows will not work! You must also be sure that the title bar option is active.
  • Edit the /etc/X11/gdm/Init/Default or /etc/gdm/Init/Default (whichever exists) and add "onboard &" between the last "fi" and "exit 0"
# sudo gedit /etc/X11/gdm/Init/Default
  fi
fi
onboard -s 684x200 -x 170 -y 568 &
exit 0

These values will display the keyboard roughly two thirds of the screen wide at the bottom. Tweak the numbers to your liking. An alternative is to use xvkbd for this purpose. First install the package (unsurprisingly, it's named xvkbd). The relevant command to put in the gdm script is:

xvkbd -geometry 684x200+170+568 -no-keypad 2&>/dev/null &

Finally, you can enable autologin in System->Administration->Login Window in Gnome, but also put the keyboard line in the init script; otherwise you won't be able to log back in if you log out.

Allowing GNOME gksu to use onscreen keyboards

GNOME's graphical su / sudo frontend, gksu, by default grabs the focus, keyboard and mouse to prevent malicious applications from capturing and then automatically supplying the password. However, this also prevents onscreen keyboards from working at the gksu prompt. To allow this, Use the gconf-editor program (usually in Applications -> System Tools -> Configuration Editor). Find the key /apps/gksu/disable-grab and turn it on. This will prevent gksu from grabbing focus and all input. You can then input the password the normal way, using Xvkbd, GOK, OnBoard, etc. Be aware though that this is a potential security vulnerability.

Onscreen keyboard in GNOME screen unlock

GNOME screensaver locks the screen by default. However, when you want to log back in, there is no onscreen keyboard. Fortunately, gnome-screensaver supports embedding an onscreen keyboard widget into the screensaver using the XEmbed protocol. One of such keyboard widgets is the Matchbox desktop environment virtual keyboard. Here is how to set it up to display at GNOME screen unlock prompt:

  • Install the package and dependencies: sudo apt-get install matchbox-keyboard
  • Open gconf-editor. Find the key directory /apps/gnome-screensaver.
  • Inside that directory, turn on the boolean key embedded_keyboard_enabled.
  • Change the value of the key embedded_keyboard_command to matchbox-keyboard --xid

Now select System -> Quit... -> Lock Screen from the GNOME menu, and when you try to unlock, the keyboard will appear underneath the unlock prompt.

Matchbox keyboard seems to default to the UK keyboard layout. If you prefer the US layout, go to /usr/share/matchbox-keyboard. Copy the file keyboard-us.xml to $HOME/.matchbox/keyboard.xml. This file will override any default ones. You can tweak the copied file - it has a simple XML syntax. There are further notes in the README: SVN version of the Matchbox Keyboard readme

Rotation control for GNOME

There is a handy GNOME panel applet, Grandr. Compile or install from the .deb then restart the GNOME Panel for it to show up in the applet selector

$ killall gnome-panel

It works well with TwinView setups too. Currently it does not rotate the stylus (this may be added to Grandr in future) but a small script can be run after login to periodically check the orientation and rotate the stylus accordingly.

  • Create the following script
$ gedit ~/wacom-rotate.sh
#!/bin/sh
# Based on work from Patrick Coke & Tim Pope
# Modified for TC1100 by Francisco Athens
# Rewritten for current xsetwacom and xrandr vesrions by Krzysztof Kosiński

IFS=$'\n'
DEVS=`xsetwacom list dev | \
   sed -e 's/ *$//g' -e 's/\(.*\) .*/\1/g' -e 's/ *$//g'`
# Rotate all detected wacom devices to the given direction.
function rotate_devices()
{
   for DEV in $DEVS; do
      xsetwacom set $DEV rotate $1
   done
}

while xset q >/dev/null 2>&1; do
   sleep 2 # Polling Interval, 2 seconds
   ROTATION=`xrandr --verbose --query | \
      grep 'default connected' | \
      sed -e 's/^.*(.*) \(.*\) (.*).*$/\1/'`
   case $ROTATION in
     normal)   rotate_devices none ;;
     left)     rotate_devices ccw  ;;
     right)    rotate_devices cw   ;;
     inverted) rotate_devices half ;;
   esac
done
  • Make the script executable
$ chmod u+x ~/wacom-rotate.sh
  • Open System->Preferences->Sessions and add the script to your startup.

Desktop-agnostic Rotation Control script

This script is a desktop-agnostic equivalent to the above. Running the script gets the current rotation status then toggles between horizontal and vertical alignment. It depends on xrandr presence, and the device strings may be distribution-specific.

  • Before making the script, check the device strings:
user@host:~$ xsetwacom --list dev
Serial Wacom Tablet eraser ERASER
Serial Wacom Tablet STYLUS

"ERASER" and "STYLUS" are device types, and should be left off of the strings in the script below.

  • Create a script using the editor of your choice. If the device strings above are different, fill them in below as appropriate.
#!/bin/bash
xsetwacom get "Serial Wacom Tablet" rotate | grep NONE
if [ $? = 0 ]; then
     xrandr -o left
     xsetwacom set "Serial Wacom Tablet" rotate ccw
     xsetwacom set "Serial Wacom Tablet eraser" rotate ccw
else
     xrandr -o normal
     xsetwacom set "Serial Wacom Tablet" rotate none
     xsetwacom set "Serial Wacom Tablet eraser" rotate none
fi
  • Set executable
user@host:~$ chmod +x manual_rotate.sh

Assign your new script to a shortcut, button binding, etc, and enjoy!

Bindings for the Stylus Buttons

The stylus buttons can be made to work using a patch to the Wacom drivers. To assign them to the actions they were meant to, you need to install some programs:

sudo apt-get install xbindkeys xournal xvkbd

Additionally, you'll need this simple script that rotates the screen. See the Rotation section on how to configure the display for dynamic rotation.

#!/usr/bin/env bash

IFS=$'\n'
DEVS=`xsetwacom list dev | \
   sed -e 's/ *$//g' -e 's/\(.*\) .*/\1/g' -e 's/ *$//g'`
ROTATION=`xrandr --verbose --query | \
   grep 'default connected' | \
   sed -e 's/^.*(.*) \(.*\) (.*).*$/\1/'`

# Rotate all detected wacom devices to the given direction.
function rotate_devices()
{
   for DEV in $DEVS; do
      xsetwacom set $DEV rotate $1
   done
}

if [[ ! $ROTATION == "normal" ]]; then
   xrandr -o normal
   rotate_devices none
else
   xrandr -o left
   rotate_devices ccw
fi
exit 0

Name this script rotate.sh, make it executable and put it somewhere in your path (eg. /usr/bin).

Edit the file ~/.xbindkeysrc and put these lines in:

"rotate.sh"
  b:30
"xournal"
  b:31
"xvkbd"
  b:32

To activate the new bindings, execute xbinkeys in a terminal. Also, add xbindkeys to your startup programs in GNOME (System -> Preferences -> Sessions) to activate the bindings on system startup. You can substitue xvkbd with a different onscreen keyboard of your choice (onboard, gok, etc.).

Compiz Fusion

TC1100's graphics card is capable of running Compiz Fusion with decent performance. Desktop wall, wobbly windows, animations and window switchers work very well. Transparent cube or demanding animations (Burn, Beam Up, etc.) are rather slow for everyday use.

All you need to do in Ubuntu 8.10 is to install the NVIDIA binary driver, then go to System -> Preferences -> Appearance, select the Visual Effects tab, and check the option of your choice. "Normal" works reasonably well, while "Extra" is a little slow. For more detailed configuration, install compizconfig-settings-manager - you can then access Compiz settings under the "Custom" option in the Visual Effects tab.

If you need to regularly turn off Compiz from time to time, a little program called Fusion Icon will come in handy. Search in the Ubuntu formus for a deb package.

External links

General

Drivers and apps

The following list applies specifically to the tc1100. See Tablet PC for a more comprehensive list that applies to tablets in general.