Two-Finger Scrolling on ThinkPad X220 + Ubuntu 12.04 (precise)

The TrackPoint on a ThinkPad laptop is one of the main reasons why I kept buying laptops from them. However, as a heavy laptop user who refused to carry around one extra mouse, the constant usage of TrackPoint can cause a significant amount of pain to my fingertip, which is very unpleasant. An once-in-a-while quick movement is okay, but scrolling up/down takes longer and requires more pressure, which is the main cause of discomfort.

As a possible solution, I’ve tried to enable TouchPad and two-finger scrolling. However, for some reason it didn’t work by setting it in gnome-control-center, so instead I used the old faithful xinput. From the output of xinput list-props "SynPS/2 Synaptics TouchPad", it’s easy to spot “Synaptics Two-Finger Scrolling”, and the two parameters can enable vertical and horizontal scrolling, respectively.

The default setting of two-finger scrolling was far from intuitive — normally people would expect it to work just like the way it works on touch devices: you touch the screen, then you can push the document up by moving your finger up. That means scrolling down when your finger is moving up. But on my laptop, moving two fingers up means scrolling up, which causes the document to move down!

To make this problem worse, there is no setting in gnome-control-center to inverse this. Again, this can be solved with xinput by simply changing the values of “Synaptics Scrolling Distance” from 100 100 to -100 -100.

Here is my current .xsessionrc:

xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
xinput set-prop "TPPS/2 IBM TrackPoint" "Device Accel Velocity Scaling" 50
xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Scrolling" 1 1
xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Scrolling Distance" -100 -100

Ubuntu as home media center

I’m really impressed. I’ve always wanted to put a small & nice HTPC in the living room. My old one is a full fledged desktop with 4 core, big ram, big hard drive, etc. Well at least it’s relatively ‘big’ when I bought it, but not anymore. The problem is — it looks really, really ugly in the living room.

And it’s running Windows XP.

Not that I’ve anything against Win XP. It’s stable enough, compatible with most of the stupid government and bank websites and applications, so I can use it to pay taxes, use web ATM, etc. It’s really useful. Mine is a legitimate copy, but I didn’t buy it. It’s actually a gift from Microsoft many, many years ago, in my previous life…

Anyway, the problem is that it’s hard to move to another PC. I’ve never be bothered enough to figure out how to use the ‘sysprep’ util, but start from scratch and update/install everything instead. It’s too much trouble, so it kinda stopped me from replacing it.

So, I was window shopping on the Internet and this Giada N20 caught my attention. It’s really small – 0.6 liter – and it comes with a remote control and HDMI. Video files could be decoded by Nvidia ION2. It’s exactly what I need. The real issue was that do I have to buy a Win 7 with it? People told me it’s really hard to use. Another thing was that the hardware is not particularly fast, so running win 7 might be too much for it. I figured I can try to install XP, since the manufacture said it’s fully supported.

I was so wrong.

I plugged in my ancient USB CDROM with the original XP CD in it. It booted into install screen and the process went just fine. I noticed that the reported hard drive capacity was incorrect, but I told myself it’s nothing and will be fixed as soon as I update the software.

No matter how hard I try (well not that hard, I just pressed the power button and F8 a few more times), it just cannot boot into XP. I thought it need some new drivers, but I couldn’t install the driver until I had a running XP, can I? Indeed it has an option saying that one may install 3rd party drivers during the install process, but it needs — floppy! Gosh, yeah I do have a floppy drive on my old machine, but who has a floppy with ‘USB’ interface nowadays? Guess I could just forget it.

In my desperation (I almost hit the shopping button for a win 7 copy), I figured maybe I can try to install Linux on it. It wouldn’t hurt. If it didn’t work I could put win 7 in it anyway. So I took out my trusted Ubuntu 11.04 USB flash and installed it.

After it booted for the first time, of course 3D didn’t work. I launched ‘Install additional driver’, it recommended Nvidia, I installed it, reboot… Yeah Ubuntu Unity interface was on, which means 3D was working. Then I enabled Mediabuntu, installed mplayer along with w64codecs, etc. Tried some high definition movies. There’s no audio output. Well, the display seemed to be fast enough, but it’s obviously running on the CPU so the codec was slowing things done. I clicked sound preference, picked HDMI 2nr (or something like that) then audio worked. mplayer picked vdpau as the video output, so I checked ‘mplayer -vc help’ and found some ffmpeg with vdpau support. I put these into ~/.mplayer/config, then 1024p movies played smoothly on my 52 inches LCD TV. Cool!

The remote control runs just like a keyboard input on this thing, and it can remotely power on/off this box. So I set the keyboard shortcut and set the default power button to ‘suspend’. Now I can resume and control it with a remote.

The last thing was to connect my Lavry DA-11 to it. It comes with USB interface and it’s standard USB audio, so there was no issue. I could switch sound output between HDMI and USB, depends on weather I want to hear the sound from the TV or my stereo set.

That’s about it. I must say it exceeds my expectation. Yeah the software is definitely there, but the hardest issue has always been the hardware. A media center relies on valid hardware drivers to work. Congrats to Ubuntu (and Linux) and Nvidia for going this far.

WebCam on Asus N20A notebooks

Well, I gave this built-in webcam a try today. `Cheese’ does show the image, but it’s upside-down.

A quick lsusb shows
Bus 002 Device 002: ID 064e:a116 Suyin Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 002: ID 147e:1000
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

It’s obviously 064e:a116, so I googled it, and this turns out:

This camera module is known to be mounted upside-down in some notebooks. There is currently no documented way to rotate the image at the device level. If you don’t mind holding your computer upside-down, the camera should work fine.

WELL, if I hold my notebook upside-down, my LCD will also be upside-down, so the video I see will still be upside-down, no ?

Portege 2000 and Ubuntu 8.10

8.10 Release Notes

BAD 😦

Now I have to use this to do presentation:

john@john-laptop:/etc/acpi$ cat videobtn.sh
#!/bin/sh
test -f /usr/share/acpi-support/key-constants || exit 0
. /usr/share/acpi-support/key-constants
acpi_fakekey $KEY_VIDEOOUT
CRT=/proc/acpi/video/VGA/CRT/state
LCD=/proc/acpi/video/VGA/LCD/state
if grep "state:.*0x0d" $CRT 1>/dev/null 2>&1
then
echo 0x80000001 > $CRT
# echo 0x80000001 > $LCD
else
echo 0x80000000 > $CRT
echo 0x80000001 > $LCD
fi