a blog by Marius Gedminas

New laptop: Lenovo T61

A week and a half ago I bought a new laptop: a Lenovo T61 (the 15" widescreen version). It's big and not very pretty (but the large screen is very nice), and was a big pain to install. After several days of fiddling I've got Ubuntu Gutsy running on it quite well, with nearly all hardware working.

Installation: I used Gutsy Tribe 3 Alternate CD (because the desktop CD either wouldn't boot, or would give me a blank screen). I had to finish the installation by touch (by pressing Enter whenever the CD spun down), because in the middle of installing packages, after installing xresprobe, the screen went blank and never came back. I think I could've used the regular CD if I thought to set SATA to Compatibility in the BIOS earlier.

Video (Intel 965GM, 1280x800): worked out of the box (with the 'intel' driver) with all xrandr 1.2 and 3D Compiz goodness. One minor bug, already fixed upstream: GDM and gnome panels were limited to upper-left 1024x768 area because X thought it had a TV connected. I added xrandr --output TV --off into /etc/gdm/Init/Default as a workaround. There are some minor problems (text consoles sometimes work and sometimes show a blank screen; xv doesn't work with XAA; enabling EXA in xorg.conf makes the server segfault; you have to specify a virtual desktop size in xorg.conf if you want to use xrandr to get dual-head modes; compiz on a dual-head screen 1280x800+1280x1024 mode doesn't work well).

Sound (Intel HDA): didn't work out of the box. I was unable to build ALSA from CVS (some error with kernel headers). In the end I used alsa-source from Ubuntu, with three extra patches. Sound now works, but is pretty quiet even at maximum volume, especially when watching movies.

Wireless (Intel 3945ABG): worked out of the box, after I realized I had to enable one cryptically named BIOS setting ("Internal Wireless Radio Frequency"). NetworkManager doesn't work. Sometimes the userspace daemon (/sbin/ipw3945d-kernelversion) dies and I have to restart it manually. This, by the way, is the only non-free driver I have; I haven't tried iwlwifi yet.

Suspend to RAM: worked after I upgraded my kernel to Gutsy's 2.6.22-9.26 (which is not released yet, I built a snapshot from git) and added acpi_sleep=s3_bios to the kernel command line. I've heard that a newer version of the X 'intel' driver will make the acpi_sleep setting unnecessary.

Fingerprint reader: worked once I installed thinkfinger from sources (it's not packaged for Ubuntu yet). It works in GDM and in terminals only; gksu breaks it (and then you have to open a terminal and killall gksu, or you won't be able to use fingerprints any more in this session), and gnome-screensaver doesn't even try to use it.

Bluetooth: works, after I added thinkpad-acpi into /etc/modules (it wasn't loaded by default). The LED doesn't work well: it stays off even if Bluetooth is enabled. Strangely, if I reboot with Bluetooth on, the LED shines until I log in, then turns off. I haven't figured it out yet. By the way, install bluez-gnome if you want to be able to pair your laptop to other Bluetooth devices. I'm surprised that it isn't installed by default.

Screen brightness: the Fn-PgUp/Fn-PgDn keys don't work well (they go into a weird feedback loop and ramp the brigtness all the way to the maximum/minimum). I can adjust the brightness manually with xbacklight.

CD/DVD: works only if you go to the BIOS and set the SATA setting to Compatibility instead of AHCI. I haven't tried burning any CDs/DVDs, but wodim -prcap says it could.

4-in-1 card reader: doesn't work, apparently.

USB: 10-15 minutes after a reboot the kernel gets an unhandled interrupt 21 (or sometimes 23) and disables it. Once that happens, the two USB ports on the right partially stop functioning (you plug in devices and nothing happens, but if you had a mouse plugged in before, it continues to work).

High-pitched noise when on battery power happens when the CPU enters low-power states. echo 2 > /sys/module/processor/parameters/max_cstate gets rid of the annoying noise at the expense of battery life (which, incidentally, appears to be about 2.5-3 hours with the standard 6-cell 53 Wh battery).

The rest: wired Ethernet works (out of the box), keyboard works (naturally), trackpoint works, touchpad works, ThinkLight works, CardBus works. I haven't tried the microphone, the modem, the ExpressCard slot, or Firewire.

Overall I'm pretty happy with my T61. If you plan to buy one, and don't want to spend a week patching kernels and compiling stuff from source, I'd recommend waiting until October, when Ubuntu 7.10 will be released. I expect all the bugs to get ironed out by then. Most of the problems have been reported in Launchpad and/or upstream repositories, but I ran out of steam before I checked all of them. The bugs I know about are listed on this del.icio.us page.

Post-EuroPython 2007 sprint day 3

Previous entry.

The numbers I posted earlier about zope.testing self-test coverage were incorrect. It turns out that when a test runner tries to trace a test that tests that a (different) test runner can use tracing to trace (different) tests, they both compete over a single sys.settrace() hook and only one of them wins. Basically you get to choose between a failing test or incomplete test coverage that ignores all subsequent tests.

If I skip the three tests that invoke sys.settrace() and run the rest with --coverage, I get that the zope.testing test suite covers 73% of the code. That's not bad, considering that some of the code is only invoked in a subprocess (which we cannot trace), and some of the code is platform-specific (if sys.platform == 'win32'), and some is Python-version-specific.

If I monkey-patch sys.settrace to set the hook only the first time it's called, I get one failing test (as expected) and I see 77% test coverage.

Oh, I forgot: that's the coverage with my prototype colorizing code which doesn't have unit tests yet. On trunk the coverage reaches 81%.

By the way, yesterday was the first time I saw an OLPC laptop in real life. It's so small and cute.

Vika and OLPC
Vika holding the XO laptop. What does XO mean, anyway?

Technorati tag:

Post-EuroPython 2007 sprint day 2

Previous entry.

During the second day I refactored the Zope 3 test runner to make nearly all of its output go through a single OutputFormatter class (in the output-refactoring branch), then created a subclass of it that uses ANSI color codes to highlight error messages (in the colorized-output branch). I've had this luxury before, and I can attest that it does increase productivity (being able to spot filenames and line numbers between several-hundred-line diffs produced by testbrowser tests is invaluable).

Zope 3 test
    runner in a white terminal Zope 3 test
    runner in a black terminal

I also had lots of fun trying to get the unit test coverage of the test runner. There's a bit of a chicken and egg problem here: to get accurate coverage data you want the tracer to be enabled during import time, but you cannot do that since the test runner doesn't exist yet. Hacks with reload() and del sys.modules['zope.testing.testrunner'] didn't work due to excessive monkey-patching in the test runner that caused infinite recursion. In the end I made a second copy of the module and used it to run the test suite of the first copy. (42% of the code is not covered by unit tests, according to the coverage report. I don't entirely trust that report, though.)

On the last day I intend to clean up the code, add the unit tests for my colorizer, and merge it to trunk.

Continued...

Technorati tag:

Post-EuroPython 2007 sprint day 1

Previous entry.

During the first day of the sprints I fixed a couple of small zope.testing test failures on Python 2.5, but didn't get anything significantly useful done. It was more of a leisurely walk than a sprint. At least I did get acquainted with the changed environment (buildout's bootstrap script that does exec urllib.urlopen('http://...').read() and requires the very latest bleeding edge setuptools that aren't in Ubuntu Feisty yet) and found a machine that still had Python 2.3 to run tests on.

I was also a bit disappointed that my two-line bugfix to trace.py that I submitted more than a year ago wasn't accepted yet and the tests were spewing spurious messages about not printing coverage results for module '<doctest ...>'.

Continued...

Technorati tag: