More HTPC Adventures

22 Jul, 2023 | Tech

It’s been a while since I’ve played about with my Home Theatre PC (HTPC or media centre). I’ve added disks as needed every once in a while, but that's about all since I moved to a combination of NextPVR and Kodi.

I did have a brief foray into the mini PC realm with an ACEPC GK3V, but the eMMC drive died within a couple of months and they weren't overly helpful about sorting that out so I returned it.

A change of TV a few years back brought Android with it, meaning I could install Kodi directly on that and move the mATX tower elsewhere in the house to act as a server rather than having it be directly connected to the TV, but that was the only real update.

The issue with that was getting the library synced across the TV and the PC, as Kodi is designed as a client rather than a server. It can support the same library on multiple devices, but that involves setting up a database and copying setup files to each device. Oh and all of the devices need to run the exact same version of Kodi (and my TV likes to update itself with no warning).

So I ignored that and persevered by manually searching through the file system each time I wanted to watch something, rather than using the library itself. More recently I started looking at alternatives.

Shrinking hardware

Although I’d moved my HTPC over to my old desktop hardware, that was too noisy (more on that below) and power hungry for me to want to leave it on continuously as it sat in my spare room, which I use as an office so spend a lot of time in.

The HTPC had been running on a small, low power AMD AM1 (AKA FS1b) setup that seemed to do the job fine. Before changing the software, the plan was to attach the PC directly to the TV as I had previously done, but rather than the massive mATX case it was previously housed in I acquired a Yottamaster FS4 DAS (Direct Attached Storage) for the storage HDDs, and I was looking to move the machine to an Antec ISK 300-65 case I had knocking around from an old desktop build (this was after the ACEPC experiment died).

The issue with that is the AM1 motherboard I had was mATX in size, and the hardware has long been discontinued. Some hunting on eBay eventually scored me a preowned but unused MSI AM1I motherboard (for £10), which is mini-ITX in size. Perfect.

Moving Kodi over was all fine (the Corsair CSR-SSD128 I bought back in 2009 is still going strong, so SSDs clearly do last) but the HDDs in that external enclosure were noisy -- not stupid loud, but when the TV was off I could hear them across the room. I tried disabling the fan, but it was the actual spinning metal that was the problem

In the end they were moved back to the old case and joined by new hardware after I built a new desktop PC, which freed up the previous Intel setup.

I was going to use the small case as something else, but when I elected to move to Jellyfin that seemed the perfect option (in hindsight, not sure why, perhaps because the built-in 65W power supply was limited for other setups). The only issue was storage.

Over the years my media had grown to about 13TB, though I was only using around 8-9TB. I considered a single 12TB HDD, which would reduce the noise and power requirements considerably. The price of those wasn't too bad, and then I looked at the price of SSDs, which had been dropping. The largest seemed to be 8TB, which was very expensive, but as I delayed and delayed the price of 4TB drives kept falling.

A birthday and a final commitment to get this sorted out saw me gifted or purchase:

I elected for the Crucial drive because it offered some future proofing (as that seems to be the way drives are going and it was considerably faster than the SATA) despite the motherboard being way too old for NVMe support.

I would have stuck with NVMe drives but Samsung were having a summer sale so the initially higher price of £229.98 for the SATA drive dropped to £154.98 once a £75 cashback was taken into consideration (compared to the £177 for the NVMe drive plus the cost of an adapter card or external enclosure).

An additional drive — probably NVMe using a PCIe adapter as the board has a x16 slot capable of x4 speeds — will get added at some stage to boost the storage even further. Although the deals coming in on 2.5” drives are tempting.

Amazon’s deals day saw the price of Crucial NVMe drives plummet so I picked up and added the following:

Impressive what you can squeeze into (or attached to) a little mini-ITX case.

Although the machine handles playback of 1080p okay, I did bump the 4GB of RAM to 8GB (a whopping £6.50 on eBay provided me an opened but unused stick of identical Kingston RAM to what I had). I’ve not tried 4K yet, so we’ll see if the ancient CPU can handle it if/when I get around to owning any.

One thing I still required was an optical drive because I will need to rip new discs I buy. The Antec case has room for a slimline optical drive, but

  1. I wanted to use the only two motherboard SATA ports for storage,
  2. I wanted to use the only PCIe slot for storage (rather than a SATA adapter) and
  3. slimline blu-ray drives are still weirdly expensive (new ones were £100+ for internal and more like £150 for external — at least for any brand you’ve heard of)

I already had a blu-ray drive in my previous machine, but it was a 5.25” unit. I have an external DVD drive from Freecom that is essentially a desktop drive in an enclosure (and PATA internally, as I checked to see if I could just break it open). So I looked for something similar, or perhaps an enclosure to convert my internal drive to external. Needless to say there weren’t a lot of options, though they do exist. I just wasn’t willing to pay the £50-60 it cost for what is essentially a box and a USB adapter.

In the end, I found an external USB connector by Wavlink that was designed for 3.5” drives (technically I have a USB adapter like this already but mine includes a cradle to slot the HDD into, which isn’t much use for an optical drive). The reviews on Amazon suggested it worked with at least some optical drives (Blu-rays were mentioned too) so I took a gamble on the £18 device.

After an initial disappointment, before realising I hadn’t turned on the socket the external power connector was plugged in to, it worked and I was able to read from what was formerly an internal drive over USB.

For future expansion, the motherboard has a mini-PCIe connector I may be able to use for USB 3 or another NVMe to PCIe adapter for additional drives.

Swimming with Jellyfin

For those with any interest in the media centre space Plex is well known, but it didn’t quite fit the bill for me. Another, open source, option -- Jellyfin -- was a name that seems to have been on the rise and has come up more than a few times due to my casual interest in sector. It looked great and it didn’t require any hoop jumping to work across multiple devices. Unlike some alternatives it runs on Linux too (I was looking to move away from Windows — mainly to lower resource requirements while increasing security and stability, and to remove the nagging about updates along with the random reboots when it applied them).

I installed Linux Mint XCFE on the newly configured mini-ITX machine, in the belief it had lower resource requirements than the regular Mint build and as this would largely be headless there didn’t seem much point in a more complex window manager.

Jellyfin itself was fairly easy to install, though I got caught out by the lack of FFMpeg if I remember correctly. I also tried some of the hardware acceleration options but AMD seem to lag a little in this and a chip of this generation didn't offer any -- though I may need to swing back around on that as VA-API may work if I understand it correctly.

The one downside with Jellyfin is it doesn’t support the default ripped DVD format using VIDEO_TS folders. So that meant I had to convert all of those to MKV containers. Not a long process for a single title, but I had about 300 of them. So that took a while.

Saving space

While I was converting the DVDs to MKV I also looked into transcoding some of them to a more space efficient format. I’d previously done this with a few TV series, changing them to h265. As my computers don’t have hardware encoding for that format each one took a while -- roughly 50 minutes for a 40-minute TV episode in regular definition.

I considered picking up a socket 1150 Xeon to replace the G3258 processor in my old desktop, which is what I was using to transcode. Or perhaps adding a GPU to speed it up.

While researching that, it turned out CPUs were still considered far quicker for transcoding and that my processor provided hardware acceleration for h264 encoding via Intel’s Quick Sync Video functionality (it’s existed on chips since the gen 6/Sandy Bridge days — h265 comes on Skylake).

Testing an encode using that h264 acceleration resulted in a file size smaller than h265 and it took just over 4 minutes to complete — much more palatable.

So the crunching began, mainly on TV series, where I created a powershell script to process all MKV files in the target folder and convert them.

At some point there comes a cost versus benefit trade-off on these though, because the amount of time it takes to identify and babysit the conversion probably doesn’t justify simply buying more storage.

I’ve got the power

Part of the reason for not using the old desktop PC as the new media centre was the idle power consumption (there was a time when I’d have considered 35 watts pretty good). This little machine is idling at about 11.5 watts1 (it was 10.5 watts before the PCIe adapter and additional SSD were added), which is much more palatable.

(Subsequent testing using a Linux bootable USB and not much else attached showed the G3258 platform could idle at about 18.5W though, so there may be an option to use that instead and benefit from a lot more CPU power. Though that does compare to 9W on a bare AM1 system.)

During playback of an SD movie it jumps to the 25-29 watt range.

The only fan in the system is the stock cooler (try finding an aftermarket cooler for an AM1 chip these days!) but I’ve stuck with that since I bought the chip back in 2009 as it’s very quiet (to the point that even with the case lid off I can barely hear it on a desk within arm’s length).

With no other moving parts, the machine is essentially silent.

The frontend

I installed the JellyCon add-on to Kodi and, aside from having to click through quite a few options to get to the library, that has worked well.

I should look into the options to make this work a little more seamlessly as their docs suggest there are some ways to add it to the main menu in Kodi.

Future ideas

Having seen a tutorial of a setup running Jellyfin using Unraid I'm considering a move to that. Unraid runs from a USB stick, which would free up an internal SATA port to allow for additional storage in the future. It also has a web interface and I haven't yet got a good remote connection working on Mint so I need to connect a monitor and keyboard any time I want to do something with the machine.

I haven't set up NextPVR or added the option to view/record live TV yet. I don't watch much these days so it's not been an issue, and with the UK channels available via free streaming services anything I do want to watch I can usually access that way. So it may never be added but who knows.

I could try and make this accessible externally, but I think I'd need to get live transcoding working for that and without hardware acceleration that is likely to be a step beyond my lightweight hardware. I may try it if that does work. If not, it'll likely need to wait until mini-ITX boards like the J4XXX/J5XXX come into the bargain bracket with their Quick Sync acceleration.

I'm also tempted to move the whole setup back to the AM1 mATX board and case to free up the mini-ITX components for other things (I figure that'll be easier to lug around). Or, if I can work out how to get the idle draw down, my old G3258 desktop hardware which would add transcoding ability (some recent tweaking has that idling at 18W so this isn't as bad as when all of the HDDs were attached). The latter would offer not only a lot more processing power but also additional connection options (twice as many SATA ports for a start).

Wrapping up

Jellyfin seems to have done a fairly good job of identifying movies and TV shows, though I did need to sort a few out. A better job than Kodi did that's for sure, and unlike Kodi none of the media disappeared when it simply decided it couldn't identify the media.

It's been good to get it back up and running. A far from cheap exercise in the end, but it should keep me going for a while -- long enough for the price of 8TB SSDs to drop to something reasonable I hope. Although I have options to extend storage via other means should I need to.

1. All power measurements taken from the wall using a kill-a-watt style device