Jump to Navigation

MeeGo Planet

MWKN Weekly News for Monday, 13 Feb 2012

MeeGo Weekly News - 13 February, 2012 - 04:00
Front Page
2011: year-in-review

Last week's MWKN issue was our second anniversary and, rather than follow the crowd and have annual reviews at the end of the year, we like to do it on our birthday. Not least because of Nokia's habit of breaking big news in the first week of February!

Unfortunately, we missed that deadline, but here's a roundup of the last year:

* February: Elopaclypse - Nokia change strategy, ditching MeeGo; Intel do a "big reveal" of 'the' MeeGo Tablet UX; Myriad's Alien Dalvik VM for running Android app is teased; Necessitas - Qt for Android; Cordia Hildon Desktop started; Valtteri Halla resigns from Nokia and loses seat on MeeGo TSG.

* March: Valtteri Halla joins Intel, no replacement on MeeGo TSG; Nokia N950 leaked; new five-person Maemo Community Council appointed with no election; Digia purchase Nokia's commercial Qt support operations; MeeGo architectural decisions - in no way open.

* April: MeeGo Coding competition launched; MeeGo Tablet UX open-sourced; MeeGo Developer Edition for N900; Nokia & Microsoft finalise contractual arrangements.

* May: Nokia announce layoffs in Symbian & MeeGo; MeeGo Conference in San Francisco - Intel rumoured to ask Nokia to lie low, whisperings about "Meltemi"; Harmattan community - where does it live?; Microsoft to buy Nokia rumours start.

* June: Elop starts reducing expectations around MeeGo in interviews; Asus announce MeeGo netbook; Nokia CTO - Rich Green - leaves; Nokia N9 and N950 announced; Qt (and Linux?) crucuial to Nokia's "next billion" low-end strategy.

* July: Nokia's 9-second N9 adverts - a frenzied hunt for hidden clues; Andrew Olmsted joins MWKN editorial team.

* August: Linux Foundation won't permit apps.meego.com for open source software; Should formeego.org expand to fork the MeeGo *project*, currently non-functional?; MeeGo COBS problems; N9 not to be launched in US, UK or Germany; discussions about the future of maemo.org.

* September: rumours of Intel "pausing" MeeGo work; Gary Birkett passes away; Maemo Community Council only has three candidates - they become Council by default.

* October: More rumours around Meltemi surface; MeeGo abandoned by Intel & Linux Foundation, launch "Tizen" with Samsung; Mer relaunches to continue MeeGo; N9 Developer blog launches; MeeGo Community Edition renames to "Nemo"; Nokia release security update for Maemo 5, coordinated with CSSU team as well; Qt Mobility 1.2 for Maemo 5; Nokia N9 sales success in Finland.

* November: stable release of Community SSU; Intel stop accepting MeeGo apps for their app store.

* December: Qt applications in Apple's App Store.

* January: Fragmentation of Harmattan community; using an N810 as a Skype phone; AppsForMeeGo formally launches for open source Harmattan/MeeGo/Mer apps; Harmattan PR1.2 betas; Harmattan outselling Nokia Windows Phone?; Qt Innovation challenge winners.

It's been a frantic year. There have been personal losses - Gary's death to those who knew him, Nokians who had jobs which were culled after Elop's changes to Nokia's strategy; as well as organisational disasters, such as the death of MeeGo and the irrelevant creation of Tizen.

What will the next year contain? Well, after two years of doing MWKN, which has seen the completion of Maemo, the birth of MeeGo, the launch of Harmattan, the fading of MeeGo and the fundamental shift of Nokia away from producing their own high-end OSes; we couldn't possibly predict.

Maybe in the next year we'll see the first mass-market devices which form part of Nokia's "next billion" strategy. Running Qt, and probably Linux, these could be far more successful than Nokia's Windows Phones - but may not be as attractive to the smartphone loving European & US markets.

Thanks again to Ryan Abel and Andrew Olmsted for their editorial assistance, and all our contributors and supporters.

In this edition (Download)...

  1. Front Page
    • 2011: year-in-review
  2. Development
    • Reverse engineering "WhatsApp"
  3. Community
    • Next Tuesday (14th Feb): N9 hack session in Vienna
  4. Announcements
    • Toggle Power Saving Mode (PSM) app for N9 and N950
    • Pierogi - universal infrared remote control app for N900

gst-av 0.6 released; more reliable

Felipe Contreras - 10 February, 2012 - 16:16

gst-av is a GStreamer plug-in to provide support for libav (fork of FFmpeg), it is similar to gst-ffmpeg, but without GStreamer politics, which means all libav plugins are supported, even if there are native GStreamer alternatives; VP8, MP3, Ogg, Vorbis, AAC, etc.

This release takes care of a few corner-cases, and has support for more versions of FFmpeg.

Here are the goods:
http://code.google.com/p/gst-av/downloads/list

And here’s the short-log:

Felipe Contreras (19): adec: flush buffer on EOS adec: improve timestamp reset adec: avoid deprecated av_get_bits_per_sample_fmt() adec: avoid FF_API_GET_BITS_PER_SAMPLE_FMT vdec: properly initialize input buffer parse: add more H.264 parsing checks parse: fix H.264 parsing for bitstream format get_bits: add show_bits function build: set runpath for libav vdec: fix potential leaks vdec: use libav pts stuff vdec: get delayed pictures on eos build: trivial improvements parse: trivial fix h264enc: fix static function vdec: add support for old reordered_opaque adec: add support for old sample_fmt adec: add support for really old bps() adec: add support for all MPEG-1 audio Mark Nauwelaerts (1): parse: be less picky regarding some reserved value

MWKN Weekly News for Monday, 6 Feb 2012

MeeGo Weekly News - 6 February, 2012 - 01:00
Front Page
Qt Innovation Challenge winners announced

Winners of the most popular N9 apps have walked away with $10,000 and, in the case of PhoneTorch, $50,000 as part of Nokia's "Qt Innovation Challenge". Participants were invited to enter the competition with: "We are looking for new and innovative content for use on this high-end, Qt-powered smartphone, and in particular we are looking for apps that match the sophisticated style and capabilities of the Nokia N9. This can include apps for entertainment, luxury and fashion, technology, travel and sport – to name a few. At the same time, maybe you will submit an app that makes innovative use of the front-facing camera on the Nokia N9, or takes advantage of features like NFC that are built-in to the phone."

Not wanting to begrude the winners but the competition failed in its aim: to make innovative, mainstream apps for the Qt platform and Nokia N9. The judging was done on number of downloads, rather than any subjective view of "innovativeness". Your editor didn't enter the competition as his in-train apps didn't meet his own definition of "innovation". However, very few of the winners do either.

This is the biggest problem with Harmattan: not the lack of apps (there are plenty), but the lack of innovative, distinctive apps which make you go "oooh".

In this edition (Download)...

  1. Front Page
    • Qt Innovation Challenge winners announced
  2. Development
    • Qt SDK 1.2 released
  3. Announcements
    • LPMCustomizer in Store for N9
    • Fremantle stack for Mer

Report: 600,000 Nokia N9 Devices Shipped in Q4 2011

Mark Guim - 3 February, 2012 - 22:32
About 600,000 MeeGo-based Nokia N9 devices were shipped in Q4 2011 according to a recent report from Canalys. Nokia shipped twice as many Nokia Lumia devices running Windows Phone during the same period. Nokia’s total smartphone shipments for the quarter came in at 19.6 million. These numbers came from a report that concluded smartphones have [...]

Continue reading Report: 600,000 Nokia N9 Devices Shipped in Q4 2011 at The Nokia Blog

Open Mobile Linux, this Saturday in FOSDEM

Henri Bergius - 2 February, 2012 - 00:55

As mentioned in the earlier call for presentations, we're running a track on Open Mobile Linux in FOSDEM this Saturday. Room AW1.120 at the ULB campus in Brussels. From the CfP:

Our primary goal is to facilitate meetups, collaboration and awareness between different projects and communities within Open Mobile Linux and provide a place to present directions, ideas and your projects themselves.

By Open Mobile Linux we mean any open source projects revolving around typical non-desktop/server Linux, such as handsets, tablets, netbooks or other creative uses. Examples of such projects could be Qt5, Mer, MeeGo, Android, webOS, Plasma Active, Tizen, Boot to Gecko, SHR and other related efforts.

There are several exciting things happening in this space, including the recently announced Spark tablet, open sourcing of webOS's Enyo framework and continuing interest in the Maemo platform. Saturday's program includes:

If there are any last-minute announcements or happenings that people want to discuss, we may be a ble to squeeze in a talk or two. Contact Carsten about this.

Also, if you want to chat other things (like PHPCR or CreateJS), I'll be around the whole weekend including the beer event. Drop me an SMS.

Looking forward to seeing as many of you there as possible!

Qt SDK 1.2 Released

Qt Labs - 1 February, 2012 - 02:35

We are happy to announce that a new important update for Qt SDK is published.
This Qt SDK 1.2 update sets a new baseline for the developers for a longer perspective. Some of the features have already been available as online updates, but Qt SDK 1.2 now integrates the very latest tools, most recent mobile build targets for Symbian and Nokia N9, and the still fresh Qt 4.8 for desktops. We have also introduced some improvements to the SDK and its maintenance tool.

As a summary, this is what is new in the Qt SDK:

  •     Fixes for Qt Creator 2.4 in a new 2.4.1 patch update
  •     Qt 4.8 for desktops delivering Qt Quick 1.1, Qt platform abstraction, Qt WebKit 2.2, and threaded OpenGL. See Sinan’s blog post for more details.
  •     More Qt Mobility examples for Nokia N9 and Symbian devices
  •     Ability to specify network proxy setting in the SDK Maintenance Tool
  •     Update to the Symbian Complementary Package introducing Analyze Tool plugin and new CODA 1.0.6 installation package
  •     An update to Notifications API improving the end user experience and fixing issues in the Nokia N9 implementation of the API.

If you already have Qt SDK installed, you can update to the latest version by running Update Qt SDK from the Qt SDK application folder on your computer. If you first time are getting started with Qt SDK, you can download 1.2 from our download page.

If you encounter problems, please file a bug report at http://bugreports.qt-project.org.

MWKN Weekly News for Monday, 30 Jan 2012

MeeGo Weekly News - 30 January, 2012 - 06:17
Front Page
Harmattan PR1.2 beta now available for N950

A beta release of the Harmattan 1.2 firmware has been released as a one-click flasher (OCF) for the N950 containing many bug fixes and some new features. Nokia's N9 Developer blog provides more details: "Harmattan 1.2 comes with a number of user experience improvements making it appealing for consumers. Five new supported languages, face recognition, enhanced copy-paste, software update notifications for applications and games in Nokia Store, folders in application view just to name a few."

"We have listed the most significant bug fixes in release notes and marked the fixed items in bugzilla. We excluded a long list of fixes e.g. on localization / terminology. Also, we put together information about known issues, limitations and differences between Nokia N950 developer Device and Nokia N9 for your convenience in the Release Notes. Suggest you read it carefully."

It should be noted that you cannot downgrade from 1.2 to 1.1 after install, and the default OCF installation wipes out all user data (music, photos, applications, etc). The actual new features and fixes are too numerous to list here, but the new font metrics will be of interest to most developers, and your editor's personal favourite is the colour schemes available in QML now.

In this edition (Download)...

  1. Front Page
    • Harmattan PR1.2 beta now available for N950
  2. Development
    • Version numbering of Harmattan explained
  3. Devices
    • Nokia N9 "may have sold 1.4m units last quarter"
  4. In the Wild
    • Nokia N9 up for People's Choice Award at Interaction Awards for its swipe UI
  5. Announcements
    • Widget system UI framework for N9 Harmattan
    • lpsmagic - system information on N9's standby screen

MWKN Weekly News for Monday, 23 Jan 2012

MeeGo Weekly News - 22 January, 2012 - 23:55
Front Page
SCaLE10x & Qt5

This past weekend's 10th annual Southern California Linux Expo, or SCaLE10x, was both fun and informative. There weren't any earth-shattering breakthroughs to behold, but it was interesting to witness how the open source world has embraced the idea of "the cloud." There are several companies activiely developing open source solutions for those who are investing in cloud computing in some regard. Likewise, it was nice to see a number surprising conference sponsors, like Facebook, HP, IBM, Media Temple, GoDaddy, and more.

For the most part, my time was spent volunteering at the Qt booth with fellow Maemo/Meego/Qt community member Niels Meyer, Nokia's Quim Gil, and a couple of other Qt Project employees. In fact, one of the best parts of the weekend was seeing Gil speak about Qt at an enlightening session in which a beautiful and fully functional UI was coded in about ten-minutes time, utilizing about 50 lines of QML. Other takealways were Qt5's goals as well as the increased level of community-contributed code added to Qt's core over the past several months. Most notably, Qt5's development cycle will freeze on February 4, launching the beta phase of the new version. The official release of Qt5 is expected sometime this summer (possibly in June).

So, what does Qt5 bring to the table for developers? Aside from a completely refactored code-base, Qt will be sporting native openGL, and will be using Wayland as its display server, rather than X server. But, keep in mind that Qt will still be able to switch between Wayland and X11 (and openGL or anything else for that matter), depending on the developer's preference.

One of the biggest draws on the expo floor was a Qt5 media player UI demo running on a Raspberry Pi. The demo (loaded on an SD card) was powered by the ARM-based board with 128 MB RAM, outputting to a full 1080p HD monitor. The UI was quick and responsive and possessed a ton of fancy eye candy - all being rendered in real-time on the GPU. Of course, the Qt booth had some other items of interest as well, such as the Nokia N9, an Android mobile phone showing off a bunch of Qt demos, and the Qt-driven Roku Streaming Player.

Lastly, it's important to add that many of the other exhibitors at the conference were intimately related to Qt in some way. KDE, FreeBSD, Disney Animation, ICS, and other all use Qt for their development purposes. Speaking of which, another volunteer at the Qt booth was a Qt community member and UI developer for the 3D animation and special effects studio Rhythm & Hues - one more company that uses Qt for all of their proprietary applications.

Whatever your opinion is about the direction of Nokia, or even former projects like Maemo and MeeGo, it was clear to see at SCaLE10x that the Qt Project isn't going anywhere anytime soon. innumerable people rely on the robust application UI framework that is Qt. This is true for both those who develop open source applications for Linux as well as plenty of others who use Qt for development within commercial and closed ecosystems. In thinking about the Qt timeline that Quim Gil showed during his information session, Qt5 is quite an exciting release indeed.

To view some photos of the Qt5 experience described in this article, click the TwitPic link below.



In this edition (Download)...

  1. Front Page
    • SCaLE10x & Qt5
  2. Development
    • DBUS sending of SMS on Harmattan?
    • Qt Quick Components on Fremantle
  3. Announcements
    • AGTL - offline geocaching for MeeGo 1.2 Harmattan

QFileSystemWatcher internals in Qt 5

Robin Burchell - 22 January, 2012 - 03:42
Just thought I'd share some details on some of the recent changes I've pushed to Qt 5 a few weeks ago. (Yes, this post is rather overdue, I've been a bit slack with writing it). If you were in Tampere when I gave a short, completely underprepared Q&A on Qt 5 a few days ago, this won't be news to you, but I will go into a bit more detail.

tl;dr, all in all, a lot of code was deleted, and things still function more or less the same, except a bit better. That's quite a common story for Qt 5, I hope... :)

First of all, platform support: as with Qt 5 itself, Symbian support is no longer a goal. Since I wanted to make some changes to internals, and wasn't able to even remotely come close to building the Symbian code, it was removed.

On Linux, the (ancient, and no longer used by default) dnotify backend also met its maker. Since inotify has been around for some 6-7 years, it was about time, especially as the dnotify backend had some interesting bugs in behaviour.

The OS X FSEvents backend (also unused for quite some time, due to bugs, and not being a recommended way of working apparently) joined to make for a trinity of dead implementations. OS X's watching is survived by kqueue, which it shares with BSD platforms.

The currently supported backends are:
  • inotify (on Linux)
  • kqueue (on BSD and OS X)
  • WaitForMultipleObjects on Windows, which I need to become more familiar with. Not having a Windows machine has meant that I'm not really able to do much here...
Aside from backend support, there were some more 'fun' changes which went in. First, some detail on implementation. Each QFileSystemWatcher has an 'engine' associated with it, which is backend-specific, and does the actual monitoring. The backend is responsible for communicating changes to the 'frontend' QFileSystemWatcher, which then sends the notifications to the API user.

In the past, QFileSystemWatcher engines used to be run in a thread. I'm not sure why this was done originally, but it pretty much never made much sense - monitoring file changes is not a particularly intensive operation, so this is just a waste of resources (thread stack, time to start the thread, etc) - which was compounded by this being a thread per engine, meaning that if you have a few different libraries monitoring files, they'd each start their own thread.

Another nasty side effect of this thread was resource consumption caused by monitoring. If you monitored a large number of paths, but couldn't consume events faster than the OS was throwing them at you, then that engine thread would happily sit there and keep on reading them and turning them into Qt signals for the QFileSystemWatcher/user code. But because that code was on a different thread, and unable to keep up, you'd just keep getting more, and more, and more signals, and memory usage would keep growing and growing.

This thread has now been removed, so changes are implicitly rate-limited to the thread the QFileSystemWatcher lives in, meaning that all of these are no longer a problem. Kudos should also go to Bradley Hughes for fixing a few issues which I missed on platforms other than Linux after it was integrated.

Brad also took this work a step further: QFileSystemWatcher has never been documented as being thread-safe, but the engines may have happened to be more or less thread-safe thanks to living on a different thread to the QFileSystemWatcher, through mutexing. One part inside Qt itself actually needed this for autotests to function correctly, too: QFileSystemModel. He fixed this requirement, and was thus able to remove the mutexes from the engines. Thanks!

I'd also like to thank Brad, João Abecasis, and anyone I've forgotten for helping to review these changes and get them integrated.

(One thing I neglected to mention above - the thread story is a little more complicated on Windows. Windows still has threads inside the engine (although the engine itself is no longer a thread, so there's still one less). This is necessary because WaitForMultipleObjects can only process up to MAXIMUM_WAIT_OBJECT handles at a time, unless you use multiple threads to do the monitoring, so that's exactly what it does. It spawns multiple threads on-demand as soon as it can't find a thread with a spare slot. But this is nothing new.)

Update and benchmark on the dynamic library proposals

Thiago Macieira - 19 January, 2012 - 07:17

My last blog on the dynamic libraries on Linux attracted over 15000 visits, which was quite unexpected (it’s 15x more than the usual traffic). It got linked from reddit and ycombinator and comments there and in the previous post have raised some interesting questions I’ll try to answer.

LD_PRELOAD

First, a quck background: LD_PRELOAD and /etc/ld.so.preload tell the dynamic linker to load a certain ELF module before the rest normal initialisation sequence. It’s preloaded before the rest of the modules, but after two important modules have been loaded: the executable itself and the dynamic linker. By itself, it means nothing at all about symbol hijacking. Its sole purpose is to load something. I have, for example, used it for loading a different binary of a library that a program required. That works fine.

Yes, it is little-known and little-used

If you complained that I said it’s little-known, you’re somewhat biased. If you complained, it’s because you knew about it, therefore you’re part of the minority that knows about it. Just think about it: there are millions of people directly using Linux today in the world. How many do you think know about this feature?

Even more so, think about how often:

  • LD_PRELOAD is used compared to running applications without it
  • LD_PRELOAD is used to load an ELF module compared to how many ELF modules are loaded by regular means
  • how many functions are interposed using LD_PRELOAD versus how many aren’t

The ratio is at least 1:1000 for a heavy user of the feature (like me!) in the best of the circumstances. It’s probably several orders of magnitude more than that for the average. Something that is used in one case in a million qualifies as little-used to me.

No, I wasn’t proposing to get rid of it (not entirely)

Some people suggested I was thinking of getting read of the preloading feature in exchange for a few cycles saved. I would still be in my right to suggest that, given the improvements and how often it is used, but I wasn’t. I’ve never proposed getting rid of the preloading feature and my proposal would not harm the most often used cases of interposition.

This requires a bit more explanation, so bear with me please.

Symbol interposition works by adding a symbol to the symbol table before the “rightful” symbol appears. The dynamic linker will resolve the symbol to the first occurrence it finds in the search order, so if you preload a library out of its order, its symbols will have higher priority than they would otherwise. The extreme case is when you preload a library or module that wouldn’t otherwise be loaded. But remember something I said before: preloaded modules are loaded after two others are loaded, so they don’t get the chance to interpose symbols defined by those.

If the executable performed a copy relocation on a data symbol, then LD_PRELOAD’ed modules cannot interpose those. For that reason, I am not counting interposition of data symbols as valid. In fact, in 14 years I’ve been hacking on Linux, I’ve never done that, so I guess the chances of that happening are a billion to one or even lower. What’s more, my proposal would do away with copy relocation, which may make data interposition a valid case.

The next important thing you must understand is that my proposal would do away with interposition of intra-library symbols, but not inter-library ones. My friend Michael Meek’s proposal of -Bdirect linking might, but even that proposal wouldn’t totally do away with it.

What do I mean by this? Intra-library means “within the same library,” while inter-library means “across libraries” (think of “Internet” vs “intranet”). My proposal was intended to improve binding of symbols inside one library because we can gain performance doing that without losing the Position-independent code and the advantages that come with it (like Address space layout randomisation). Specifically because we don’t want to lose the PIC support and we don’t want to go back to pre-ELF days and their problems (see Ulrich Drepper’s paper for some information on it), all inter-library symbol resolution would remain as-is, via PLTs and GOTs, including the ability to interpose symbols.

And here’s why I think we’re entitled to doing that: because you cannot do it anyway unless the library has been specifically designed to allow it, like glibc is. Let’s take the code from the last blog:

extern void *externalVariable; extern void externalFunction(void);   void myFunction() { externalFunction(); externalVariable = &externalFunction; }

And amend it like so:

void externalFunction(void) { }

If we compile this code with optimisation (GCC’s -O is enough) and inspect the assembly output, we can notice that both functions are present in the output but that myFunction does not call externalFunction. In other words, the compiler inlined one function into the other, even if the inline keyword was never added to it, and that expanded to zero code. With advances such as link-time optimisation, even moving the function to another compilation unit might not be enough to prevent the inlining.

That’s why I said that to support the case of intra-library symbol interposition, the library must be specifically designed to allow it, which is definitely still possible under my proposal. Most libraries aren’t designed like that and will never be, so I am confident that optimising for the greater majority of the libraries instead of the few is warranted (taking my system: I counted 3623 distinct libraries and plugins and I’m pretty sure none except libc and libpthread allow for interposition, so it’s probably a 1000:1 case again).

Benchmarks

Another important remark I saw in the comment threads was about the lack of benchmarks in my previous blog. Here they are.

Please note that “benchmark” means “comparison.” It does not imply “speed executing something.”

How I did it

I started by trying to find an executable I could run non-interactively, that executed a relatively CPU-intense activity and quit. That executable should be in my standard set of built executables, as I didn’t want to recompile the entire system. I settled on KDE’s kbuildsycoca4 with the options --noincremental --nosignal: it looks for all *.desktop files in the search paths and compiles a database for faster lookup, called the SYstem COnfiguration CAche. The options tell it to ignore existing databases and do it all, plus avoid signalling running applications over D-Bus to reload their settings.

The tests were run on my laptop, which is an Intel Core-i7-2620M, clocked at 2.6 GHz, with an SSD but no tmpfs temporary dir, with 2x32kB of L1 cache, 256 kB of L2 cache, 4MB of L3 cache and 4 GB of main RAM. I locked the CPU scaling governor to “performance” so the CPU was running at 2.6 GHz when the test starts and it soon goes over to turbo-mode and stays there (3.2 GHz). The system was not completely idle while running the test, but relatively so. To try and avoid other problems, the native benchmarks were run under the FIFO real-time scheduler, with a single processor of affinity. The tests were run in 64-bit mode and were run “warm”: I ran the benchmark first after any recompilation and discarded the results.

I did four sets of tests, as follows:

  1. The first, the baseline, was a regular build on my system, with no change to default KDE 4 build options or to Qt 4.8′s.
  2. The second was modified by adding -Bsymbolic-functions to the five KDE libraries and six Qt libraries used by the program
  3. The third was modified by replacing -Bsymbolic-functions with -Bsymbolic and recompiling the same 11 libraries
  4. Finally, on the fourth, in addition to keeping -Bsymbolic, I made all symbols exported from those 11 libraries have protected visibility. This required surprisingly few modifications to them, as they were more-or-less ready to be built on Windows too. Each library already has a XXXX_EXPORT macro associated because of the “hidden” visibility support, which right now expands to __attribute__((visibility("default"))). Moreover, the buildsystem for those library already defines a specific macro only during their builds. So it was easy to ensure that #ifdef that macro from the buildsystem, the XXXX_EXPORT macro should instead expand to __attribute__((visibility("protected"))), otherwise it should remain unchanged.

Each set of tests consisted of:

  • Run Ulrich Drepper’s relinfo script on the 11 libraries and tally up the types of relocations
  • Run Valgrind’s cachegrind tool with branch-prediction and the cache sizes set to match my machine
  • Run the perf stat tool to gather hardware counters. Each run of the tool reported the average of 10 runs of kbuildsycoca4, all run under FIFO real-time scheduler. After the first warm-up run, I chose the best of 3 runs in quick succession

The raw results I collected you can download from here (that also includes results with LD_BIND_NOW=1).

Results

First of all, I went into these benchmarks fully expecting that nothing would be visible in the performance benchmarks. It’s clear that these are micro-optimisations, so in a fairly large program they should be drowned out by inefficiencies in other parts. Also, considering that my system wasn’t completely idle when running the CPU benchmarks, the numbers have a degree of noise which could hide the faint results. The results have, however, shown a few clear improvements.

Here’s what I found:

  • Relocations: relocations are work that the dynamic linker must do either at load-time (non-PLT relocations) or during run-time (PLT). Reducing or simplifying relocations improves start-up and run-time performance.
    • The number of non-PLT relocations drops by 2.65% with protected visibility: that was expected because the linker options affect only the PLT. To change the non-PLT relocation count, a change to the compilation was necessary.
    • The number of relative relocations doubles with the linker options: that was also expected, because the linker can bind the relocation to the symbol that is inside the library being linked. Instead of referring to the symbol by its name and triggering a full look-up, a relative relocation simply records how many bytes past a fixed mark (the load address) the relocation should be, which is much simpler to execute. The number increases again with -Bsymbolic compared to -Bsymbolic-functions because the linker can bind non-functions too. The number dropped with protected visibility, but by less than the number of total relocations removed.
    • The number of PLT entries is one-third of the original because the linker can make intra-library function calls directly instead of going through the PLT stub. Each PLT entry corresponds to 8 bytes in the .got.plt section and 16 bytes of stub, which means this reduction saved as many as 15571 relocations and as much as 373 kB of memory size. This is confirmed by the count of PLT entries used for local symbols, which drops to nearly zero. The number isn’t exactly zero because both QtCore and QtGui have been prepared for 5 of its symbols to be interposed when built with -Bsymbolic-functions, a preoccupation I didn’t take into account in the protected visibility work because it wasn’t relevant.
        Note that there must have been an error with the -Bsymbolic builds because two libraries had a higher PLT count than they should. I have not investigated whether this was a a mistake on my part or a bug in the linker.
  • Valgrind results: valgrind executes the program in a simulated CPU, which on one hand means we get consistent results independent of what CPU I run this in and how idle or busy my system was, but on the other hand may or may not reflect reality (YMMV).
    • Instruction count decreases slightly by 0.9%, 1.1% and 1.2%
    • Data accesses to L1 data cache decreases slightly by 1.4%, 1.6% and 2.1%
    • Last-level cache references decrease by 7% while the LL cache miss rate remains constant, probably because there are fewer instructions executed, fewer data accesses and a slightly improvement in L1D miss rate
    • Number of indirect branches executed drops by 22%
    • The indirect branch misprediction rate drops considerably from 22% in the original to 16% with just the linker options and 8.8% with the protected visibility, while the overall branch misprediction rate drops from 4.7% to 4.3% and then to 4.1%. With 2.9 million fewer mispredicted branches, at a 20-cycle misprediction penalty, that’s 57 million cycles saved.
  • Perf results: perf uses hardware counters from the CPU to do its bidding, but it is subject to scheduling issues. The kbuildsycoca4 program does context-switch in its execution because it tries to verify with the D-Bus daemon if another instance isn’t already running. Moreover, this program is I/O intensive, meaning it makes a lot of system calls, which is why I let the benchmarks run with a “warm” system cache. Unlike the Valgrind results, there’s a great deal of noise and error in the numbers from perf because they represent an actual CPU.
    • There’s a roughly 3% overall performance improvement as measured by the execution time. The noise in the number doesn’t show which solution is best, but it shows that all three are better than the unmodified library code.
    • There’s a 3 to 4% improvement in number of cycles required to complete the operation. Unfortunately, the numbers are showing performance decreasing as I optimise more, which is counter-intuitive and I cannot explain (noise or real mis-optimisation). I think my machine was slightly less idle on the last test set, as the last results I got showed a much worse performance with a much bigger standard deviation.
    • There’s roughly 3% improvement in the number of instructions executed, which is similar to the reduction in cycles, but also shows that more instructions are executed per cycle with the optimisations. I cannot say why exactly it is, but I imagine it’s because of reductions in branching, branch misprediction and cache misses. The calculation of instructions per cycle shows improvement in two of the three benchmarks by close to 1%.
    • Branches executed reduce by 4 to 5% but the reduction is in the opposite order of the number of branches I know are in the code, which means there was a considerable amount of noise in this test. Another similar metric shows a roughly 5% improvement in branch loads.
    • The rates of cache misses and branch mispredictions remain more or less constant, which coupled with the number of branches reducing means we have an improvement in performance due to fewer absolute mispredictions happening. I cannot conclude anything about a reduction in cache references because the numbers varied too much.
        This is supported by the calculation of cycles gained in the reduction of branch misprediction. The SandyBridge architecture has a 20-cycle penalty for branch misprediction, so if we calculate how many cycles were lost in each benchmark due to mispredicted branches and subtract from the original, we get roughly 6 million cycles gained (0.24% of the total), which is in the same order as the improvement in instruction throughput (instructions per cycle).
Conclusions

The numbers are fairly small, as was expected, since we’re talking about micro-optimisations. However, three distinct benchmarks have shown with a reasonable degree of confidence that there’s a performance improvement in the order of 3% (execution time, cycle count and instruction count, and that’s reasonable to me, with the limited sample size I had). That’s more or less what I hoped to see, but much more than I expected to be able to show.

Another important aspect is that this was a non-GUI testcase, even though by virtue of library dependencies, both QtGui and kdeui libraries were present. Note how the two libraries have, together, 45824 relocations and 14708 PLT entries in the original library set, which corresponds to 73.3% and 62.4% of the total relocations in play respectively, as well as 65% of the PLT entries for local symbols. The number of relocations is indicative also of the size of the code in those libraries. But since the application isn’t a GUI one, that code is mostly not executed.

If we consider that the problem of cache misses increases with code size (and the cache miss rate could increase too, compounding the effect) and that of cycles lost due to mispredicted branches increases with the number of branches unless the misprediction ratio drops (which the benchmarks have shown to remain stable), we can expect that a GUI application could gain even more in performance due to these improvements. That’s difficult to prove however in a GUI application, so we’ll have to stay with just the theoretical exercise.

In all, I still think this is warranted. The drawbacks are fairly minor: the interposition of symbols is rarely used already, interposition of symbols in intra-library lookups close to non-existent in libraries that aren’t designed to do that. All we need to do now is change the status-quo, which is probably the hardest part.

Who will support me?

MWKN Weekly News for Monday, 16 Jan 2012

MeeGo Weekly News - 16 January, 2012 - 08:30
Front Page
Community Council meeting: time to fold Harmattan back into maemo.org?

A Maemo Community Council meeting took place Thursday last week, with RM Bauer and Momcilo Majic from the council; Niels Breet from Nemein and Matti Airas from Nokia.

Although no firm policy decisions were made, some discussion about Bugzilla upgrades (3.4, which bugs.maemo.org runs, is going EOL) and Downloads repository issues was had.

The interesting bits cropped up with Rob's objection to apps.formeego.org moving to the maemo.org infrastructure. Niels Breet highlighted that moving off meego.com "this quarter" was sensible; and Matti Airas expanded on that:

"we might start to promote maemo.org as the backup for meego.com as the latter will be going away pretty soon. we might start to promote maemo.org as the backup for meego.com as the latter will be going away pretty soon. and with that move (and with apps.formeego.org using maemo.org facilities in the future) I don't see maemo.org being shut down any time soon. but that's not a promise."

Re-reading the discussion, it seems there may have been a communication problem - with both Matti and Rob talking, presumably, about the Harmattan aspects of meego.com; rather than the defunct netbook and tablet sections which Nokia has no interest in.

In your editor's opinion, this would be a good move to solve the fragmentation issues which Thomas Perl has raised recently. Obviously such a move would be need to coordinated carefully, but the opportunity could be taken to drop the antiquated bits of maemo.org (e.g. Brainstorm) and consolidate under-the-covers technology around Downloads/Packages/AppsForMeego.

Unfortunately, participation ahead of time wasn't possible due to poor communication about the meeting happening ahead of time. A follow-up meeting is going to be scheduled within the next few weeks to discuss the real policy issues that were only touched on in last weeks meeting. Hopefully we'll know ahead of time this time.

In this edition (Download)...

  1. Front Page
    • Community Council meeting: time to fold Harmattan back into maemo.org?
  2. Development
    • Aegis "open mode" discussion for Harmattan moves to Talk
    • PR1.2 beta release for N950 coming soon
    • SDL and PyGame available for MeeGo 1.2 Harmattan
  3. Community
    • Spam comments on the maemo.org wiki
  4. Announcements
    • Command-line/arbitrary service sharing for Harmattan
    • TV-out control for Nokia N9 and N950

Sorry state of dynamic libraries on Linux

Thiago Macieira - 16 January, 2012 - 07:12

Last week, we identified a bug in Qt with Olivier‘s new signal-slot syntax. Upon further investigation, it turns out it’s not a Qt issue, but an ABI one. Which prompted me to investigate more and decide that dynamic libraries need a big overhaul on Linux.

tl;dr (a.k.a. Executive Summary)

Shared libraries on Linux are linked with -fPIC, which makes all variable references and function calls indirect, unless they are static. That’s because in addition to making it position-independent, it makes every variable and function interposable by another module: it can be overridden by the executable and by LD_PRELOAD libraries. The indirectness of accesses is a performance impact and we should do away with it, without sacrificing position-independence.

Plus, there are a few more actions we should take (like prelinking) to improve performance even further.

Jump to existing or proposed solutions, Google+ discussion.

Details

Note: in the following, I will show x86-64 64-bit assembly and will restrict myself to that architecture. However, the problems and solutions also apply to many other architectures, like x86 and ARM, which should make you consider what I say. The only platform that this mostly does not apply to is actually IA-64.

The basics

Imagine the following C file, which also compiles in C++ mode:

extern void *externalVariable; extern void externalFunction(void);   void myFunction() { externalFunction(); externalVariable = &externalFunction; }

The code above demonstrates three features of the languages in one function: it loads the address of a function, it calls a function and it writes to a variable. The compiler does not know where the function and variable are: they might be in another .o file linked into this ELF module or they might be in another ELF module (i.e., a library) this module links to.

This compiler produces the following assembly output (gcc 4.6.0, -O3):

call externalFunction movq $externalFunction, externalVariable(%rip)

This assembly snippet is making use of two symbols whose values the assembler does not know. When assembled, the assembler produces a .o with three relocations. This GCC has produced the most efficient and most compact compilation of the code I wrote.

When we link this .o into an executable, we start to see the drawbacks. The first is that both instructions need to encode, in their bits, the values of the symbols whose values we didn’t know. So the linker must somehow fix this. It fixes the call instruction by making it call a stub or a trampoline, which jumps to the actual address. This stub is placed in a separate section of code called the Procedure Linkage Table (PLT). The contents of the PLT stub is not that important, but suffice to say that it is an indirect jump.

The movq instruction cannot be fixed. There’s simply no way, because it writes a constant value to a constant location, directly. Even if we allowed for the instruction or a pair of instructions wide enough to write any 64-bit value to any variable in the 64-bit space, we still have a problem: those values are not known at link time. So instead of fixing the instruction, the linker “fixes” the values. For the address of externalFunction, it uses the address of the PLT stub it created in the previous paragraph. For the externalVariable variable, tt will create a copy relocation, which means the dynamic linker will need to find the variable where it is, copy its value to a fixed location in the executable and then tell everyone that the variable is actually in the executable.

What are the consequences of this? For the PLT call, it’s a simple performance impact which could not be avoided. Since the address of the actual externalFunction function is not known at compile and link-time, and we don’t want to leave a text relocation, the only way to place that call to find the address at run-time and indirectly call it.

For the copy relocation, the consequences for the executable are small. The code it will execute is still the most efficient and most compact. The dynamic linker will have to find where the symbol actually is at load-time, which is something that it would have to do anyway, plus copy its contents, checking that the size hasn’t changed. This is done only once, then the code runs in its most efficient form.

The fact that we resolved &externalFunction to the address of the PLT stub means that any use of that function pointer (an indirect call) will end up in a function that does an indirect call too. That is, it’s a doubly-indirect call. I seriously doubt any processor can do proper branch prediction, speculative execution, and prefetching of code under those circumstances.

It gets worse

So far we’ve analysed what happens in an executable. Now let’s see what happens when we try to build the same C code for a shared library. We do that by introducing the -fPIC compiler option, which tells the compiler to generate position-independent code. The compiler produces the following assembly output:

call externalFunction@PLT movq externalFunction@GOTPCREL(%rip), %rdx movq externalVariable@GOTPCREL(%rip), %rax movq %rdx, (%rax)

When assembled, the .o still contains three relocations, albeit of different type.

When we compare the output of the position-dependent and the position-independent code, we notice the following:

  1. The call is still a call, but now we’re explicitly calling the PLT stub. This might seem irrelevant, since the linker would have fixed the call anyway to point to the PLT if it had to, but isn’t.
  2. The single movq instruction was split in three. This is required by the x86-64 processor, since the instruction set cannot encode a 64-bit value and the 64-bit address to store it in the same instruction (such instruction would be at least 17 bytes long, which 2 two bytes longer than the maximum instruction length).
  3. The values for the two symbols are loaded indirectly. Instead of encoding the two values in those two middle movq instructions, the compiler is loading the values from another linker-generated structure called the Global Offset Table (GOT).

The compiler needed to generate the code above since it doesn’t know where the symbols will actually be. As was the case before, those symbols can be linked into the same ELF module as this compilation unit, or they may be found elsewhere in another ELF module this one links to.

Moreover, the compiler and linker need to deal with the possibility that an executable might have done exactly what our executable in the previous section did: create a copy relocation on the variable and fixed the address of the function to its own PLT stub. In order to work properly, this code must deal with the fact that its own variable might have ended up elsewhere, and that &externalFunction might have a different value.

That means the indirect call through the PLT and the three movq instructions remain, even if those two symbols were in the same compilation unit!

The problem is that even if at first glance you’d think that the compiler should know for a fact where those symbols are, it actually doesn’t. The -fPIC option doesn’t enable only position-independent code. It also enables ELF symbol interposition, which is when another module “steals” the symbol. That happens normally by way of the copy relocations, but can also happen if an LD_PRELOAD’ed module were to override those symbols. So the compiler and linker must produce code that deals with that possibility.

In the end, we’re left with indirect calls, indirect symbol address loadings and indirect variable references, which impact code performance. In addition, the linker must leave behind relocations by name for the dynamic linker to resolve at load-time.

All this for the possibility of interposition?

Yes, it seems so. The impact is there for this little-known and little-used feature. Instead of optimising for the common-case scenario where the symbols are not overridden, the ABI optimises for the corner case.

Another argument is that the ABI optimises for executable code, placing the impact on the libraries. The argument is valid if the executables are much larger and more complex than the libraries themselves. It’s valid too if we consider that application developers write sloppy code, whereas library developers will write very optimised code.

I don’t think that argument holds anymore. Libraries have got much more complex in the past 10-15 years and do a lot more than they once did. They are not mere wrappers around system calls, like libc 4 and 5 were on Linux in the late 90s. Moreover, if we consider that the rise of interpreted languages, like Perl, Python, Ruby, even QML and JavaScript, the code belonging to the ELF executables is negligible. Compare the size of the executables with the libraries that actually do the interpretation:

-rwxr-xr-x. 2 root root 13544 Aug 5 06:27 /usr/bin/perl -rwxr-xr-x. 2 root root 9144 Apr 12 2011 /usr/bin/python -rwxr-xr-x. 1 root root 5160 Dec 29 13:46 /usr/bin/ruby -r-xr-xr-x. 1 root root 1763488 Apr 12 2011 /usr/lib64/libpython2.7.so.1.0 -rwxr-xr-x. 1 root root 947736 Dec 29 13:46 /usr/lib64/libruby.so.1.8.7 -rwxr-xr-x. 1 root root 1524064 Aug 5 06:27 /usr/lib64/perl5/CORE/libperl.so

That’s even valid for interpreters that JIT the code. As optimised as the code they generate can be, current understanding is that operations with critical performance are implemented in native code, which means libraries or plugins.

Existing solutionsPartial solution for private symbols

When developing your library, if you know that certain symbols are private and will never be used by any other library, you have an option. You can declare their ELF visibility to be “hidden”, which has two consequences. The clear one is that the linker will not add the hidden symbols to the dynamic symbol table, so other ELF modules simply cannot find them. If they can’t find them, they can’t steal them. And if they can’t steal them, the linker does not need to produce a PLT stub for the function call, so the call instruction will be linked to a simple, direct call as the executable in the first part had been.

The other consequence is an optimisation that the compiler does. Since it also knows that the externalVariable variable cannot be stolen, it does not need to address the variable indirectly. The generated assembly becomes:

call externalFunction@PLT movq externalFunction@GOTPCREL(%rip), %rax movq %rax, externalVariable(%rip)

The .o file will still contain three relocations. However, note how the getting of the address of the externalFunction function is still done indirectly, even though the compiler knows it cannot be interposed. That means the linker will still generate a load-time relocation for the dynamic linker, to get the address of that function. Fortunately, it’s a simpler relocation since the symbol name itself is not present.

If there’s a reason for getting the address indirectly like this, I have yet to find it.

Partial solution for public non-interposable symbols

If your symbols are public, however, you cannot use the ELF “hidden” visibility trick. But if you know that they cannot and will not ever be stolen or interposed, you have another possibility, which is to tell that to the compiler and linker.

If you declare a variable with ELF “protected” visibility, you’re telling the compiler and linker that it cannot be stolen, yet can be placed in the dynamic symbol table for other ELF modules to reference. You just have to be absolutely sure that they will not ever be interposed, because that will create subtle bugs that are hard to track down. That includes access to those symbols by position-dependent executable code, like we did in the first section.

The GCC syntax __attribute__((visibility("protected"))) works in ELF platforms only, whereas the one with the “hidden” keyword is known to work in non-ELF platforms too, like Mac OS X (Mach-O) and IBM AIX (XCOFF).

Another way to do the same is to use one of two linker options: -Bsymbolic and -Bsymbolic-functions. They do basically the same as the protected visibility: they keep the symbols in the dynamic symbol table, but they make the linker use the symbol inside the library unconditionally. The difference between those two options is that the former applies to all symbols, whereas the latter applies to functions only.

The reason why -Bsymbolic-functions exists requires looking back at the executable code from the first section. While the variable reference required a copy relocation, the function call was done indirectly, through the PLT stub. A variable can be moved, but moving code isn’t possible, so the executable code needs to deal with the code being elsewhere anyway. For that reason, it’s possible to symbolically bind function calls inside a library without affecting executables.

Or so we thought. The problem we discovered last week deals with a situation of when you treat a function as a data reference: taking its address. As we saw on the first part, the linker will resolve the address of the function to the address of the PLT stub found in the executable. But if you symbolically bind the function in the library, it will resolve to the real address. If you try to compare the two addresses, they won’t be the same.

Proposed solutions

Some of the solutions I propose are ABI and binary compatible with existing builds; some others are ABI incompatible and would require recompilation. Unfortunately, the best solution would require source-incompatible changes. Still, all the changes below are giving a bit of optimisation to libraries by making executables less optimised.

Use of PLT in function calls should rest only with the linker

As we saw in the code generated for the library, with -fPIC, the compiler decided to make the call indirectly by adding “@PLT” to the symbol name. Turns out that the linker doesn’t really care about this and will generate (or not) the PLT stub if needed. If that’s the case, the compiler should not make a judgement call about where the symbol is located just because of -fPIC.

Function addresses should always be resolved through the GOT

Function calls already require a pointer-sized variable somewhere and a relocation to make it point to the valid entry point of the function being called. What’s more, taking addresses of functions is a somewhat rare operation, compared to the number of function calls across ELF modules.

That being the case, we can take a small “hit” in performance and the loading of a function address should happen via the GOT in position-dependent code (executables) just like it is done for position-independent code.

The benefit of doing this is that the function address we load will point to exactly function’s real entry point, instead of the PLT stub. When we call this function, we avoid the doubly-indirect branching we found earlier.

PLT stubs should use the regular GOT’s address, if it exists

If a given function is both called and its address is taken, the PLT stub should reference GOT entry that was used for the taking of the address. The reason why it isn’t already so, I guess, is because the entries in the .got.plt section aren’t initialised with the target function’s address, but the local module’s function resolver. This trick allows for the “lazy resolution” of functions: they are resolved only the first time they are called.

I wouldn’t ask for all functions to be resolved at load-time, but if the address of the function is taken anyway, the dynamic linker will need to resolve it at load time. So why waste CPU cycles in a function call if the address was computed already?

Copy relocations should be deprecated

Instead of copying the variable from the library into the executable, executables should use indirect addressing for reading variables and writing to them, as well as taking their addresses. One benefit of doing this is avoiding the actual copying. For example, for read-only variables, they may remain in read-only pages of memory, instead of being copied to read-write pages found in the executable.

The big drawback of this is that the indirect addressing is a lot more expensive, since it requires two memory references, not just one. The next suggestion might help alleviate the problem.

The linker should relax instructions used for loading variable addresses

This is a suggestion found in the IA-64 ABI: the compiler generates the instructions needed to load the address of the variable from the GOT, then use it as it needs to. If the linker concludes (by whichever means, like protected or hidden symbols, the use of one of the symbolic options, or because this is an ELF application and the symbol is defined in it) that the symbol must reside in the current ELF module, it can change the load instruction into a register-to-register move or similar.

For our x86-64 64-bit case, the instructions the compiler generated were:

movq externalVariable@GOTPCREL(%rip), %rax movq %rdx, (%rax)

By changing one bit in the opcode of the first instruction, with no code size change, we can produce:

leaq externalVariable@GOTPCREL(%rip), %rax movq %rdx, (%rax)

The x86 instruction “LEA” means “Load Effective Address”. Instead of loading 64 bits from the memory address externalVariable@GOTPCREL(%rip) and storing them in the register, that instruction the address it would have loaded from in the register. This isn’t as optimised as the original code found in the executable for two reasons: it requires two instructions instead of just one and it requires an additional register.

It’s possible to generate an even more efficient code if the assembler leaves a 32-bit immediate offset in the second movq instruction, making it 6 bytes long. This extra immediate would be of no impact in the original code, besides making it longer, but it would allow the linker to optimise the code further:

The original would be:

movq externalVariable@GOTPCREL(%rip), %rax movq.d32 %rdx, 0x0(%rax)

And it would get relaxed to:

nopl.d32 0x0(%rax) movq %rdx, externalVariable@GOTPCREL(%rip)

That is, the first 6-byte instruction is resolved to a 6-byte NOP, whereas the second 6-byte instruction executes the actual store, with no extra register use. The compiler cannot know that the register will be left untouched, but at least there is no dependency between the two instructions that might cause a CPU stall.

The same applies to other architectures too. The full -fPIC code on ARM to store a value from a register into a variable is the following:

ldr r3, .L2+8 @ points to a constant whose value is: externalVariable(GOT) .LPIC1: ldr r3, [r4, r3] @ r4 contains the base address of the GOT str r2, [r3, #0]

If the linker can conclude the symbol must be in the current ELF module and cannot change, it may be able to avoid the extra load (the middle instruction) by changing the code to be:

ldr r3, .L2+8 @ points to a constant whose value is: externalVariable-(.LPIC1-8) .LPIC1: add r3, pc, r3 str r2, [r3, #0]

Unlike x86, the ARM instructions cannot be optimised further, since the immediates encodable in the instructions have limited range.

The linker should relax instructions used for loading function addresses

Similar to the above, but instead looking at function addresses. The original library code is:

movq externalFunction@GOTPCREL(%rip), %rdx

But it can be relaxed to:

leaq externalFunction(%rip), %rdx

With ARM, the original code is:

ldr r3, .L2+8 @ points to a constant of value: externalFunction(GOT) ldr r2, [r4, r3] @ r4 contains the address of the base of the GOT

But relaxed, it would be:

ldr r2, .L2+8 @ points to a constant of value: externalFunction-(.LPIC0+8) .LPIC0: add r2, pc, r2
There should be a way to tell the compiler where the symbol is

We’re already able to tell the compiler that a symbol is in the current module, with the hidden visibility attribute. We should be able to tell the compiler that we know that the symbol is in the current module but exported as well as that we know that the symbol is in another module.

I would suggest simply using the existing ELF markers and being explicit about them:

  • __attribute__((visibility("hidden"))): symbol is in this ELF module and is not exported (equivalent on Windows: no decoration);
  • __attribute__((visibility("protected"))): symbol is in this ELF module and is exported (equivalent on Windows: __declspec(dllexport));
  • __attribute__((visibility("default"))): symbol is in another ELF module (equivalent on Windows: __declspec(dllimport)); this also applies to symbols that must be overridable according to the library’s API (like C++’s global operator new).

Considering the other suggestions, we know the references to symbols with “default” visibility can be relaxed into simpler and more efficient code in the presence of one of the symbolic binding options. That means we can use the “default” visibility for cases of uncertain symbols.

Getting there

Some of the solutions I listed are already possible and they should be used immediately in all libraries. That is especially true about the use of the hidden visibility: all libraries, without exception, should make use of this feature. In fact, since this option was introduced in GCC 4.0 seven years ago, many libraries have started using it and are now “good citizens”, for they access their own private data most efficiently, they don’t have huge symbol tables (which impact lookup speed) and they don’t pollute the global namespace with unnecessary symbols.

Other solutions are not possible to implement yet. The solution I personally feel is most important to be implemented first is that of the ELF executables: they need to stop using copy relocations and they should resolve addresses of functions via the GOT. Only once that is done can libraries start using the “protected” visibility and generate improved code. This implies changing the psABI for the affected libraries, which may not be an easy transition.

An alternative to using the “protected” visibility is to use the symbolic binding options. The code relaxation optimisations would come in handy at this point to optimise at link-time the code that the compiler could not make a decision on. Unfortunately, those options apply to all symbols in a library, so libraries that must have overridable symbols need to use an extra option (--dynamic-list) and list each symbol one by one.

Using -fPIE

The compiler option -fPIE tells the compiler to generate position-independent code for executables. It is similar to the -fPIC option in that it generates position-independent code, but it has the added optimisation that the compiler can assume none of its symbols can be interposed.

With executables compiled with this option, copy relocations and direct loading of function addresses aren’t used. This solves the problem we had. Therefore, compiling executables with this option allows us to start using some of the optimisations I described before.

Unfortunately, as its description says, this option also generates position-independent code, which can be less efficient than position-dependent code in some situations. My preference would be to have position-dependent code executables without the copy relocations. However, there’s an added, side-effect of this option: it defines the __PIC__ macro, whose absence can be used to abort compilations for libraries that have transitioned to the more efficient options.

Further work and further reading

I highly recommend Urlich Drepper’s “How to Write Shared Libraries” paper. His recommendations did not go as far as suggest changing the ABI like I have, but he has many that library developers should adhere to, regardless of whether my recommendations are accepted or not. For example, using static functions and data where possible and avoiding arrays of pointers are recommendations I have made to many people.

Other work necessary is to improve prelinking support. Shared libraries are position-independent, but they can be prelinked to a preferred location in memory. One optimisation I have yet to see done is to use the read-only pages of prelinked data when the library is loaded at that preferred address (the .data.rel.ro sections).

MWKN Weekly News for Monday, 9 Jan 2012

MeeGo Weekly News - 8 January, 2012 - 23:59
Front Page
Apps for MeeGo - how to use, submit & help evaluate applications

Niels Breet has posted an introduction to "Apps for MeeGo" for users, developers and people willing to test apps:

"We have been working on apps.formeego.org for a while. The idea is to have a community driven Apps catalog for open source applications. Created by the people who also contributed to maemo.org Downloads (More than 100M downloads and counting!), many of the concepts born there were brought along."

"This site includes a community driven QA part, where you can test apps and fill in a simple score card about the app. Once a certain amount of positive reports have been made, the app will automatically go to the stable Apps site. Apps will also go through some automated tests, so we can prevent broken applications from entering the repositories."

Unfortunately, the site and processes weren't in place for the N9 launch. This has meant the Nokia Store has become the default place for developers wishing to ship applications for the N9 (and N950). Discoverability of applications is also easier with Nokia Store for users; with no central Application Manager on Harmattan, users have to go to a specific client to see the apps available to them.

As touched upon by Thomas Perl last week, fragmentation of the N9 experience is a big problem for a niche platform - one it can ill afford. The extra overhead for developers of targetting the mainstream Store, updating meta-data sites like n9-apps and also dealing with OBS for Apps for MeeGo is something your editor, as a developer, does not look forward to. Metrics such as download counts will also be fragmented, giving developers - and users - inconclusive statistics.

Hopefully, Apps for MeeGo will succeed - but your editor can't help feeling it might be too late. Especially since there won't be any other MeeGo devices for which it could host content.

In this edition (Download)...

  1. Front Page
    • Apps for MeeGo - how to use, submit & help evaluate applications
  2. Applications
    • mplayer for Harmattan
  3. Development
    • Font metrics change in Harmattan part 3 - designing truly flexible UI layouts
  4. Devices
    • Maemo devices in movies

Android vs. Maemo power management: static vs. dynamic

Felipe Contreras - 3 January, 2012 - 15:10

Some of you might have heard about Google’s Android team proposal to introduce wakelocks (aka suspend-blockers) to the Linux kernel. While there was a real issue being solved in the kernel side, the benefits on the user-space side were dubious at best, and after a huge discussion, they finally didn’t get in.

During this discussions the dynamic and static power management were described and discussed at length, and there was a bit of talk about Maemo(MeeGo) vs Android approaches to power management, but there was so much more than that.

Some people have problems with the battery on Android devices, for some people it’s just fine, some people have problems with the Maemo, other don’t, so in general; your mileage might vary. But given the extremely different approaches, it’s easy to see in which cases you would have better luck with Maemo, and in which with Android–Although I do think it’s obvious which approach is superior, but I am biased.

An interesting achievement was shared by Thiago Maciera, who managed to get ‘5 days and a couple of minutes‘ out of the Nokia N9 while traveling, and actually using it–and let’s remember this is a 1450 mAh battery. Some Android users might have trouble believing this, but hopefully this blog post would explain what’s going on.

So lets go ahead and explore the two approaches.

Dynamic Power Management

Perhaps the simplest way to imagine dynamic power management, is the gears of a manual transmission car. You go up and down depending on how much power does the system actually needs.

In some hardware, such as OMAP chips, it’s possible to have quite a lot of fine control on the power states of quite a lot of devices, plus different operating power points on the different cores. For example, it might be possible to have some devices, such as the display on, and active, some other devices partially off, like speaker, and other completely off, like USB. And based on the status of the whole system, whole blocks can be powered off, other with low voltage levels, etc.

Linux has a framework to deal properly with this kind of hardware, the runtime power management, that originally came from the embedded world, and a lot from OMAP development, but is now available to everyone.

The idea is very simple; devices should sleep as much as possible. This means that if you have a sound device that needs chunks of 100ms, and the system is not doing anything else but playing sound, then most of the devices go to sleep, even the CPU, and the CPU is only waken up when it needs to write data for the audio device. Even better is to configure the sound device for chunks of 1 second, so the system can sleep even more.

Obviously, some co-operation between kernel and user-space is needed. Say, if you have an instant messenger program that needs to do work every minute, and a mail program that is configured to check mail every 10 minutes, you would want them to do work at the same time when they align at every 10 minutes. This is sometimes called IP heartbeat; the system wakes up for a beat, and then immediately goes back to sleep. And there are kernel facilities as well, such as range timers.

All this is possible thanks to very small latencies required for devices to go to sleep and wakeup, and have intermediary modes (e.g. on, inactive, retention, off), so, for example a device might be able to go to inactive mode in 1ms, retention in 2ms, and off in 5ms (totally invented numbers). Again, the more sleep, the better. Obviously, this is impossible on x86 chips, which have huge latencies–at least right now, and it’s something Intel is probably trying to improve effusively. All these latencies are known by the runtime pm framework in the kernel, and based on that it and the usage, it figures out what is the lowest power state possible without breaking things.

Note I’m not a power management expert, but you cant watch a colleague of mine explain the OMAP 3 power-managment on this video:

Advanced Power Management for OMAP3

And there’s plenty of more resources.

Update: That was the wrong link, here are the resources.

Static Power Management

Static power management has two modes: on and off. That’s it.

OK, that’s not exactly the case in general, but it is in the Android context; the system is either suspended, or active, and it’s easy to know in which mode you are; if the screen is on, it’s active, and if it’s off; it’ is suspended (ideally).

There’s really not much more than that. The complexity comes from the problem of when to suspend; you might have turned off the display, but there might be a system service that still needs to do work, so this service grabs a suspend blocker which, as the name suggests, prevents the system from suspending (until the lock is released). This introduces a problem; a rouge program might grab a ‘suspend blocker’ and never release it, which means your phone will never suspend, and thus the battery would drain rather quickly. So, some security mechanisms are introduced to grant permissions selectively to use suspend blockers.

And moreover, Android developers found race conditions in the suspend sequences in certain situations that were rather nasty (e.g. the system tries to suspend at the same time the user clicks a button, and the system never wakes up again), and these were acknowledged as real issues that would happen on all systems (including PC’s and servers, albeit rarely, because they don’t suspend so often), and got fixed (or at least they tried).

Versus

First of all, it’s important to know that if you have dynamic pm working perfectly, you reach exactly the same voltage usage than static pm, so in ideal cases they both behave exactly the same.

The problem is that it’s really hard for dynamic pm to reach that ideal case, in reality systems are able to sleep for certain periods of time, after which they are woken up, often times unnecessarily, and as I already explained; that’s not good. So the goal of a dynamic pm system is to increase those periods of time as much as possible, thus maximizing battery life. But there’s a point of diminished returns (read this or this for expert explanations), so, if the system manages to sleep 1s in average, there’s really not much more to gain if it sleeps 2s, or even 10s. These goals were quite difficult to achieve in the past (not these, I invented those numbers), but not so much any more thanks to several mechanisms that have been introduced and implemented through the years. So it’s fair to say that the sweet spot of dynamic pm has been achieved.

This means that today a system that has been fine-tuned for dynamic pm can reach reach a decent battery life compared to one that uses static pm in most circumstances. But for some use-cases, say, you leave your phone on your desk and you don’t use it at all, static pm would allow it to stay alive for weeks, or even months, while dynamic pm can’t possibly achieve that any time soon. Hopefully you would agree, that nobody cares about those use-cases were you are not actually using the device.

And of course, you only need one application behaving badly and waking up the system constantly, and the battery life is screwed. So in essence, dynamic pm is hard to achieve.

Android developers argued that was one of the main reasons to go for static pm; it’s easier to achieve, specially if you want to support a lot of third party applications (Android Market) without compromising battery life. While this makes sense, I wasn’t convinced by this argument; you still can have one application that is behaving badly (grabbing suspend blockers the whole time), and while permissions should help, the application might still request the permission, and the user grant it (who reads incomprehensible warnings before clicking ‘Yes’ anyway?).

So, both can get screwed by bad apps (although it’s likely that it’s harder in the static pm case, albeit not that much).

But actually, you can have both static and dynamic power management, and in fact, Android does. But that doesn’t mean Android automatically wins, as I explained, the system needs to be fine-tuned for dynamic pm, and that has never been a focus of Android (there’s no API’s or frameworks for that, etc.). So, for example, a Nokia N9 phone might be able to sleep 1s in average, while an Android phone 100ms (when not suspended). This means when you are actually using the device (the screen is on), chances are, a system fine-tuned for dynamic pm (Nokia N9) would consume less battery, than an Android device.

That is the main difference between the two. tl;dr: dynamic pm is better for active usage.

So, if Android developers want to improve the battery usage while on active usage (which I assume is what the users want), they need to fine-tune the system for dynamic pm, and thus sleep as much as possible, hopefully reaching the sweet spot. But wait a second… If Android is using dynamic pm anyway, and they tune the system to the point of diminishing returns; there is not need for static pm. Right? Well, that’s my thinking, but I didn’t manage to make Android developers realize that in the discussion.

Plus, there’s a bunch of other reasons while static pm is not palatable for non-Android systems (aka. typical Linux systems), but I won’t go into those details.

Nokia’s bet was on dynamic, Google’s bet was on static, and in the end we agreed to disagree, but I think it’s clear from the outcome in real-world situations who was right–N9 users experiencing more than one day of normal usage, and even more than two. Sadly, only Nokia N9 users would manage to experience dynamic pm in full glory (at the moment).

Upstream

But not all is lost, and this in my opinion is the most important aspect. Dynamic pm lives on the Linux kernel mainline through the runtime power management API. This is not a Nokia invention that will die with the Nokia N9; it’s a collaborative effort where Nokia, TI, and other companies worked together, and now not only benefits OMAP, but other embedded chips, and even non-embedded ones. Being upstream means it’s good, and it has been blessed by many parties, and has gone through many iterations, and finally it probably doesn’t look like the original OMAP SRF code at all. Sooner or later your phone (if you don’t have an N9) will benefit from this effort, and it might even be an Android phone, your netbook (if not already benefiting in some way), and even your PC.

Android’s suspend blockers are not upstream, and it’s quite unlikely that they will ever be, or that you would see them used in any system other than Android, and there’s good reasons for that. Matthew Garrett did an excellent job of summarizing what went wrong with the story of suspend blockers on his presentation ‘Android/Linux kernel: Lessons learned’, but unfortunately the Linux foundation seems to be doing a poor job of providing those videos (I cannot watch them any more, even though I registered, and they haven’t been helpful through email conversations).

Update: I managed to get the video from the Linux Foundation and pushed it to YouTube:

Here is part of the discussion on LKML, if you want to read it for some strange reason. WARNING; it’s huge.


MWKN Weekly News for Monday, 2 Jan 2012

MeeGo Weekly News - 2 January, 2012 - 05:00
Front Page
Fragmentation of Nokia N9 resources & community

Thomas Perl has posted a couple of articles on the fragmentation of the Nokia N9 community:

"It's really tedious to hunt down information about Harmattan. It's not really MeeGo (and MeeGo Is Dead(tm), anyways) and it's not branded as Maemo, even though it's Maemo. Yeah. It's not really Maemo, but it is. And it's not really MeeGo, but it is branded as such."

"The reason why gPodder 3.0.2, which has been released two weeks ago has not yet made it into Ovi Store is not because I was lazy (in fact, I uploaded the .deb on the same day as the release day, i.e. 2011-12-13) but because it took Ovi Store QA one whole week(!) to realize that the gPodder package isn't optified. Guess what? Optification isn't really needed by Harmattan anymore, and the Ovi Store has passed all previous gPodder releases which have been packaged exactly the same. Apparently they decided it's necessary this time."

This matches your editor's experience as well. Unfortunately, there's no easy solution. It's a real opportunity for someone to step up, gather requirements and make a proposal people could get behind.


In this edition (Download)...

  1. Front Page
    • Fragmentation of Nokia N9 resources & community
  2. Applications
    • Extending the life of an N8x0: automatic Skype launcher
    • Applications from n9-apps.com can now be installed using Nokia's MeeScan barcode reader
  3. Development
    • Showing custom services in Harmattan contacts app?
  4. Announcements
    • Map plugin for N9 Gallery now available
    • Nokia Pulse (private location sharing service) now available for N9

New Year, New Direction

Randall Arnold - 1 January, 2012 - 10:06

I want to thank WordPress for the very cool blog stats job they did for the 2011 summary.  Saved me a lot of work!

Which is especially good since I’ve been working hard on something new (I know, I know: what’s new in that, right?).  But bear with me!

In a lot of ways I was all over the place in 2011 and want to fix that for 2012.  So for the most part my highly personal writing will occasionally show up at texrat.net.  There will be a few more articles showing up here, mostly Nokia and Qt oriented, but going forward there will be a new home for the technical stuff.  So at some point Tabula Crypticum will no longer be updated.

This isn’t an easy decision, nor is it easy to implement.  I’ve had a lot of fun writing here, and reading the comments, but results were too erratic.  There were either amazing days of 3000+ views or frustrating days of a few accidental visitors.  I had trouble establishing something close to steady readership.

A lot of that of course is being some random, non-famous individual who talks too much.  Where’s the allure in that;)   But the fact that a few articles received extraordinary attention leads me to believe (in possible delusional fashion) that sometimes I get lucky and post something useful.

One way to increase the odds of that for a blog is to add more authors.  Along with authors you need editors.  Next thing you know you have a publishing empire.

Well, my new plans are not so grandiose.  Rather, I want to build a new blog in and around communities.  Particularly Maemo and MeeGo.  Not the products, but the people… many of whom are now scattered across the Internet striving valiantly to keep the free fires burning.  They’re involved in cool projects we are excited to share!

It’s not quite ready to officially launch yet, but I am announcing the creation of post404.  It’s starting off with a handful of senior editors and hopefully we can pull in a community of contributors.

Sound fun?  Follow @post404_Mag on twitter (and me still at @texrat of course) to get engaged!

Those of us starting this are passionate and hopeful.  Going forward, expect to see a lot less “I” and a lot more ‘we”.  Thanks for your interest!


Filed under: Into Outreach, Inviting Change, Mentioning Maemo, Mentioning MeeGo, The Process and Product Frontier, The Write Stuff Tagged: community, post404

2011 Year in Review: Travel and a Cookbook

Dawn Foster - 31 December, 2011 - 10:00

Every year, I like to write some kind of year in review blog post. I started writing these in 2007 as  a way for people that I don’t talk to very often to keep up with what I’ve been doing, but I’ve found that it helps me see what I’ve accomplished (or not accomplished) that I can use to reflect on what I want to do in the next year. You can find the 200720082009 and 2010 editions if you want to see how this year compares with previous years.

2011 in Review

In general, I stayed much more focused this year. In past years, I’ve had a tendency to become exhausted and burned out with too many side projects. This year, I focused on a couple of things and was happier and healthier as a result.

  • I finally published my vegan cookbook: What Dawn Eats: Vegan Food That Isn’t Weird. I have been collecting recipes for this cookbook for 15 years, and I am really excited to have it published. It is available in paperback, Kindle edition and PDF format. Out of everything I did in 2011, this is what I am most proud to have accomplished.
  • I spent a lot of time traveling in 2011, which is something I had been wanting to do for a long time. After ending a relationship of 6 years in May, I realized that this was a great opportunity to combine some of my work travel with a few fun side trips, since I didn’t need to hurry home to anyone. Aside from a few trips to San Francisco, Ohio, Seattle and Austin, most of my travel was international. I went to Vancouver (BC), Victoria, Prague, Berlin, Amsterdam, Paris, Sao Paulo and Rio de Janeiro. You can see pictures from some of my trips on Flickr, but I’ve been a little lazy about getting the set from Europe posted.
  • I also had more than my share of personal turmoil this year after my father unexpectedly passed away in June. It was a sudden reminder that life is short, which also fueled my travel bug to see the world while I can. However, the silver lining in all of this is that my sister and I learned that we had another sister that we never knew about. It’s been great to spend some time getting to know her and my new adorable little niece.
  • Aside from a little slacking during the holidays, I’ve been happy with my progress toward getting stronger and healthier. Over the summer, I had a few long runs of over 8 miles (~13k), which is longer than I had ever run in my entire life! I had a minor setback in an unfortunate incident with a sidewalk (sidewalk: 1, Dawn: 0), but I didn’t let it slow me down. The doctor called me an endorphin junkie as I was sitting in his office a week later looking at the follow-up x-ray of my fractured finger asking him when I could start running again, but he gave me the OK as long I as didn’t fall on my hand. During the cold and rainy winter months, I’ve been mostly a gym rat, lifting weights and doing cardio on the machines, but it keeps me in shape until the weather improves enough for me to want to run outside.
  • From a work perspective, I am still leading the Community Office within Intel’s Open Source Technology Center. While it’s been a rough year with a lot of changes in some of my projects (MeeGo and now Tizen), I’m happy with the work. I get to work with amazing, smart people both on the team at Intel and in the community of open source developers, and I have the opportunity to work on interesting projects while traveling to new places.
  • I’ve also presented at a bunch of conferences this year. Most of the presentations were related to my work at Intel talking about MeeGo, Tizen or community metrics at various Linux Foundation events, the MeeGo conference, AppUp Elements, OS Bridge and OSCON. However, I also did a couple of presentations about Hacking RSS at SXSW and WebVisions, just for fun :)
  • I also somehow found time to read almost 40 books this year and am attempting to learn French.

What I Want to Accomplish in 2012

  • I plan to continue to do more traveling in 2012. I really have the travel bug, and I just want to visit places that I’ve never seen before.
  • Like last year, I want to continue to be even healthier this year to build endurance and strength with longer runs in the 8-13 mile range and more regularly hitting the gym to lift weights. After pigging out over the holidays, I also need to get more diligent about not eating too much and making better choices about what I eat.
  • In a carryover from what I wanted to accomplish in 2011, but never quite got around to it … I still want to get back into doing some light programming for fun projects. I’ve been dabbling a bit over the past couple of years, but mostly with things like shell scripts and awk that aren’t really programming, so I’d like to do more with PHP and APIs.
  • Right now, I’m at the phase in my French lessons where I know some basic vocabulary, but I want to get to a point where I can actually carry on a conversation in French that goes beyond basic greetings and travel phrases in 2012.
  • I will also try to get better about blogging here after neglecting this blog for the past few months.

Qt & The Next Billions

Paulo Arancibia - 26 December, 2011 - 18:29

Después de Febrero 11, muchas cosas cambiaron en Nokia, a Symbian le pusieron fecha de vencimiento, a MeeGo lo mandaron al freezer, el único que recibió un fuerte respaldo fue Qt, pero viendo la magnitud del descalabro, era difícil creer en esa promesa, paso el tiempo y hay que admitirlo, Nokia esta cumpliendo con lo que prometio, desde Febrero 11 a la fecha se han liberado Qt 4.7.3, Qt 4.7.4 y Qt 4.8, el trabajo en Qt 5 sigue viento en popa, ademas a mediados de junio, Nokia anuncio que Qt pasaría a ser parte fundamental de su estrategia para el Next Billion y mas importante aun, en Octubre se completo el proceso por el cual Qt pasa a ser administrado bajo un modelo de Open Governance.

El futuro de Qt parece asegurado, ademas de Nokia muchas otras plataformas contemplan la posibilidad de utilizarlo de forma oficial o existe el potencial de que terceros lo porten y le den soporte, el siguiente es un listado de alguna de ellas.

Nokia

Ademas de poder ser usado en Symbian y MeeGo, Nokia a anunciado que Qt sera el entorno de desarrollo que potenciara su estrategia para el Next Billion, cuando Marco Argenti hizo el anuncio en Nokia Connections 2011 no dio muchos detalles, lo que hizo que durante un tiempo se especulara con la idea de Qt corriendo sobre S40, ya que hasta ese momento S40 era la plataforma que Nokia estaba posicionando para ser usada por el Next Billion, paso el tiempo, llegaron los DevDays y por suerte con ellos, algo de información llego a la superficie, según Kenny Mathers (Head of Developer Relations en ese momento) la plataforma elegida para la estrategia Next Billion de Nokia no va a ser S40, esto sumado a que Symbian y MeeGo yo no juegan este partido, hace que nuevamente se vuelva a especular con Meltemi, ahora bien ¿que es Meltemi?, una ¿versión lite de MeeGo? o ¿una evolución de Maemo/MeeGo?, quizás para mitad del año que viene, con la release de Qt5 podamos saber mas, mientras tanto no queda otra que esperar, pero con la seguridad de que Nokia esta cocinando algo en Ulm.

Canonical

La relación entre Canonical y Qt comenzó hace tiempo y sigue profundizándose, el solo hecho de que Unity 2D haga uso extensivo de Qt y QML es una muestra del compromiso de Canonical con Qt, si a esto le sumamos las intenciones de Canonical de llevar la experiencia Ubuntu, a smartphones, tablets y smart TVs, la idea de un nuevo “ecosistema” con Qt como uno de sus pilares, comienza a tomar forma y merece la pena ser seguida de cerca.

Research in Motion

QNX el OS que compro RIM para usar en su próxima generación de smartphones y tablets, incluye a Qt entre sus paquetes desde hace tiempo, muchas soluciones se venden haciendo uso del tandem QNX/Qt, por suerte esto no ha cambiado con la compra de RIM y para dejarlo claro, George Staikos (Vice Presidente de RIM) manifestó el apoyo por parte de RIM a Qt en una de las keynotes de los ultimos DevDays, anuncio que Qt seria soportado en BBX y para que quede el mensaje claro, mostró varias demos desarrolladas en Qt corriendo en su PlayBook.

Hewlett Packard

Qt siempre formo parte de webOS, es cierto que es una versión algo vieja (4.6 y 4.7.1) la que se encuentra disponible entre sus paquetes, esto ha permitido que miembros de la comunidad porten apps y el framework por su lado, todo esto se pone mas interesante luego del anuncio de la apertura del código de webOS por parte de HP, donde Qt puede tomar impulso para todos aquellos interesados en desarrollar aplicaciones que corran de forma nativa en webOS.

Samsung/Intel/Linux Foundation/Nomovok

Este es el grupo de los unidos por el espanto, por un lado Samsung una empresa amante del control total que ve que con Android no puede crear una cárcel 100% invulnerable, Intel que ve que el mercado mobile se esta comiendo su reino, prueba una vez mas crear un OS para sus chips de bajo consumo de energía que están siempre por llegar, quizás esta sea la ultima oportunidad de Intel para lograr algo el éxito, antes de tener que renovar su licencia con ARM y empezar a fabricar chips con tecnología ajena, perdiendo no solo el control sobre la tecnología, sino el de su propio futuro, la Linux Foundation, ese sello de goma organizador de conferencias y vendedor de remeras, no pincha ni corta en las decisiones pero todos quieren tener su visto bueno como para darle un toque mas Open Source a sus proyectos, y por ultimo Nomovok que en la época en la cual MeeGo aun vivía, aposto fuerte por el y ahora esta tratando de recuperar toda la inversión hecha, la cual en su mayoría se desarrollo usando Qt, la idea de Nomovok es vender su UI que corre arriba de los que debería de ser Tizen a fabricantes chinos de tables económicas para ayudarlos a diferenciarse, para ello se ha comprometido a portar Qt a Tizen y darle mantenimiento.

El futuro de Qt en Tizen, esta complicado mas que nada por razones políticas, Samsung tiene a EFL con el que sueña sustituir a Qt, a Intel puede que le interese mantener a Qt después de todo el trabajo y progreso que realizaron en MeeGo, pero con tal de seguir teniendo a Samsung de socio no va a decir nada y aceptara lo que Samsung decida, lo que piense la Linux Foundation no le importa a nadie y lo que haga Nomovok va a terminar siendo irrelevante sin el apoyo de Samsung e Intel, prueba de esto es la conferencia sobre Tizen que Nomovok organizo hace algunas semana en China, en donde ni Intel, ni Samsung se hicieron presentes, ni mucho menos patrocinaron, cosa que si hizo Qt, que participo como Silver Sponsor, esto no quiere decir que Samsung e Intel prohíban o restrinjan el uso de Qt en Tizen, pero sin el apoyo de ellos, Qt va a estar relegado a los hobbystas, a soluciones muy especificas y a lo que pueda hacer la comunidad.

KDE

Esto parece una obviedad, pero no podía dejar de mencionar el soporte y apoyo que el proyecto KDE le da a Qt, para muchos, KDE es sinónimo de Qt y viceversa, lo cual puede ser una arma de doble filo, mas cuando la persona que interpreta esto ignora que KDE es una plataforma y Qt es un entorno de desarrollo, sino hagan la prueba de preguntarle a cualquier usuario de Linux que piensan de Qt y casi con seguridad terminara respondiendo con temas relacionados a KDE.

KDE siguiendo la evolución de Qt, ya esta preparando el salto a Qt5, lo que debería capitalizarse en una mejora en la performance general del sistema, pero que se notara mas en la parte de gráficos. algo que en KDE se usa y se abusa mucho.

Mer Project

Este proyecto del que hace un tiempo hable aquí en el blog, es la continuación de MeeGo por otros medios, luego de que todos los que lo soportaran le soltaran la mano, el proyecto avance a paso lento pero firme, con entregas regulares y sumando apoyo de otros proyectos Open Souce, como por ejemplo la gente de Plasma Active, que de a poco se esta convirtiendo en una de las UIs preferidas de quienes trabajan y experimentan con Mer.

Raspberry Pi

El proyecto cuyo objetivo es crear una GNU/Linux box basada en ARM por menos de U$S25 sigue avanzando, lo que ha llamado la atención de mucha gente, tanto que personas dentro de ICS y Nokia, están trabajando en una versión ultra optimizada de Qt5 para esta plataforma, ademas se creo un programa por el cual Nokia esta entregando a 400 miembros de la comunidad placas para que puedan usarlas en sus proyectos.

Haiku

Haiku aparece en esta lista en una especie de fetichismo de mi parte, es cierto que su comunidad tanto de desarrolladores como de usuarios es muy pequeña, pero el port de Qt en Haiku ha permitido que muchas aplicaciones KDE corran en el, haciendo que Haiku se torne un poquito mas interesante y permitiendo que podamos aplicar nuestros conocimientos en un proyecto en donde cualquier aporte, por mas mínimo que sea puede lograr un gran impacto.

Los Otros

Aquí entran los ports de Qt para iOS, Android y Windows 8, estos ports cuentan con distintos grados de madurez y soporte, por un lado tenemos a Digia que esta trabajando en el port oficial de Qt para Windows 8, también tenemos al proyecto Necessitas cuyo progreso es impresionante, cuenta con una integración muy buena con Qt Creator y también con un port de Smart Installer (llamado Ministro) para el manejo de dependencias, muchas apps creadas con Qt están ya disponibles en el Android Market, por ultimo están los ports para iOS, el primero, UIKit, es mas un experimento que otra cosa, esta limitado a aplicaciones de una sola ventana y no tiene soporte multitouch, luego esta Qt4iOS, este port es comercial, tiene soporte completo para Qt Widget, QML, OpenGl, Qt Mobility y Qt3D, ademas ya hay al menos una aplicación desarrollada con el, que paso el proceso de verificación de la Apple App Store y ya esta en venta.

Conclusiones

Ademas de los entornos clásicos como Windows, Mac OS X y Linux, existen muchos proyectos en donde Qt puede ser usado, en algunos con mayor o menor soporte, algunos mas maduros, otro que recién empiezan, es lo bueno de Qt y de su promesa Code Less, Create More, Deploy Everywhere.

Symbian forever

Paulo Arancibia - 23 December, 2011 - 20:30

Symbian Monolith

Hace unos días atrás, en una de esas “brillantes” directivas de los cráneos del área de marketing de Nokia se decidió que el nombre Symbian ya no era cool y era percibido por el publico como algo obsoleto, la solución a este “problema” llego en la forma de un nuevo rebranding (el tercero en los últimos años), desde ahora el core del OS se seguirá llamando Symbian y la UI pasara a llamarse Nokia Belle y en un futuro Nokia Carla, Nokia Donna o como fuera que decidan llamarlo, la idea detrás de esta decisión es bastante clara, hacer que el nombre de Symbian quede en el olvido lo mas rápido posible.

Desde hace unos años, pero últimamente de forma mas sistemática a Symbian se le han achacado todos los males por los que pasa Nokia en la actualidad, en mi opinión el problema no es Symbian, el problema es la gente que toma las decisiones en Nokia, lo que ahora conocemos como Nokia Belle tendría que haber visto la luz mínimo hace dos años, permitiendo acelerar la estrategia de usar Qt para homogeneizar el desarrollo y servir de medio de transición hacia Maemo/MeeGo, pero en el ínterin en vez de desarrollo, lo único que hubo fueron guerras internas, estaban los que querían seguir mejorando Avkon, estaban los que querían imponer Qt, estaban los que perdían el tiempo con Orbit, los que planeaban la apertura del código y que luego de mucho esfuerzo se llevo a cabo, para que pasados un par de años se volviese a cerrar y mientras todo esto sucedía no había nadie con una idea o visión de que hacer, nadie que tuviera capacidad de ejecución, que hiciera que todos marcharan en la misma dirección, y mientras todo esto ocurría, se perdía tiempo, se perdía dinero y se perdía el liderazgo en el mercado, todo esto cambio cuando llego Elop, el si tiene una visión, pero esta visión no incluía ni a Symbian, ni a MeeGo, Nokia Belle es ahora un OS con una UI moderna, bien optimizada para ser usada en dispositivos touch, con un completo entorno de desarrollo basado en Qt que permite fácilmente migrar una aplicación Qt desarrollada para Symbian a MeeGo, pero llega tarde y ahora la pelea es cuesta arriba y con todas las de perder, Symbian toda una leyenda, es ahora denostado, ocultado a los ojos del publico y ya tiene fecha de vencimiento, MeeGo que tendría que ser su sucesor, es ahora un juguete para experimentación, la única esperanza que nos queda a los que creemos en el Open Source es que el rumor de Meltemi se transforme en una realidad y que todo estos desarrollos creados con Qt y los nuevos patrones de interacción introducidos con MeeGo puedan seguir siendo usados en el futuro en algún producto de la compañía.

Symbian paso de ser el rey, a ser el tonto del pueblo, un OS que tuvo y tiene aun características que mucho OSs actuales de la competencia implementaron hace muy poco o que aun no lo han hecho, cosas como la multitarea real, que estaba presente desde los principios en Symbian, ni hablar de cosas básicas como copiar y pegar, características que tanto iOS como WP7 tuvieron mucho después de su lanzamiento, o tecnologías como NFC que son soportadas por Symbian desde hace tiempo y usadas por los licenciatarios japoneses desde hace años en el mundo real, es por eso que da mucha bronca escuchar o leer a gente que no tiene la mas puta idea de como funciona o lo complejo que es desarrollar un OS hablar mal de Symbian, oír a fanboys idiotas que defienden una marca cuando en realidad lo que tendrían que defender es una idea, una forma de ver la tecnología aplicada a nuestro mundo, pero eso es demasiado pedir para gente sectaria, monotemática y unineuronal, ni hablar de las agencias de relaciones publicas disfrazadas de sitios de noticias tecnológicas en donde “expertos” dan sus análisis totalmente influenciados por el sponsor del mes o peor aun los inútiles de los departamentos de marketing que creen que todo se soluciona cambiando nombres, agregando keywords rimbombantes a folletos o poniendo fotos de gente feliz en anuncios.

Por mientras, nosotros, que no nos conformamos simplemente con usar algo, sino que queremos saber como funciona, que deseamos conocer el fundamento de las decisiones de diseño que se llevaron a cabo al implementar una característica o función X, y que elegimos la marca y modelo de un móvil no por el precio, no por las modas, no porque sea lo que usan todos, sino porque se ajusta a nuestros requerimientos técnicos y a nuestras ideas de como y para que debe ser usada la tecnología, para gente como nosotros Symbian va seguir siendo un gran OS, con sus ventajas y sus desventajas, un OS que creo de la nada el mercado de los smartphones, un OS que permitió mostrarle al mundo que un móvil podía usarse para muchas otras cosas ademas de para realizar llamadas telefónicas, algo que hoy damos por sentado pero que hace 15 años solo Symbian podía hacerlo, es por su historia y por su legado que para nosotros Symbian seguirá siendo Symbian, ahora y siempre.

Microsoft + Nokia Babies: Hate at a Distance, Love Up Close

Randall Arnold - 23 December, 2011 - 14:48

original source: http://www.pop.com.br/

Apologies to QML fans but I’m going to to extend the interruption of that series by at least one more article.  Blame a cynical friend’s recent conversion to the Dark Side of mobile Microsoft

As regular readers know I’ve been a dual Microsoft/Linux power user for many years.  While some friends see that as a bad case of cognitive dissonance, I prefer to call it technical agnosticism.  I was never interested though to include Windows Mobile in that scope, mainly due to an observance that it was just Windows scaled (badly) down to a handheld device rather than something specifically designed for the form factor.

Microsoft finally realized that, bit the bullet, and created Windows Phone from scratch.  But the product still carried Windows branding baggage and has been panned by some mobilists and tech pundits– many of whom did so with ten-foot virtual poles.

This has been especially true of Nokia fans (self included), particularly those who saw great things in the Linux-based operating systems Maemo and then MeeGo and had high hopes for the sexy N9.  Nokia’s CEO had brought about the Elopocalypse in accepting Steve Ballmer’s engagement offer, and no one from the Linux side of the family wanted to be part of the post-wedding reception.  Some later snickered at the Spanish meaning for “Lumia” (as tempting as it is to riff on that further, I’ll demur).

So far the MicroNokia nuptials have resulted in two acknowledged offspring: the fraternal Nokia Lumia twins, 710 and 800.  There’s nothing apparently spectacular about the 710, hardware- or appearance-wise.  Its low price is the most attractive feature.  As for the 800, photos don’t quite do it justice.  You have to use this device to realize its true beauty.

The same can be said for Microsoft’s Windows Phone 7 OS.  Yes, videos seem compelling, but jaded smartphone users aren’t easily impressed by moving pictures.  Experience it first-hand, however, and the skepticism melts.  I admit to encountering that at Nokia World when I first got to play with the Lumias.

This sort of mindset conversion is never more dramatic than when a diehard open source devotee is swayed.  Such was the case when my aforementioned friend Johan Paul surprisingly tweeted the following:

I’m highly interested in what he’ll have to say further, the more he uses his Lumia 800.

Now, I can’t quite profess unconditional love for these babies.  Some of the beauty is only skin-deep and there are genetic defects only a mother could overlook.  My personal OS peeves are no tethering, no Bluetooth file transfers and no USB mass storage mode.  HUGE step backwards in my opinion and a MUST fix.  As for the Lumia 800, lack of TV output combined with omission of a front-facing camera have my teeth gritted.  I also have to wonder why support for quickly-trending NFC was left out.

Beyond feature failures, Microsoft and Nokia face distinct but obviously related challenges here.  The former needs to get Windows Phone in general out of the market share basement.  The latter needs to re-establish their specific phones as must-have products.  I have yet to see a clear signal on how evangelical overlap is going to be handled by the two, particularly where software development is concerned.  I also still wonder if the marriage between them will ultimately put off other WP participants (not that I actually care).

Nevertheless, if outreach efforts can get examples into the hands of prospective buyers everywhere, even doubtful ones like my friend Johan, Microsoft and Nokia do indeed have a potentially winning combo.  The 25,000 device-seeding effort won’t hurt!  In addition to my QML explorations, I plan to develop for Windows Phone and can’t wait to start showing off my own Lumia 800.

I just need to get that pretty baby in my hands…

Disclosure: author is a former Nokia employee and current Nokia Developer Champion learning Qt


Filed under: Into Outreach, Inviting Change, Mentioning Maemo, Mentioning MeeGo, The Write Stuff, Views and Reviews Tagged: forumnokia, Johan Paul, LinkedIn, Lumia, Maemo, MeeGo, Microsoft, Nokia, Windows Phone
Syndicate content