It's Pi all the way down...

by
A screenshot of the Ubuntu Mantic desktop, showing the Firefox web browser, a terminal, and the selection of Mantic wallpapers in the settings application in the foreground.

Meet the Minotaur!

It’s around this time of year that a new Ubuntu release comes out (including images for the Raspberry Pi), and shortly afterwards I pen something on the subject of how best to tweak it to get the most out of it on your Pi. Past subjects have included adding a swap file … but that’s now done out of the box. Or enabling the “zswap” facility … but that’s now on by default too. Erm … let’s see, how to flash the image to an SSD? Nope, that’s as easy as an SD card these days, thanks to rpi-imager. Disabling multipath to gain a bit more RAM on the Pi Zero? Nope, default now too.

The list is indeed shrinking fast, but it’s not completely empty yet and the arrival of the Pi 5 has certainly left a little opportunity for post-release tweakage!

Speaking of the 5 …

Presto!

What’s it like? How is the Pi 5, and how is Ubuntu on the Pi 5?

Simply put, it’s an awesome piece of Pi. I’ll go so far as to say it’s the first Pi where, if your computing needs are fairly typical, it will meet them as well as any cheap PC.

I use Pis for pretty much all my work. All my coding, packaging, emailing, talking to colleagues online, and much of my browsing is done on a Pi 4. But there it is: “much of”. Not “all of”. Playing videos on Youtube? Painful. A video call involving a dozen colleagues? Out of the question. For those I turn to a PC. Often at home, the honking huge thing which doubles as a gaming platform, but out on the road my little laptop does these duties.

When I call my laptop “little”, I’m not kidding. I like my diminutive, and above all cheap, computers. I really don’t like lugging around a thousand quid’s worth of easily breakable or nickable gear. So my current laptop is an Acer Travelmate Spin B1 which has these positively mind-blowing specs:

Component Specification
CPU Intel Pentium N4200 (ooooh!)
Graphics Integrated Intel Graphics
RAM 4GB (yes, my Pi has more)
Storage 64GB eMMC (again, the Pi has a bigger, faster SSD)
Display 11.6” 1080p (you guessed it, my Pi has a bigger monitor)

Yet, for all its diminutive capacity, it still breezes past my main Pi 4 at boot time, and is an eminently more capable desktop machine [1]. In fact, I run two Pi 4s for my work; one runs the Ubuntu desktop and the other a customized Ubuntu server image with kmscon as the console. The vast majority of my work (including all email) is done on the latter because the console is so much faster than the desktop.

So … enough waffling and delay. What about the Pi 5?

It beats the laptop. Hands down. I know my laptop is nothing to write home about, but this Pi is, being the first Pi to roundly beat one of my PCs at being a “good desktop”. It boots faster (about 20 seconds from cold for Ubuntu; we’re not at the blazing 7 seconds that RaspiOS manages, but Ubuntu’s a rather beefier desktop environment). It runs faster (everything launches faster, and generally “feels” faster than on the laptop). It’s considerably more expandable (remember the storage on my laptop is a soldered-on eMMC module!). And yet, it’s cheaper.

The “cheaper” comparison obviously sounds unfair; the laptop includes a keyboard, touchpad, battery, screen and so on, and moreover it’s older technology (newer technology is typically cheaper per unit of performance than older). When I bought it refurbished several years ago, it still cost about 300 quid, so let’s tot up my Raspberry Pi equivalent:

  • The Pi 5 I’ve been testing on is the 8GB model (kindly provided a couple of months ago by the folk at Raspberry Pi), which retails for 80 quid
  • Add in a good power supply (12 quid)
  • Reasonable keyboard (20 quid [2])
  • Mouse (10 quid)
  • Monitor (80 quid for a 24” FHD)
  • Good SD card (15 quid for a 128GB SanDisk)

217 of your pounds sterling. Yes, definitely “cheaper”, and recall we’re comparing to a refurbished laptop, not a new one. It’s not as portable as the laptop, but 83 quid probably buys a fair sized power-bank! Alright, that’s still not a fair comparison but I’m going to make it anyway because my Pis really do accompany me on the road :-)

An image of Dave's hotel room at an engineering sprint. Amidst a collection of socks, a Pi 400 is hooked up to the huge 40-something inch TV in front of the bed. The screen is displaying the Ubuntu logo typically seen during desktop boot. In the left foreground, two toolboxes are open on the bed. On the right, a small table is covered in the detritus of the day: Dave's laptop, empty coffee mug, glasses, a copy of Private Eye, a graphic novel, and several random bits of Pi paraphenalia.

Dave’s “portable” setup.

Abracadabra!

What should you do to get the most out of Ubuntu on your Pi 5? Honestly, not a great deal. Anyone who’s used Ubuntu desktop on the Pi 4 extensively will be yelling things like “active cooling!” and “SSD boot for performance!” at the screen, but frankly these are optional on the 5 and absolutely unnecessary to have a system that works “well”.

The pre-release Pi 5 sent to me a few months back (thanks Gordon!) didn’t include the fancy new cooling fan [3]. The board does get warm, particularly under load, and it’s not too difficult to get it to throttle (watching a video fullscreen in Firefox will do the job). But do I notice it throttling? No! And once the video finishes (or the package finishes building, or what have you) and I go back to doing less computationally intensive things, the board’s back to an unthrottled temperature within a couple of seconds … without any active cooling.

The other thing the Pi 5 didn’t arrive with was the official power supply [4]. This is a rather more important piece as, in order to reach its full potential, the Pi 5 does have rather higher power demands. Specifically, if you want the USB ports to deliver enough juice to run external storage (and thus to boot from an SSD drive), you need a supply capable of delivering 5 amps at 5 volts. The vast majority of USB-PD compatible supplies don’t manage this (certainly none of the ones I owned could). There are a few third-party power supplies that do (for example, the Radxa Power PD 30W) but my recommendation to most would be to simply buy a Raspberry Pi supply.

I’ll write a bit more about this in a future article but an important aspect here is that the official supply has a “captive cable”. This means that at the “business end” (that sticks into your Pi), it will deliver 5V. If your supply requires an external cable, it’ll presumably deliver its rated 5V at its socket, but that doesn’t guarantee it’ll still be 5V at the business end of the cable you’re inserting. Furthermore, to carry 5A, USB cables need an e-marker chip.

Anyway, suffice it to say, I’m still running my 5 off my old 3A capable supply (an official power supply is on order!), and even though it may not power anything beefy off the USB ports, it’s still managed everything else without any brown-outs.

A Raspberry Pi 5 sits on top of a blue-painted desk. Various cables (USB, ethernet, micro-HDMI, and USB-C power cable) are plugged into it, as well as a brown ribbon cable (FFC) leading to a Raspberry Pi camera module. To the left, various jumper leads trail from the GPIO header to a small breadboard containing a rotary encoder with an RGBLED embedded within it.

Cool as a very odd cucumber.

What about storage? Much the same applies. Yes, I run my Pi 4 on an SSD, and for doing serious work on the Pi 5 I would do exactly the same. But whereas on the Pi 4 this was about gaining capacity and performance, on the Pi 5 it’s really just down to extra capacity (and possibly reliability). The SD card interface is so much faster on the 5 (and the IO bandwidth to other components like memory so much bigger), that there really isn’t a hard requirement to have an SSD for good desktop performance. A decent SD card is perfectly sufficient.

In summary, a throttled, under-powered, SD-card driven Pi 5 is still a considerably more comfortable and responsive machine than an unthrottled, fully-powered, SSD-booted Pi 4. And it’s still capable of beating my laptop!

Ala Peanut Butter Sandwiches?

So … there’s nothing to do? No hardware to add, no software to tinker with to get the most out of Ubuntu on your shiny new Pi? Perish the thought! Where would we be without the need of a bit of tinkering? [5]

There’s a few major things that we couldn’t get into the release in time. The first is the upstream patches for libcamera (this is the reason for the camera module plugged into the board in the shot above — still testing!). This is intended to be delivered as an SRU in Mantic, which isn’t too bad given that libcamera isn’t included in the base image so users need to download it anyway.

The second is the mesa patches for full graphical performance. These did make it into the base image, so most applications on the desktop do indeed get the full benefit of the new Vulkan-compliant drivers. But some desktop applications (and one rather notable one in particular) don’t use the system’s mesa drivers because they’re shipped as snaps, so they use the libraries included in the corresponding content or base snaps (most of which are still from the 22.04 era).

Obviously this includes Firefox.

In the foreground, the Pi 5 setup from the prior image can be seen (breadboard on the left, Pi 5 in the middle, camera module on the right). Behind the breadboard are some colourful lego bricks with some jumper leads trailing out of them, and a soldering iron barely visible behind them. To the right is the edge of a keyboard, and behind it a set of small drawers containing electronic components. To the rear of the desk can be seen a speaker, a monitor showing Firefox, and the background selections of Ubuntu Mantic. But not much else can be seen because of the black and white cat standing indignantly in the middle of the desk, blocking the view.

He’s not helping.

For the most part, this doesn’t matter too much. Browsing the web and even playing video is still fine because the CPU’s capable of just powering through (the Pi 5 really does have a beast of a processor!). However, fire up the WebGL aquarium sample and it becomes blindingly obvious. It’ll barely manage a paltry 2fps, if you’re lucky. Replace the Firefox snap with a deb so it’s using the system mesa libraries (I won’t go over the instructions again here, but you can derive them from this post if you really want to) and all of a sudden that jumps up to a much more respectable 40fps or so (at least on my 1080p monitor).

Naturally, the plan is to include the updated mesa drivers in the base snaps as soon as we’re able after launch, so hopefully this should be a short-lived state of affairs. Also, as noted, this doesn’t appear to affect the vast majority of web browsing, only rather niche things like WebGL.

The other missing bit is a power monitoring daemon, which is something I’ll be prioritising in the next cycle. The new power management chip on the Pi 5 allows the OS to determine whether the previous reboot was due to a power brownout. This is fantastic as brownout issues are notoriously variable and difficult to diagnose, so having the hardware tell you that this was definitely the cause, should deal with a whole pile of Heisenbugs.

Finally, the other major change with the Pi 5 is the means by which GPIO pins are controlled. No longer is the SoC itself driving the GPIOs. The new RP1 “southbridge” is now in charge instead. This means that the traditional GPIO libraries like RPi.GPIO no longer work. I’ve written about this previously and thankfully Ubuntu’s pretty well placed to weather the storm here. We switched the GPIO Zero back-end over back in hirsute (21.04) and added rpi-lgpio (a RPi.GPIO compatible shim) back in kinetic (22.10) to ease the transition.

These pieces needed a few updates [6] to deal with the Pi 5’s new hardware, but that’s all included in mantic. With a bit of luck most users either won’t notice the change, or won’t have much difficulty in getting their circuits to work on their shiny new Pi 5.

That’s all for now. Go grab your copy of Mantic Minotaur (it should be in rpi-imager by the time I publish this) and have fun!


[1]Running Windows on it was as awful as you might imagine, but Ubuntu is still light enough to be perfectly useable on it
[2]At this point, anybody who knows me is spluttering their tea over the screen; “twenty quid? Sure you’re not missing a zero there, Dave?”
[3]There weren’t enough to give one to each alpha tester at that point, and it wasn’t necessary for Ubuntu’s compatibility work
[4]Again, there weren’t enough to go around. However, I should add that they did very kindly (and usefully!) ship a Pico Probe with the board which was really useful in debugging things, especially since it attaches to the separate debug port now, meaning I didn’t have to unplug things from the GPIO pins just to get a serial console
[5]That’s rhetorical :)
[6]Try pinout on the new Pi 5!