GTK 4.18, the PinePhone and Megapixels
Table of Contents
While I have largely moved on to one of my (too) many other devices,1 whenever I pick up my original PinePhone (usually that's the 3GB/32GB postmarketOS Community Edition), I get nostalgic. It has served me well, and five years after, it's still reasonably well-supported. But the clock may be running out.
I still agree with nokzemedia that the PinePhone is in many ways "the bedrock of Mobile Linux”, as it came at an affordable price with good timing. Unfortunately we recently had to witness a nail to the PinePhone's coffin happen.1
The GTK 4.18 issue
GTK 4.18 dropped the old GL renderer, as proclaimed in February 2025:
The old GL renderer has been removed. This may be unwelcome news for people stuck on very old drivers and hardware. But we will continue to make the new renderers work as well as possible on the hardware that they can support.
This means, that from GNOME 48 onwards and on any distribution that ships GTK 4.18 (which includes current Arch Linux (ARM), Alpine/postmarketOS edge, Fedora 42 and will include Alpine 3.22/postmarketOS 25.06, NixOS 25.05, and Debian 13 "Trixie") GTK apps are now only GPU-accelerated on devices that supporting OpenGL ES 3.0 or OpenGL 3.3, Vulkan, or newer. Otherwise, we're stuck with software rendering.
This sounds very bad, but let's remember, that it was GTK4 that introduced GPU acceleration to GTK - GTK3 was all 'software rendering' if you will. While most other apps should be fine-ish, if you want to take a photo with Megapixels, you are at the end of your luck. I can imagine that this will also be notable for some use cases, e.g, with video playback.
What to do if you have a PinePhone?
First, let me say that there's no need to put into the trash-bin if the PinePhone still works for you. Also, if you run Ubuntu Touch or Sailfish OS on your PinePhone, you just don't have to care about this: Neither of these use GTK4 anywhere.
If you are on Phosh (or Sxmo or whatever), and use Megapixels as a camera app, then you need to make choices. Overall, things seem mostly fine in the few apps I have tried with software rendering, even GNOME Maps felt okay and was within my expectations for how it would perform on PinePhone. Note: I am familiar with the PinePhone, meaning, my expectations are rather low. While Megapixels does not work at all (as it fails to create the necessary GL context for the viewfinder), other GTK4 apps mostly work okay in my brief testing.
That said: If you note significant, new performance issues with other GTK4 apps, please tell - I am open to adding notices to listings on LinuxPhoneApps.org in such cases.
The hard way: Run a fork of GTK 4.18 with the old renderer patched back in
The following is likely only viable on a distribution level, but as it is a possibility, it has to be listed. As mentioned in Weekly GNU-like Mobile Linux Update (14/2025), kkofler did just that:
GitHub - kkofler/gtk: Fork of GTK to restore OpenGL ES 2.0 support
Note: I have not tried this, and it may not work yet. Assuming the GTK devs did not just drop the old renderer for no reason, maintaining it and keeping it along going forward to and beyond GTK 4.20 will be at least some work, if not a lot of work.
Running Megapixels on a GTK 4.18 distribution
Let's explore the ways to run Megapixels, once GTK 4.18 has landed in your distribution.
Flatpak
Of course you could stick to an older distribution, but, really, you should not. If you want to continue using Megapixels, there's a flatpak that makes that possible, for as long as the (now deprecated) GNOME 46 runtime is still installable.
Due to
The GNOME 46 runtime is no longer supported as of April 17, 2025. Please ask your application developer to migrate to a supported platform.
I have looked into building the flatpak against the GNOME 47 runtime... and that seems to work fine on the AllWinner A64 PinePhone at least.
That said, a flatpak should also works with a GNOME 47 runtime, as GTK 4.16 still contains the removed renderer. I've shared my changes in this Merge Request.
Megapixels 1.x in distrobox
You can also - especially if you want to keep using Megapixels 1.x - use distrobox with an Alpine 3.21 image, which ships GTK 4.16 (that still has the renderer), and, being Alpine, should use the least disk space (compared to other distributions).
I've tested this on Mobian Trixie. The following worked for me:
sudo apt install distrobox
distrobox create --image alpine:3.21 alpine-3.21
Now, enter distrobox - this will take a bit the first time, as now the image is being actually installed.
distrobox enter alpine-3.21
In distrobox, run the following:
sudo apk add mesa-gles megapixels postprocessd
After that, you can just run megapixels from the terminal. To export a launcher to Phosh/your UI, do the following (again, from within the box):
distrobox-export -a megapixels
The result is a relatively small container:
sudo du -sh ~/.local/share/containers/storage/
1.1G /home/mobian/.local/share/containers/storage/
Of course, this does not yet account for the space distrobox and its dependencies (e.g., podman) use on disk.
The result is fine: Pictures are being taken - only tapping the preview image to view the photo does not work. Likely, installing loupe
or eog
in the distrobox can fix that though.
Other camera apps
Alternatively, you could try going for a different camera app.
GNOME Camera (Snapshot)
While GNOME Camera supports the PinePhone, the view finder is slow - and ... don't move when you take a picture. It's a replacement, but not necessary the replacement you want.
Shutter
harbour-shutter uses the libcamera backend and is being developed for Sailfish OS primarily, but can be also used on Maemo Leste and Ubuntu Touch on the PinePhone (and PinePhone Pro). It just needs to be packaged for more distributions from what I can tell; and if more should be needed: I am sure contributions are welcome.
Revive some abandonware
Of course, there's some old stuff to tinker with, too:
- GitHub - JNissi/camcam: Camcam camera for Pinephone Phosh
- GitHub - OpenMandrivaSoftware/om-camera: Camera for PinePhone
Build something new
Of course, coming up with something new is always an option. That said, with all the thought and work that went into Megapixels, joining Martijn and help him move Megapixels away from GTK is likely a good way to reach decent results.
Also, libobscura exists. From what I can gather, it still needs some work to support a real phone camera, but again, lots of thought and work went into this - and for phone camera hardware, it likely does not get simpler than with the PinePhone cameras (from a pipelines/diagram standpoint, that is).
Sidenote: What about the Librem 5?
The Librem 5 is also affected by this change. Fortunately, there's hope that improvements to the etnaviv driver can solve the situation, as the hardware supports OpenGL ES 3.1, so that the removal of the old gl renderer in GTK can optimistically be viewed as a temporary setback only. The same is true for the PinePhone Pro, it's just a different driver (panfrost) for the Mali T860 GPU (which, in addition to OpenGL ES 3.1 also has the potential to support Vulkan 1.0).Contrary to what I thought after reading Martijn's post, the PinePhone Pro is not affected by the change in GTK 4.18 - I managed to get Megapixels 2.0 Alpha 1 running on postmarketOS edge. If the Wikipedia page on ARM Mali is correct, all that it could gain for even better speeds is Vulkan support in software. That said, recommending the PinePhone Pro does not really feel right either - the battery life is just too poor, and it's not the only issue.
Conclusion
While GTK 4.18 performance on the PinePhone has been surprisingly okay (and outdone my very low expectations), I think it's time to put it clearly: Don't buy a PinePhone anymore. Five years in, most kinks have been worked out, but the world is moving on, and I just can't recommend it - or any other device that (effectively) supports only OpenGL ES 2.0 - any longer.2 Unfortunately, there's no drop-in replacement (meaning, a widely supported device that has a replaceable battery, a headphone jack, and supports microSD(XC) at an affordable price point) - but that's a story for another day.
Mostly the Google Pixel 3a (I have three, one with postmarketOS (edge + Phosh) that I spent most of my time with (+ one with Ubuntu Touch and one with Droidian) and also devices like the OnePlus 6 or, if you have spare change, a Fairphone 5. See my postmarketOS wiki page to get an idea of my 'device problem'.
An earlier nail in the coffin would be Flutter, which dropped GLES 2 support about 2 years earlier - please feel free to nitpick if you can date this more exactly.
This means that I also can not recommend a PinePhone Pro or a Purism Librem 5 at this point either, but at least there's hope as the hardware is more modern and it's "just" a software issue for these devices.