Sailfish Community News, 8th April, Browser Multimedia

Subscribe to future posts here :bell:

Sailfish OS update from Jolla

In the last newsletter Martin Schüle, Jolla’s Chief Designer, discussed the ideas behind the new Sailfish 4 ambiences. This time we thought we’d look at a slightly different aspect of the operating system, but sticking with the graphical side of things to look at the way multimedia works in our updated browser engine.

As you may be aware there have been two significant upgrades to the browser in the last two Sailfish OS updates. Although a large portion of the browser code comes in the form of Gecko — the same browser engine at the heart of the Firefox web browser — there’s a lot more to these browser updates than just porting over the engine and leaving it at that.

Some other parts of the process, such as the introduction of Rust to the build, have already been covered elsewhere. The multimedia stack at the heart of the browser has received big improvements, but it’s not something which has had much visibility. We’re therefore keen to share some insights with you. Audio and video playback has become such an essential part of the browsing experience that we knew it was an area we had to put considerable effort into. The work in transforming the multimedia stack was spearheaded by Jolla’s Middleware Engineer Andrew Branson, and so let’s have the details in his own words.

The Sailfish Browser uses Mozilla’s Gecko web engine to render webpages, and tracks the Extended Support Releases (ESRs) of that. It is challenging to adapt to all of the changes in each ESR release, and each bump represents a substantial amount of work to migrate our Browser’s integrations. One particular hurdle in the ESR52 upgrade (released in SailfishOS 3.4.0) was the loss of GStreamer support. That had been used since the beginnings of Sailfish Browser to integrate hardware video codec support into the browser through the gst-droid library developed and maintained by Jolla. This library wrapped underlying Android Stagefright codecs into GStreamer elements, and also performed colour conversion to provide the I420 frames that Gecko needed. Other hardware acceleration mechanisms available in Gecko aren’t easily applied to Sailfish OS: although Firefox’s Android app includes support for Stagefright codecs, this would require device-specific builds of Gecko, and would require Sailfish OS including more Android than we’re comfortable with. So a new mechanism was needed.

Gecko includes support for Gecko Media Plugins (GMPs) to decode and encode video streams. The plugin architecture was added so that non-free video software could be added to Firefox after installation, such as video codecs or DRM libraries. For instance, h.264 video support is required by HTML5, but is patented so it’s not possible to include an implementation in the Gecko source code, so Cisco provides an OpenH264 codec as a GMP, so this can be downloaded and installed for h.264 support when needed, and if the user chooses. The Widevine DRM library is also supplied in this way, which enables the use of video streaming websites such as Netflix.

OpenH264 isn’t much use to Sailfish OS, as it’s a software codec library and those don’t perform well on mobile devices; producing slow framerates and sucking battery power. But we can use this method to wrap up the Android Stagefright codecs in a similar way to gst-droid, producing a new plugin library: gmp-droid. Although this has to be built individually for each adaptation, it is a small library (much smaller than the enormous Gecko) and so doesn’t consume too many build resources. GMP supports h.264, VP8 and VP9 decoding, and gmp-droid will query for these codecs on device after installation, and declare itself to Gecko for each of those that is supported in hardware. So HD Youtube videos can be played even on budget devices.

The Sailfish OS multimedia capabilities have been generating quite some interest during the two most recent community meetings, and it’s clear that they’re an important feature for many Sailfish OS users and developers. Although much of the discussion in the meetings has been focused on Qt, hopefully it’s nonetheless of interest to get a bit of an insight into some of the work that we’re doing to make audio and video playback work as seamlessly as possible…

Energy from the Community

Theme Color

It’s always nice to get a reaction, especially when it’s a positive one. All the discussion about ambiences last week prompted nephros to get in touch to let us know about Theme Color, an app which allows you to control the colour theme on your device with even greater precision than you’d be able to using the standard ambience interface. When it comes to the beautiful and elegant ambiences we discussed in the last news letter, in nephros’s own words Theme Color “allows Sailors to utterly mess up that beauty and elegance, and replace it with clownishly colourful, hideous or indeed sometimes also beautiful colour schemes.” It’s an impressive tool and calling it “fully featured” feels like an understatement. Install yourself a copy from OpenRepo. Quite apart from all the functionality, I personally consider the wobbly cover to be good enough reason to have it installed on its own.

Tidings

In the last newsletter we mentioned Hacker News and Kaktus, both news feed apps each with their own particular focus. Perhaps one of the longest-standing feed aggregator apps on Sailfish OS is Tidings, developed by Martin Grimme for many years. Since the app hasn’t seen any updates since 2019, it’s excellent news that poetaster , developer of the aforementioned Hacker News app, has taken over development of Tidings and plans to release an update to it in the near future. Tidings is available from the Jolla Store and comes highly recommended. There have been a flurry of other updates from poetaster in the last couple of weeks that also deserve a mention. If you’re the type of engineer that prefers concrete to software , then you should definitely check the recent updates to Concrete Mixer and Beam Calc, also both in the Jolla Store.

Молитвослов

While many Christians around the world will have celebrated Easter this last weekend, Orthodox Christians who base their religious timetable on the Julian calendar will still be planning their Easter celebrations for the start of May. The timing is therefore auspicious for zyyev to be releasing an update to Молитвослов, a prayer book app for Orthodox Christians that also includes a religious calendar. The latest changes have seen updates to add new content and to work better with light ambiences. The latest version is available both from the Jolla Store and OpenRepos.

podQast

Another app to receive an update recently is podQast from Cy8aer , a queue-based podcast player. Amongst its many great features are the fact that you can search gpodder.net and fyyd.de for podcasts — which is great if you want to discovers something new — and that once you’ve found a podcast you enjoy, you can subscribe to all of the episodes with just a few presses. The latest changes give a speed boost to the app by introducing an improved SQL-based data model. It’s available from the Jolla Store, as well as OpenRepos.

Community Shout-Out

We were pleased to receive a browser pull request from piggz this week, to fix a long-standing issue that’s been preventing the browser from running on mesa EGL devices such as the Pinephone. This isn’t something that you’ll have experienced if you’re running an an official Sailfish X device, but it has affected non-libhybris ports, as well as the SDK emulator. The PR isn’t merged yet, but isn’t far off. Once merged the changes will work their way in to a forthcoming Sailfish OS release.

Please feed us your news

This is a community update, and frankly we can’t always keep up with all the exciting stuff happening in the Sailfish community. Plus, the less of this we have to actually write ourselves the better. So please help us out by posting 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 8th April full details here.

18 Likes

MMM app updates so then let me just plug myself:

Microtube got an update. It was not working for some time and previously required api key. That’s no longer the case. Now it doesn’t require API key any more and is working just fine. I still need some help to build nodejs for arm64 and i486 so that microtube is limited to armv7hl only

1 Like

Thanks! I’ll include Microtube in the next update. A mention of your camera work is still in the pipeline too.

1 Like

Could the Pinephone see official Sailfish X status at some point?

The topic of new Sailfish X hardware has come up in recent community meetings, so it’s probably worth you taking a look at the minutes. I don’t think Pinephone was discussed specifically there though; so if you want an official answer you might like to raise it at a future meeting.

3 Likes

Thank you for the kind words :smiley:

This thing started out as an attempt to have a simple frontend to basically dconf write <colors>, but somehow I got distracted majorly along the way.

It first transformed into an exercise in QML for me, which lead to adding useless stuff like Transition eyecandy (I mean, who has time to fix boring things like your UI elements not changing state correctly, when you have to make a decision whether your Cover image wobble eases as InOutElastic or rather InOutQuart!), and now I find myself merging all kinds of translations in other languages contributed by people. Funny how these things turn out.

It’s superfluous and flimsy at its core, and that extends to its core feature which is still buggy and fragile as hell. But hey, it’s for fun, and it does what it does and I hope people like it.

5 Likes

I was hoping to include Microtube in the next newsletter, but unfortunately I can’t get the videos to play. Searching works fine. Any ideas about how I might fix it?

Did you try to restart app? And possibly its the problem with nodejs being in nemo dir so we can skip this week till i build nodejs myself

Aha! That did the trick, thank you. It’s working nicely now so I think it’ll be nice to include it. I’ll mention about the issue for phones without nemo user, and that you’re working on a fix.

1 Like

just wanted to say that the community news were a very good idea :slight_smile:

I’m glad you are doing this so well.

9 Likes

Trick why after restart it works fine is that it updates node modules on start (should make app wait for it to finish but stuff doesn’t work) so after first launch they will be updated and all will be fine.

I’m currently baking some DASH playback but thats for another news :slight_smile:

3 Likes