Sailfish Community News, 22nd April, Xperia 10 II, QMF

Subscribe to future posts here :bell:

Sailfish OS update from Jolla

If you’ve been keeping your Sailfish ear to the community ground you’ll be aware that the Xperia 10 II is next in line for official Jolla Sailfish OS support. It’s an important milestone, and not just because it’s a gorgeous piece of hardware with an ultrawide 1080p OLED screen, four superb cameras, IP68 water resistance and the ability to plug in both a headphone and SD card (making it practically a unicorn in the phone world). On top of that, it’s also the first officially supported handset to run the 64-bit version of Sailfish OS.

You’ll be pleased to hear then that the Xperia 10 II release is imminent, and that there will be a free version available from the Jolla Shop for you to try out. This will offer all of the usual non-paid features of Sailfish OS. Having installed the free version, you’ll be able to upgrade it to the full paid version later. This free version will be made available as soon as the next Sailfish OS release lands, so keep an eye on your device and Jolla’s social media channels to be the first to find out when it’s available.

It’s always nice to have some big hardware news. But many parts of Sailfish development continue in the background without fanfare, while being just as important. It’s great therefore to get the opportunity to highlight some of this work in the newsletter. No doubt many of you on these forums will be familiar with dcaliste, one of our most prolific community contributors. Damien has been contributing to Sailfish OS since 2015. After reading a remark from a user mentioning that there were unfixed bugs in the document app, even though it was open source, he thought “yeh, why not look at the code after all”, and the rest is history. Damien’s contributions are notable for adding to the OS directly and you may have noticed his work on Calligra, gnupg support in email, Web calendar support, and his numerous contributions to calendar syncing more generally. He has an impressive track-record of fixing bugs and submitting features to Sailfish.

As well as these more visible features, Damien has also been involved in tasks that are hidden in the background, but which are no less important for it. It’s a great pleasure therefore to hand the rest of this update over to Damien, for him to explain the work he’s been doing on upgrading the Sailfish messaging framework to support Qt6.

The electronic mails are handled in Sailfish by a software framework called Qt Messaging Framework, aka QMF. It is a free software project that is hosted by Qt infrastructure, mainly licensed under LGPL v2 and v3. Its git history goes back to 2009 when the project was branched from the Qtopia messaging stack. Qtopia was a development done under Trolltech* to build an operating system based on Qt primarily targetting mobile environments and providing frameworks and APIs for all services of a modern computer phone, as described on the Qt site (it was renamed to Qt Extended later). Qtopia runs on the Neo Freerunner handset and the Openmoko distribution was mainly based on it.

The QMF architecture allows developers to create software to access emails. It is based on a client/server architecture. A server daemon runs on the device and is responsible for fetching and sending emails from various accounts. This is the messageserver5 process that may be seen from the list of running processes.

This server uses plugins to establish a dialogue with mail servers on the Internet. There are plugins for the POP and the IMAP protocols in the QMF repository, but the plugin architecture allows it to be extending to support other (proprietary) protocols. The server is also responsible for the permanent storage of received emails on the device. This storage uses an hybrid architecture based on an SQlite database (~/.qmf/database on device) to quickly access all metadata and a disk directory structure (~/.qmf/mail on device) to actually store the full email contents like attachments. Then, one can write a client to access this server or the database directly, using the client part of the QMF libraries. Thus QMF provides an API to abstract emails. The main entry point being the QMailMessage class. For instance, to create a mail programmatically one can simply write:

QMailMessage email;
email.setSubject("Hello Sailfish forum!");
email.setFrom(QMailAddress("Damien", "dc@example.org"));
email.setTo(QMailAddress("Sailfish forum", "forum@example.org"));
email.setBody(QMailMessageBody::fromData("This is an email built with QMF.",
                                         QMailMessageContentType("text/plain"),
                                         QMailMessageBodyFwd::SevenBit));

This is a personal appreciation, but having contributed to fixes and new functionalities, I find the way the QMF API handles emails to be very well designed. As far as I know, QMF is only used in Sailfish OS nowadays. This is a pity in my opinion, particularly when considering its well defined client/server architecture and the ability to create and run various clients. It’s not at all a monolithic piece of code doing everything without separation between UI, storage, mail protocols and so on. That being said, the code base is huge and can be difficult to appreciate at first sight. If anyone is willing to use it and feel a bit lost, don’t hesitate to open a thread in this forum, I’ll be happy to guide him or her as far as I can. Historically, QMF was initially developed when QML was not commonly used to design the UI, if at all. So QMF does not provide any QML bindings. This is the role of a friend project: nemo-qml-plugin-email. On top of these bindings, the UI client we’re using is jolla-email, developed under a proprietary license.

Let’s move back to the framework itself. As mentioned before, QMF is hosted in the Qt infrastructure. It’s in the Qt lab sub-repository which hosts various projects related to Qt but not part of the official toolkit releases. Qt moved at the end of last year to a new major version, Qt 6. This means that backward compatibility was broken for any APIs noted as deprecated during the version 5 iterative improvements. Of course, Qt 6 builders were added to the CI and having successful compilations became mandatory in autumn 2020. QMF, as a project written earlier than 2009, was using a good number of deprecated APIs, some even inherited from the Qt 4 era. It urgently required some rejuvenation since not passing CI gates means that no changes can be merged into the master any more. Patches were beginning to pile up in the fork hosted on git.sailfishos.org.

After compiling the devel branch of Qt (at that time Qt 6 was not yet officially released), I decided to try to upgrade QMF on my machine. I proposed a variety of commits upgrading deprecated API calls. chriadam and flypig soon joined and contributed numerous patches and reviewed mine also. This task, started in autumn last year recently reached a conclusion with the CI accepting the 36 commits allowing the code to compile (and pass tests) with Qt 6. Various parts of the QMF codebase have been upgraded to use more recent ways of doing things like:

  • moving from QRegExp to QRegularExpression,
  • deprecating the use of QCodec on QTextStream but using QTextDecoder and QTextEncoder instead,
  • using QElapsedTimer instead of QTime,
  • using range constructors for lists and sets,
  • creating a QmfList class to maintain stable references (because QList is not guaranteeing it any more),
  • creating a mock to handle network configuration because QNetworkConfigurationManager does not exist any more and is not provide d in the compatibility with the Qt5 library.

It’s good that the QMF CI is now passing and the code base has been modernized to use Qt 6. Some modernisation steps could still be interesting to do though, like moving away from the old DCOP machinery for IPC between the message server and the clients, using QDbus instead.

To conclude this insight on the email handling in Sailfish OS, a backport of some of the changes is now needed to get this upstream QMF back into Sailfish. Indeed, some deprecations and their replacements have been introduced in Qt versions no earlier than 5.15 which is quite recent (compared to the 5.6 that Sailfish is based on at the moment). So changes are not always visible at the UI level, but to keep the software stack up-to-date, sometimes major reworks are needed.

Some fascinating insights there from Damien, I hope you’ll agree. One of Sailfish’s strengths is that members of the community can contribute directly to its development. Sailfish is blessed with a very active and committed community, and for anyone inspired to make similar contributions, or to contribute in other ways, I’d encourage you to do so. Your input is always very welcome.

* One of the nice things about working for Jolla is that you’re surrounded by people with great knowledge about the history of mobile phones in general and Nokia in particular. A historical snippet that comes from this is that while Qtopia was developed by Trolltech, the renaming to Qt Embedded happened under Nokia. Qtopia was a Linux-based mobile OS with mostly key navigation, which was released on a couple of million stylus-input devices in China by Motorola..

Energy from the Community

As always, we’re eager to showcase some of the great apps available for Sailfish OS, created by you in the community. We’ve picked out just a few of the apps that have received recent improvements, representing just a fraction of the total updates that found their way into the Jolla Store and OpenRepos this fortnight.

Scribble

In the last newsletter we covered a few apps from poetaster, who’s had a prolific run of releases recently. There was one app missing from the list, since it was still passing through the Harbour approval process at the time. Having now made it through, I’m happy to recommend Scribble, a simple but very effective sketch app. Originally written by Tobias Planitzer and now picked up for further development by poetaster, it benefits from bright colours and fluid interaction, making great use of the touchscreen. You can import photos to act as backgrounds which can even be removed later, which is perfect for outlining. The latest version fixes some file saving bugs and adds Chinese translations from master translator dashinfantry. Thanks also go to vige (who you’ll know as this forum’s illustrious maintainer) for suggesting it to be included in the newsletter. It’s available from both the Jolla Store and OpenRepos.

Thakir Prayer Times

As we’re currently midway through Ramadan, the Muslim holy month, it’s great timing for the release of the Thakir Prayer Times app from hafmed. In addition to the titular prayer times it also contains a host of other features, including a collection of doaa (prayers) in both written and audio sample format that can be listened to inside the app, and a compass that uses your phone’s inbuilt sensors to indicate the Quibla direction. To this layperson it looks brilliantly fully-featured and a great new addition to the Jolla Store and OpenRepos.

Microtube

We heard about the improvements that have been made to browser multimedia last time, and viewing videos on YouTube has been one of the beneficiaries of that. However, if you find yourself watching a lot on YouTube, you’ll be glad to have Microtube from Mister Magister installed. Microtube is a standalone app that harnesses nodejs to allow the most important parts of the site to be accessed easily, including finding videos by category, search and of course the all-important viewing. The interface is clean and easy to navigate, and there are also more advanced features including a safe mode and SponsorBlock options. The headline improvement for the latest update is that you no longer need a YouTube API key to make use of the app. There are a couple of bugs with fixes in the works, including a glitch that affects phones without nemo user, but Mister Magister is pushing regular updates out and so expect this to be resolved soon. I initially experienced problems playing videos, but this was fixed after a restart, a small inconvenience compared to the benefits of having the app installed. Grab yourself a copy of this nice app from OpenRepos. One important thing to be aware of is that Microtube is accessing YouTube services, so you must make sure yourself that it complies with the YouTube terms of service before using it, in order to avoid contravening them.

Pollenflug

Depending on your latitude on the earth, you’re quite possibly thoroughly surrounded by Spring and heading rapidly into Summer at this point in time. In many countries this means more sun :sun_with_face:. But for many people it also means that allergens such as pollen will start to have a nasty effect. If you’re someone who suffers from hay-fever or a related allergy, then I can strongly recommend Pollenflug, a new app by Andreas Würst. It allows you to select from seven different allergens (Mugwort, Birch, Alder,…) which you can then monitor based on your current location, allowing you to amend your plans if necessary depending on the conditions outside. The latest update brings pollen maps and support for French data. Pollenflug currently provides info for Germany and France; the app is improving rapidly and I really hope it can support more countries in the future to spread its benefits more widely. Both the functionality and presentation are first class. Get it from the Jolla Store or OpenRepos.

Please feed us your news

Thank you to everyone who fed us news for this newsletter. There’s no shortage of good stuff going on in the community right now and it’s easy for us to miss things, so please do keep the info rolling in. The best way is to post your Sailfish news updates to the forum as a reply to this post. We’ll collate as much of it as possible into one easily digestable post for the next update.

And don’t forget to join us at the community meeting every other Thursday on IRC. It’s a great place to discuss any of the content you see here, or to share your ideas for future updates. The next meeting will be on the 22nd April, full details here.

35 Likes

Super positive update and great news about the imminent release of Sailfish on the Xperia 10 II

Is it possible to confirm that Android support will be available on the phone too please?

As you say the phone also sports 4 cameras so support for all of them via Sailfish OS would be really good.

Just waiting to understand how good the Android and camera support will be before ordering a Xperia 10 II. :slightly_smiling_face:

1 Like

Thanks - Not being adept in code I take it that means “Yes”?

Yes, the “alien” refferrs to Alien Dalvik (an alternative to Google Android)

2 Likes

Mister_Magister contributed a patch for multi camera support so this is clearly something I’m looking forward to on the Xperia 10 II.

8 Likes

I’m curious if that also covers the double selfie camera in the XA2 Ultra

If both cameras can make photo then yes

6 Likes

Cool, but now the question is if we already should keep the finger down on the refresh button for the Sailfish X Page or how patient my 10 II needs to remain.

Long story short the patch allows cameras that can make photos to make them. Stupid “bokeh” effect cameras still wont work and will be as useless as they should be. But like wide angle cameras will work

6 Likes

I’m curious - what’s different with “bokeh” effect cameras that prevents them from working with SFOS?

Everything? they aren’t even cameras and to use them you need to use proprietary libs and basically only stock android camera app is able to use them not even 3rd party android camera apps

4 Likes

That’s interesting. While I may know how to create such an effect with regular lenses (love the Sigma 105mm f/1.4 Art for this) I must admit, I don’t have the finest idea how they do this on Android.

In fact it is no magic and I don’t understand your hate towards the general Idea. The second camera with other focal length or used as stereo camera exists to generate a depth map from the two images. From that the effect is calculated. Both is not trivial but also no magic, only math.
Ok, if the vendor does not allow to access both of the cameras in a ‘normal’ way with closed blobs etc that’s there decision and i don’t support it. But the general concept, without doubt, is interesting and nothing which can’t be solved from third party software developers with some effort. Most should be relatively feasible using libs like openCV and some matrix calculations and filters.

Except that you can’t access second camera due to blobs. Like, don’t you think if it would be possible, 3rd party devs would do something about it? but guess what they can’t cause they aren’t working like normal cameras

1 Like

Immediately went to purchase a 10 II, now only at 249 in most Finnish stores for 128 gig device. Truly good deal. Can’t wait to try Jolla device since Jolla 1!

5 Likes

Soo, two thoughts:

  1. Does this mean that only 64-bit packages can be installed, or is there compatability with 32-bit apps?
  2. If you are a dev and haven’t already, please add aarch64 versions of your app so we aren’t starved for older apps in the new world.
4 Likes

Yes, only 64-bit packages. It was confirmed on IRC.

7 Likes

:frowning:    

oh! where can one find the patch?

Oh! And great work everyone!