linuxuk.org Adventures in Linux Land

15Feb/1029

The New UI for ARM Based Ubuntu Devices

ARM based platforms traditionally have a problem with graphics drivers and free software. Encumbered by licensing issues, many platforms only ship with 2D based drivers whilst the 3D driver-enabled offerings only frequent the poshest of circles such as Nokia's N900. There are exceptions, but its a painful reality at the moment.

Vendors are trying to work around it, especially as there is the expectation of a ramp-up in the availability of ARM based hardware. Super long-life netbooks, low powered touch based computers, and even a flurry of smaller embedded devices are forecast to hit the market this year, many of which will be based on the Linux operating system. Ubuntu would be a great match for this.

Ubuntu and ARM

Ubuntu runs very well on some ARM based platforms and there is a sustained effort to make it work more ubiquitously across many more. To that end our goal is to have Ubuntu running on any ARM based device (as long as there is hardware available). A lofty goal but one which we would like to see happen.

So what can we do about the 3D graphics licensing issue? Legally not very much. The companies that own the IP (Intellectual Property) rights to these drivers often want large licensing fees for their technology. This is a model for single product lines (take the Nokia N900 for instance) but for Ubuntu where we are targeting a more broad approach, this isn't ideal.

So when you buy your new, ARM based netbook that has an obscene amount of battery life and you just want to install the 3D clutter based, wonderfully rich UI that Ubuntu Netbook Edition offers, what do you do?

Well Ubuntu recognizes this problem and as part of the Lucid Lynx release there is an effort to bring a similarly wonderfully rich UI to non-3D-accelerated hardware.

The new 2D EFL based Launcher

Default ARM 2D Launcher

Above you can see the default UI for Ubuntu's ARM based releases starting from Lucid (10.04). It's a direct clone of the UI found in the 9.10 Karmic release on i386 although this one is based on EFL (Enlightenment Foundation Libraries) meaning that its fast on non-accelerated platforms. If there is 3D hardware available it can use that but it works perfectly fine without.

Another great thing about the 2D launcher is that isn't not restricted to ARM hardware only, in fact if you have Lucid installed now, getting the launcher couldn't be simpler. At the command prompt just type the following (make sure you have the universe repository enabled):

sudo apt-get install netbook-launcher-efl

and voila, your UI switches to the new launcher. Of course a simple:

sudo apt-get remove netbook-launcher-efl

will remove it if you decide its not what you want.

Beyond Netbook Launcher

Default ARM 2D Launcher
Another of the great things about this launcher, as apposed to the 3D launcher shipped with Karmic, is that its extremely theme-able. The theme file is contained in:

/usr/share/netbook-launcher-efl/data/themes/default.edj

Theme files use the edje declarative layout format. By changing this file you can completely change the way the UI looks. For example, see the alternate UI screenshot above, both are based on the same code, the only difference is that they have a different theme file.

So if you have ARM based hardware but no 3D acceleration, fear not, you can get the same great user experience that your i386 cousins have in Ubuntu Netbook Remix.

12Feb/107

Ubuntu live cd’s, now 33% faster

One of the goals for the Lucid cycle was to investigate why it took so long to boot an Ubuntu live cd session. Why is this important I hear you ask? Well the live cd is usually the first thing a potential new Ubuntu user sees. They get an Ubuntu Desktop (or other flavour) cd from their friend/colleague/random person, insert it into their machine, wait for a while and are then presented with a live session. All well and good but if your running on slower hardware, even a different architecture such as ARM, this initial slowness can be orders of magnitude more than a fast desktop/laptop. For example, the ARM images we shipped for Karmic took over 3 minutes to boot into a live desktop session.

How do you boot a live cd session?

The first thing to do was find out why it was slow. There are a few ways to do this but I chose to first use simple time-stamping methods and afterwards, the much prettier bootchart package.

A bit of background on how the live cd session is booted. There are two broad steps in the process of booting a live cd, the first is setting up the environment ready for the session, and the second, you guessed it, is actually booting into the session. Initial hunches were that the first step, setting up the session, was the major cause of slowness so investigations started there.

Casper

Setting up the session is the responsibility of a project called casper. Casper is a set of scripts that are run on boot to do such things as unpack the initial filesystem, add a dummy user, setup languages and keyboard layouts and so forth. Its mainly written in perl.

The time-stamping stage of investigates confirmed that casper was indeed slower than it should be. I'll skip ahead to the bootchart part of the story as thats much more visually interesting.

Casper before


Above you can see the casper section of the live cd boot process. I've highlighted the bits that immediately stand out. The overall boot was 3 minutes and 15 seconds with casper responsible for around 2 minutes of that.

The highlighted bits seemed to have one thing in common, they all interacted with the debconf database. From the debconf programmers tutorial document:

"debconf is a backend database, with a frontend that talks to it and presents an interface to the user. There can be many different types of frontends, from plain text to a web frontend. The frontend also talks to a special config script in the control section of a debian package, and it can talk to postinst scripts and other scripts as well, all using a special protocol. These scripts tell the frontend what values they need from the database, and the frontend asks the user questions to get those values if they aren't set."

So communicating with the debconf database was slowing the boot. Initiating the call, sending the data and receiving a response, was taking up to 4 seconds at a time and when there are many of these calls, they all soon add up.

After many a head-scratching moment it was decided that the best way to solve this would be to initiate the communication once and keep it open so that when debconf was needed, the overhead in setting it up was removed. The implementation details are all in the code history but the results are much easier to show.

Casper after


With a couple of other tweaks besides the debconf one, the boot is now down to 1 minute 53 seconds and casper takes just under 50 seconds of that. There is more room for improvement, pre-generating a default locale (although which locale that would be is a tough choice), pre-generating fonts and looking into SSL, but for now, this is a big win.

The bootcharts above are for the ARM based iMX51 device made by Freescale which is only just beginning to proliferate onto the market. Intel/AMD based machines show an equivalent speed-up.

Conclusion

So there you have it. The next time you boot into a Lucid live cd session it shouldn't take quite so long, and now you know why.

3Nov/098

What would you like to see for ARM based embedded distro’s?

So its that time of year again, we released a great product and instead of being content, we want to make an even greater one next time. It's scary to think that I leave for the Ubuntu Developer Summit (UDS) next week but as a Canonical employee we are all charged with coming up with great idea's on how to make our particular field of interest even more awesome than it is now.

15Sep/090

New Ventures Ahead

As a follow-up to my work related post about me losing my job to the economic crisis, I though it would be only fitting to announce my new role, that of Ubuntu Mobile Developer for Canonical. I'm really looking forward to working with a hugely talented team and helping Ubuntu continue to be the first choice OS for Linux based machines.