My first real hardware project… building a home media server
Some of you may be wondering how I spend my free time when I’m not designing websites or writing WordPress plugins. Generally, the answer is “doing really geeky things”. This past weekend, for instance, I set up a media server on my home network that can stream to the Roku set-top-boxes on my living room and bedroom TVs.
In all, it cost me just shy of $80, with most of that going towards storage.
For the curious among you, this is how I did it.
1) Get an old computer.
You don’t need anything fancy… I’m using an HP Pavilion 533 circa 2002 running Windows XP Home. I got it secondhand for $10. Now granted, for $10, I didn’t get much… 40GB hard drive, 256MB of RAM, and no power cord/keyboard/mouse. Also, the CD drive won’t open until you jab at it with a paperclip and it has some sort of antique abomination called a “floppy drive”.
2) Get a really big hard drive.
40GB (with a pretty significant chunk of it going toward the operating system) probably won’t cut it for most people’s digital media collections. But the drive was perfectly good, so I decided to leave the existing hard drive alone and let it do all the OS stuff, and stick in a second drive with 1TB capacity exclusively for storage. I found one on eBay for $52… A nice Western Digital Green WD10EACS drive.
The only problem was that 1TB drives apparently only come in SATA flavor, and the Pavilion only has IDE connections (Here’s where I get to tell you that I’m SO not a hardware person… this whole project was pretty much all trial and error).
Amazon saved me on that little problem. For $6.50, I got a SATA to IDE hard drive adapter that snaps right on the end of the drive. It almost seemed too easy, but at $6.50, if it didn’t work, I figured I wasn’t out much. Update: I found out the hard way that those cheap little adapters are more trouble than they’re worth. The connection on mine was really loose, an the power to the drive kept cutting out. I ended up corrupting the drive (thank goodness for backups). I replaced the adapter with SATA power adapter and PCI SATA card and it works much, much better.
3) Buy more RAM.
The piddly 256MB the Pavilion came with was alright as long as you never wanted to update Windows XP past service pack 1. Unfortunately, the software I was planning to use needed it at service pack 3, or it wouldn’t even install. The board could handle up to a GB and memory is cheap ($11.32, in my case), so that’s what it got.
4) Assemble the beast.
Or rather… clean it, and then assemble it. This thing was made in 2002, and I don’t think the case had been opened since then… plus the (solitary) rear case fan was blowing in instead of out. It’s amazing how much dust a computer can accumulate inside it without choking and dying.
I’d like to reiterate that I’m not a hardware person, and it’s been a LONG time since that required computer maintenance class in college. Getting everything to work right took a few tries.
For one thing, it refused to recognize the second drive. I tried every configuration I could think of and played with the jumpers on both drives, trying to get it to work. I’m still not entirely sure what I was doing wrong. I finally gave up trying to put both drives on the same ribbon cable (I was initially attempting to make the storage drive a slave to the OS drive), and used the ribbon cable that was connecting the mostly useless CD drive to the board instead. That worked, so I left well enough alone.
For another, someone (possibly the manufacturer… I don’t know) password protected the BIOS, which I discovered when I attempted to verify that it was, indeed, detecting that the storage drive existed. FYI, Google helpfully says that you can reset that password by pulling out the CMOS battery on the board and waiting 5 to 10 minutes before putting it back.
5) Install stuff.
It might also help to get rid of any junk the OS came with. I’d considered dumping Windows XP and installing Ubuntu – and I might still do just that at some point – but I’m lazy, and that was extra work, so I opted uninstall the stuff I knew I wasn’t going to need just to keep things tidy.
After that, I started in on the Windows updates. I ultimately needed Service Pack 3, which meant I first had to upgrade to Service Pack 2. Windows Update was being less than helpful installing them automagically, so in the end, I downloaded both from microsoft.com and installed them manually.
Next, the media server software itself. I went with Plex. For one thing, it can stream to Roku, which was the whole point of building this thing. For another, it works with both Windows and Linux, so it I ever unlazy myself long enough to put Ubuntu on the machine, I won’t have to change much of anything.
I also wanted to be able to control the server from my laptop, so I added TightVNC. It’s free and it lets me screenshare.
The last thing I did was share the storage drive with my laptop (that nifty little “Share With” option when you right-click on a drive or directory in Windows). That way I could just transfer files directly over to the server rather than going to all the trouble of setting up FTP or using a USB thumb drive to move them.
6) Configure stuff.
Plex is fairly easy to set up. You pick the type of media and the directory Plex should expect to find it in, and it pretty much does the rest. A word of advice… don’t use the setting on Plex that tells it to refresh the database on every change to a monitored directory while you’re importing your entire media library. I crashed it twice before I figured that one out.
And of course, don’t forget to install the Plex channel on your Roku.
7) Tweak stuff.
I’m not 100% done with this project. I’m having some buffering issues streaming extremely large video files *cough*DVD rips*cough*, so I’m trying to find a happy medium between acceptable video quality and file size. Also, Lifehacker has a pretty nice article on other things I can add to make life easier.
Update: Since I originally wrote this post, I’ve made a couple of discoveries.
For one, I solved my buffering issue (sort of). My old-as-hell Pavilion came with a 2.0 GHz single core processor. When Plex streams a video, it transcodes it on-the-fly to a format the receiving device can play… which would be fine if I had the recommended minimum 2.5 GHz dual core processor Plex calls for. Unfortunately, the board in my Pavilion doesn’t support dual core processors (though I did upgrade it to a 2.4GHz single core I had lying around just for the hell of it), and the on-the-fly transcoding was just killing it. Lucky for me, though, Plex has the option to play a file without the transcoding. Simple solution: save the files in a format my Roku can play natively (like .m4v).
For another, I’ve discovered that Comcast-leased routers apparently prevent you from publishing your Plex server (something about double-NAT that I’m still not entirely clear on). From what I’ve been able to find out, the solution is to ditch the leased router and get my own so that I can put my router in a DMZ.