QT/KDE on OpenWrt

As you may know OpenWrt’s collection of ported packages is continuesly growing.

Many graphical stuff gets ported, as well as graphical desktops and toolkits (lxde, xfce, gnome based on GTK2 - e17 based on the enlightenment foundation libraries - etc.).

However there was no approach yet to port the last missing Desktop “KDE” and underlying Toolkit “QT”.

That’s why I went to “Tokamak 4″ this weekend, a meeting organized and founded by the KDE foundation, intended to communicate and hack together related to several KDE software projects.

We were about 25 people from all over the world and I really enjoyed the stay and nice, friendly and mixed party - surprisingly I was the only one not using KDE (however not for a special reason - just got used to my current environment) :).

They showed lot’s of interest in the UCI-System (Unified Configuration Interface) OpenWrt is using.
It’s a simple, human-readable, easy-to-parse configuration file format and library OpenWrt uses for services to make it easy writing Administration Interfaces for them (e.g. the webinterface “LuCI”).
We were spinning around about KDE Plasma applets which will list available OpenWrt-devices ready to get administrated right through native applications.

Key deal for me however was to get in touch with people who know the QT/KDE architecture very well, for sure promoting a bit OpenWrt, qi-hardware and it’s concept of open hardware and why I think having QT/KDE support within OpenWrt is opening lot’s of opportunities for both projects.

Since QT is able to use DirectFB (a very powerful but light abstraction for the linux framebuffer) - and therefore does not require a X11 system necessarily - it would be also great for limited hardware such as the Ben NanoNote (32MB of RAM) where I got GTK2-based apps running on top of DirectFB quite some time ago.

I expected to get basic support for QT within OpenWrt done this weekend, however I underestimated the size and complexity of QT - never touched QT-code before.
I realized QT is not just a toolkit as GTK2 is, but a whole framework which tries to abstract as much as possible from the underlying system. It features own backends for multimedia, sound, graphics, even networking - to achieve a stable API and platform compatibility without the need of code modifications, no matter which backends or systems are used below.

In which way the typical issues of such a abstraction-concept - such as getting bloated, having performance issues, being feature-limited as you’re usually just able to support the least common denominator of all supported backends, etc. - I’ve no idea yet - maybe they found a way, will find that out sooner or later.

They also use “qmake” as build-system which is structured quite different than e.g. GNU make, so this got another temporary road blocker as I used qmake never before and had to dig in first.

Back to the port of QT to OpenWrt: I’m having promise to see the first basic QT based application running on a OpenWrt supported device within the next days.

Will let you know :)

GTK2 running on top of DirectFB on OpenWrt!

OpenWrt is now able to run applications based on toolkit GTK+ on top of DirectFB!

Using DirectFB avoids having a full blown X11-server (most times Xorg) running, but having the possibiliy of getting nice GTK2 widgets onto your display without altering applications which are using the toolkit.

I was quite happy I got that working, because unfortunately DirectFB-support on part of gtk2 is quite broken in most versions.

Due its incredible slowness of GTK2 on the Openmoko Freerunner (400 MHz ARM, 128 MB RAM) I didn’t expect much of gtk2 on top of DirectFB.

Surprisingly, a simple gtk2 app runs quite well and responsive on my Ben NanoNote by qi-hardware (366 MHz mips, 32 MB RAM).

I was curious and started some benchmarking with the gtk2 performance testing tool “gtkperf”. However I had to patch gtkperf that it’ll be usable with the qvga-resolution on the Ben NanoNote (otherwise parts of the app were hidden and the benchmark will get falsified because not the whole gets redrawed).

Do not compare your results of an original version of gtkperf with mine - varieties may be caused due to mentioned changes! (Patch: http://nanl.de/files/patches/gtkperf/gtkperf-adjust-layout.patch)

What got tested?

gtkperf using GTK2 on:

  1. Openmoko Freerunner with DirectFB
  2. Openmoko Freerunner with Xorg and glamo driver
  3. Openmoko Freerunner with Xorg and fbdev driver
  4. qi-hardware Ben NanoNote with DirectFB
  5. qi-hardware Ben NanoNote with Xorg and fbdev driver (not yet done)
1 2
GtkEntry - time: 0.91
GtkComboBox - time: 16.01
GtkComboBoxEntry - time: 10.18
GtkSpinButton - time: 2.37
GtkProgressBar - time: 1.04
GtkToggleButton - time: 2.54
GtkCheckButton - time: 1.72
GtkRadioButton - time: 4.16
GtkTextView - Add text - time: 9.47
GtkEntry - time: 2.08
GtkComboBox - time: 30.40
GtkComboBoxEntry - time: 21.65
GtkSpinButton - time: 3.54
GtkProgressBar - time: 2.55
GtkToggleButton - time: 4.66
GtkCheckButton - time: 2.71
GtkRadioButton - time: 6.64
GtkTextView - Add text - time: 26.06
3 4
GtkEntry - time: 1.73
GtkComboBox - time: 22.70
GtkComboBoxEntry - time: 16.52
GtkSpinButton - time: 2.60
GtkProgressBar - time: 1.93
GtkToggleButton - time: 3.60
GtkCheckButton - time: 2.28
GtkRadioButton - time: 5.73
GtkTextView - Add text - time: 18.81
GtkEntry - time: 1.07
GtkComboBox - time: 18.61
GtkComboBoxEntry - time: 10.98
GtkSpinButton - time: 2.81
GtkProgressBar - time: 1.51
GtkToggleButton - time: 4.31
GtkCheckButton - time: 2.60
GtkRadioButton - time: 7.42
GtkTextView - Add text - time: 12.48

 

The results are really interesting!

On the Openmoko GTA02 (Freerunner) GTK on DirectFB seems to be almost twice as fast as GTK on top of Xorg!

Even though the Hardware of the Ben NanoNote is quite limited compared to the GTA02, the benchmark looks quite promising and GTK2-applications seem to be - unline I expected - really usable on that kind of limited hardware.

What’s really confusing to me: running gtkperf on top of the accelerated Xorg-glamo driver for the glamo graphics chip is slower than using the not accelerated Xorg-fbdev driver. However this myth should not be part of this article; I’ll get in touch with Lars - the author of Xorg-glamo - regarding this issue.

UPDATE: Lars told me this is related to the glamo-overhead. Data transferred to the framebuffer via fbdev only consists of pure pixmap-data. Data transferred via the glamo-driver consists of data AND special glamo-related commands (telling the chip what to accelerate) which results in more data to be transferred. Normally this shouldn’t cause such a discrepancy, however the glamo <-> memory-onnection is a bottleneck and only capable of tansferring around 4 MB / second which slows down unacceleraed content. The glamo chip provides the interface for the SD-card, so the whole bus is shared by graphics- and SD-carc-traffic. That’s the reason why e.g. playing videos (unaccelerated) stored on SD-card is that damn slow!

Further tests, benchmarks, evaluation coming soon…

Versions:

gtkperf: 0.40 (with patch: http://nanl.de/files/patches/gtkperf/gtkperf-adjust-layout.patch)
DirectFB: 1.4
GTK+: 2.17.0
cairo: 1.8.6
pango:1.26.0
freetype: 2.3.9
glib: 2.22.2
atk: 1.22.0
pixman: 0.14.0
Xorg X11 server: X11R7.4-1.5.1
xorg-driver-glamo: b45d78c927715b8814404fc2a34ae0aa1d003c29

OpenWrt on the Ben NanoNote!

The Ben NanoNote I got a few weeks ago by qi-hardware is now running OpenWrt!

The patch, published by the manufacturer ingenic itself, which provides linux support for their SoC’s (System-on-a-Chip’s), is roughly cleaned up, unneeded stuff is cleared out and it’s levelled up to 2.6.25.20 (originally the patch refers to 2.6.24.3) and - running!

That’s the good news…

…now the bad ones:

What’s next?

I was in Hamburg this weekend meeting Lars for a hack-session on the Ben NanoNote. He’s also part of the OpenWrt-team and now another proud owner of such a device :)

Besides his ongoing contributions to the Openmoko-project, hopefully he will also help us* spending some of his time on the NanoNote - thank’s a lot at this point for your great work and efforts!

*i’m happy to announce that last week I “became an official developer of the [qi-]core team” with “focus
on the OpenWrt integration” - let’s see what will happen :)

qi-hardware

qi-hardware is a startup (announced 20th of July on linux.com) which set itself the target of manufacturing and deploying  hardware under the idea of “Open Source Hardware” (for details you might want to read the mentioned article on linux.com or on qi-hardware.com itself).

This idea might call some analogies to Openmoko and - indeed - not just the ideas, also the people are almost the same :)

Same idea? Same targets? Same people? Let’s face it: same mistakes? At least qi is saying: “no!” as described in their post “Lessons learned

Based on the saying “back to the roots” aka “the more basics the fewer problems” they announced their first device:

the “Ben NanoNote”, which (at least for now) comes with no RF-hardware at all.

Nevertheless the project looks very interesting and promising - even more when I was told that OpenWrt is going to be used as default operating system.

Shortly after I was asked whether I’m interested in helping getting OpenWrt running on it - I agreed, got one and am now hacking on it :)

Let’s see how things will do…