Thursday, January 28, 2010

Breakneck / N.I.C.E.2 / Excessive Speed on Linux (PART 1)

"Breakneck" (also known as "N.I.C.E. 2" and "Excessive Speed" in some markets) is an old racing game from the late 1990s. Originally from a German company called "Synetic" it was sold worldwide under the other names via local distributors (in the US it was marketed by "SouthPeak Interactive").

What made this game so kick ass? Well, it had a TON of options. The base game comes with:
10 Track Locations, with multiple variations of most tracks (24 total)
9 Car Classes containing at total of 43 vehicles with 8 possible "Sponsor" graphics/colors.

There are also multiple ways to play the game:
Single Race (my favorite)
Arcade Game (a "First Person Shooter" with armed cars)
Time Attack - Best Race
Time Attack - Best Lap
Multiplayer Mode (create a driver profile, mod your car, find a sponsor, win races for $$)

And we haven't even GOT to the "Options" option on the main menu yet! Here you can set everything from reflections to collisions with trees to enemy skill and gravity. You can also decide whether the cars "deform" or not. In some other racing games the cars don't dent, which is mostly because they use actual makes and models and the manufacturers don't particularly want their vehicles all banged up in the game, and there's also the issue of morons who might think the damage is based on real-world crash data. Wow, are they in for a surprise when they rear-end another car at 180 MPH and can't just drive away from it!

BreakNeck uses "fake" cars. They have bogus names and manufacturers, but if you ignore the obvious alterations to grills and lights you can usually figure out what they're actually supposed to be. Sometimes it's fun to just race the wrong way on the track and see how long you can go before your car is so smashed up it's done. Not the point of the game, but a great way to blow off some steam for sure!

Another thing that made the game great was the availability of fan-made content. There are car editors, texture editors, and track editors for this game and some people spent a LOT of time creating extra cars, crazy paint jobs, and new variations of the tracks. The editors and extras can be nearly impossible to find now because the game is so old, so I was glad I'd archived mine to a CD-ROM (except for the car editor, which I can't locate).

My game, then, is pimped out with 67 additional tracks (including two new locations - Canada and Italy - which weren't available in the US release); 21 additional cars (some of which are based on actual models). I actually used to have another disc full of even more cars (such as the "Fifth Element" taxi and the "Batmobile") but I lost it. :( The new cars don't necessarily use the boring "sponsor" graphics either.

So, now you may understand why I want to get this old game going again. Actually I have it running on my WinXP machine, but I just set up a Home Theater PC that uses Linux and thought it would be cool to set it up so I could play this game on the TV screen.

"Part 2" of this post has the technical stuff.

Breakneck / N.I.C.E.2 / Excessive Speed on Linux (PART 2)

. . .Part 2. The Technical Stuff

Ok, first of all to get this game running under Linux you'll need to install Wine. Wine is a Windows compatibility layer for Linux. Most Linux distributions have it in their repositories, and that's really the best way to install it. It can be difficult to compile from source or install manually. So, ok, go do that. I'll wait.

MAKE AN IMAGE

Ah! You're back so soon? Cool. You'll need your Breakneck CD-ROM to install the game. But we're not going to actually use the disc. First of all, it's a pain in the ass to swap CDs in and out. That's so last century! I've also noticed that the game tends to remember which CD/DVD drive it was installed from, because on my system with multiple optical drives the game will only run with the CD in the drive from which I originally installed it. So, what we want to do is make an IMAGE of the CD. This is a really good idea with an old game like this that is out of production - if you damage the CD you're out of luck (unless you find one on eBay I suppose). Here's what to do:
1. Insert the BreakNeck CD in your CD/DVD drive.
2. If it "auto mounts" you need to unmount it! If you see its icon on the desktop just right+click and "unmount" it. If your system isn't set up to show mounted drives on the desktop you need to open a terminal and type "mount" at the prompt. Look for the CD in the list (probably /dev/cdrom). If it's there type (without the quotes) "umount /dev/cdrom" or "umount /media/cdrom" or "umount /mnt/cdrom" depending on what you saw in the list.
3. Create CD-ROM ISO image with dd command (assuming CD is at /dev/cdrom and $ is the prompt):

$ dd if=/dev/cdrom of=/tmp/BreakNeck.iso

That will create the ISO file in your temporary files "/tmp" directory. Just navigate to it and move it where-ever you plan to store CD-ROM images. For example, I put mine in a folder I created in my Home directory: "~/Games/Windows/CDs/"

You can put the original BreakNeck CD-ROM away for safe-keeping.

CREATE A FAKE DRIVE

You'll need to mount the ISO file every time you want to play the game. You'll need your trusty terminal again. Type the following commands (we'll be working as root so you'll need administrative access. "$" represents the prompt):

$ sudo su

$ mkdir /media/iso

$ gedit /etc/fstab

(on that last one if you're using Gnome that works. Or instead of "gedit" put in whatever text editor you prefer to use)

on a new line at the bottom of that file enter this:

/tmp/isolink /media/iso udf,iso9660 ro,user,loop,noauto 0 0

Save the file. That line now creates a link between a temporary file and the media/iso folder we created above.

That's it! Well, almost. We still need the "/tmp/isolink" but we'll create that in the next step.

INSTALL THE GAME

Open up a terminal and type the following:

$ ln -sf ~/Games/Windows/CDs/BreakNeck.iso /tmp/isolink

$ mount /media/iso

Your ISO file is now mounted as if it were the original CD-ROM! You should be able to run the installer just as you would on a Windows machine. You can skip the DirectX install because Wine already has a nearly complete implementation of DirectX 6 built into it. I didn't try any of the DX Media stuff because the running commentary from "Eddie" is hyper annoying.

At this point you should be able to run the "Setup" utility. You can select whatever graphics card you want, it doesn't matter, because we'll HAVE to use the Software Engine. You can either select it in the first drop-down box OR you can just check the "Software Engine" checkbox. Don't bother playing with any of the other options, except make sure "SoundFX" is checked. Force Feedback won't work, so you can ignore the radio buttons at the bottom. Click "Benchmark" to make sure the settings work, and to see if the frame rate is high enough. If it isn't, you'll need to either dial down the resolution (lower the smoother) and/or the bit-depth (32 to 16). If all goes well you can then test play the game.

UPDATE: Ubuntu 10.04 Lucid Lynx / Linux Mint 9

With the latest versions of Ubuntu (and derivatives) there is now a "ExecutableBit" security policy in place by default that blocks .EXE files on CD-ROMs, DVDs, and mounted ISO images from being marked as executable/trusted, so you can no longer just double click on such files and have them run in Wine. :(

In order to install BreakNeck from the CD-ROM (or the mounted ISO image of it) you will need to either press ALT+F2 to get a "run" window or open a Terminal and type:

$ wine /media/iso/setup.exe

Once the program is installed, however, the EXE file being executed is installed to the Wine "C:" drive as a trusted executable, so if you want to play the game directly (without XBMC being involved) you'll need to run the game from the Main Menu entry or you'll need to execute the launch script explained in the next section, which will be treated the same as typing the commands in a terminal.

CREATE A LAUNCH SCRIPT

Normally you won't be able to just click on the game icon on your desktop or in your main menu and play the game because it is going to want your CD in the drive! So, let's create a script that will "insert" the virtual CD in the fake drive and then launch the game for us!

Open up a text editor and type in the following (replace "username" with your login name):

umount /media/iso
rm -r /tmp/isolink
ln -sf ~/Games/Windows/CDs/BreakNeck.iso /tmp/isolink
mount /media/iso
env WINEPREFIX="/home/username/.wine" wine "C:\Program Files\SouthPeak Interactive\BreakNeck\breakneck.exe"

Explanation:
Line 1 makes sure no other ISO files are mounted.
Line 2 removes the "isolink" file because the next line can't always overwrite it properly.
Line 3 creates the "isolink" file pointing to the desired ISO file.
Line 4 mounts the ISO file to our fake drive
Line 5 launches BreakNeck in Wine.

Save the file with whatever name you want (something like "BreakNeck" is good) and then right+click on it and under the Permissions make sure it is "executable."

Here's the cool part: Copy that file and edit it to mount different ISO files and launch other programs and the scripts will do the virtual CD-swapping for you - always making sure the correct CD image is in the virtual drive.

I should note that this method only works with games that require a single CD be in the drive. I haven't tackled games that want you to swap out CDs during the game.

CONFIGURE WHEEL

Odds are you don't want to drive your car with the arrow keys on the keyboard. You probably also don't want to drive with a joystick (but you can if that's all you've got), but I'm going to talk about setting up a wheel. Specifically a Thrustmaster wheel since I have two different ones I tried.

1. Do not, I repeat NOT, install the drivers/utilities for your game controllers in Wine. They simply will not work because Wine gets the game controller configurations from Linux.

2. Plug your controller into a USB port. If you have an old "game port" controller you're probably SOL - I couldn't get the one I had to work. I would highly recommend you only plug ONE controller in - the one you want to use - for best results.

3. Open up a terminal and type:

$ sudo apt-get update

$ sudo apt-get install joystick

$ jstest --normal /dev/input/js0

(on that line you may have to try js0, js1, js2, etc. to find your controller - and if you plug and unplug devices in different orders they'll get different assignments)

Once you've located where your desired controller is mounting, we need to calibrate it! In the terminal again (example is if your controller mounted as /dev/input/js2):

$ jscal -c /dev/input/js2

The terminal will prompt you to do stuff with the controller. Do it and your controller will be calibrated. This calibration will carry over into BreakNeck running in Wine. Or at least is should.

2. Download joysticktester.exe to test your controller within Wine. You may discover that an axis is reversed, or that the buttons have enumerated differently than they're labeled. Make note of anything goofy and if it's an axis issue you should be able to just calibrate it in reverse by running the "jcal -c" command again and switching what you told it was the "maximum" and "minimum" limits.

3. If you're seeing your controller in Joysticktester within Wine. You're ready for the next step! If not, you may need to change the permissions for the /dev/input/js* files. Since those files are automatically created changing permissions on the files themselves won't stick - you need to add your main user to the "plugdev" group to automatically get read-write access to any js files the operating system makes. You normally shouldn't need access to the /dev/input/event* files and if you do change the permissions it will screw up the controller names in Wine (for example if I change permissions on /dev/input/event4 - which is linked to /dev/input/js0 - then in BreakNeck it will stop reporting my controller as "Thrustmaster Pro Digital" and call it "/dev/input/event4" in the "Controls" setup. It will still WORK, mind you, but it shouldn't be necessary to do that.

4. Run your launch script and go to the "Controls" entry on the main menu in the game. You should see your controller, by name, listed under the options. Tell it the correct TYPE of controller (keyboard, wheel, joystick, etc.). You may notice the X,Y,Z axis settings are BLANK! Whatever you do, do NOT try to assign them within BreakNeck. Not only will it NOT work, it will disable the axis settings and you'll have to do a registry hack to fix it. You CAN, however, change button assignments without worry. Some buttons, though, may be dead - but if you did the Joysticktester.exe test you already knew that.

5. AXIS FIX - if for some reason you still can't steer and or your gas/brake doesn't work or if you accidentally tried to assign an axis in the game controls settings you'll need to fix it manually. You'll also may need a working copy of the game running on a Windows system to do it! Ok, the simple fix is navigate to: ~/.wine/Windows/regedit.exe then navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\SYNETIC\HAND\V2\Input

If the "Input" folder doesn't exist, just create it. If you're lucky it's already there.

A. If the "Input" folder is already there you should have an entry for your controller by name. The "value" string will be a long sequence of binary number data. For a Wheel controller the first two sets should be "02 01" so if they are "00 00" just edit them and your controller should now work.

B. If the "Input" folder is missing, or has no entries in it, you'll need the data from a working Windows machine. Using Regedit get the string data. You can just "export" the Input key and then "import" it to your Wine registry and that should fix it.

LAUNCH FROM XBMC (optional)

I'm setting this up on my Home Theater PC so I want to be able to launch the game from inside my media center interface. I installed the "Launcher" programs plugin from the SVN repository and created a launcher pointing to my custom script. Works beautifully!

Happy Racing!

Thursday, January 14, 2010

Adventures in building an HTPC


It's 2010, and like a lot of folks I'm a bit disappointed the future was not available as advertised. No rocket packs, no flying cars, no moon bases, no androids, no space hotels, no Martian colonies, nor any eerie black monoliths igniting Jupiter into a sun (that we know of). Watching TV hasn't evolved very much either. Ok, so we got digital broadcasts and widescreen flat panel televisions and the CES show out in Vegas was loaded with 3D TV hype - but the basic way most people watch TV isn't all that futuristic. Sure, some people have Tivo or a DVR from their cable or satellite company, but that's just the digital version of time-shifting your viewing with a VCR - and people were doing that back in the mid-80s. If you've got digital cable or satellite you can watch some stuff sort-of "on demand" which is a good start at living in the future. . .which is now the present.

But the obvious "future" of television is the complete convergence of the Internet and Television. They (the mysterious "they" who know all, see all) have been telling us for years that is what's going to happen, but the TV networks are obviously resistant to it, lest they go the way of so many newspapers. You can now get shows on Hulu.com from half a dozen networks, and the ones who aren't there provide them on their own web sites. That's if you like professionally produced corporate sanctioned content. There are, of course, tons of amature videos out on the Web too, and it's not unheard of for "made for web" content to be high quality too (I'm looking at you "Dr. Horrible's Sing-Along Blog").

My desktop computer sits in a corner of the living room and has a graphics card in it with S-Video output. I ran long audio and video lines around the edge of the room so I can switch the living room TV to the "Line Input" and have my computer set up to use the TV screen as an additional monitor. For years now I've been dragging media players and browser windows over to the TV and popping them full screen. That's also how I play DVDs. I've never actually owned a stand-alone DVD player since I could just use the one in my computer on the living room television. While this is kind of cool, it does tie up my desktop computer as a "media center."

So, I thought, why not just HAVE a dedicated media center computer? Well, cost is part of the reason. So I asked some friends and family for their broken or obsolete compters and components just to see if I could manage to build up a workable HTPC ("Home Theater PC" or "Media Center PC" if you prefer) out of cast-off parts. Here's what I ended up with:

Full ATX tower with a 500 W power supply
1.25 GB DDR Memory
Abit IS7-E2 motherboard
Pentium 4 CPU
ATI Radeon X1300 Graphics card (2 DVI ports, 1 S-Video output)
ATI TV Wonder Pro Tuner Card (Coax and S-Video inputs)
DVD-ROM drive
DVD+RW drive
Floppy Drive
Microsoft wireless keyboard and mouse
80 GB Seagate SATA Hard Drive

For the underlying operating system I wanted something stable and free so I went with the Ubuntu 8.04 LTS "Hardy Heron" version of Linux, and installed XBMC (X-Box Media Center) on top of that. Which all sounds well and good, except that's my FINAL configuration. It took a week of failed attempts to find hardware/software combinations that would actually work together.

Attempt #1
Installed the XBMC Live 9.04 to the drive. Included ATI drivers didn't work. Underlying system is Ubuntu with Flux (which I hate) and X-server conflicts or frankly I'm not sure what all - I just couldn't get it to work. I could run XBMC windowed in Flux, but couldn't make it work fullscreen nor get TV-out to work. DVD playback also wouldn't work. Wiped the drive, time to start over.

Attempt #2
Installed the XBMC Live 9.11 to the drive. Same results as the older version, except a second attempt to install legacy ATI drivers screwed up the system so badly I couldn't get anything to work. Wiped the drive started over.

Attempt #3
Decided I needed to forget the prebuilt live cds and build a live system myself. Following instruction for "XBMCbuntu" I installed the minimal version of Ubuntu "Karmic" and got XBMC installed on top of that. I decided it would be easier to configure things if I installed an underlying desktop system, so I went with XFCE since it's light-weight. After fighting with various configuration issues and repeatedly having to install additonal software just to do that I realized I probably just should have started with Xubuntu. So I wiped the drive again.

Attempt #4
Installed Xubuntu "Karmic" and put XBMC on top of that. Had problems with the ATI drivers though. The Radeon X1300 is no longer supported by the drivers from ATI so I had to use the Open Source drivers, but the TV output support on that is not quite fully baked yet. I couldn't install the older ATI drivers that did support the card because they don't work on the X-Server used by Karmic. So I had to decide if I was going to try and "downgrade" the X-Server or if I should just downgrade to an older version of *buntu that had a compatible X-Server already. I opted for the latter. Wiped the drive once again.

Attempt #5
Decided to just go with the most "vanilla" option and installed Ubuntu "Hardy" 8.04 Long Term Support on the drive. It's stable and problems are well documented in the support forums, often with multiple solutions. The Proprietary ATI drivers offered up by Ubuntu ended in a "White Screen of Death." If I disabled direct rendering I could get a usable desktop, but XBMC requires direct rendering for OpenGL so I HAD to have it working. I tried using the EnvyNG installer and forgot to remove the drivers installed by Synaptic first, which led to some install errors and a broken X-Server that I tried and tried to reconfigure, but whatever got hosed up it was bad. Got mad, wiped the drive and started over. Again.

Attempt #6
Again, with the same version of Ubuntu, only this time I didn't install the drivers presented by Ubuntu, and I didn't use EnvyNG. I went to the AMD/ATI web site and found the last driver (Catalyst 9.2) that supported my card and downloaded it. Backed out to a command line, stopped the X-Server, and ran the installer. That got me to a desktop, and I could run the Catalyst Control Center for the ATI card, but it reported it was using the "mesa" software acceleration for OpenGL. XBMC didn't care for that - in fact it refuses to run. I was able to get DVDs to play, even full screen, and could choose between the monitor and the TV, but not both at once. I later realized it was because the DVI-0 and S-Video ports are "shared" so you have to pick and choose. However, when I moved the monitor to DVI-1 so I could have cloned video on both screens the auto-detection would default to using the VESA drivers! I went through several guides online on how to "fix" various ATI issues on Linux and eventually got to a point where I could either have XBMC working, but DVD playback was just a black screen or get DVD playback working and XBMC was a black screen. It seemed no matter what I did I could never get them both to work.

Attempt #6.5
After spending a couple days trying to sort it out I uninstalled everything ATI from the system and booted with the VESA drivers. I downloaded the next older ATI driver from the AMD/ATI web site and installed that. When I ran the installer I made sure the monitor was connected on DVI-1 and the TV was on and connected to the S-Video port. FINALLY the configuration worked! I had cloned video on both screens, I had hardware accelerated OpenGL graphics for XBMC, and DVDs would play full screen.

The next issue was to get the ATI Wonder Pro TV Tuner working. XBMC actually doesn't have ANY support for TV tuners! Crazy, huh? The recommended solutions are to either use XBMC as a "front end" to access a MythTV server (MythTV is sort-of an open-source Tivo thing), or use a program called "TVheadend" which can create a "media stream" for TV tuner channels that XBMC can be configured to play. The "TVheadend" routes sounded easier so I tried that first.

I was getting errors such as "/dev/video0 doesn't exist" because Ubuntu auto-detects the hardware for video capture and the device map isn't even created unless the device is detected as usable. Without a signal source a TV card is useless, so Ubuntu would just pretend it wasn't there. Once I realized that and rebooted and the /dev/video and /dev/video0 existed. I eventually created the files manually as root and now they "stick" even when the card doesn't have a signal. In order to ACCESS the card I needed to go into the "Authorizations" control panel and release access to the device and then, with the "Users & Groups" make sure my user account was part of the "video" group. Failing to do those things resulted in "access denied" permissions errors. But there was another problem (I'll get to in a moment). Oh, and since it is an analog capture card and TV broadcasting over the air has all gone digital, I had to connect it to the Cable TV coax to make it work.

TVheadend wouldn't work for me. In reading the FAQ on the developer's site I found out it only supports the PAL broadcast standard for analog TV capture cards. Since I'm in the United States I needed something that could work with NTSC.

So the other alternative is MythTV. I hadn't heard good things about it. I'd heard it was difficult to set up and the interface sucked. The criticisms were correct. The installer failed to set up the SQL server backend and I had to manually configure it. The front-end interface is as clunky as I'd heard, especially after the slick "Confluence" interface of XBMC 9.11. MythTV's setup showed my card by the correct name and let me select it, but then acted like it didn't exist. I never did get MythTV to work and uninstalled it.

It would be nice if I could also record live TV shows to the hard drive (something MythTV is designed to do) but the hard drive is only 80 GB, which is far too small a capacity for real duty as a DVR. But I figured if I could get it working maybe I'd pick up a larger drive in the future. So far I haven't been able to get Gstreamer, Transcoder, or Mencoder to record from the card. The closest I've gotten is white noise sound and a scrambled picture. I've decided it's not worth my time to try and get a feature working I'll likely never use.

I realized that I didn't actually NEED the ability to record TV shows. I know if I miss a show I can usually catch it online anyway, so I literally haven't recorded a TV show in YEARS. All I really needed was the ability to watch live TV! I reasoned that if I could find a TV Tuner program that would see the card I could just "launch" it from within XBMC. I knew there were launchers for game emulators, and a generic one to launch any binary so I just needed the tuner program.

KDETV was my first stop. It saw the card, but the channel scanning wizard didn't work. The sound didn't work. I also had zero luck with XawTV, Zapping, or Mplayer. In looking for solutions I ran across mention of another program called "TVtime." I downloaded it and lo-and-behold it WORKED! Right from the start it not only saw the card but when I launched TVtime I was watching channel 2 on my Cable TV.

So I installed the "Launcher" plug-in for XBMC and configured a launcher for TVtime, then added that launcher to my Favorites. From the main page of XBMC I can hit my Favorites and select "TV Tuner" and BAM! TV Time opens up and I can watch TV.

Other plug-ins I installed that worked for me (ones with "*" by them also worked in XBMC 9.04):
Program:
Launcher
Emulauncher*
SVN Installer
XBMC-Zone Installer
Video:
Animefreak
Bleach7*
CBS*
PBS
CNN*
NBC
SY-FY
USA
YouTube
G4*
National Geographic*
FreeMovies

These ones didn't work right and I uninstalled them:
Animeseed (plugin works, but folders were empty)
InstanzAnime (plugin doesn't die, but couldn't find any content in the folders)
Veoh (crashes during video buffering)
Navi-X (hit and miss with content)
VideoMonkey (hit and miss with content working)
Yahoo Music Videos
myTV (python script error)
ABC (Australia) and CBC (die with a script error)
Accuweather (script freezes while retrieving data)

I didn't even bother finding a plugin or script for Hulu.com because I know none of them work right now. Hulu has been in sort of a war with "scrapers" and changed how their site worked in a way that broke the Hulu plug-ins. But I watch a lot of stuff on Hulu, so what am I gonna do?

I created a launcher for Firefox with Hulu set as the home page. I can launch it from within XBMC and hit F11 to pop the browser full screen. I tweaked the settings to over-ride the fonts with some GIGANTIC ones I can actually see on a TV screen from across the room. A good work-around, I figured, until a working Hulu plugin or script surfaces again, right? Well, not as good a work-around as I'd have liked.

Adobe Flash Player on Linux SUCKS. Especially for full-screen playback, where it turns everything into an unwatchable slide-show. This appears to be more of a problem on system withotu Nvidia cards because of the stupid way Adobe decided to check for hardware direct rendering with the "SGI" vendor flag. SGI contributed code to the OpenGL project a long time ago, so just about any cards out there that aren't Nvidia (and I've heard evne some of them) report the vendor string as "SGI." But Flash on Linux turns off hardware support if it sees that and forces you to use the software rendering, which is CPU intensive - no, make that VERY CPU intensive - and makes for unwatchable fullscreen videos. I obviously have harware accelerated direct rendering working or XBMC wouldn't even start, so I found out you're supposed to be able to over-ride the shoddy detection by creating a folder and file at /etc/adobe/mss.cfg and inside that file put the line OverrideGPUvalidation=1. Does it work? Not very well. It slightly improved playback, but not in full-screen mode. Ok, the videos play decent at their original embedded size on the Hulu pages, but that's kind of tiny. Here's what I have to do to watch it any larger:

1. Quit XBMC because no other OpenGL programs can be running
2. Use the "Pop-Out" option instead of the "Full Screen" option.
3. Once the littel pop-out window has loaded I have to close the window from which it popped - you can't even have another instance of Flash running because it's using OpenGL too.
4. Hit F11 on the Pop-Out window. I get a bigger version that still has slightly choppy playback and I have to live with the "playhead" bar across the bottom of the screen, but it's still better than watching a postage stamp sized video.

Can we say "Pain in the ass?" This isn't likely to be "fixed" until a couple of things happen. Either Hulu has to stop breaking the XBMC plugins and let them scrape the video content (unlikely), XBMC developers need to come up with an unbreakable way of scraping content (unlikely), or Adobe needs to rewrite the Flash Player for Linux so it actually works as well as the one for Windows (unlikely).

SO, if you like to watch a lot of Hulu.com videos you will want to watch them on a Windows system, since that's the only platform on which Adobe cares to make their player function properly. If you want to build an XBMC system and use Windows as the desktop system underneath I'd recommend only doing that with a Windows 7 machine. I couldn't get XBMC 9.11 to work on a Windows XP system at all. Apparently XBMC 9.04 does work (because it uses OpenGL rather than DirectX), but I also found almost none of the plugins work under 9.04 which makes the whole idea of using XBMC kind of pointless. To summarize:

Use LINUX if you want:
Stable, Free, Secure
Don't care so much about Hulu content
Don't have an ATI graphics card

Use Windows 7 if you want:
Hulu has to play smoothly in Flash
You have an ATI graphics card
You have any other hardware that's poorly supported on Linux

What I ended up with is a system I can use to:
Watch DVDs
Watch YouTube videos
Watch Free Movies
Catch TV shows from a number of networks
Watch Live TV
Stream Net Radio
Play MP3s and CDs
Play retro video games
Get my local weather instantly
Access the Internet on my TV
Do this all with a keyboard and mouse across the room on the couch

I'll save anyone with an ATI TV Wonder Pro tuner card a lot of trouble setting up the audio. Apparently only SOME of the cards have PCI Audio enabled, the rest will ONLY output sound through the (green) line jack on the back of the card. Here's how you find out which one you have:

1. Open a Terminal
2. Type: lspci -n
3. Look for: 14f1:8801 or 14f1:8811 (Hooray! You have PCI sound enabled card!)
4. If it says 14f1:8800 you're out of luck. Gotta patch sound physically OUTSIDE the computer.

You have a couple of options to patch sound physically:

1. TWO SOUND OUTPUTS
Connect a set of amplified speakers to the sound output of the TV card, or run a patch cable to a stereo receiver and select that input when you want TV sound. You'll have to have ANOTHER set of speakers, or ANOTHER patch cable running from the sound output of your computer audio card. In other words, your TV and Computer sound outputs are not connected to each other in any way! If you have set up the 3 jacks on your sound card for Surround Sound you will HAVE to run independent audio connections.

2. PATCH TV SOUND TO AUDIO CARD
You can only do this if you either have more than one audio card in your computer OR if you only have one audio card that you are NOT using it for Surround Sound output! You'll need a small 1/8" male to 1/8" patch cable long enough to run from the (green) audio output on the TV card to the "Line In" port on your audio card. Then in the ALSA Mixer make sure that "Line In" is not muted and has full volume.

The last piece of the Live TV puzzle was to get Television Listings on my TV I can browse (similar to the on-screen listings you get with digital TV or satellite). The main script used on XBMC for that purpose is called "myTV" but it would kick out a Python scripting error when I tried to run it. I couldn't even get to the configuration screen. "TVtime" can incorporate XMLTV data into its on-screen display, if you can actually GET the XMLTV data. Part of the problem is in finding FREE listing services. Most plugins, programs, and scripts out there use "Schedules Direct" which has gone to a subscription service for $20/year. They also apparently own Zap2It, and so I've read on the XBMC forums the "Zap2It Labs" supports open-source projects and there IS an authorization code for XBMC software to get the listing data, but the only two listing scripts or plugins I could find were "myTV" and "WebScheduler" - neither of which would work (the latter wouldn't even install). XMLTV is available from the Ubuntu repositories, but that really is just a collection of EPG scripts. The "North America" ones access Schedules Direct, so those were useless to me. Then I found "mc2xml" which is a small stand-alone program that can access different EPG providers and generate an XMLTV-complient file. To get free listings the program accesses "TitanTV" which is also a problem. TitanTV's EPG service requires a 30 digit ID number to work, and the ID provided with "mc2xml" has been deactivated. Apparently the manufacturers of tuner cards pay TitanTV for access (and that cost is figured into the price of the card when you buy it). The ID number is a UUID related to the hardware (not exactly easy to get because you have to use a packet sniffer to capture it). In theory there is one ID per card, so only one user per ID. If they detect too many users with the same ID then TitanTV deactivates that ID number and it no longer works. Which is why nobody who HAS one of these ID number will let anyone else use it!

However, you can go to Zap2It.com or TitanTV.com and put in your information (without even needing to register for an account) and get your local TV listings in a web browser. So my solution was to just bookmark those sites in Firefox and when I want the on-screen listings I just use my Firefox launcher. The "myTV" listings looked pretty good in the screen-shots I've found, so it would be great if that would work within XBMC, but until the plug-in gets fixed on Linux the browser work-around will have to do.

Obviously building a HTPC out of cast-off parts isn't the ideal way to do it, and there are still a lot of issues with "scraping" content (audio, videos, TV listings) from web sites. If I had money for an HTPC it would be hard to argue with just BUYING a "media center" computer that already has all the software and hardware working together.