User:Evandotpro/HP TouchSmart tm2t

Fedora 14 on the HP TouchSmart tm2t
By Evan Coury (http://www.Evan.pro/)

This is a guide about how I got Fedora 14 set up and running properly on an HP TouchSmart tm2t-2100 (aka HP tm2) tablet. Instead of simply providing a bunch of steps and commands for you to blindly follow, I am going to provide some extra details and explanations in an attempt to leave readers a bit more educated on the issues they're trying to solve.

Different versions of the tm2
Note: There are several revisions of the HP TouchSmart tm2t, all of which have moderately different hardware inside. HP has differentiated these models with a suffix after the tm2t in the model number. To find out which yours is, look for a white HP sticker on the bottom, and it should say "Model: tm2t-xxxx", where xxxx will give you a hint to the version. Mine is the tm2t-2100, which specifically means it's one of the later configure-to-order models (not quick-ship, etc). For the sake of reference, I ordered my tm2t mid-November, 2010. There are older models of the tm2t that have different processors and graphics, however this guide is specifically geared towards those who have one of the newer tm2t's with switchable ATI graphics.

Here are my specs for the parts that were configurable: See HP's tm2t product page for more details on this tablet.
 * Intel Core i5-470UM 1.33GHz
 * 8GB DDR3 (2 Dimm)
 * 500GB 7200RPM
 * Intel Wireless-N Card with Bluetooth
 * ATI Mobility Radeon HD 5450 ("Switchable" with integrated Intel graphics)

'''PLEASE MAKE SURE YOU RUN A YUM UPDATE ON YOUR FRESH FEDORA 14 INSTALL BEFORE FOLLOWING ANY OF THE ADVICE ON THIS PAGE. ALSO IF YOUR SYMPTOMS DO NOT MATCH THOSE DESCRIBED IN THIS GUIDE, YOU MAY WANT TO ASK US IN IRC FIRST IF YOU ARE UNFAMILIAR WITH THE COMMANDS AND FILES MENTIONED IN THIS GUIDE.'''

If you have any issues or need help, feel free to join #fedora on Freenode and ping me. My nickname is EvanDotPro.

ATI / Intel switchable graphics, battery life, brightness controls
The first issue I ran into when trying to switch over to Fedora 14 was incompatibilities with the ATI graphics card. While there are open source Radeon drivers, they do not yet support the 5xxx series Mobility cards with switchable graphics. Here are the symptoms I was experiencing: I found that by default, the power-hungry ATI Radeon card is always powered on. In fact, using the kill-a-watt that my girlfriend bought me, I realized that my laptop was using between 29 and 32 watts sitting idle on a fresh Fedora install, which is way too high.
 * Booting the live CD or live USB, you have to choose "basic video" to get to the desktop and complete the install.
 * The overall battery life is absolutely horrible, the laptop runs hot, and the fans spin constantly.
 * You are unable to enable desktop effects or do other 3D-accelerated things.
 * The LCD brightness is stuck at 100% and the [fn] brightness keys do not work.
 * The HDMI port doesn't seem to work.
 * Neither standby nor hibernate work.

Solution
As it stands, the best solution for this whole video issue is to simply disable and power off the ATI card. This might be a disappointing solution for those who were hoping to get the extra graphics performance of the ATI, but since neither the open source radeon drivers, nor the proprietary Catalyst drivers support switchable graphics on the 5xxx series Mobility cards, there's no reason to leave it on. By switching to the Intel graphics, you'll get hugely improved battery life and the advantage of well-supported graphics drivers with 3D support.

If you have not done so, please run a now and ensure all your packages are up to date.

First, edit as root and remove  from your kernel line.

Next add the following to the end of same line of your : acpi_osi="!Linux" acpi_osi="!Windows 2006" acpi_osi="!Windows 2009"

Next, edit as root and add the following to the end of the file: echo OFF > /sys/kernel/debug/vgaswitcheroo/switch modprobe -r radeon

Finally, stop X from using the auto-generated by running: su -c 'mv /etc/X11/xorg.conf /etc/X11/xorg.conf.old'

Reboot and be amazed:
 * Your tm2t will now run much cooler and more quiet, as the ATI card is powered off.
 * Your battery will last over twice as long.
 * You will be able to control brightness using your [fn]+[f2]/[f3] keys. (This is not quite perfect, see unresolved issues below.)
 * You can now enable desktop effects and run 3D-accelerated applications, as you're using the well-supported Intel graphics.
 * Closing the lid puts the computer into standby mode, which now works properly.
 * [fn]+[f4] now works to toggle the VGA port (before it was incorrectly being interpreted as a 'p' Bugzilla: #598001)

After doing these steps, dimming my screen, and following a few recommendations from powertop, my power consumption was down to 11 - 12 watts, yielding me incredibly good battery life. In fact, it seems to last quite a bit longer than Windows 7 did, however I did not measure so don't quote me on that.

Explanation
Now if you're wondering how or why exactly that worked, I'll explain.

After installing F14 in "Basic Video" mode, Fedora will be configured to fall back to the old Vesa drivers and disable kernel mode setting with.

Included in the more recent kernel (2.6.35+) is vga_switcheroo, which gives us the ability to toggle between the ATI card and the integrated Intel video, as well as power off the unused card. However, after my fresh F14 install and, it seemed to that vga_switcheroo was either missing or disabled for some reason. You can check if vga_switcheroo is enabled with.

As it turns out, there are a couple of pre-requisites before the kernel will turn on vga_switcheroo.
 * Both the radeon and the i915 kernel modules must be enabled. You can check if these modules are loaded using . In my case, they were both already enabled by default, however I still didn't have vga_switcheroo.
 * The second requirement is that you must boot using KMS (Kernel Mode Settings). Booting with, using the Vesa driver will prevent vga_switcheroo from loading. This was the problem for me because installing F14 "basic video" mode automatically added to my kernel line in Grub.

So, the first thing to do is obviously to remove from the kernel line. While this does successfully enable vga_switcheroo, it unfortunately causes a new problem with the tm2t: after a couple of seconds of the kernel loading (right before the init scripts start), the tm2t's LCD simply shuts off. The computer continues booting successfully, just without the LCD on. Luckily there are options such as plugging in an external monitor via VGA (which interestingly seemed to cause the laptop's LCD to come on sometimes) or connecting to it from another computer via SSH (this requires you to turn on SSH and open up the port in iptables).

At this point, I was starting to get suspicious that at least a couple of my issues may have a common denominator: ACPI. In digging through my dmesg, I noticed several ACPI errors, and two that specifically referenced something about the backlight. Eventually, I stumbled across a comment on kernel bug #14216 which suggested adding the following to your kernel line: acpi_osi="!Linux" acpi_osi="!Windows 2006" acpi_osi="!Windows 2009" The bug was specific to the backlight issue, however I was willing to try anything related to ACPI since I suspected it was also the culprit of the LCD shutting off.

From what I understand, adding these options with exclamation points tells the kernel not to report those as supported OS interface strings. I'm guessing something about reporting our OS as Linux (or Windows 2006/2009) causes some quirky bios/ACPI bugs or something. You can read more about kernel parameters, including acpi_osi, here. Regardless of what exactly it does, adding these kernel parameters seems to solve a handful of issues including the LCD turning off, the [fn] brightness keys, etc.

At this point, we're still using the ATI card so now we needed to make the ATI card shut off automatically when the laptop starts up. For this, we add the following to : echo OFF > /sys/kernel/debug/vgaswitcheroo/switch modprobe -r radeon The first line uses vga_switcheroo to power off the ATI card so the system uses the Intel graphics. This command alone causes some issues though, because the radeon kernel module will keep trying to interact with the ATI card and cause a bunch of errors and timeouts which slows down the boot and shutdown processes, as they hang while the radeon module is waiting for the ATI card to timeout (with errors like "atombios stuck executing" and such). There's probably more negative side-effects than just that, but it's easy enough to avoid this by simply unloading the radeon module once we've powered off the ATI card by adding that line.

Lastly, the reason we move the file is because it was automatically generated/installed based on us installing in "basic video" mode, and it tells X to use the Vesa drivers which we no longer need. Trying to boot without moving the results in X locking up with a black screen when it starts. Besides, now-a-days it's generally accepted that it's better to have no and let X automatically configure itself if at all possible.

SynPS/2 SynapticsTouchpad, jumpy cursor, no right click, etc
Support for the "SynPS/2 SynapticsTouchpad" in the tm2t is very buggy. First when introducing a second finger to the pad, the cursor jumps all over the place until you remove the finger. Additionally, when attempting to right click by pressing down on the pad in the right click area, it is simply recognized as a left click.

Research

 * The most relevant bug for this is Bugzilla: #613220. I have provided as much information as I can to that bug report.
 * The issue of the cursor jumping around like crazy with two fingers has since randomly cured itself on my tm2t and I've been unable to reproduce it. I did not do anything to address the issue, and there were no updates to the synaptics drivers, but after a random reboot, a second finger produces the expected cursor behaviour instead of the random jumping. I'm not sure what caused this or how to reproduce it now. Interestingly, the issue is also no longer happening when I boot the Live version of Fedora 14 without updates, so it most definitely does not have to do with any updates. There are also no bios settings for the touchpad, so I know it wasn't that.
 * Randomly, one time I rebooted, and noticed that my tap-to-click setting was not working, only hard-press clicks worked. I went to re-enable it in the mouse settings in Gnome, and the "Touchpad" tab was missing. Strangely, however, hard-press right and left clicks were working perfectly. It knew exactly where my finger was and performed the correct click accordingly. Here are all of the logs like evtest, dmesg, Xorg.0.log, etc from when it was behaving this way. Note that returned "Couldn't find synaptics properties. No synaptics driver loaded?" while it was like that.
 * For a period, the mouse was behaving differently every single time I would shut down and boot the laptop back up. I kept track for a few times until it went back to the original issue:
 * Booted with original issues where tap-to-click works but all hard-press clicks regardless of right or left are registered as left clicks. Mouse preferences has touchpad tab.
 * Shut down, boot back up.
 * Now the hard-press right and left clicks work perfectly but soft tap to click does not work and touchpad settings are missing. In GDM (Gnome login screen), the tap to click (not pressing till you hear "click") works as expected, but once logged in, only hard press clicks work.
 * Shut down, boot back up.
 * Now everything is working perfect! Tap-to-click works, hard press right and left clicks work as expected, etc. It's all perfect. EXCEPT, the touchpad settings are missing still. (Can't disable touchpad while typing, etc)
 * Shut down, boot back up.
 * Back to original issue... All hard press clicks are left clicks. Touchpad settings are now back and works again.

Solution
Still investigating.

Explanation
Pending solution.

Unresolved issues / to-do

 * There still doesn't seem to be a way to enable / use the HDMI port. It would be nice if there was at least a rudimentary level of support for this with the siwtchable ATI graphics, as sometimes it may be useful to have support for plugging into a monitor/tv/projector via HDMI at the cost of battery life. I've already been in multiple scenarios where the HDMI port would have been useful. The VGA port works, but there's not always VGA available in every situation.
 * While standby works, hybernate does not seem to.
 * The backlight brightness [fn] keys work, however they do not trigger the gnome pop-up which shows where the brightness level is. Also the "dim display when idle" settings are buggy, as they will turn the brightness UP when idle if you have the backlight dimmed down.
 * On the touchpad, there is a area in the top left corner with an LED. On Win7, you double tap that corner, and the amber LED turns on, indicating that the touchpad has been turned off. Double tapping again, turns the LED off and the touchpad back on. This doesn't work at all. I have at least mentioned this in Comment #4 in Bugzilla: #613220 but may deserve it's own BZ. I did notice something in either dmesg or Xorg.0.log at one point that mentioned an error about "Touchpad_On" and "Touchpad_Off" inputs, but I forgot to save them. I will try locating those messages again, as I believe they're very relevant.
 * The right click on the touchpad does not work (see main section about about touchpad issues).
 * The rotate-screen button on the side of the monitor doesn't work, but this could probably be easily scripted to work.
 * Fingerprint reader does not work.
 * The screen / touch / wacom input does not rotate automatically when flipping the screen into tablet mode. I plan on providing script(s) for this.
 * There is a built in accelerometer in this thing. It would be neat to create an option / setting so that in tablet mode, the screen would automatically rotate, iPad style. This would have to be easily toggled as it could be just as annoying as it is useful.
 * No multi-touch integration in Gnome yet like pinch zoom or flick to scroll, etc.

Function Keys (F1-F12)
The function keys (F1-F12) on the tm2t have special functionality such as brightness control, volume, media player controls, etc. In order to use the function keys for their normal purposes, such as [alt]+[f4] to close a window, [f5] to refresh, etc, you have to hold down [fn]. I personally find this very frustrating. Luckily, this can be easily disabled in the bios.

Home, End, Page Up/Down
They're all missing from the tm2t's keyboard. Simply hold [fn] while using the arrow keys. I've found I actually prefer this to the typical full keyboard where they're up by Insert and Delete.

Huge fonts in Gnome
By default the fonts are very large for the LCD on the tm2t and tend to eat up a lot of screen real estate. To remedy this, I went to System > Preferences > Appearance > Fonts tab > Details and changed the Resolution setting to 78 dots per inch.

Update: After going through this process again, I realized that booting with the Intel drivers (not Vesa) causes the fonts to return to a more reasonable size without any adjustment. However, they may still be too big for some, so I'll leave this here.

Add touch support to Firefox / Chrome
For Firefox, the Grab and Drag add-on is very useful. For Chrome, there is chromeTouch.