We finally got a cabinet for our home theater stack, which is good, because our daughter is just about to start walking! I had three simple criteria for the cabinet: big enough to hold our components, made of wood, and with glass-front doors that can be child-proofed. It was surprisingly difficult to find something that fit the bill.
Anyway, this post isn't about the cabinet, but the subsequent upgrade that the cabinet instigated: the mythbox is a regular tower PC, so to fit in the cabinet it has to lay on its side, which makes the DVD drive unusable. This doesn't seem like too big a deal, but taken together with my other peeves about that system (very loud fans; looks ugly and out of place in the living room; lacks the horsepower needed to decode HD video; and a fragile and increasingly complex disk partition layout that is perpetually threatening to overrun its capacity). That's right: time for a new Mythbox!
Let's go shopping!
This time, I decided to do it Right: get a media-center computer case with very quiet fans, a decent CPU/GPU that might have a chance to playback HD video, and a single large SATA hard drive that I can partition in a non-insane way to accommodate our needs. It's really amazing how much system can be had for less that $400 these days:
- Case: Antec NSK 2480 [$100]. This clean aluminum media case looks a lot like a normal piece of A/V equipment, and the internal layout is really thoughtfully designed (apparently, an internet-famous case fetishist was heavily involved). This thing is dead quiet, too. This may sound like hyperbole, but it's literally true: when I first powered it on, I thought I must have missed a connection somewhere, because I didn't think it was on!
- CPU: AMD Athlon X2 4050e 2.1 GHz dual-core [$40]. The fact that this level of computing power is available for the cost of dinner for two is really really stupid in a really good way. 40 bucks...unbelieveable! I could have spent $70, which would have bumped it up to 2.8 GHz, but really, what's the point? I'd just be chasing a number at that point, I think.
- MoBo: Gigabyte GA-MA78GPM-UD2H [$100]. I needed a MicroATX form factor for the Antec case, and an AM2 socket for the CPU. I wanted good onboard video/sound/ethernet, and with SATA and Firewire controllers built-in. Oh, and I wanted HDMI and digital audio outputs so I can plug it directly into my Sony soundbar, so I can get rid of my crazy routing through the TV. This one fit the bill, and I've been happy with Gigabyte boards in the past. I'm hoping the onboard Radeon GPU will have enough firepower to decode HD video, but I actually haven't finished setting it all up yet, so we'll see...
- RAM: OCZ 2x2GB DDR2 800 SDRAM [$50]. RAM is now $10 per GB. That's sick...I remember paying ten times that not to long ago! I love it.
- HD: WD Caviar Green 1TB [$90]. Not to harp on about how cheap all this tech is (too late!), but ten years ago, someone I knew paid a few thousand dollars for an 18GB hard drive.
And...that's it! Build your own mythbox in five easy pieces. Well, not quite. Normally, I'd have to buy a DVD drive too, but I'm harvesting the one from my Linux-box-that-went-boom. Also, I didn't realize that the CPU didn't come with a heatsink/fan, so I had to run to Fry's to pick one up. Can I just say, the CPU cooling market is getting a bit out of hand. There were all kinds of enormous coolers on the shelf, many with copper tubing and "blingy" LED effects (/me eyeroll...does *anyone* think that's cool?). Some of these were only around $40, but I just couldn't bring myself to buy something so ridiculously overengineered (or rather, I should say, so perfectly marketed to a demographic to which I don't belong). I got a nice, circumspect Thermaltake unit for $20.
Byte by Byte, putting it together...
I like assembling my own system. It's fun! I opened the case, surveying and appreciating all of the little features the case fetishist added to its design. First, you seat the motherboard, aligning its back ports with the port panel on the case. Once it's been screwed into place, carefully seat the CPU. The next step is probably the most difficult: seating the heatsink/fan onto the CPU. It's held in place with a clamp which exerts quite a bit of down pressure on the CPU, to maintain excellent thermal contact. This makes it a bit difficult to clamp on. I'll just note that the clamp designs are much better now than several years ago; I'll never forget a build about 5 years ago, during which I just about punctured a mobo with a flathead screwdriver, with which I was attempting to force a heatsink clamp into place. Ouch. Amazingly, it still worked after that...
Anyway, next up is to seat the memory sticks, and install the HD and DVD drive. Then all that remains is to thread all of the cabling: power to mobo, fans, disks; data from disks to mobo; connect front panel lights and switches to mobo. Voila! Done.
Installing Linux
Dear reader, you and I both know that I've been complaining too much lately about how Linux doesn't "just work" often enough. How I would love to tell you it had gone differently this time. Alas, I cannot.
- First attempt: Kubuntu-9.04. This was released just a few days ago. I was pretty happy with Kubuntu-8.10 on the old mythbox, so this was the logical choice. Unfortunately, the new mythbox was behaving very erratically during the install. I was seeing weird errors during bootup ("ata1: Softreset failed (Device not ready)"), and frequent stalls and freezes during the installation process. This was pretty frustrating; I probably hard-reset the machine a dozen times trying to get it to install. Googling the problem was not very enlightening, but I did see that others were having similar problems with Ubuntu-9.10 and Gigabyte Mobos, so I was somewhat relieved that it might not be a hardware problem.
- Second attempt: Kubuntu-8.10. I still had the install CD I burned for the old mythbox, so i gave it a try. Unfortunately, I had the same instability issues.
- Third attempt: OpenSUSE 11.1 (KDE4 Reload edition). OpenSUSE and I have a colorful history. I have heard good things about it over the years, and have tried to check it out several times, but in all those attempts, I have never been able to install it successfully. I am not exactly a linux newbie, so this has always been pretty frustrating for me. When I've tried to report my issues, I'm basically told that I must have "weird hardware". I am sad to report that my latest experience with OpenSUSE was no better. As with Kubuntu, I couldn't even get through the installation process due to my system freezing up.
- Fourth attempt: I decided to return to the comfortable embrace of my old friend, Gentoo. At this point, I was becoming more convinced that some component was either defective, or simply so new that it wasn't supported well in the kernel. Either way, I saw an RMA in my future, which is always sad.
But then...surprise! I had no instability issues whatsoever under Gentoo. No weird messages, no interruptions, no hard resets! The installation process went very smoothly. Well, if you've never done a Gentoo install before, it's way, way more hands-on than Kubuntu or OpenSUSE. With those distros, you select you language, give a partition layout, and press Go. With Gentoo, you almost literally build your OS from scratch. You download a pre-fab compile chain and system toolset, but literally everything else is compiled on the fly, including the kernel. It's kind of fun, if you're into that sort of thing!
Reaching the Desktop: Installing KDE
Once the base installation is complete, the next step is to type
emerge kde, which takes many hours to compile (due to dependencies, that one command represents almost 600 packages, including little things like, oh...xorg-x11). So, there's plenty of time to go see a movie, have dinner with friends, get a good night's sleep, and check on its progress in the morning I executed the
emerge kde command on Saturday afternoon, around 2:00 pm. It finished around 9:00 am the next day! The good news is, there were zero issues encountered in compiling and installing those 600 packages.
That's not to say there were no issues in trying to
use the packages, though. I don't usually go into microscopic detail about why I am sometimes frustrated that Linux is not easier to use (or rather, to administer...I actually think it's already very easy to use); I think this particular case may be illustrative of my general experience:
- KDE is finally installed. Great! So, let's use it. Start the xdm graphical login service (
/etc/init.d/xdm start): FAILED: it's mis-configured to use xdm (which is not even installed) instead of kdm.
- Find correct configuration file where the
DISPLAYMANAGER environment variable lives. It's currently in /etc/conf.d/xdm. Set the variable to "kdm" even though the comments in that file instruct that it should be "kde-NN" where NN is the KDE version number. The comments are wrong/deprecated.
- Try
/etc/init.d/xdm start again: FAILED. Xorg starts momentarily, then I am dumped back to the vt text console with no error message.
- Try bypassing the login manager by executing
Xorg & startkde: FAILED. X starts, shows the default grey mesh screen with X cursor, but the keyboard and mouse are unresponsive, so there's nothing to do but hard-reset.
- Google around, find a message board post saying that I need to enable the Hardware Abstraction Layer daemon. So, execute
/etc/init.d/hald start (and do rc-update add hald default so it gets started at boot from now on). Try Xorg again: MARGINAL. Keyboard and mouse work, but the Xorg is not configured correctly.
- Run
xorgcfg to configure X: FAILED. Error: ":1.1 is not allowed to own the service org.x.config.display0"
- Instead of googling that error, just try an alternative configurator:
Xorg -configure: MARGINAL. Creates a viable xorg.conf file, which I place in /etc/X11. I can now successfully log into a KDE-4.2 session using the KDM login manager! BUT: it looks terrible. The screen resolution is 1440x900 instead of 1920x1080, so everything looks blurry due to the pixel resampling. I definitely need to use my TV's full screen resolution.
- Install
ati-drivers to get better X performance and full 1920x1080 screen resolution: FAILED. Missing kernel option "Enable unused/obsolete exported symbols". Reconfigure / compile / install the kernel. Reboot.
- Try to install
ati-drivers again: FAILED. "ati-drivers-8.552 requires support for pci_find_slot". No hint this time where to find that option in the kernel's menuconfig. Google for it: find this bug report. Basically, I also need "Enable deprecated pci_find_* API" option in my kernel. Sigh. Reconfig / compile / install kernel (again!). Reboot.
- Try to install
ati-drivers a third time: FAILED. Got message from the ebuild: "DRM support is enabled builtin, so direct rendering will not work". Argh! That means I have to Reconfig / compile / install kernel (third time!). Reboot.
- Try to install
ati-drivers a fourth time: SUCCESS!
- Run
aticonfig --initial to tweak xorg.conf for new driver and DRI settings: SUCCESS
- Execute
eselect opengl set ati to enable ATI hardware-accelerated openGL.
- Start KDM: FAILED! Screen goes black, no response from keyboard. Hard reset.
- Go back to my original xorg.conf file. I guess I will have to tweak it by hand to enable what I need, which is pretty ridiculous. Try setting the Driver parameter to
radeon, which is the open-source driver for ATI cards: FAILED. This causes Xorg to throw a signal 11 error with a useless backtrace. So, let's review: I can use the generic vesa driver and get an ugly undersampled desktop, use the open-source radeon driver and get an immediate Xorg crash, or use the closed ATI driver and get a blank screen. Neat!
- Digging into this issue, I discovered that my
emerge kde command did NOT actually pull in xorg-x11 as a dependency! That seems really weird to me. It obviously pulled in *some* X11 stuff, since I am able to start an X session. I don't understand all of the overlapping X packages, but it would seem pretty important to have xorg-x11. So I emerge it, and it brings about ten friends along for the ride.
- Next I decided to nuke the ATI closed drivers, and just try getting the "radeon" driver working. I ran
X -configure again, and then manually changed the "Driver" to radeon (instead of vesa): SUCCESS! I finally have a KDE desktop at full resolution, and glxinfo says I have direct rendering enabled. However, glxgears is pretty slow (~500, would like to see a few thousand).
- Though glxinfo claims direct rendering is enabled,
Xorg.0.log tells a different story:
(EE) RADEON(0): [dri] RADEONDRIGetVersion failed to open the DRM
[dri] Disabling DRI.
(==) RADEON(0): Will attempt to use R6xx/R7xx EXA support if DRI is enabled.
ABI class: X.Org Video Driver, version 4.1
(II) AIGLX: Screen 0 is not DRI capable
(II) AIGLX: Loaded and initialized /usr/lib64/dri/swrast_dri.so
(II) GLX: Initialized DRISWRAST GL provider for screen 0
Module class: X.Org XInput Driver
ABI class: X.Org XInput driver, version 2.1
So it looks like hardware DRI failed, so it's falling back to software DRI. A little more digging around led me to conclude that DRI is simply not supported yet for my video card. It's expected in kernel version 2.6.30, so I'll just wait for that.
This post is really long, so I'm going to write about setting up MythTV in a new post. See you there!