The Tokamak 4 Files: Plasma on Mobile Devices

In front of you you have the second installment of the <i>Tokamak 4 Files</i>, a series of articles that put various aspect of KDE SC which have been worked on during the Tokamak 4 sprint in February earlier this year. During Tokamak 4, which was hosted by the openSUSE folks in the heart of Nuremberg in Germany, a group of 26 hackers and artists gathered for about a  week to work on various aspects of and beyond Plasma, KDE's desktop and netbook shell.

[TODO:groupphoto from wiki page w/ names]

One of the focus points of the fourth edition of Tokamak was running Plasma on Mobile devices and work on the KDE Development Platform's suitability for mobile development. While Plasma Netbook has come to maturity in its first release along with teh KDE Software Compilation 4.4 earlier in February this year, the Plasma team is also looking beyond this formfactor. In a breakout team which worked on platform and UI topics for the whole week, two rather impressive results have been reached, a prototype of Plasma mobile, a Plasma environment for smartphones, and an RFC (Request for Comment) to shrink the footprint of the KDE platform in order to make it a more viable option for devices with limited hardware resources, especially in the mobile and embedded space.

Plasma Mobile

The new Plasma Mobile shell, which has been conceived by QGraphicsView-hacker Alexis Menard not long ago has seen some serious work put into it. The first session that was held discussed various UI concepts for devices like the Nokia N900 and the Intel JAX10. The developers had some sample devices of both at hand, so proposals could easily be related to the actual device Plasma Mobile might run on. A first idea was to employ concepts of a ZUI [TODO:ZUI link], though the team wasn't really happy from a visualization point of view with those concepts. The next idea that was further explored included an "Activity" concept, more closely oriented at how the current Moblin interface looks like. This UI has as its major concepts topical modes. The start screen can be unlocked by dragging a bar with 4 rather large buttons onto the screen, combining unlocking of the device and bringing the primary UI into the picture. Those Zones can hold both, Plasma widgets for a specific topic such as PIM or Social Networking, and also applications that are used there. Each zone can be flipped to its backside to open a (currently unused) scratchpad area which can be used to hold contextual information or application launchers for the specific activity. As the team decided to go forward with this idea, the participating Oxygen designers headed by Nuno Pinheiro created mockups that were turned into moving screens subsequently.

[TODO: mockup Plasma mobile]

Prototype of Plasma Mobile on Maemo and Moblin

http://www.notmart.org/index.php/Software/A_mobile_Tokamak
http://blog.morpheuz.cc/28/02/2010/the-mobile-concept/
http://labs.trolltech.com/blogs/2010/02/28/tokamak-4-the-kde-plasma-meeting/

Plasma Mobile is based on Qt Quick (also known as Qt Declarative, or QML) as prototyping environment. (Although it is not unlikely that the final version of Plasma Mobile will be based on the same technology.) Qt Quick has been closely integrated with Plasma making it a first-class citizen in the Plasma space, meaning that Plasma components can easily be integrated into QML-based applets and applications, but also that QML can be used to write Plasma Widgets and containments in. In order to fully open Qt Quick for use with Plasma, the team implemented a small number of changes to how QML works, and has already proposed them for inclusion in upstream Qt. [TODO: accepted?]

The Plasma Mobile team was able to get Plasma Mobile running on both Intel's Moblin platform, which came preinstalled on the JAX10 devices, and also on the Nokia N900 with Maemo installed. Changes between the codebases for Moblin and Maemo even at this very early stage of development were minimal and will completely be gone by the time Plasma Mobile becomes more mature. The major differences at this point in development were at the buildsystem level. Those are likely going to go away in the near future anyway as Meego replaces Moblin and Maemo as the target platform for these devices. In any event, Qt's concept of "Write Once, Compile Everywhere" is also true for KDE's Plasma, bringing a unified shell and canvas-based toolkit to a wide range of devices, mobile and less portable. Qt Quick will see its first public release as part of Qt 4.7, which is to be expected this summer. The summer of 2010 might also bring a first technology preview of Plasma Mobile.

The bottom line of the early prototyping work for Plasma Mobile is that KDE's software stack already brings very compelling options to mobile platforms. The very short timeframe in which Plasma Mobile was brought to a first prototype impressively displays how the time to market can be reduced with a platform that brings a great deal of re-usable components with it. Various pieces of technology that are today included in Plasma are also very well suitable for usage on mobile devices. Plasma widgets, the so-called Plasmoids, can in many cases be re-used and shared across Plasma shells such as Plasma Desktop, Plasma Netbook and Plasma mobile. Also the UI elements Plasma brings are highly re-usable because they are built with different input methods in mind and are made to scale flexibly, making it possible to use these UI elements on a wide variety of displays.

From a performance point of view, the team is definitely on the right track. Already today, performance is very good, animations on the target devices were very smooth, even though for the JAX10, the team didn't have video drivers allowing compositing. With better drivers becoming available, runtime performance will be even less of a problem. There is, however, some room for improvement in the memory footprint (installed and runtime) area, which was the focus of another subteam that specifically worked on reducing Plasma's footprint to make it more suitable for devices with limited hardware resources and stronger restrictions on power usage.

<h2>Reducing the Footprint of the KDE Development Platform</h2>

The second group has worked on reducing the footprint of the KDE development platform. The goal is to reduce the on-disk footprint of the KDE libraries, which offer functionality shared between applications (or the workspace shell, e.g. plasma-desktop, plasma-netbook, plasma-mobile). Kevin Ottens writes
<pre>
Assessing that we want to remove of the internal dependencies is obviously not
enough to reduce the size of the platform as advertised to OEMs and third
parties. We identified that some of the platform is likely to be less useful
depending on usage of the device it is deployed on. So we aim at tagging parts
of the platform as "suitable for X". Which of course raised the question of
the the different usages.

We identified that the view on the platform should not be as binary as
splitting it into "Full Desktop" and "Mobile Phone" but rather more finely
grained. We refer to the current full scale setup as "Desktop profile". The
other end of the scale is the "Mobile profile". The middle sized edition is
named the "Tablet profile" (at least for now, although admittedly that's the
best name we could come up with so far).
</pre>

The following usage patterns are currently planned:

<ul>
<li>Desktop: Extensive and power user usage as we know it today (the full game: multimedia, any content reading, complex content editing)</li>
<li>Tablet: Mostly Internet connected devices for multimedia usage, reading
content, some content editing</li>
<li>Mobile: Very constrained devices, multimedia usage, content reading, very
light content editing</li>
</ul>

You can read more about these plans on the <a href="http://mail.kde.org/pipermail/kde-maemo/2010-February/000059.html">KDE Maemo mailing list</a>. These plans are currently discussed and checked for sanity and omissions, and will then be RFC'ed on kde-core-devel, KDE's central technical list for infrastructural decisions.

Tokamak 4 provided the opportunity to the Plasma team to sit together and think about the future of KDE applications and the Plasma workspaces on mobile devices. During Tokamak 4, the developers came forward with solid plans how to make the KDE platform rock beyond the desktop. During and following Tokamak 4, these things are now being implemented, progress so far is very good.