Thin clients as the ultimate media computer (t620)

Since kodi has gotten support for launching emulators directly from within the GUI, I've been interested in getting a cheap computer that could act as a media player, emulator machine and server. Ideally, fanless and low power (less than 10W).

In retrospect, a used laptop could have done the job fine. But then I would have missed out on the fun of finding a secondhand thin client. I was also curious because I've never laid hands on a thin client before.

Enter the t620

Picture of an HP t620 thin client
		from the front.

Not quite sure how I came across this particular model. It was likely thanks to parkytowers.me.uk, which is a great resource on thin clients. There is a lot of information, personal experience from the author as well as reports from people that write in. Big kudos to the person that put that site together. There was also a craze of people using the t620 and it's cousin the t620 plus (which is thicker and has a PCIe connector out of the box) as routers. Which you can read about on serverthehome.com.

Picture of an HP t620 thin client
		from the back.

In any case, I found a cheap secondhand t620 and was positively surprised by the hardware. For a mere 50 bucks I got a well built mini computer, with socketed RAM and expandable storage thanks to the M.2 slot. The case can be opened without any tools. The stand can be fitted in two positions, so that the unit stand up vertically (as in my pictures) or lies horizontally on its side. It's fanless and low power. Perfect for a media PC. The price I got it for was okay, I feel 20-30 is a fairer price, but secondhand electronics seem to have gotten more expensive since the pandemic related chip shortage.

Picture of an HP t620 with the
		case opened, exposing the motherboard and various expansion slots.

I tried a few different distributions before settling on debian (It's boring I know, but it meets the criteria).

LibreElec

This is a great distribution if you just want to use kodi. Very minimal setup, you get an OS that automatically boots into kodi and automatically updates. Although not relevant for the t620 which has an x86_64 chip, LibreEelec can be especially interesting for ARM single board computers. Depending on the SoC, hardware video acceleration is not necessarily mature and working in the mainline linux kernel and downstream projects. With LibreElec you can easily get a recent kernel and working hardware video acceleration for many ARM boards.

Libreelec worked well out of the box with the t620. Including hardware video acceleration (you can see this in kodi when playing back a video and pressing "o", it then shows something along the lines of "ffmpeg-h264 (HW)"). You don't strictly need a keyboard either, everything can be done with a game controller. The only limitation I found is that some emulators (ex: prboom and mgba) don't work well with the default wayland setup, they launch and run in the background, but the screen remains black. You can use the xorg "legacy" libreelec image to get around this. Do note that it doesn't seem ARM boards can use the legacy xorg image, so several emulators won't work.

LibreElec is great if you just want to use kodi, but it's a super lightweight distribution not meant to be expanded and configured like a general-purpose distribution. So installing and configuring server software on it will likely be a pain. I didn't want to try.

Arch Linux

I tried this because it's the same distribution I had on my desktop and laptop (obligatory "I use arch btw"). Being arch linux I thought it would give me the fine grained control to setup a combined media computer + server.

Installation was a little more complicated than just flashing an image using LibreElec. I followed the Arch installation guide, which went quite well. When installing GRUB I had to add the "--removable" option to "grub install" otherwise the system wouldn't boot. I included the amd-ucode package to get any relevant microcode (even though I gagged a bit when installing such proprietary nonsense). The rest of the system setup went quite smoothly with the help of the reputable arch wiki.

For the kodi and emulation setup with arch linux I tried a different approach: using kodi for playing video files, and retroarch for emulation. This works rather well, with the exception of hardware video decoding, which I could not get working in arch linux for some reason. I spent quite some time going through the arch wiki trying different setups. It seems the video drivers are properly loaded, as `vainfo` says h264 video decoding is possible, and there are messages in the logs during boot that the radeon drivers are being loaded. There is even a "hardware video decoding" option in Kodi under settings -> playback. But it still seems to use software video decoding. I tried asking in the arch forum, but that didn't help me fix the problem. Nonetheless, the cpu is good enough for most h264 1080p files. The occasional file or IPTV stream seems to overload it and cause choppy video. I wonder if this lack of hardware video acceleration is maybe to do with recent changes in mesa, which caused some hiccups with hardware video decoding on my AMD arch linux desktop too. Anyways, retroarch works fine with this setup, and I haven't come across any emulators which have the black screen bug described earlier. Only issue is in UI/UX, you first need to exit kodi and then launch retroarch. I came across ly which is text-based login manager suitable for this purpose. Only issue is that you need a keyboard to use it. Ideally, I wanted a system where I could do everything with a game controller, both navigating in kodi and playing emulators.

Debian

And that's how I came to debian, looking for emulation within kodi and hardware video acceleration.

I had actually never done a debian install on an x86_64 machine. I've only used debian derivatives (raspbian, armbian) on ARM boards, where you download an image and flash it to a micro SD card. Following the Debian Install wiki page went smoothly. Aware of the faulty EFI implementation on the t620 thanks to parkytowers I used the expert graphical mode of the debian installer and selected "yes" when it asked whether I wanted to install GRUB to a removeable media location. Initially, sound was off, and I needed to unmute audio using "pamixer". Audio then worked fine over HDMI (with a DisplayPort adapter) and the 3.5mm jack.

I even got wake-on-lan to work, hooray! This needed to be turned in the BIOS under "Power Management" as well as in the OS. For the OS part, the debian wiki had everything I needed, namely an extra three-line file in /etc/network/interfaces.d/, easy. I did notice that if you have wake-on-lan enabled on the ethernet interface and boot up without a cable plugged in, there is a pretty long delay during boot. I guess it's looking for the missing ethernet network interface.

I also discovered that you can get the kodi game emulator add-ons through this repository. LibreElec comes with the kodi libretro add-ons by default, arch has several of them in the AUR, but they are missing from the debian repos. Once I added an extra package (kodi-peripheral-joystick) for game controller support, launching emulators from within kodi worked nicely. I played a bit of GBA and Doom, no extensive testing, but both ran well.

Hardware video acceleration worked out of the box, which was a happy surprise after being unsuccessful with arch.

I did have to use a login manager (lightdm) to seemingly get the audio to work. It also seems the audio won't initialize properly if auto login is enabled. Unfortunately that means a keyboard is still needed to hit enter so that lightdm starts kodi.

Wrap-up

I'm really quite impressed with this little machine. The physical object feels like it's good quality, the case can be opened without tools, it's relatively small, it's fanless, it can run different linux distributions. When I started playing with the t620, I got a similar kind of excitement as I did when I first played with a raspberry pi 1: wow, this machine is low-power, small, discrete and yet it's basically a full computer with which you can do anything. My mind started racing with the different possibilites. Of course the t620 nowhere near as small as a single board computer, but it does have a case, a stand, a large heatsink, a proper M.2 socket and 6 USB ports (or 8 if you count the 2 internal ones). And the secondhand price is comparable to that of a single board computer.

Flexibility and vanilla linux distributions are the main advantage of the t620. Although the raspberry pi has raspbian (in which kodi is available), this is not the same as the upstream debian distro. That and the linux kernel for the raspberry pi is not mainline. This means continued software support is dependent on raspberry pi. Not so with the t620. Other ARM single board computers (I'm thinking of SBC's supported by armbian for example) also have software support limitations. They usually have varying levels of support by the mainstream, vanilla linux distributions (like arch or debian), and you are better served by a distribution which targets specific boards, like Armbian, LibreEelec or Lakka. Usually most things needed for headless use work perfectly fine, but hardware video acceleration or other specific hardware features are where these board-specific distros do better.

That's it for this post. The t620 is happily being used as media player and occasional emulation machine. In the future I want to put it somewhere offsite in a different location to my other servers, where hopefully it can serve double duty as a media player and a backup server that can be turned on remotely with wake-on-lan.

There are some other thin clients of interest, namely the t630 and t640. The t630 is a minor performance upgrade, while the t640 is a big step up. From the specs it should be able to run quite a snappy desktop. For the free software afficionados who want to avoid the AMD PSP (equivalent of the Intel ME) and binary blobs in these thin clients, an ARM board and LibreElec may be of interest. Although I've tested LibreElec on an orange pi 3 and not all emulators worked. I didn't try to setup wake-on-lan, but it may be board specific too.

Picture of an HP t620 next
		to an Orange Pi 3. Picture of an HP t620 on
		its side with an Orange Pi 3 on top.