Tuesday, 14 June 2011

Linux on Fujitsu Amilo Li 1705

Earlier this year I bought a Fujitsu Amilo Li 1705 and I've been wanting to get Linux working properly on it, as it would make a handy portable development system.

As I've just upgraded the CPU from a single core Celeron M to a proper Dual Core processor, I was keen to see how well Linux ran on it, especially as it had made a HUGE difference when running Vista.

It goes without saying that these days installing Linux is a lot less painful than it used to be. In fact, in most instances you can go through the entire install and configuration process without ever touching a command line.

Ubuntu can even take away the agony of partitioning. Using the Wubi application downloads the install files, creates a loopback file system, and configures your Windows boot menu to allow you to install Linux without having to do anything scary with your existing system. You can even uninstall it from add/remove programs.

Once you boot into your new "Ubuntu" option then the install proper takes place, and one reboot later you are the proud parent of a bouncing baby Linux.

End to end the install took less than half an hour. Uninstalling takes a few seconds.

Logging into Ubuntu for the first time it is time to go through the checklists:

Has the correct graphics driver and screen mode been selected? Yes.

Is 3D acceleration working? Yes.

Do we have sound? Yes.

How about wireless networking? Yes again.

Is CD Burning working? Sure is.

How about playing DVDs? Oh dear.

There is an art to getting DVD playback working on Linux. Thankfully the process for doing so in Ubuntu is extremely well documented and it only takes a few minutes to install the necessary packages.

sudo apt-get install ubuntu-restricted-extras
sudo /usr/share/doc/libdvdread4/install-css.sh

Sadly although the DVD started to play the media player crashed. Not only did it crash, but it took out the window manager too, leaving me back at the login screen.

Installing VLC and trying to play DVDs through that had much the same result. After a bit of fiddling I was able to find a video driver within VLC that didn't crash within a few seconds. However playback was extremely stuttery and stalled within ten minutes.

Trying to install a basic 3D game also showed problems - Saurbrauten was running at a less than impressive 2fps.

The strange thing is that in Windows the 3D isn't that bad, and DVD playback works fine. So what is going wrong?

Web browsing was also a bit hit-and-miss, with various crashes and lockups (usually when playing video, but sometimes when playing music).

After a bit of a search I found the problem is down to the graphics drivers - a Via Chrome9 HLC - a reasonably common choice for laptops and netbooks. Not exactly a 3D powerhouse but no-where near as bad as Ubuntu was making it appear.

The driver that is installed is the OpenChrome open source driver. This provides 2D and 3D acceleration for the Chrome9 driver. Badly.

This isn't meant as a dig at the team that are doing the drivers. The fact that the drivers work at all is no mean feat. However they certainly not stable enough for every-day use. As development appears to have stalled in 2009 I'm not exactly holding my breath for bug fixes.

That said, VIA do provide (limited) support for Linux, and do have a set of drivers available to download at their linux portal.

The problem is that the drivers don't work with the latest Ubuntu release - so for now it is back to Unbuntu 10.10 (the latest supported one) to test their drivers. As the drivers are dated April 2011 it looks like they are still supporting them.

One uninstall and re-install of Ubuntu later. . .

OK, so once we've installed Ubuntu 10.10 and downloaded the drivers let's install them:

The current version is 5.75.32.87a-u1010-55689.tar.bz2. Enter the following:

tar -jxf 5.75.32.87a-u1010-55689.tar.bz2
cd 5.75.32.87a-u1010-55689
cd 5.75.32.87a-u1010-55689
sudo ./vinstall

Once the install has completed a reboot should be all it takes to get things working.

Well, this is a bit of a mixed bag. On the one hand the drivers have fixed the crashing during DVD playback, and 3D is now running an awful lot faster. On the downside the screen resolution is entirely wrong and the Monitors option refuses to allow you to change it.

As a side note, recent Ubuntu releases don't need an xorg.conf (the X11 configuration file), and do a damn good job of detecting what graphics card / monitor resolutions are available to you. As part of the VIA driver install an xorg.conf is created in /etc/X11. We can use this to add our "missing" resolutions.

So, how do we find our missing modes?

Open a command prompt and enter the following:

cvt 1024 768 60

This returns the following:

# 1024x768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
Modeline "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync

Now, we need to edit our xorg.conf file.

sudo vi /etc/X11/xorg.conf

We are looking for the currently enabled display.

Section "Monitor"
Identifier "CRT"
Option "Enable" "true"
EndSection

We'll need to edit this section to add in our missing mode. I've also added in some of the other standard resolutions.

Section "Monitor"
Identifier "CRT"
Option "Enable" "true"
Modeline "1280x800_60.00" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync
Modeline "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
Modeline "800x600_60.00" 38.25 800 832 912 1024 600 603 607 624 -hsync +vsync
Modeline "640x480_60.00" 23.75 640 664 720 800 480 483 487 500 -hsync +vsync
Option "PreferredMode" "1280x800_60.00"
EndSection

The final line of the section selects which of our modes we are going to use. In our case we want the 1280x800 one.

One restart of X11 later and YES! We are running in full-screen! 3D now works at a reasonable speed (not stunning, but it does work). DVD playback also works - and by selecting the X11 driver in the VLC preferences it doesn't max out the CPU either. Result!

Using VIA's own drivers has changed my Ubuntu install from being basically unusable, to a pretty stable one.

After four hours of testing (I played a couple of DVDs, browsed the web, listened to some music and basically did all the regular things that I want a laptop to do) there were no crashes or lockups.

I was even able to enable the extra desktop effects such as "wobbly windows". All in all it is very nice indeed.

Once VIA release drivers for 11.04 I should be able to upgrade to that. But there isn't any rush for now.

Update

As the legendary comic Jimmy Cricket often said: There's more...

Updating the kernel reverts the drivers back to the OpenChrome ones. You can, of course, re-install the VIA ones, but there is a little extra to do this time.

We'll need to re-compile the kernel modules for the current kernel version, and then re-run the install routine. So in the directory where we expanded the drivers:

cd 5.75.32.87a-u1010-55689/5.75.32.87a-u1010-55689/VIA_Chrome9/
sudo make
cd ..
sudo ./vinstall

Now, we'll need to copy our configuration file back:

cd /etc/X11
sudo cp xorg.conf.viabak xorg.conf

Now, reboot and everything should (hopefully) be working again!


Notes:

One thing that I have found is that changing resolution (ie a game trying to set full-screen 800x600) stuffs the display. As soon as I find a fix then I'll update the article.