Home

Stuff that I’ve done at home, not really school related but I feel they need to be documented somewhere…

Building a Media PC

I bought my mother a 42″ LCD TV (A 720p Acer one) for around $900 about 8 months or so ago. We were using a cheap Set top box with it which also had a recording function. It wasn’t too bad, however it started to get a little… dodgy. This included fuzzy signal and recordings not working and such. So we decided to throw it out and build something new.

In my investigating, I decided that we should buy a Tivo.  Before I got around to buying it, I visted a friend of a friend and they had this Media PC set up and it was working really well, so I instead decided that I’d go ahead and build my own Media PC.

3577639583_082d0796c9

Hardware

The computer has a cheap motherboard/cpu/ram setup with the old video card from my gaming machine (an nVidia 6600GT). I used the case from one of my old computers and bought a new power supply too.

My cheaping out on the power supply was a terrible idea, it has an 8cm fan that is fairly loud, which can get annoying when you’re trying to watch TV. Thankfully it’s not too much of a problem.

The hardware Specs are:   2.4ghz Core2Duo, 2gb DDR2 ram, nVidia 6600GT (128mb) Video Card and for the hard drives I use a 40gig System Drive (I have like 10 different 40gig drives lying around) and a 250gb SATA drive for TV Cache and Recorded Shows (I’ll explain later in this post).

I can’t remember the exact cost, but we’re looking at about $400 or so worth of parts (cheaper than the $700 Tivo).

The TV Card is the main part of a Media PC setup, you need something that isn’t so cheap that it fails to do what you want it to do but you don’t want to spend a billion dollars on it. The one I found was the DViCO DVB-T Dual Express. It’s available from a few major retailers for about $150AUD.  It has good reception, a nice remote, allows tuning into two channels at once (record one channel, watch one channel, or two computers on different channels (see MediaPortal below).

A nice listing of hardware that would be suitable for a Media PC is at my Server Building guide, all you would need to add is a TV Tuner card, also the motherboard in that article has HDMI out, which is just perfect for todays High Definition TVs.

3577640247_c5153b7e8f

Software

There’s many different Media Center programs out there, the most common one being Windows Media Center, though, the version of windows I used for this didn’t come with it. Instead, I used a program called Media Portal, it’s free and has a lot of good features.

Some of the things that I think makes Media Portal stand out above the rest are:

  • The ability to share your TV to other computers in the house.
    This means you can have your media PC watching one channel while another computer is watching another channel, or you can schedule recordings from another computer without inturrupting what’s happening on the other computer.
  • Hooks in with your existing video library
    I have it connected to my server (Zoe) so it can see the videos stored there and allow easy access to them.
  • Nice easy recording options
  • My Mum can use it

MediaPortal is a Windows only program, I figured I would use Windows XP Pro 32bit, I had a copy lying around at the time and figured that it’d be fine. (See Further below for Issues)

Configuration

As for setting it up, I installed Windows, updated it to the latest version of Windows (then turned off automatic updating, Auto Updates are EVIL), I didn’t bother with Antivirus as Firefox + Common Sense makes Antivirus unnecessary (Note for all of you about to uninstall your antivirus, I know what I’m doing, this machine does not store any important data and losing it all to a virus isn’t a problem for me).

I installed MediaPortal and configured it, one of the things I did was mapped a drive that links straight to the videos share on my server (you will need to do this to get MediaPortal to see it) as well as got all the TV Channels added (some of the channels like Prime have 3 channels broadcasting the same thing, you can turn this off in the Server Configuration of MediaPortal).

With my dual drives, I keep the system on the first drive and then put all my video on the second drive. Drive 2 is named “Bruce” (name courtesy of my Dad). On that drive there’s a folder for recordings and a folder for TV Cache, TV Cache is used to store the timeshifting that allows you to rewind live TV. Note that the TV Cache is necessary whether you use Timeshifting or not, the way MediaPortal works is by having the server record the TV and save it into a TV Cache file and then the Media Portal program stream the TV from that file (don’t worry, you can run the TV Server and the TV Client Program on the same machine).  Because it works this way, it allows multiple computers to be connected to the same TV Server. The setup in our home has the Media PC in the lounge room and I can access TV from the PC in my bedroom.

Other things of note: It’s a good idea to set auto login up and set MediaPortal to open when you turn on your computer. The remote will need to be configured to work with MediaPortal. I simply worked out what keys to press to make things happen in MediaPortal, then mapped them to the remote (also see, Issues below).

Issues

Building a MediaPC is not as simple as I had hoped. Here are some of the issues I came across.

General Windows Douchebaggery – The copy of windows I had used seemed to have some strange issue with Explorer not being a happy chappy. This caused random problems with Windows Explorer crashing. I have no clue why or how so I formatted. (See “Soon to come”)

Remote Issues – Two things here, firstly, the remote isn’t very responsive, you’ve got a list of 700 movies to scroll down through, and you can only press “down” once every second. I got around this by setting up the skip buttons to skip through a list page by page it doesn’t take as long to go through a list. The 1 second wait time between button presses is annoying though.

“Could not start Timeshifting” – I couldn’t find any information on this at all. It was an error that occurred when we had the media PC set to go to sleep rather than to bootup/shutdown. What I think it may be is that the TV Card isn’t properly freeing itself up when the computer goes to sleep, so it gets stuck and throws us this unhelpful error message.

Channel 10 Fails – A trick by channel 10 and other major TV networks is to make TV shows go for 10 minutes longer than they’re schedualed so that they make you sit and watch 10 minutes of the previous show, the intention of this is to get you to get interested in the show on before it. Unfortunately, this therefore means that when you’re recording TV, it starts too early and you also miss the end of the show.  To fix this, there’s a setting in the Server software to say “Prerecord x minutes and postrecord x minutes”. I set both to about 15 minutes.

Running out of Space – Depending on how much you’re timeshifting with, MediaPortal needs room to move. For TV Cache this means upto 5gigs and for recordings you’ll want to set aside a lot more. Our 250gb recording drive gets full every now and then.  The big problem with it is, it doesn’t tell you what’s going on, only that it can’t start the TV Stream. You will probably also notice that it will slow down a lot just before it gets completely full. I’m thinking up a possible solution to this (a warning system perhaps).

TV Stream Freezing – This happens rarely, but it still happens. Maybe, once every 2 weeks, the TV Stream will just crash, freeze, go glitchy or something equally unwatchable. The easiest way to fix it is to just reboot the computer, then everything is fine after that, it’s still a pain in the butt though, there’s so many points that could be failing (Media Portal, Windows, TV Card, Hard Drive).

Windows Incompatability – Media Portal REQUIRES Windows XP SP2/Vista SP1 or higher to run as well as the .NET framework.  I also had issues getting it to run on Windows Server 2008. It doesn’t seem to want to run in VMWare or Sun VirtualBox on my MacBook either 🙁

Soon to Come

At the time of this post, I’m currently installing Windows Vista onto my Media PC. I figured it was worth giving it a shot (and again some time later I might try Windows 7 too).

I’m also perhaps looking at a method of doing a warning when the Media Center runs out of space (instead of having a big cry).

If you like the post, want more information or there’s anything you’d like to see on my blog, please feel free to comment.

Ducky.

Posted by duck in Home, How-To Guides, Reviews

Server Building with Rudd Money

Update: 29/1/17 – This is all old. Currently I’m using a HP Microserver and FreeNAS.  Server Wise, FreeNAS is glorious for a NAS compared to OpenSolaris.

At the moment for storage, I use a set of external hard drives for storing all my data.

On my MacBook, I have: 500gb + 500gb + 200gb + 300gb External Firewire drives and a 500gb internal drive.  This was going good for me, except for a few issues:

1. In the middle of the night drives would randomly spin up, unless they were positioned perfectly the hum would go through the wall and straight to my bed. This got annoying.

2. There is no redundancy in any of my drives, if a drive fails, I’ve lost all my data.

3. My music drive is only 200gb, I have more than 200gb of music, so my music collection is split into multiple places.

4. All the other computers in the house link through mine for music/movies. All our stored TV Shows (recorded through the media PC) get stored on my external drives and then accessed through the network. If I take my laptop to work, then there’s no access to movies.

5. Firewire is being phased out on the Mac Laptops, I’m due for a new laptop early next year and it most likely won’t have firewire, leaving me with no access to my drives.

So, because of all these issues, I decided to build myself a new server.

Now, I could run off and grab myself a nice HP ProLiant DL380 server for a mere $5,900 (plus extra for the drives). I’ve worked with similar servers at my work, but they’re loud and overkill for what I want to do.

I decided to do a bit of shopping around to see what I could get, I used my 2 main sources of cheap parts, umart and PC Case Gear.   Difference between the two is that PC Case Gear has awesome support, a bigger range, faster shipping and and nicer looking website (but is a tad more expensive).

Now, the parts.  I decided to go with an AMD Board and CPU, I’ve already built 2 Core2Duo machines and I HATE the way the CPU heatsink clips on, if you’ve ever had to push something onto a motherboard while watching the board flex as you do it, you know exactly what I’m talking about.

CPU:   AMD Athlon 64 5200+AM2    –   Price:  $87
I went as cheap as I could on the CPU, anything new enough can handle what I had in mind for it.

RAM:  Corsair DDR2 Twin2X 6400C5  4gb     –   Price: $68
Corsair makes great quality, fast ram. For what I had in mind, 4gigs would be enough. This comes as 2x2gb sticks.  Note that the speed is 800mhz and not 667mhz, so it’s not the slowest stuff. (The motherboard will support upto 1200mhz ram, if I could afford it).

Motherboard:  Gigabyte GA-MA780G-UD3H AMD780G FSB5200 4DDR2 1200OC VGA PCIE2.0 GbLA     —  $143
I’ve generally always cheaped out on motherboards, this time I didn’t so much.  It has onboard Video, 4 slots for Ram, Gigabit LAN, 6 SATA plugs and something I didn’t know it came with, but is great, was the fact that the board uses 2oz copper, I don’t know exactly what they mean by that, but the board is thicker than usual motherboards and doesn’t bend anywhere as easily as the cheaper ones do. It also has high quality capacitors, so it *should* be a durable board. Note that the board has no fans on it, this means it will run silently.

Case:  Antec Three Hundred Tower Gaming Case – Black   —  $104
I could have gone as cheap as I could on the case, but I’ve learned that having a good case will keep everything running together smoothly and quietly. The case also comes with 2 12cm fans (the bigger the fan, the more air it can move, the slower it has to run and all that means the fans can run silently).Case

Power Supply: Corsair VX-450 450Watt Power Supply     –   $125
This was the only part I bought from PC Case Gear, as I couldn’t find a suitable one from UMart. I actually wanted the 400Watt version of this, but they wouldn’t have it in stock till later this month so they gave me the option of getting this one instead. You should always make sure it has enough connectors for what you want to do, I was planning on running at least 4 SATA Drives on it, this PSU comes with 6 (perfect).

Hard Drives:  2x Seagate SATAII NCQ 7200RPM 32mb Cache 1tb   –  $159ea
1xSeagate SATAII 7200RPM 32mb Cache (earlier model) 1tb – Already Owned
1xWestern Digital SATA2 5400RPM 32mb Cache GreenPower 1tb – Already Owned
I already owned 2 of the drives and had them sitting in cases that I was using for long term storage, I cleared them off and shuffled data around till I could have them empty to use in the server.  I didn’t realise one of the drives was 5400RPM, and I suggest against doing this, one 5400RPM drive could slow down performance for your entire raid.

Postage: umart – $39
PC Case Gear – $17
The umart order got posted with fastways. I got a message from umart saying they’ve shipped my order at 8pm one night, at 7:20am the next morning the order arrived at my door.
The PC Case gear order took 2 days to arrive.

Setting Up

As for setting everything up, it was relatively pain free. There was a screw hole on the motherboard that wouldn’t line up with anything on the case which was a little dissapointing. The case was pretty solidly built (some cases you can easily flex the metal of the case).CaseInside

If you go to use an Antec case with the bottom mounted PSU, you should probably check to see if the cables from the Power Supply are long enough, because I got the umart order earlier and was just waiting on the power supply to test it, I tried to put a cheap powersupply in but the cables weren’t long enough to fit.

As what happened with the last machine I built, the cable for the power light on the case has a 3 pin plug (with only the two outside pins being used) but the motherboard will only let me plug in a 2 pin plug. I really with someone would set a proper standard for this as it’s happened to me twice.  I ignored it, connected the power light to the hard drive activity light so I can at least see when the computer is turned on.  At a later stage I might rewire the connector so I can plug everything into where it’s supposed to go.

The CPU heatsink felt a little dodgy going on, I may have done it slightly wrong, but when I did get all clipped on it felt sturdy (unlike previous Core2Duo heatsinks that felt like they weren’t clipped on properly).

Getting all the Hard Drives in took a while to get it all neat, carefully folding cables and moving everything around until it fit right.  I also used a 40gig IDE Drive as the system drive. I was hoping it wouldn’t affect performance too much, it seems ok. (note, I carefully tested the drive for all forms of errors before using it, if you’re planning on using an old drive for anything, you should always use Spinrite or HDD Regenerator to test for errors (1 or 2 errors is reason enough to throw it out)).Hard Drives

I didn’t put in a CD Drive, I’m planning on borrowing a CD Drive from another machine to install the OS, after it’s installed I won’t need a CD Drive for running it.

System and Software

Now, for the system I wasn’t sure what I wanted to use for the OS.  I knew I wanted to raid the drives together some how to add some redundancy in, I also wanted to have the system usable for other purposes as well (like web hosting, ssh access etc).

I had done a load of research on different raid levels, and I decided on using a RAID-Z, this is very similar to a RAID-5, where you get:  Drive Size * (Number of Drives – 1) of usable storage space. In my case with 4x1tb drives:   1tb * (4 – 1) = 3tb of space.
This setup means that any one drive can fail without the system going down or any sort of data loss.

To use a RAID-Z, I need to use a form of Solaris, I chose OpenSolaris, it’s free and Open Source. It’s not exactly Linux either, it runs differently in a few ways. Though a lot of the commands are still the same.

I had some trouble getting the network sharing to work right, I followed a few different guides but found this one to be pretty good. If you’re going to do something similar, I suggest you do a lot of reading about everything so you know what you’re trying to do.

Statistics

Now for some numbers 😛

Transferring from my Mac to the Server, I get upto 60MiB/s, I get around the same from my Windows Vista Ultimate machine (Over gigabit ethernet).

On the server end, the network peaked at about 91MiB/s with both the Mac and the PC transferring files to the server.  Compared to my Firewire drives, this is getting near double the theoretical maximum of Firewire. (Firewire does 400Mbit/s, a theoretical max of 50MiB/s, in practice I get upto 40-45MiB/s over Firewire).

Using the command:  “yes > crapfile”  on the server resulted in the drives being written to at upto 140MiB/s.  Thus, with the gigabit connection to the server running at a max of 91MiB/s, the hard drives are no longer a bottleneck. (I don’t know how reliable the “yes > crapfile” command is, but it seemed to do the job pretty well 😉 )

Here’s a screenshot of the server during transferring data, note that the CPU usage is nowhere near being maxed out, the RAM is maxed out due to RAM caching, but it isn’t affecting the network speed so everything seems to be handling it well.

System Monitor during a Data Transfer

What next?

The server is currently in testing phases at the moment, I still need to set up permissions, reformat the machine to be 64bit (the version I’m using for testing was actually installed on a Pentium 4 then I moved the drive to the server machine), set up Apache/MySQL/PHP as well as build a web interface for administratrion. In the future I’m also working on building the comptuer into a “Home Server” machine that will handle as many things as I can think will be cool 😛

Naming

I figured I’d add, I named the computer Zoe, after a character from the TV Series called Caprica (currently there’s only a pilot released). I called the Raid “Caprica” too 🙂

Conclusion

In conclusion, I’m very happy with all the parts for the server, there’s still a bit left to work out software side too though.

The total cost for it all was: $585.84 without drives
With 4x1tb drives the cost is: $1221.84  (that’s $636 worth of drives)

Posted by duck in Home, How-To Guides, Reviews