Updated: June 12, 2020
This ain't a new topic. Already back in 2014, I tested the original Pi, and tried to make it into a media system. In the end, amidst much excitement and some rigorous tinkering, this turned out to be a typical home Linux effort - super-interesting, unique, fun, but never quite as good as it should be. The professional product polish and edge weren't quite there.
The year is 2020, and I'd like to resurrect the effort using a brand new Raspberry Pi 4. My goal is to put together an affordable, elegant, visually pleasing system that would be capable enough for casual everyday computing. The list includes Web, mail, movies, streaming, pretty much anything except heavy rendering and games. So let's see if we can make this happen.
Ingredients for the mini desktop cake
So, I decided to go for the following hardware components for me project:
- Raspberry Pi 4 Model B - On paper, Pi 4 is a juicy beast. It a quad-core Cortex-A72 (ARM v8) 64-bit processor, clocked at 1.5 GHz, 4GB LPDDR4-2400 SDRAM, dual-band 2.4GHz and 5GHz 802.11ac Wireless card, Bluetooth 5.0, Gigabit Ethernet port, 2 x USB 2.0 ports, 2 x USB 3.0 ports, 40-pin GPIO header, 2 x micro HDMI ports, which support 4K 60Hz video resolution, audio jack, and then some. Cost: USD65.
- Flirc case (Silver) - Beautiful, stylish. Cost: USD25.
- Original 5.1V 3A USB-C power adapter for Raspberry Pi 4. Cost: USD12.
- 50cm HDMI cable - I originally got a 25cm cable, but it was too short for the spatial arrangement I had in mind. The cable is full-sized, so it can be repurposed with other hardware, so I also had to get a micro HDMI adapter. Cost: USD18.
64GB Samsung EVO Plus microSDXC UHS-I U3 memory card- Unfortunately, the one I bought was fake, so I had to return it. No problems there, I was fully refunded. Cost: USD16.
- 64GB Sandisk Ultra microSDXC U1 memory card. Cost: USD22.
- VicTsing combo Wireless keyboard and mouse - Beautiful full-sized keyboard with lovely feedback. The mouse comes with the dongle stored inside the battery bay, batteries not included (three AAA). Alas, it came with the ISO layout and not ANSI, but I intend to use it as En (US). Cost: USD28.
- BenQ GW2280 22-Inch 1080p monitor - Like other reusable items (cable, keyboard, mouse, etc), this component isn't strictly Pi, but I needed it in order to set up the mini PC. I deliberated between Dell and BenQ, as I really like the quality of Dell monitors, but I went this, because it was: a) 12 dollars cheaper b) had two HDMI ports instead of just one c) the desk stand is designed in a wicked way, which is perfect for the Pi and its Flirc case, as I shall soon demonstrate. Cost: USD104.
Total cost of components: USD274.
Now, based on your location on this planet, this package will probably cost you between 250-300 dollars. To put things into perspective, when I bought my Lenovo G50 laptop in 2015, it cost about USD450. It is not easy comparing these two, but the idea is similar - I got the laptop as a sort of el-cheapo test device - still running strong. It does the job reasonably well, it has 8GB RAM, a DVD tray plus a 1TB hard disk, a delta that roughly corresponds to the price gap between the then complete machine (laptop) and my soon-to-be assembled Pi-based machine. Now, 64GB flash isn't enough for everyday computing, so I intend to use a spare WD Essential disks that I bought a while back, most likely a 640GB device + network shares.
All in all, just like in 2014, when I tried to build the home media server and whatnot, the Internet likes to throw numbers around. Saying you can have a home PC for ~50 dollars sounds lucrative, but it is also misleading. I don't see how one can have all the required peripherals for work - at the very least mouse, keyboard and monitor, to say nothing of cables and storage, for less than 200 dollars. You can find flash-based laptops for sale for this cost, and they will probably offer rudimentary performance and display quality.
Hint: There's PINEBOOK Pro, which comes at roughly half the cost, so ... maybe something to explore in the future. But that's a different story altogether. Let's go back to baking our Pi, shall we.. Anyway, cost is something one must consider if they go about building their own utilitarian mini desktop.
At this point, I'd also like to point out a few other details:
- I did want to buy the 8GB Pi 4 model, but it was sold out. Everywhere!
- I wanted to buy the Argon ONE case, as it looks dope, but it was also sold out.
- I wanted a smaller screen - something laptopy - but smaller screens tend to be more expensive.
Well, we have our components. Let's assemble them!
Mini desktop, ready
So here it is, beautiful and elegant. Best of all, as you will notice, the monitor stands is exactly the same width as the Raspberry Pi case! This ain't no coincidence, and it was one of the reasons why I went for the BenQ monitor, as I can now place the Pi there most unobtrusively. Better yet, I can line additional cases, with other Pis next to the Flirc box. Or perhaps even mount them on the back on the monitor, similar to what I did with the smart TV setup. You must appreciate what I did here.
And, now we just need to choose an operating system!
The Hunt for the Tux October
This turned out to be much more difficult than I expected ... The 64-bit SoC architecture seems to have thrown a mini spanner into the wheels of Linux community. Looking about, there were only really two viable options for the Pi in a way that didn't require too much hacking. The first one is the official Raspberry Pi OS (formerly Raspbian), based on Debian Buster. However, it runs the LXDE desktop, which I never really found mature or visually pleasing enough for sustained use.
The second choice would be Ubuntu MATE, which has fully usable images for Pis up to Model 3, but not, alas, Model 4 just yet. However, what you can do is a two-step hop. Grab Ubuntu Server 20.04, install it, then install a desktop environment of choice (like MATE).
Now, there are several other operating systems available, but here, you get a mouthful of technobabble that doesn't help anyone. Things like 64-bit kernel, 32-bit userland, EEPROM flashing, NOOBS package, and whatnot. I know Raspberry Pi is meant to be a tinkerer's heaven, but there's no reason why it cannot have a complete, simple desktop solution, too. Those don't need to be mutually exclusive. Indeed, we have two choices before us, and I decided to try them both.
Attempt 1: Ubuntu MATE
I started with the Ubuntu Server 20.04 two-step hop.
Write downloaded image to the memory card
Download, dd to a memory card. You can optionally use the official Raspberry Pi Imager tool, if you're not comfortable with the command line. If you are, then on Linux, the simplest thing is simply to copy the image to the card, while taking all the precautions not to destroy anything of course. Indeed, please be EXTRA careful when you select the output file (of=), so you don't accidentally overwrite something critical or kill your data.
sudo dd if="image path" of=/dev/"SD card device name e.g.: mmcblk0) fconv=sync bs=1M
The second step is - network configuration. When the server image boots, you will not have any UI, only the command line. You can SSH into the server and then administer your Pi this way, or you can work on the console with the monitor and keyboard attached. Either way, there must be network. In my test, I was going to use Wireless networking only - no Ethernet cable. This meant configuring the Wireless network from the command-line using netplan - or using an auto-configuration tweak file network-config.
I started by trying to configure the network using netplan. I encountered quite a few errors I couldn't really fix. Initially, I got YAML errors in the netplan configuration file - you cannot use tabs, only spaces, for instance. Then, I wasn't able to apply my configuration, no matter what I did - netplan simply refused to do it.
Instead, I tried the network-config option. Once you have the OS image written to the SD card, there will be two partitions: system-boot and writable. Mount system-boot, and then open the file named network-config in a text editor.
sudo mount /media/"user"/system-boot /some-mount-point
Here, you will need to insert the credentials for your access point. The file contains a commented sample block, which you can edit and use - replace the network name and the password entries with your own information for your Wireless access point.
"Wi-fi network name":
password: "Wi-fi password"
MATE desktop installation
Once this step was done, I booted the server image, and it acquired an IP address successfully, and I had the network up and running. At this point, I grabbed the desktopify script (as it happens, created by the project manager of Ubuntu MATE), and ran it:
sudo ./desktopify -de ubuntu-mate
After a while, this step was complete, and I had a MATE desktop.
MATE desktop configuration & tweaks
Overall, things were looking all right. But this wasn't the end of the journey. Far from it. I had to quite a few changes and make the desktop work and behave as I needed. Some of these were MATE-related issues, others specific to Raspberry Pi 4. I promise a whole avalanche of tutorials in the coming weeks. In essence, the major issues were:
- The display only rendered as 1824x984 pixels instead of the full 1920x1080px resolution. This is resolved by disabling the overscan option in the Pi boot configuration. This file is located under /boot/config.txt for older 32-bit Pis and under /boot/firmware/usercfg.txt for the new 64-bit Pi 4. There's more to be said, but it's not important at the moment.
- The MATE desktop fonts were too pale - not pure black. So I had to edit the desktop theme to have pure black fonts, the only acceptable font color. I created my own custom theme called MOTE, and I will show you how to do this soonish. In essence, very similar to editing themes in Gnome 3. This is not Pi only.
- The desktop wasn't using compositing, so I had to fiddle with Marco window manager until I got everything right. For example, I wasn't able to turn transparency in Plank when using the Cupertino desktop layout. Then, even when I did change to using Marco via MATE Tweak, this setting wasn't preserved across logins, and I had to use dconf-editor to affect a permanent change. More in a separate guide.
- Half a dozen other functionality tweaks, like window positioning and whatnot. We will have a complete essential Ubuntu MATE & RPI4 tweaks guide, as well. Should be fun!
- Hardware-accelerated video rendering wasn't used - this is a big one, more on that shortly.
After a while, I did have a stylish, presentable desktop, with lots of nice software included - or installed. With my tweaks in place, it was even more fun than my recent Ubuntu MATE review experience. I was actually rather surprised by how quickly and smoothly things ran, even from an SD card. Memory usage was relatively low, and 4 GB sounds like plenty, but do note there's no swap configured.
But then I started playing videos ...
Technically speaking, Pi can do 1080p and even 4K without any problems. Even my first-gen Pi could do full HD without problems. But not this one. Playing in Firefox was decidedly choppy. I tried VLC, and I got the same results. Choppy playback. Looking at system resource figures, Firefox was eating almost 300% CPU, and that would be three full cores, trying to process video. Obviously, I was not getting hardware acceleration. I could even see this myself in the system information tab in the System Monitor tool - llvmpipe AKA software rendering only.
I was eventually able to solve this - but it's not a trivial process, at all. So I promise a complete tutorial very soon. For those of you who are extremely impatient, then you need to edit the usercfg.txt file, and add the following entries:
Reboot. Then, you need to make sure that your browsers and media players are configured correctly, and that they are using the hardware acceleration. This requires separate setup for Firefox, Chromium and VLC, and we will cover those in a dedicated guide. Overall, this was a fairly successful attempt, but the video side of things took a lot of time and tweaking. Roughly two full days.
Attempt 2: Raspberry Pi OS
I decided to grab a second SD card (price above not included but not relevant either) and test with the official release. Here, I didn't do any tweaks beforehand. Once inside the rather over-bright LXDE desktop, I configured the network without any issues. There's also a first-time guide, which helps you get around. Quite handy.
For instance, it asked me about black borders - which were there - and so I didn't need to manually fix the boot configuration. I then ran the raspi-config tool and did some extra changes, like enable the use of the GL driver and such. Not bad, but way too nerdy. Seriously, there's no reason why things should be more difficult than they are.
After a few minutes, I had the desktop - and the desktop had me. But I didn't want to be using it really. It just didn't look modern enough, and there's no reason to compromise on aesthetics. Furthermore, you do get a more optimized performance out of the box, but with a few caveats.
Your browser is Chromium, configured with adblocking and some h.265 extension thingie, I presume for improved video playback. I tried HD video, and they worked fine. But then, I installed Firefox, and I hit the same problem as the one I had in Ubuntu MATE earlier. In fact, you don't get Firefox - if you try to install this package via apt, you will get an error. Raspberry Pi only ships with Firefox ESR (firefox-esr). So supposedly, you have a choice, but then not really. This is the paradox of open-source and Linux. Your choice here seems to be using a browser that you may not want, or even if you go for Firefox (without hardware acceleration by default), you are forced to use the ESR. Nothing wrong with it, I LOVE ESR, but what if someone wants a newer version?
Anyway, here's the list of issues I had on the official, up-to-date image:
- Browsing didn't work at first, because my time was out of sync, so obviously that can mess with Web certificates. I had to resolve this by syncing the time:
sudo timedatectl set-ntp True
- VLC played with HW acceleration, but didn't render anything in full screen. Solved, but you will need to wait for me to show you this in a separate article.
- Audio didn't work at first (raspi-config lets you choose between auto switch, headphones and HDMI), then it did work with the headphones, and then, after a reboot or two, everything sorted itself out. I did not switch the audio output anywhere. We will discuss audio tweaks separately.
- I never got more than 30 Mbps downsteam, even though other devices in the exact same placement manage easily 3-4 times that (Wireless). Network was also flaky now and then - I would get an occasional name resolution problem and/or page timeout, and Firefox would often only display mobile pages rather than desktop pages. This did not occur in Ubuntu MATE at any point. MOAR tweaks, and a separate guide!
At this point, I decided to try other desktop environments, like MATE!
Trying other desktops ... and failing ... and succeeding!
You would think, Xfce is Xfce, MATE is MATE. Well no. The MATE that you get in Raspberry Pi OS, or perhaps Debian, is nothing like the one you get in Ubuntu MATE. Half the utilities are missing, you don't get most of the desktop layouts that you can change with MATE Tweak, and you don't get the themes and icons either.
I also tried Plasma - performance was not good - and Xfce - it looked simply awful. I promptly went back to MATE, and started tweaking heavily, trying to make it look nice and presentable and elegant. After a lot of work and frustrations, I hit a whole bunch of new problems and errors and inconsistencies:
- I had to manually edit the lightdm.conf configuration file to be able to get to a login screen where one can change the desktop session. With the default pi-greeter, there's no such option.
- In MATE, there was no network icon in the indicator applet - only volume. After I installed the network-manager-gnome package, the icon showed up, but it would not list any Wireless network, it claimed the network was not ready - even though I was connected and browsing. The same issue occurs in Plasma and Xfce. The reason is a conflict between WPA supplicant, which is used for networking in the default LXDE session, and Network Manager. Fixable, as I will show you in a dedicated tutorial.
- There's quite a bit of cross-contamination between Xfce, MATE and LXDE. For instance, I configured Plank as an auto-start application for MATE, but it also showed in the other two desktops. But then, it also showed in Plasma!
- Plank in Raspberry Pi is different from Plank in Ubuntu MATE. Among other things, it does not have a right-click preferences option, and you can only tweak the dock by launching its preferences sub-utility from the command line.
- Applications refused to center, but after the dconf-editor tweak, all but Chromium did obey the change.
- Pluma does not remember the last opened documents, at all - it does in Ubuntu MATE.
- I tried the Compton GPU window manager, and the performance was abysmal, with lots of tearing. Going back to Marco (adaptive) seemed to offer the most reasonable results.
- In MATE, through the Control Center, you have access to Raspberry Pi Configuration, which works nicely, and then there's something titled (Raspberry Pi) Recommended Software. The first one looks like a simplified version of raspi-config, while the second didn't work at all (complained we were offline, even though the network was working just fine). To see whether this was a desktop environment glitch, I retried in the official desktop (LXDE), and still no luck.
Eventually, things started to shape up ...
This does not sound encouraging, but I persevered and invested another day or two polishing things up.
- I copied a bunch of themes and icons from Ubuntu MATE here - including my customized theme with black fonts. This allowed me to have a slick setup, almost identical to what you get in the other operating system.
- I tweaked Firefox, including hardware acceleration and user agent.
- I installed a bunch of software.
In the end, the MATE desktop on top of Raspberry Pi OS did look rather modern and presentable!
The system offers reasonable performance, decent video acceleration, audio works, and you have a bunch of nice programs and tools. The only downside is that you must invest a lot of manual work - none of this is default.
And just a quick reminder, we went from (left) to (right) - click to enlarge:
Other things - performance, heating
Let's go back to the Pi itself. Like I said, I really love the visuals. The monitor is reasonable. The keyboard is excellent. The Wireless mouse ... doesn't really work with my smooth, white desk surface, and I had to use a wired mouse instead.
The most outstanding thing is - The Pi 4 gets hot. Not finger-burning hot, but it's definitely rather warm. We're talking in the region of 50 degrees Celsius or so - there's no throttling, but it's not ideal. I also happen to have a Pi 3, and there, the heating is not an issue. At all. The case is always pretty cool. Now, I don't know if this is Flirc, the Pi itself, or the two combined. But then, this is sort of inevitable - the more power the Pi has, the hotter it will get. I am going to explore this avenue some more, and perhaps even grab a case with a fan, although a fanless setup sounds preferable. One small bit of info: a set of updates, including firmware, did help with the heating a little bit. The case is now cooler. Warm but more lukewarm than cozy hot.
Performance is decent. Video - you get about 22 FPS in the WebGL Aquarium test. Now, when I try the same thing on my Slimbook Pro2 laptop, it easily hits 60 FPS and caps there. This tells me there's more room for improvement on the hardware acceleration front. We probably need new firmware, new kernels, better GL support - I'm talking the official Raspberry Pi OS.
I spent three or four days fiddling, and in the end I did have a 100% working desktop that I could sit back, relax and enjoy. But that's a lot of time invested. Well, as you can see, there's nothing smooth or plug 'n' play about this experience. So the answer to our question. It's: YES. This can be a nice little mini desktop when running MATE, provided you have the patience to sort everything out.
Overall, Raspberry Pi remains nerd technology. Well, in essence, this is the bread and butter of the Pi - hardcore nerddom, and tweaking unto oblivion. Perfectly fine, no surprises there. But the problem is, it's a binary choice: zero or everything. There's no middle ground whereby you get a simple and modern PC, without having to resort to hackery. This is a perennial symptom of Linux-at-home in general. Very few distributions are able to provide the user with you could classify as a smooth, simple experience.
Now, with that said, Raspberry Pi 4 has a lot of potential. It can be a mini desktop in its own right. I am pleased with my setup overall. It looks the part, the performance is reasonable, the capabilities quite solid, even jolly good given the device price tag. But it is still not a plug-n-play box as I'd like it to be. Which is why I will continue fiddling and tweaking, as is my duty as a nerd, and I will bombard you with guides and articles that showcase my progress. Hopefully, one day, I will be able to say: there, there's your perfect mini desktop, just grab it, and Bob's your uncle. We're close. Almost there. So keep your eyes peeled for updates, and see you around, fellow nerds.