Thursday, October 8, 2020

My Raspberry Pi 4 Desktop System

 


A couple of months ago, I bought a 4 GB Raspberry Pi 4 and decided to see whether I could use it as a desktop system. After some trial and error, I finally have come up with what seems to me to be a usable configuration.

The first decision I made was the case. I'd read online that heat was an issue with the Pi 4. To keep the Pi from throttling from overheating, you can either use an active heat dissipation system--a fan or even a liquid cooling system--or you can use a passive system, with large heat sinks and enough surface area to shed heat. I don't want a noisy fan, so I read several online reviews and bought a case from Flirc. The Flirc case is designed to be a heat sink. It has a column that seats atop the CPU and conducts heat up into the case. The Flirc works well; my Pi 4 has never come close to throttling due to excessive heat. The idea seems to have caught on, and there are other similar cases on the market now.

Since I was aiming for a cheap desktop system, I didn't want to buy expensive, high-end peripherals. I bought an Acer KA220HQ monitor, and I tried an Amazon Basics wireless keyboard/touchpad before settling on a Logitech K400 Plus wireless keyboard/touchpad. Eventually, I replaced the keyboard/touchpad with a Logitech K380 Bluetooth keyboard and Logitech M535 Bluetooth mouse--more about the monitor and input devices later.

Since my Pi 4 was going to be a desktop system, I wanted it to be able to have adequate audio and video capability. The built-in audio on the Raspberry Pis isn't great, so I looked for a digital-to-analog converter (DAC). Because I'd already ordered the Flirc case, I decided to buy a USB DAC instead of a HAT (hardware attached on top). I picked the Sound Blaster PLAY! 3, a nice reasonably priced USB DAC. I bought Logitech S120 stereo speakers and a Cyber Acoustics ACM-51 microphone to use with the Sound Blaster. For video, I bought a Raspberry Pi camera module V2 and a Makeronics clear acrylic holder case. The ribbon cable is clunky, but it works.

Once I had all the pieces, I plugged them together and had a great little inexpensive desktop system. Well, no, not at first. The first Pi 4 I ordered, I tried several micro HDMI to HDMI cables, but I couldn't get any of them to seat properly in the micro HDMI port on the Pi 4. I contacted Canakit, the company that sold me the Pi 4. They replaced the Pi 4, and the new one worked.

I installed Pi OS (formerly Raspbian) and ran into my second hurdle. The monitor randomly blanked. I read up on display issues with Raspberry Pis--the online documentation for boot configuration options was especially helpful. It appears that the Pi 4 can't read the EDID (extended display identifcation data) from the Acer monitor. I tried downloading the EDID data into a file and editing config.txt to use the file, but that didn't work, either--the system came up in 640x480. I eventually came up with a boot-time HDMI configuration that improved the screen blanking problem, but even with that, I also have to manually set the mode and group for the display each time I booted the Pi 4. The screen still randomly blanks once in a great while--an annoyance, but I can live with it.

The Pi 4 was barely usable as a desktop system. It was slow and not very responsive. Looking around online, I found several blog and video posts that suggested that Ubuntu Mate is much snappier. I installed Ubuntu Mate on a second SD card and gave it a try. It did seem more responsive, and it also seemed to get along better with my Acer monitor--it was able to identify the Acer. My subjective impression was that Ubuntu ran a little hotter than Pi OS. The deal breaker for me was that I never could configure Ubuntu to use the camera.

Doing some more research, I came across suggestions that using an SSD (solid-state drive) instead of an SD card would greatly improve performance. I bought a 120 GB Western Digital Green SATA SSD and a Sabrent M.2 SSD to USB 3.0/SATA III enclosure. I made sure that the Sabrent enclosure could do UASP (USB attached SCSI Protocol) rather than the slower USB storage protocol. When I first got the SSD, USB booting was not in the default critical Pi OS stream, so I had to switch to the stable stream. But it worked, and the SSD really improves performance. And now, USB booting is available in the default Pi OS stream.

By this point, I had only one open USB port available for anything else I'd like to use with the Pi 4, such as a flatbed scanner or a thumb drive, so I bought an Anker 4-port USB 3.0 hub, which worked well. As I plowed through more online articles and videos, it became clear that power can be an issue with the Pi 4. I read advice to use powered USB devices, rather than ones that draw power from the USB bus on the Pi 4. I thought that power could have something to do with the screen blanking problem. So, I bought a  UGREEN SATA to USB 3.0 adapter cable and an Atolla powered USB 3.0 hub. I also got the Logitech Bluetooth keyboard and mouse, to free up another USB 2.0 port. The powered adapter cable worked fine with the Sabrent enclosure. But when I tried using the powered USB hub, it interfered with the SSD--the SSD became corrupted, and I had to reinstall. So, I ditched the powered hub and went back to the Anker.

By now, I had a usable system, but the SSD and USB DAC and the hub were taking over my desk. So, I got a Yahboom Raspberry Pi cluster case. The Pi 4 in the Flirc case sits on top--the case is too tall to fit between the shelves. The Sound Blaster DAC and the USB hub fit in the middle shelf, and the SSD sits on the bottom shelf.

I'm pretty happy with this setup. The system works reasonably well. Once in a great while, the display will blank, and I've changed my browser habits so that I have a minimum number of tabs active at any one time. But this is a usable desktop system.