Taking Screenshots on the PinePhone… sort of

We all know that, when playing around with a new device, the most important thing you can do is record the experience so that others can behold your techno-wizard glory.  Pics or it didn’t happen, no?  Which makes it that much more frustrating that the PinePhone currently can’t take screenshots in seemingly any of the OSes that are compiled for it.

Attempt 1: The Built-In Option

I’ve been using Ubuntu Touch, since at the moment it has the most features and the least suck of the available OSes.  (Technically the build is from UBPorts, but I’m going to use the terms interchangeably because I’m lazy.)  Allegedly, UBPorts lets you take a screenshot by simultaneously pressing Volume Up and Volume Down, but that doesn’t work on the PinePhone – best I can gather, that only works on Android ports of Ubuntu Touch.

Attempt 2: The Command Line Option

Other posts suggest that you can use phablet-screenshot from the phablet tools package, but that too leads to disappointment, with the program freezing.  Running debug mode (-d) shows that it’s trying to pull the screenshot from adb:

...
+ adb start-server
+ check_devices
+ set +e
+ adb wait-for-device

Since the PinePhone isn’t running Android, adb isn’t really a thing, and you’ll end up waiting forever.

Attempt 3: The Raw Option

Looks like we’re going to have to create this from scratch.  All of the above-mentioned techniques essentially do the same thing: they dump the framebuffer /dev/fb0 to a file and then convert that file to PNG, JPEG, or whatnot.  How hard can that possibly be?

Dump the Framebuffer

The first step is easy enough: cat /dev/fb0 > img.raw.  This dumps the framebuffer (i.e. what’s on screen) to a raw file.

Figure Out Your Screen Size

The raw image file is just that: a raw stream of pixels, with no dimensions built in.  As such, you next need to figure out how big your screen is.  For the PinePhone, this is 720×1440 pixels.  If you want to discover this yourself, you can just type fbset (sudo apt install fbset if necessary).

Get the Script

This helpful chap cooked up a lovely little Perl script that will then convert the raw image to png.  Download the script, chmod + xto mark as executable, and invoke with ./iraw2png 1440 720 img.raw img.png.

NB: I swapped the dimensions.  You’ll see why.

Inspect the Results

Here’s the result, which doesn’t exactly look like the Desktop:

Success!

It definitely captured a thing.

Mope!

It captured some manner of console, perhaps the TTY output? I don’t know. Evidently there are other framebuffers to be found. If you know how to find them, please do send a comment since I’m up a creek on this one.

5 comments

Ferdinand Thommes

Why do so many blogs these days not show the date when a post was written? That makes this one about screenshots on the PinePhone pretty useless not knowing if it is months old and things work fine now or if it is current.

Agreed. That’s why this post has the date. For what it’s worth, screenshots are now possible, but only with Manjaro.

Ferdinand Thommes

I did not see one, that’s why I commented.

I owe you two apologies.
1) The dates show up everywhere except on desktop when you’re actually viewing the post. Working to fix that.
2) I shouldn’t have been dismissive.

Ferdinand Thommes

Thanks for coming back to me. No hard feelings.

Leave a Reply to Ferdinand Thommes Cancel reply