I got a new Raspberry Pi 4. It’s neat! Some thoughts on it. Bottom line: it’s a great little computer and my only complaint is the SD card I/O is slow.
First, context. A friend gave me an original RPi Rev B way back in 2012 or so. I’ve used it every year or two when I needed a small Linux box to do something. For awhile I had RetroPie on it for gaming. I dusted it off last week to serve as a network proxy for my SunPower PVS6 solar power monitoring system. It’s working great for that! But it’s a very slow, limited system.
So I bought a new RPi4. I got a Vilros kit that includes a case, a power adapter, heatsinks, an SD card, various cables. It’s very convenient. The core computer is $55 but the kit is $135. Probably not a great value but this was in stock at Amazon; like everything else these days, availability is not great.
The RPi4 is the first RPi capable of running a 64 bit OS. The ARM Cortex-A72 CPU in it is quite capable but nothing too exciting, but since it’s the ARMv8-A architecture it’s pretty well up to date. You have your choice of 1-8GB RAM wired on the board. And all the IO integration that makes the RPi so popular. 4 USB ports, gigabit ethernet, two HDMI ports, WiFi and Bluetooth built in, an audio jack, and of course the famous GPIO pins for hackery.
A word on cases. A nice case goes a long way to making it feel like a “real” computer. The Vilros case is a nice aluminum case that fits just right. RPi4s apparently run hot, at least when actively used. My case has an always-on fan. There’s a bunch of passive cooling cases that basically turn the whole chunk of aluminum into a heatsink, that seems like a better idea if it’s sufficient.
On power: the RPi4 uses 3-5 watts. Everyone recommends a good USB power supply, the official one is 5.1V/3.0A. Alternately the RPI4 can be powered over ethernet with a small extra board. Note 3A is a lot of power for USB; that’s a device intended for charging, not just a random computer’s 0.5A USB port.
Operating system
Vilros shipped an SD card with Raspberry Pi OS (aka Raspbian) installed. Full desktop environment. I used it for a few minutes and it seemed to work but was as unlovely as any Linux desktop. Also slow; you could see the background picture repaint when I dragged windows. I only want this as a headless server so I wiped it and put Ubuntu 21.10 server on it. How about that? Stock Ubuntu, compiled for aarch64 and with a clean boot loader. Shout out to the RPi folks for creating a great disk imager. There was also a thing called NOOBS, a small boot system which let an RPi install its own OS, but I guess that’s deprecated.
The RPi4 has some complex boot loading and firmware overlay stuff. I don’t understand it but it seems to work. USB booting is supported via a bootloader on the SD card.
One drawback with Ubuntu is it’s less clear how to tinker with the Raspberry Pi-specific stuff. Raspbian has raspi-config which lets you adjust things like clock speeds, GPU memory usage, etc. It looks like you can just edit config.txt on the Ubuntu boot partition, this works sort of like BIOS settings but for the RPi.
Another useful tool for RPi-specific hacking is vcgencmd. This lets you get at a bunch of state on the GPU, which apparently in this Broadcom implementation is controlling the whole system. This lets you get at things like how much RAM is dedicated to video (78MB for me) and what the current temperatures, voltages, etc are.
There’s a whole lot of software dedicated to working with the GPIO pins. This capability is the really neat hidden feature of the RPi and gets pretty complex as you mess with different modes of I/O: I2C, Serial, etc.
No one buys an RPi4 for performance. But it’s pretty impressive, particularly by historical standards. Unfortunately it feels slow for interactive stuff. But then I’m spoiled by fast machines with SSDs. The main issue with the RPI4 is the SD card is slow. Some comparisons to an Intel NUC based on a i5-7260U.
With the cheap SD card Vilros sent me hdparm reports about 45 MB/s. Compare 100 MB/s for a spinning disk on an Intel NUC or 1600 MB/s to SSD. I’d hoped the SD would be faster. And that 45MB/s is for synthetic tests: this blog post says 7 MB/s for reads for random access reads. SD cards are clearly not a fast medium. This blog post suggests 100-300MB/s with a proper SSD drive plugged in to USB 3, which is big boy PC speeds but nothing amazing. The RPi4 can boot off USB so you can eliminate the SD entirely if you want. It’s too bad they don’t have an NVMe interface, but then that’d require a PCI bus. (The Compute Module product does have one.)
Another word on I/O: older RPis implemented ethernet on the USB bus so performance was severely limited, particularly if you wanted to use it as a router with multiple ethernet interfaces. Raspberry Pi 4 has a dedicated channel for its ethernet separate from USB, so that helps.
RAM is reasonably fast. Testing with sysbench I get about 4GiB/s on the RPi 4; compare 17GiB/s on the Intel NUC.
CPU is impressively fast. Again testing with sysbench, using one or two threads the RPi was about 1.35x faster than the i5-7260U. With 4 threads the RPi is 1.6x faster. The Intel CPU is 4 threads but only 2 real cores; the RPi4 has four cores. I have no idea if this is a real world CPU benchmark, probably not.
I played around with overclocking a bit. Boosting CPU speed from 1500MHz to 2000MHz gave me about 1.3x speedup. Max temps were 45C and 52C respectively. Then I found the arm_boost=1 config.txt setting, which apparently gets you 1800MHz as a temporary boost with extra voltage. I don’t normally overclock but since they say it’s safe I’ll leave that enabled.
I found a note in the docs that suggests there is no hardware support for video decoding.
Thoughts
What an impressive bit of kit. What I like best is how contained it is; a small pack of cards running a real 64 bit Ubuntu with zillions of hardwaer ports. The only drawback from a conventional computing point of view is you’re limited to USB 3 for disks. And hell that’s not bad at all, with an SSD significantly faster than computers I was using on the daily a few years ago. If I were using the RPi 4 interactively I’d be sure to set up USB booting to a fast disk.
But I’m not using it interactively. In fact I probably won’t use this RPi4 much at all. The old RPi B is doing fine as my proxy device. But now I’ve got this little swiss army knife computer sitting around for the next project where I need something this flexible. I’d like to learn more about ARM as a practical server platform. Or maybe I’ll use it as a web a server for my plotter. Or a base for some home automation tinkering via those tasty GPIO pins.
One other thought; the RPi 4 is the flagship product but there’s other devices. The Raspberry Pi Zero 2 W is a smaller, cheaper system suitable for less demanding uses (like being a web proxy). I/O ports are limited but for a certain type of application it might be more suitable. There’s also a Compute Module which looks like an RPi 4 only without all the I/O ports (and with the SD card built in). I think this may only be of interest to folks designing embedded systems.