Archive for the Gadgeteering Category

In My Nerdiest Hour

Posted in Gadgeteering with tags , , , , , , on February 5, 2008 by Kit

Since we made the switch to Linux in our home, I’ve recently done some really swell things with our home entertainment system. Our home is currently a living advertisement to what can be accomplished with free (as in freedom) software like Ubuntu.

The Rundown

In the course of setting all this up, I’ve managed to fulfill a few lifelong dreams:

  • The ability to access my entire music library from anywhere in my apartment and anywhere else with internet connectivity.
  • The ability to play my favorite old school arcade, NES and SNES games from my couch with an arcade controller rather than hunched over a computer keyboard.
  • The ability to stream any no-DRM video format (DivX, Quicktime, etc.) from my computer to my television.

While setting all this stuff up, I managed to accomplish a few other interesting things as side effects:

  • I can remotely cue up BitTorrent downloads on the server without using my desktop machine.
  • I can play some really great PC games (like Vega Strike) just as if I were using an arcade console.
  • I get the satisfaction of doing it all with software that supports open standards, free speech, and involvement in a real community.

The Equipment

Our old desktop PC – Hiari – is beginning to show her age. Besides a full hard-drive, she doesn’t have much memory and her old CPU isn’t fast enough to do the kinds of things the old lady and I have been wanting to do. We determined that it was time for an entirely new PC, and that Hiari could be fitted with a server OS and moved to the basement to quietly serve up media files in her retirement.

I’m conservative about upgrades, and don’t like to buy new hardware (I average about 5-6 years between major system upgrades). Therefore, I always try to upgrade to a system with enough power to keep me happy for an equally long span.

I set myself a budget of $500, and found that it was pretty easy to stay inside it. In fact, thanks to this Slashdot article, I built a system that can match the performance of many high-end gaming rigs.

After installing Ubuntu 7.10 Desktop on the new system (now named Nakato), I wiped Hiari’s hard drive, installed Ubuntu 7.10 Server, and moved all of our old media, documents, etc. onto her storage drive. After getting the server OS configured, I removed her monitor, keyboard, and mouse, and moved her to place of honor in the basement where she will live out the remainder of her life serving up files and downloading torrents.

A tear or two may have been shed as I took her downstairs… but honestly I think she’ll enjoy having more privacy and a more relaxing environment.

I’ve taken advantage of a previous apartment dweller’s strategically placed hole in one of our vents to get network cable into the basement. I hate wireless for its lack of stability and security. Good old fashioned Cat5 requires a physical connection to gain access and doesn’t flake out when the people upstairs turn on their microwave.

Network Services

File Server: With Hiari in place as our file server and Nakato in place as our main desktop, it was easy to get the two sharing files. Since we only run Linux at home, there was no need to mess with SAMBA or anything like that. The Unix standard file protocol, NFS, worked great.

After setting up a share on Hiari, I modified our fstab to mount the remote drive on our desktop transparently. Our document, video, and music folders act just as if they were on our local hard drive, courtesy of a few symlinks. It’s actually easy to forget that they are stored on Hiari downstairs.

SSH: Unlike Nakato, Hiari has no GUI desktop. Instead I can log in to a command shell via SSH. The connection is encrypted, so I can log in from pretty anywhere without worry.

UPnP: I also installed MediaTomb on Hiari, so she now serves music and video to UPnP devices (like my PS3 and my D-Link network mp3 player).

Internet Music Server: NFS lets me access my mp3s on the local network, and UPnP lets my devices access them. But what about when I’m away from home? GNUMP3d lets me stream my music over the internet from just about anywhere. It was easy to set up, and offers the ability to protect it’s interface with a password. Eventually I hope to upgrade to something that uses SSL to make things a little more secure.

DynamicDNS: We have DSL for internet, which means that our home IP address is constantly changing. I set up a free account on no-ip.com, and installed their (also free) client on Hiari. This gives me a free, easy to remember internet address that is always up to date.

TorrentFlux: TorrentFlux is a BitTorrent client that can be operated off of a remote server through a web interface. The old lady and I can just log onto Hiari’s TorrentFlux admin page and queue up torrents to our hearts content. We can close the browser and forget about them until we decide we want to see if anything new has downloaded.

You’re on TV!

Nakato has a dual-monitor capable graphics card and my television has a VGA port, making me only a few cables away from being able to use all these new multimedia capabilities right from the couch – which is the whole point of this exercise.

Most Linux installations end up using Xinerama for dual-monitors, but it’s not really what I wanted. Since my second monitor is a TV, I don’t actually want the second monitor to be treated as an extension of my desktop – which is Xinerama’s main feature.

With a large shared desktop, windows and dialogs might accidently get switched to a blank monitor when the TV is turned off. What I wanted was to have the monitor itself treated as a second desktop that I can switch to at will for playing games and watching movies. Support for this behavior is actually part of Xorg as-is. A few modifications to my xorg.conf settings and everything was running.

Finishing Hardware Touches

Along with a desktop, I need to get a couple other things over the TV to really make this complete: Audio and a good game controller.

Audio wasn’t as easy as I’d hoped: the VGA channel on my TV doesn’t have its own audio input. This bites, because it means I can’t use my TV speakers for output from Nakato. If I had a sound system hooked up to my TV, it wouldn’t have been a problem… but I don’t really have room for a fancy sound system.

I resolved this with an ultra-cheap (under $15) set of small computer speakers and an audio splitter with long cable. Not the most elegant solution, but it sounds good enough for us.

The game controller was also a challenge. I have a PS3 and several controllers, so I was hoping that they’d work for Linux gaming. No dice. They kinda work, but the button mapping is a mess.

Luckily, USB gamepads are cheap nowadays, and I got this baby for a song. What I really like about it is that the cable retracts into the controller’s housing… I have a real problem with leaving controllers and their cables all over the living room.

The new controller works with Linux out of the box, no messy drivers necessary. But it’s not very convenient to plug it into the desktop when I’m sitting on the couch. I solved this by throwing a long USB cable over to my TV cabinet and duct-taping a little 4-port USB hub to the housing of my cable box.

There are wireless gamepads out there too, but few of them seem to recharge via USB. That’s a deal-breaker for me. I’m not interested in constantly swapping out rechargeable AA batteries. Dear USB device makers: Why do you insist on manufacturing so many devices that require batteries without providing a facility to recharge them through the USB port?

Games

Arcade Games: For arcade machine games, I use sdlmame. Unfortunately, Ubuntu still hasn’t bundled an official build for my CPU (AMD64), but I found a preliminary version here that worked perfectly.

Nintendo and Super Nintendo: GFceu and zSNES work great for Nintendo and Super Nintendo games respectively.

pict0011-b.jpg
(The old lady enjoys a stimulating game of spacial relationships.)

Nintendo 64: This was more of challenge… Mupen64 is the only actively developed Nintendo 64 emulator for Linux. The version in the Ubuntu repos was extremely buggy, so I had to make my own binary – which was a pain. Ubuntu’s focus on being friendly means that it doesn’t come with many dev packages pre-installed. Of course, they are all just an apt-get away… but sometimes figuring out exactly what you are missing can be a challenge.

Watching Movies

This worked out of the box. I had to install some codecs to view things like DivX and Xvid, but Totem prompted me to do this automatically. Here’s a picture of the old lady enjoying some original Star Trek on the big screen, courtesy of our fancy new media setup:

pict0010-b.jpg

Still To Do

Anybody who is into home networking will tell you that there is always something left to do. And anybody who is into home media will tell you the same thing. Bringing the two together is bad magic for the gadget obsessed.

Remote Control: Currently, I have to use the mouse and keyboard on Nakato to control movies and launch games. I already have a gazillion remotes, including 1 bluetooth remote for my PS3, 1 IR remote for the cable, and 1 IR remote for the TV. I’d love a programmable universal remote that does both bluetooth and IR, but I’m afraid that even if such a thing exists, it costs like $500. It takes a special kind of man to spend $500 on a remote control, and I’m not him.

Game Launcher: I want some kind of front end for launching games and other software that can be controlled by a joystick. There are a few things out there … Wah!Cade looks great, but I’m having trouble compiling it for my AMD64 processor.

Thin Clients: The old lady and I are house hunting, and my grand plan is to install thin clients with tiny LCD screens in various rooms to access things like music and Wikipedia (to resolve debates). Obviously, this isn’t really necessary in our tiny apartment. But I’ve been thinking about the various different flavors of client computing available, and what sorts of hardware I’d like to run them on.

Wine: I’m thinking about playing with Wine to get some games from the Windows world working on Nakato. We’ll see, I have so many entertainment options that I’m not sure if I’m going to need to go there for quite some time.