Thursday, April 14, 2011

Short Story of a Long Struggle - Part 2: It's alive...

I'm freshly back from San Francisco, and among other things (like finding a place to live in Redwood Shores) I attended Camp KDE 2011 on Monday. It was great! Thanks again to Celeste, Claudia, Justin, Jeff, and all the people who made this possible - you guys rock ! :)

I was actually invited to give a talk about Kontact Touch as part of the KDE on Mobile track. For those who missed it and are interested, our awesome team of organizers have made it available online already :



You can skip the setup downtime until 1:45, but the really interesting stuff starts at 15:00, when I'm performing a live demo of Kontact Touch on the Nokia N900. Will you manage to find the hidden crash in the demo ?? ;)

At the end of my previous post we left off at the point where we solved all the memory and platform issues on Windows CE. All issues ? Well, not exactly, there was still a small area of resistance...

For an unknown reason, we would get random hangs during the initial account sync, or later on while trying to send mails, or browse folders. After some monitoring, we found out that those hangs were caused by socket notifications being lost on the way. We fixed a couple of bugs in Akonadi, solved a few dbus issues, but nope, the problem was still there. This was the beginning of a long hunt, involving multi-thread and multi-process debugging sessions, random reproducibility, and more fun.

Anyway, this post is called Short Story of a Long Struggle, so long story short: the problem was coming from the Qt event dispatching and socket notifiers implementation for WinCE. The implementation was roughly based on the same logic that for desktop Windows, however on WinCE the underlying priorities for threads and event dispatching are quite different, so we basically ended in situation where we would starve some threads and processes, or would never get the socket handlers to be called. By now this was nothing that could frighten Marcus Brinkmann anymore, so he simply went forward and implemented a whole new Qt event dispatcher for WinCE ! With this new event dispatcher, the problems finally disappeared and we finally started having a stable Kontact Touch on WinCE, also fixing a few obscure bugs on the N900 at the same time. Victory !!!

One we got that sorted, the last piece of the puzzle was to speed up a few parts and perform last-minute optimizations. As you can see on the video above, the result on N900 is really good. The apps are fast, responsive, and the animations are super smooth !

Unfortunately, we can't really say the same about the TouchPro2... Despite our best efforts, Kontact Touch is still really slow and sluggish there. But I believe this is a limitation of the hardware itself, as Windows Mobile itself is painfully slow at times on the TP2, at the limit of unuseable. It's too bad really, as the app would rock there too if it only had a little beefier hardware.

So this brings us to the end of this journey. This was a bumpy ride at time for sure, but we had an awesome team working together to make this happen against all odds. Thanks again to everybody involved at KDAB, Intevation and g10 code !

Now it's time to look to the future, and I'm already having "Kontact Touch on Android" as the number one item on my list to Santa for Christmas :)