Some Computer News

Over the last couple days, I’ve acquired a whole bunch of TV shows with the HEVC codec. Not really a problem, but a lot of devices, like a Roku or Fire TV thing, can’t play it directly. That means it has to be transcoded. I use VAAPI in Jellyfin to trancode, but it doesn’t really work with HEVC. I found out the drivers that Debian provides are version 18.something, and I need at least version 20.1 for VAAPI to transcode HEVC video on an AMD graphics card. Those drivers are available in the testing repositories, but the dependency requirements are a little too complicated to make installing them worthwhile. I also put together a VM with Ubuntu 20.10, which has those drivers as standard, but it failed to boot up when I had the GPU passed though to it. The LTS version worked, but like Debian, the drivers are too old. Hopefully the newer drivers make it to Debian’s stable repos sooner rather than later. In the meantime, I’m fine for two reasons: First, I usually watch stuff through Kodi on a computer, which means I can direct play everything; second, my CPU can handle transcoding a couple streams at once, so it’s not a huge problem.

In other news, I ordered a new laptop today. I was eyeing a few during the black Friday week things a couple weeks ago, but decided against it. Today, I was at my parents’ house taking care of some school work. I had my Surface Book (first gen) hooked up to a 1080p monitor for some extra work space. I had Excel, Word, about a dozen Firefox tabs open while playing music on Spotify. It felt a little sluggish and not as responsive as it should be. In fact, when I scrolled though my RSS feeds, the music skipped when it was loading images. CPU usage was 80-95% when watching a 1080p Youtube video with the other stuff open in the background. This isn’t something I do often, and this semester is coming to an end, but I still have two more to go, and it is nice to take my work with me if I want to.

The touch screen on the Surface has also been broken since the summer. It sometimes experiences phantom touches along the bottom inch of the screen. That’s disappointing, but livable. I don’t really use the touchscreen. More unforgivable though, is the stylus situation. It won’t work along the edges of the screen, even after repeated calibrations, rendering it useless. I bought an iPad and Apple Pencil in September to pick up this slack, but I haven’t used it much. I haven’t felt the need to take notes in my classes. It feels like I kind of wasted the money on that, but eBay shows that I should be able to sell the stuff for almost as much as I paid for it if I want.

These issues got me looking for laptops this afternoon. I first turned to Slickdeals to see if there were any good deals out there today. First, I found an HP Pavilion that seemed like a good deal. It had a Ryzen 4700U CPU, 8GB RAM 128 GB NVMe SSD and a 1080p display for $450. Someone left a comment comparing it to a similar Dell. The Dell seemed like a better deal, with a better charging system, two M.2 slots, and 1x 8GB RAM stick (making the upgrade to 16GB easier). I found out from another Slickdeals post that there was 12% off Dell stuff with a sign up at a third-party site. I did that and was ready to order a 15″ Inspiron 5000 for about $500. I read and watched a few reviews, and decided the display and build quality would be too big a step down from the Surface, so I moved on.

I gave Best Buy a look and set my only criteria to an AMD processor and a 1080p display. Another HP popped up, but this time it was an Envy x360 (that means the screen flips all the way around). This one was equipped with a Ryzen 4500U, 256GB NVMe SSD and 8GB RAM for $629 new. I learned in the Best Buy questions and through some research that the RAM and SSD are able to be upgraded, and it’s compatible with an active stylus, like the Surface pen. The upgradability is a must-have for me, and the stylus compatibility is a huge plus. I waffled for a couple hours, but decided to buy an excellent condition open-box one for about $570. It should be in by December 22 they say, but of course I’m hoping it arrives earlier. The AMD processor bests more expensive Intels and has pretty good integrated graphics. I should be able to run some games at 1080p medium settings. It totally murders the i5 6300U in the Surface Book (11,286 passmark score vs. 3,269). The Verge called the 13″ version the best sub-$1000 laptop. I think I’ll probably keep the 256GB SSD for now, but I’ll definitely be upgrading to 16GB RAM as soon as possible. I’m really looking forward to it, and I’ll update when it comes in.

Here’s an update on a little bit of everything:

The computer stuff is working great. The TV set up seems to be working just fine, despite its Rube Goldbergian nature. In fact it’s probably working even better than the old set up. With the old set up, I’d have to restart the living room computer (containing the TV tuner) occasionally and often when I’d be getting comfortable in bed for the night. So far, no restarts of the cetonproxy virtual machine have been required. I suspected network performance might be degraded by having a network TV tuner, but it has not been impacted at all. I’ve been acquiring more TV shows and movies from a variety of sources and Jellyfin handles them with no trouble. I’m sure my system isn’t the sleekest out there, but it gets the job done for me. I’m sure I’ll make more adjustments in the future though.

On the car side, things are finally starting to return to normal. My car has been on jack stands in the driveway for two or three weeks now. I’ve been having a problem with erratic and incorrect readings from the right rear wheel speed sensor. I swapped the sensor with the left side and had no change. I decided to replace the right rear wheel bearing because it contains a magnetic wheel that the sensor reads to generate a signal. It’s not possible to see this ring without taking the bearing out of the spindle, so I decided for $50 or so, I might as well replace it if I take it out. So I got the new bearing installed in the span of a day, but had trouble putting the axle into the bearing. It’s an extremely tight fit, which I think is normal for my type of car. I tried hitting it cup portion of the axle with a hammer and pry bar to drive it into the bearing, but I poked a hole in that cup. So I need an axle. I took a chance on one labeled for an automatic version of my car for only $60. The flange on the differential side was 10mm too small to bolt up. So I sent it back and spend about triple the price on one that should fit my manual car. It should arrive by the end of the week I hope. I also hope it slides into the bearing easily like the automatic axle.

In the meantime, the air conditioning in my wife’s car quit working. I bought a set of manifold gauges to see what was going on inside the system. The gauge reading led me to suspect a broken expansion valve. My initial plan to remedy this was to have a local shop discharge the AC, then I would replace the valve myself, and go back to have the system recharged. I called a shop and they said it would cost $120 to do that. Way more than I was hoping to spend. So I decided to buy a vacuum pump and a few pounds of refrigerant for about the same price and do it myself. After draining the refrigerant, I set about replacing the valve. I was hoping I’d be able to take the valve out under the hood where the AC pipes go in and out of the cabin. Unfortunately, whoever at Honda designed that hole made it a few millimeters too small to get the valve out through it. So what could have been a half hour job took several hours (I did stop for breaks a few times). I had to remove the glove box, the cabin fan and a couple more pieces of plastic to take out the evaporator and then replace the expansion valve. Installation was the reverse of removal. Happily, the new valve did the trick, and the AC works again. I don’t think it’s quite as good as before though. With the car stopped in 90 degree heat, the air is cool but not cold. Moving along it’s fine. I’m so glad to have a car with working air conditioning again.

That’s it for now I guess. Computer things have been pretty static lately. I’m thinking about getting a Minecraft server going. I never really got into Minecraft back in the day, but I really want to. I’m usually a fan of open-ended games like Cities Skylines or No Man’s Sky, but maybe Minecraft is too open-ended. I did install a shader and neat texture pack, which makes a huge difference in the visuals. Maybe I’ll have to see if my brother can help me get into it.

TV is Working, More or Less

So I’ve gotten the TV working on the new system. It’s kind of a convoluted set up, but it works just about perfectly so far. I have coaxial cable coming into the office from the ONT in the basement, and that goes into a Ceton InfiniTV 6 Eth cable card TV tuner. The tuner is connected by ethernet to the Cisco switch and in turn to an ethernet port on the server. To my surprise, the tuner was plug and play with the switch. I was expecting to have to adjust some settings, but it worked right out of the box.

The tuner is accessed directly by a Windows 10 VM running a piece of software called cetonproxy. This makes the Ceton tuner appear to be an HDHomerun to other programs. It’s a Windows-only thing right now unfortunately, so I have 3 cores and 5GB of memory dedicated to a VM just to run this little utility. I’ve never used a container, but this seems like a good use case for one. I don’t know if it’s feasible to run Windows stuff inside a container, but I’ll have to do a little research.

After cetonproxy works its magic, the tuner is usable as an HDHomerun on everything. I initially wanted Jellyfin to handle all the TV tuning stuff, but it turned out the Jellyfin plugin for Kodi doesn’t really do live TV. It lets you watch channels, but there’s no guide or access to recordings, so it’s kind of useless in my opinion. This meant I had to use NextPVR to do my TV tuning.

I generally like NPVR, and I’ve been using it as my TV solution for about a year and a half. It does everything I need a PVR package to do, but it always felt a little bit rough around the edges to me. That’s probably because it’s developed largely by one person, and he can only do so much. It’s closed source, so no one else can contribute. I personally feel like the developer could have a much more robust package if he open-sourced it, but whatever. In the fall, he released a huge update to the program, and created a version for Linux.

After a couple false starts, I had the Linux version installed. The documentation for NPVR v5 is very sparse, and almost nonexistent for the Linux version. The web interface that’s now used to control the program seems to include fewer settings than the old set up, and the descriptions of the settings are very brief. This is something that could be vastly improved in an open source project. I’ll be researching to see if tvheadend can replace NPVR for me.

Yesterday, I recorded a bunch of shows. NPVR, and I assume most other PVR programs, record shows to a .ts file. I’m not sure what kind of encoding these files use, but it results in huge file sizes. A two hour-ish recording of the move Tangled resulted in a ~15GB file. That’s not a whole lot smaller than a similar-length Blu-Ray rip with multiple DTS and AC3 audio tracks. Handily, NPVR includes an option to automatically re-encode recordings after they finish. There is a choice between CPU and VAAPI (graphics card) encoding. Since I had the GPU set up for Jellyfin, I figured that would be the thing to use. I set it, and it didn’t work. I got some help from a rather brusque forum member. Turns out the developer omitted a line or two of code that is needed when selecting the VAAPI option. Again, something that probably wouldn’t happen in an open source project. So for now, VAAPI is useless. Additionally, either VAAPI sucks or my GPU (an RX480 4GB) does, because it can only process one of those .ts files at half speed, which means it takes 10 minutes to encode 5 minutes of video. I’m very disappointed because my RTX 2080 Super, which I know is a significantly better GPU, can plow through a 2 hour Blu-Ray rip in 20 minutes or so using NVENC. The CPU encoding option is much faster, at double speed, meaning a 5 minute video would take 2.5 minutes to encode. This uses 20 virtual cores though. I’ll have to see how it works with multiple simultaneous encoding jobs. I only have 32 cores to give, and the rest of the VMs need some too. For now though, I don’t have a choice.

Another fly in the ointment is Jellyfin and its NPVR plugin, which allows Jellyfin to use NPVR as a backend for TV services. I had it going in a test when I was using the old PCI tuner, but since I set up and then removed the tuners on Jellyfin, I can’t get it working again. There’s an update to Jellyfin out that I’ll probably install next week, so we’ll see if that fixes it. That successful test also used an older version of NPVR, which might have something to do with it. I don’t want to use the old version though. Overall, I’m satisfied. I get TV on my TVs, so I guess I can’t complain too much.

The Dust Settles

After too many weeks of struggling and waiting and struggling some more, I finally have a functional server running almost all the services I was planning on, including this blog. Last we left off, about a month ago, I was rounding up the parts I needed to assemble a white label server. So here’s what I got.

The Hardware

Intel S2400SC motherboard: This is a dual socket LGA1356 motherboard with eight RAM slots total and a decent selection of PCI express slots. I picked it because it has PCIe x16 and x8 slots that would be capable of holding a graphics card. I initially planned to use the built-in SAS mini ports to handle my hard drives, but this didn’t end up working out. I used the same Xeon E5-2450 CPUs I bought for the HP server. I also decided to add 16GB more memory just in case.

Dell PERC H310: I flashed this popular and cheap SAS card to IT mode which allows it to be used as an HBA so I can use ZFS instead of hardware RAID.

Corsair RM850x power supply: I spent a tad more than I wanted to really, but I wanted an 80 Plus Gold power supply giving at least 850 watts with semi-modular cables at the minimum. They were all priced similarly, but in and out of stock, probably due to the pandemic.

HP NC365T: A popular and cheap 4-port gigabit network card.

Antec P101 case: I picked this because it billed itself as a quiet case, it came with four fans and it said it should hold an E-ATX motherboard, meaning my CEB motherboard shouldn’t be a problem.

Turned out, the CEB motherboard was a tiny problem. Despite what the internet said would happen, only three screw holes lined up with the standoffs in the case. The standoffs that didn’t line up were touching the motherboard, so they had to be removed. The motherboard was definitely not mounted securely with only three screws, and it was a bit too flexible with no standoffs behind it. There were some foam standoffs on the motherboard, but only two and they weren’t in the right places.

I moved and super glued the foam standoffs into new positions, and then I 3D printed a few more for the rest of the board.

The orange things are the 3D printed standoffs.

With that done, it was no trouble the get the board in and screwed down. I had to use a zip tie in the upper right corner, but it gets the job done just fine. Building in this case was alright I guess. I’m not a fan of the immovable power supply shroud, and I don’t really care for the tool-less drive bays. On the other hand, there wasn’t much choice for an E-ATX case at this price.

Mmmmmm, that dual-socket goodness.

With the basic components assembled, it was time to install the hard drives and get going. Flashing the H310 to IT mode was a piece of cake and not worth talking about more. I bought two Seagate 1TB SAS drives to use in RAIDZ for my hypervisor. For some reason, these are incompatible with the H310. It knows the drives are connected, but doesn’t pass them though to the OS. I couldn’t get to them in Proxmox or a GParted live USB drive. It might be the fault of the hard drives, and not the H310, but I don’t have any other SAS equipped devices to test that theory out. So I bought another copy of an old 750GB SATA drive I had laying around. That worked just fine.

The Software

With the computer finally up and running, it was time to get some services installed. I got WordPress installed first, and it was running fine when it was being accessed via port forwarding on my router. I realized I was going to need a reverse proxy to handle access to multiple services on a single domain name. pfSense has HAProxy available in its repositories, so I decided to go with that. It’s a little convoluted to set up if you have no experience with reverse proxies, but after watching a couple videos and reading a few articles, I got it going. There was one problem though; no formatting (CSS and the like) was being applied to web pages accessed through the reverse proxy.

I found a few solutions on the web, but I couldn’t figure out how to implement them. They all involved changing the HAProxy configuration, which wasn’t a problem. It seems like most people run these reverse proxies on a separate virtual machine, not on pfSense, so their configuration was done in a text file rather than a web interface. Forum posters were being told to add a couple lines of code to the config files, but I wasn’t able to do that on pfSense. I decided to come back to that later.

After adjusting some HAProxy settings to try to get a reverse proxy going for my local services, I accidentally locked myself out of the pfSense web interface. No problem, I thought, I’ll just roll back to the most recent snapshot. So I did, and I was back in. That also wiped out the new SSL certificate I made earlier in the day. Again, not a problem I thought, I’ll just issue it again. Turns out I had already issued all the duplicate certificates I was allowed for the week, and I couldn’t get a new one until the next week (today).

In the Meantime

While I was waiting for the timer to run out on the certificate, I decided to press on with some other services. I set up a wiki to keep track of my network and installation notes for things. I decided to would be fun to try out an RSS reader, so I got Tiny Tiny RSS going.

A big part of setting up this server was for media serving with Plex, or something like it. I looked into the options, and it seems the three most popular, in descending order, are Plex, Emby and Jellyfin. I was originally planning on Plex, because it has the best name recognition and I knew it could do what I wanted. I tried out Emby before, and I was considering it this time. I hadn’t heard of Jellyfin before, but people seemed to like it. I axed Plex because while most commenters said it did a great job of serving up media, many useful functions are locked behind a not-inexpensive premium tier. The same is true of Emby, and Emby has an additional demerit with its licensing. Basically, Emby used to be open source, and the developers suddenly decided to go closed source. I don’t necessarily have a problem with closed-source software, but going from open to closed, and so abruptly is a problem to me. Jellyfin picked up the pieces and is based on the last open-source Emby code available. It’s not totally 100% quite yet, but it does everything I need.

From the start, this media server was supposed to take over the live TV services from the living room computer. Things were looking promising at first. Jellyfin supports live TV, and using NextPVR as a backend, so I was all set with my stupid Ceton tuner. I put the tuner in (with no drama like the HP server had) and set up PCI passthrough to a Windows VM for NPVR. I connected Jellyfin to that and things were working perfectly, with absolutely no fuss. I seemed too good to be true. And it was.

While the tuner worked perfectly (better than the bare-metal installation on the living room computer) with the Windows VM turned on, things went south when I shut the VM off. Shutting the VM down crashed the whole server. It was an abrupt shutdown, like yanking the power cord. That wouldn’t work. If it was a graceful shutdown, like clicking the button in Proxmox, maybe I could have dealt with it. Maybe not with the frequency with which Windows needs to reboot for updates.

The only solution to letting the new server handle the TV services was to get a new tuner. Pickin’s are pretty slim when it comes to cable card tuners these days. You can either have an old (used) HD Homerun, but they’re really expensive and only have three tuners, or you can have a stupid Ceton which has more tuners, but has very little software support (probably because the company doesn’t exist anymore). I picked a Ceton InfiniTV 6 Eth. This is an ethernet tuner similar in style to an HD Homerun, except worse. It’s gotten a tad less painful to go with a Ceton tuner in the past year because one enterprising person in the NPVR community has authored a piece of software called cetonproxy. This makes a Ceton tuner appear to be an HD Homerun device. That means I can either use NPVR 5.0 to handle tuning, or let Jellyfin do it directly. I’m not sure which way I’m going to go, but the tuner should be in tomorrow I hope, so I’ll post an update soon.

Today

I was finally able to issue a new SSL certificate today. I got HAProxy set up after reviewing a few tutorials and I figured out what I needed to do to make WordPress and my other services work though the reverse proxy. Some services need this code added to the “Backend pass thru” section of their backend configuration:

http-response set-header Content-Security-Policy upgrade-insecure-requests

Some need this added to the same section:

http-request set-header X-Forwarded-Port %[dst_port]
    http-request add-header X-Forwarded-Proto https if { ssl_fc }

I don’t know why some need one or the other, but it works, so ¯\_(ツ)_/¯. I’ll have to read about it some time.

WordPress would load up mostly fine with the the first option, but some sections of the site, like the live appearance customizer wouldn’t load, and Firefox would tell me passwords may not be secure. This said to me that there was mixed http and https content being served up. This happens because WordPress doesn’t know it’s behind a reverse proxy that is handling SSL. All I had to do was add this code to the top of my wp-config.php file:

/** Make sure WordPress understands it's behind an SSL terminator */
define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on'; 

Next

Coming up this week, I need to get the TV tuner set up and get a torrent client going with Jackett, Radarr and Sonarr. The weather is going to be very hot and sometimes rainy after tomorrow, so it should be a great time to stay inside at the computer. I’m so happy to have the blog back after a month away. I really missed it.