Acid3, make QtWebKit catch up

Acid3, make QtWebKit catch up

qtwebkit-acid3

The Mac, Windows and Gtk+ port get 100/100 and pixel perfection for the acid3 test for quite a while but the Qt port was stuck somewhere else. How can this happen? For QtWebKit we decided to use as much of Qt as possible. So instead of relying on ICU we used the Qt Unicode support, instead of relying on libxml2 we used the QXmlStreamReader, instead of doing font matching and font/glyph caching we solely rely on QFont and QTextLayout to do the job. One had to apply some minor fixes to the Qt version of classes such as XMLTokenizer or TextCodec, or integrate SVGFonts into the Qt port as well…

What is next? We will have to get the rendering to be pixel perfect as well and then can merge the changes chunk by chunk. I’m going to sleep now, enjoy the screenshot.

Releasing Software to the wild

Releasing Software to the wild

So what should one do on 08.08.08? Get married? Get divorced? Or the thousands of things in between? Openmoko picked this day to release the 2008.8 software update (code named A(pril|ugust)SU) and I will travel to Mechelen to catch up with some friends from foreign countries.

Let us take a small look at the release. Doing this in the Good, the Bad and the Ugly (Queen) style. But keep in mind Bad and Ugly are only there to be fixed, so this part is actually there to keep good engineers happy and focus on constantly improving by turning the Ugly into Good for the next release…

The Good
During the last six month I have added features and fixed bugs in our bootloader, kernel, xserver, enlightenment, distro and tried to punch the Qtopia parts we use into shape (Qtopia gave me so much wonderful real world examples for our Software Engineering class at the FU Berlin… *lovely*). So I’m really happy as all of these things I have created during that time are under Free Software licenses from day one! I’m also glad to have worked on all these different areas. It is fun to start in an application bug, go down to the kernel, hardware and back to user space.

Erin, Matt, Olv, Jeremy, John, Julian, Tick of Openmoko wrote code that is shipping in the Om2008.8. So this is the first release where our taiwanese friends at Openmoko started projects or contributed to projects that are used to power our hardware. John is an upstream OE contributor, Matt is our local kernel guy and Linux contributor, Tick is maintaining opkg (that o-hand.com helped to create) and is also maintaining the packagekit backend for opkg. We are slowly breeding Free Software contributors, explaining them the need of asbestos underwear. I’m totally excited as this is just the beginning.

We have started to focus on making our phone usable. This means we will integrate working solutions where they are available, we will improve them where possible, we will create new solutions were required. So we have picked connman and patched it, we have started FSO because there is nothing else.

We have worked towards the goal to make our hardware usable as primary phone. We have established our wonderful QA unit that systematically tests our software, PM and QA sit together and talk about the issues, the state, the way to go, sometimes the QA room is even crowded with engineers trying to pinpoint the issue. A wonderful improvement over what was there before.

Our kernel, u-boot, X is a lot more stable, suspend/resume can be almost trusted (well I know how to kill it…). We started to work on performance glamo waitstates, hardware ECC…

We have a support list and a workflow how to provide upgrades to our users

I use it as my primary phone and work hard for the day that my mom can use it just as she is using kubuntu today.

The Bad (keep in mind this can be changed and will be changed)
I had difficulties following the WebKit development and more difficulties reviewing and writing patches. So the next weeks I will wait for the ASU bugs to queue and focus on reviewing patches, SVG and acid3 for QtWebKit.

There are many reasons why not to use the Freerunner and our software update as primary phone. Our wifi driver has issues, our kernel has issues, Qtopia still has fundamental issues, our modem is giving us a hard time, the battery lifetime could be a lot better, the boot time is incredible long.

We should focus on delivering a good polished product. Currently the bootloader is initializing our graphic chip, the kernel resets, we see a white screen for awhile, init shows an init screen, black as X is starting, e is starting an init screen. So the bootloader, kernel, system level, X, WM guy need to sit together and make that smooth, no mode switching, sane handover…Software and Hardware people will have to work together, hand in hand. Stop thinking of boundaries, approach the people you depend on, also approach the people that depend on your work. Be a universal person and don’t be afraid to touch the kernel, it is just a C program anyway. But then again I have high confidence that this will happen.

I love the peopleware book and recommend it to everyone. It is an absolutely must read. Too many of our engineers worked overtime during the creation of this product. We will have to force people to leave the office early.

We have to get our stuff upstream. We have cool u-boot patches, we have s3c244x linux patches, we have kdrive/x patches, we have some OE patches, we have stuff to propose to freedesktop.org for virtual keyboard handling. In the future we should try harder to get our stuff upstream from day one. We should have the resources after the release to do so. It is something that we have to do now.

The Ugly
Oh well, QA asked us to not release due the stability issues they see during their heavy testing. We do not meet the quality standards our QA team has for an ordinary phone (the good thing about hiring someone that didn’t know Linux and Free Software). On the other hand they didn’t see the OM2007.2 factory image. I think OM2008.8 enables a Freerunner to be used in friendly user trials, maybe OM2008.8.1 will make QA more happy. Until then we will release ealry and release often.

I hope you enjoy the upcoming release, I do, happy hacking

z.

Code Cloning an example

Code Cloning an example

Some parts of code cloning are bad. In contrast to my other post this is supposed to be entertaining and something you can do before breakfast. Find the difference yourself and draw the conclusion. This code is from qmailstore.cpp from the qtopiamail library. This is not to pick on any developer at Trolltech but to highlight how code review and discussion could create a better Qtopia product.

    d->checkComparitors(key);

QString sql = "SELECT id FROM mailfolders";

if(!key.isEmpty())
sql += " WHERE " + d->buildWhereClause(key);

if(!sortKey.isEmpty())
sql += " " + d->buildOrderClause(sortKey);

QSqlQuery query = d->prepare(sql);

if(query.lastError().type() != QSqlError::NoError)
qLog(Messaging) bindWhereData(key,query);

if(!d->execute(query))
qLog(Messaging) checkComparitors(key);

QString sql = "SELECT id FROM mailmessages";

if(!key.isEmpty())
sql += " WHERE " + d->buildWhereClause(key);

if(!sortKey.isEmpty())
sql += " " + d->buildOrderClause(sortKey);

QSqlQuery query = d->prepare(sql);

if(query.lastError().type() != QSqlError::NoError)
qLog(Messaging) bindWhereData(key,query);

if(!d->execute(query))
qLog(Messaging)

DVB-H with a Nokia SU-33W

DVB-H with a Nokia SU-33W

Dear Free Software loving Nokia,

first of all congratulation for acquiring Trolltech. You have gained a great team of highly motivated and passionate people. Many from us in the Free Software and OpenSource community care a lot for Trolltech. Recently I have acquired something as well, the money was not enough for all of Nokia so I started with getting a Nokia SU-33W. This is a bluetooth based DVB-H (Digital Video Broadcast for Handhelds) receiver.

While I know a lot about mpeg transport stream, multiprotocol encapsulation (MPE), FLUTE, OMA BCAST, RTP, h264 and have seen quite some DVB-H/DVB-T chips, I’m unable to make any use of my acquisition because the bluetooth protocol (directly on top of L2CAP) used is not documented.

Please give me access to the protocol specification to allow me writing a Free Software driver for your bluetooth device as I would like to watch TV with a HTML5 Video Element inside a QtWebKit KPart.

Looking back at Guademy

Looking back at Guademy

I have attended Guademy 2008 in the beautiful city of Valencia this year and presented a talk on WebKit and the Qt integration, produced some demos showing to embed QWidgets and QObjects into the QWebPage and how to interact with it, my other talk was a look at Qt 4.4. While preparing the slides I was in a constant wow mode. It is incredible what the Trolls added to Qt 4.4. It was probably a bit too much but it highlights what a team of excellent programmers can achieve when they focus on a common goal. Qt developers keep on rocking!

It was nice to catch up with some of my fellow KDE developers, see some GNOME developers, talk with local developers. I think events like the Guadec are really helpful, not only you can catch up with developers from your village, but also to see people from other villages and projects and discuss and get inspired. It inspired me to give KDE4 a try, fix some bugs, write a mail (which is still in the moderation queue) to kde-devel on KNumInput.

So whatever you want to develop Guademy into for the following years, make sure to keep it a place where people from the different desktop and non-desktop Opensource and Free Software projects can come together and talk to each other. There are things GNOME can learn from us, there are things we can learn and should learn from GNOME. I sincerly believe that whatever makes GNOME and KDE different we have more in common than what separates us.

So thanks a lot for organizing Guademy, your hospitality and see you next year.

PS: Because Jos asked, blogger.com works in the demo browser, this post is created with it.

Slowly getting frustrated with Qtopia

Slowly getting frustrated with Qtopia

So I have been working on this Qtopia integration. Being a good Free Software citizen I report the issues (most of the time with patches) upstream. Because I don’t like non public tasks and prefer discussions on patches I had to decide to use the qtopia-interest mailinglist (note the increased volume since february). The amount of feedback, even on obvious issues is kind of low, admitingly disappointing. I understand creating a generic framework which is easy to customize for very different kind of devices is very hard. But this is what Trolltech decided to do with Qtopia, so I ask for advice how I can achieve my customisation as it is currently not possible, the feedback is zero, none, nada. This is something that engineers, creators of frameworks should love to discuss, use cases, approaches to API… no interest at all from Trolltechs side.

But where the frustration starts is copy and paste. Their approach to platform integration is, copy an existing platform, sed -i s/THEIR_NAME/YOUR_NAME/g, hack on it until it is working, copy code from the Qtopia libraries and change one line, add device specific code to the core Qtopia libraries, have five copies of yuv blending code (unaccelerated, bytewise…, we had to call the ambulance for raster…). So I have had to fix bugs/asserts/crashes on copy and pasted code where someone fixed the original code in qmodemsiminfo.cpp but forgot to update all places where they copy and pasted the whole class to. In this case certain modems send different responses when no simcard is inserted, a perfect example for abstraction (removal of copy and paste, fix without copy and paste).

With C and C++ you have languages where you can change/extend the behavior of so called “objects” (coming from Object Orientated Programming) with something called “subclassing”. You do not need to copy the sourcecode to achieve that.

With Linux we have gained generic input systems (started in 2.4, really used in 2.6), sysfs (2.6) and I’m specially proud that a couple of device classes (battery, backlight, led…) originated from our handhelds community and found their way into mainline. So instead of writing one class for one battery, you can create one class that is going to work for every battery, with a stable userspace interface. When raster saw that, he read the battery class specification and implemented it. And it doesn’t look like Qtopia will gain support for these ‘classes’ of devices anytime soon, instead you, as an integrator, have to manually parse your special device, no help is coming.

When doing hardware development, you don’t follow the waterfall model. You create hardware, write drivers, work on GUI stuff, have iterations on everything (new hardware, new kernel, new GUI). The kernel gets better suspend resume handling, the initialisation order of drivers change. The input device numbering in userspace change as well (/dev/input/eventX). Because the kernel developers knew that these numbers in userspace will be random, they added ioctl’s to get the vendor id, product id, version and name. So sane code would have a class/factory where you create an input device handler for a given Vendor and Product ID, or name of the device (e.g. “Neo1973 keyboard”), I would hide this behind a nice API where you only have to deal with the actual handling of keyboard data. Qtopia’s approach to this is… Right, Copy and Paste and using hardcoded device numbers. So in the neo case you have four copies of this code, they don’t include linux/input.h but duplicate the struct and use magic numbers instead of the defines..

You have to rush, you do mistakes, you do stupid things and this is kind of acceptable but what really frustrates me is that they justify their behavior. They justify copy and pasting the same code to four places (and changing the class name) as a way to avoid bloat (which the abstraction would add) and that hardcoding the random device number is the right thing to do and that finding the right device is bloat and not needed.

So dear people can someone explain me where the world of someone who has grown up in the Free Software world, started to program here, getting review and comments, creating patches, polishing them, reworking them due feedback is disjunct with the world of copy and paste. As a buddhist I know that my world is not better than their world, only different. So please can some one help me to understand how their world is different, how I could understand them, how one can help them to recognize that copy and paste and layering violations create more problems than they solve?

Qtopia progress

Qtopia progress

I safely returned from Taipei and was almost in time. As I don’t have a hitchhiker guide to transatlantic traveling I had to learn it the hard way. Don’t take the arrival time for granted and plan the evening. If anyone knows how to legally get a rental copy of I’m a Cyborg but that’s ok. please tell me.

Taipei is great and I hope this was my first visit in many to come. It was a pleasure to see the Openmoko offices, catch up with the local engineers (too many to name them and I would forget one and would feel really bad about it). My short-term goal for tick and jeremy is to make them start a blog, take videos of their apps (assassin, diversity) and expose themselves to the public. It was a pleasure to meet the other foreign engineers and I’m specially honored to have met Werner Almesberger, received a talk on kboot, and rasterman and enjoyed the training on the graphic pipeline, state of XRender and general musings on object orientated programming.

I have finally a result of the automatic build of Qtopia/X11 that is not segfaulting (yeah!) and the experience feels like wasting time. I think I have spent almost of the last week on this thing as the turnaround times are so heavy. E.g. I managed to compile Qt for the target without fontconfig and the apps were only able to display numbers but not any glyphs. So I had to pass -fontconfig and the includepath for fontconfig to the configure script. This results in a five hour penalty as Qt for the desktop (totally unrelated), Qt for the target (not only the two classes knowing of fontconfig) and then the full Qtopia stack (I assume the Qt with and without fontconfig is binary compatible… so another waste of time). Anyway I have a GTA02/Freerunner (with GPS, WiFi, GSM, without a working bluetooth) that is powered by enlightenment, which is of importance for buddhists, and Qtopia/X11. We need to polish the packages and configuration, make sure that qpe is launched as part of the Xsession start and then let our “black team”, allan, do the testing and secure my job by finding bugs. The modem gets powered on, Qtopia finds it, I see the PIN Dialog and once raster is finishing his keyboard we can enter stuff. Pal hurry up!

What is so cool about Openmoko? In contrast to many other companies, specially in the hardware industry, is that the relevant stuff is public, our failures with hardware, our stupidity, our brilliancy, our success, our progress, our vision. This allows you to track it and be part of it and contribute. We are open, and mean it, and this commitment to openness is important. This is showing with our platform strategy. We are not only a Gtk+ company, we are not only an EFL company, we are not only a Qt/Qtopia company. We have enough flash to make it possible for you to carry your favorite toolkit and language in your pocket, show it to your friends. So our platform strategy is different, it is toolkit and language neutral, in the current age this implies DBus and yes we are interested in reusing and creating DBus Interfaces around GSM/SIM, Networking, PIM, Journal, Location, Communication,… This effort is lead by former Opie colleague and close friend Dr. Michael ‘mickeyl’ Lauer who currently enjoys the sun in Recife and is attending the Bosa Conference with a bunch of other Openmoko people (raster, stefan, daniel).

So consider contributing, your open phone is waiting for you. And remember warranty is void when NOT opened.

QtWebKit, Illume and Diversity

QtWebKit, Illume and Diversity

I’m writing this on one of these roundtrips when waiting for the Qtopia buildsystem to finish. I changed the mediaengine from helix to gstreamer, this means in one library another implementation gets compiled and the library is linked, maybe the other part of Qtopia needs relinking after it and that would be fine. The truth is, I switch the engine now configure of Qt desktop, Qt target and Qtopia is ran and I’m compiling Qt for the desktop, Qt for the desktop and the Qtopia libraries and applications from scratch. If anyone knows how to stop these stupidity and get me acceptable roundtrips times for such minor changes please comment.

To everyone that say QWebKit, the Qt WebKit integration is called QtWebKit and please use that when referring to this module. As communication is done by blogs these days I have seen this workaround. If you experience a crash on exit with QWebView, please tell us, there is no need to add a workaround to your application, Qt4.4 is not final. So please write a small application that is crashing on exit and the Qt WebKit inside and outside of Trolltech will take a look and fix it. What did you make believe this is an bug in amarok and is needing fixing there? The cool thing with the Free Software world is you can fix the stuff where it has to be fixed and we should utilize this, so please show us the problem.

Urs, I’m glad you had a go at the QtWebKit KPart and yes QNetworkInterface is not present if you compile QtWebKit with Qt4.4. You want to look into the QNetworkManager and provide an implementation using KIO. If you need any help, I’m here to help and I’m sure Simon and thiago will help you too.

raster left taipei yesterday, he is probably packing and leaving to the bossa conference soon, he has been busy working on illume, our window manager module for the GTA02/Freerunner, tick has created a project for our EFL based installer application (using PackageKit) and last, but certainly not the least application we are going to develop in our GForge is diversity. This application is combining GPS, GeoClue, Jabber, your Journal with each other and providing a bling-bling interface using EFL. When walking around in a foreign city you can see where you friends are, were, where they haven taken their cool pictures that you have seen on flickr, get routing with OpenStreetmap to find your way, see people with the same interests as you, take a city tour people like you have enjoyed, let your Freerunner guide you through the city, go sight-seeing or just chat with your relatives back home (and certainly be able to control your privacy). I hope we will have some more videos up in the next couple of weeks.

I have been enjoying my time in Taipei, I’m definitely coming back soon and if we work hard Openmoko can have a bright future, we can start a Software Industry in Taiwan solely based around the concepts of Freedom and Free Software, this is really exciting!

Taipei, Qtopia on X11, and tracing memory allocations

Taipei, Qtopia on X11, and tracing memory allocations

I moved into the OpenMoko apartment yesterday and right to the backside of the apartment we have some kind of hill and I could not resist and had to walk up to get this city view:
03020055.JPG

raster has been working on a new launcher, window decoration and application navigation for the OpenMoko device, some things are pretty hot about it. It is called illume and can be found here. This launcher is using EFL, actually it is a module for e and the cool thing is edje. With this little file you define objects, their look and their behavior, e.g. if it gets clicked a signal is emitted, you can write mini programs, so on click you can get a transition, like sliding out the menu. edje is pretty powerful.

WebKit related I’m spending my spare time tracking allocations, stale data and memory fragmentation. I use spiegel.de as my test site and monitor heap usage and address space growing (due fragmentation?) and somehow lacked a good application for profiling. raster kindly pointed me to memprof and now I can do this (well memprof has some performance issues with WebKit when getting the profile, but it is performing better than Instruments.app for this job):

memprof

I see most of the memory was allocated by QImageData::create, when clicking on the create method I can see the callers and navigate through the backtraces. It is working with C++ and you can easily add qMalloc,qCalloc,qRealloc,WTF::fastMalloc to the list of functions to ‘ignore’.

QtWebKit in action

QtWebKit in action

Following up Simon’s QtWebKit in Action and to answer some comments from previous blog posts. Yes with QtWebKit you can embed QWidgets into HTML, you can control their position, size, etc. with JavaScript and apply CSS, invoke slots and such things. Lars, Simon and Girish created a demo for the DevDays it can be seen in action on the site Simon mentioned and you can grab the source from svn://labs.trolltech.com/svn/webkit/demo.

© 2025 Strong Leaf