Project Redshark - Turning Your Xbox Into A Mobile Media Monstrosity

John Riney <john@rineysoft.com>

05/06/05


Hey Make Readers!

Welcome to the full-on, unabridged version of my article! Thanks a lot for stopping by. Since putting together Redshark, I've built a new and improved audio player based on a Linksys NSLU2 - Shark Mark 2 (and its snazzy enclosure) - why don't you take a look at that after you're done here?

There's also my blog, where I talk about the stuff I'm working on.

--riney (11/08/06)


Introduction

Quick, when I say "Xbox", what's the first thought that pops into your head? Games? Monopolistic business practices? Controllers the size of a planet? Whatever you thought of, I'm guessing it wasn't "something I should put in my car". In this article, I'm going to show you how to make that black slab of plastic you had to buy to play Halo into the foundation of a powerful car computing environment.

The Idea

Some time ago, I decided that I wanted a system for my car that could store every album I own and play them back at will. Sure, there's off-the-shelf solutions that would probably work just fine. A sensible human being would have purchased an iPod, plugged it into their tape deck, and been quite pleased with themselves. Of course, I'm a nerd, and being a nerd kills any hope of sensibility dead. I figured a system I built myself would suit my needs much better than anything store-bought. Also, an article about buying an iPod would be boring. Moving on!

My requirements for the system were pretty simple. Foremost, it needed to play music. Related to that, it needed plenty of storage and a clean, elegant interface. Second, I wanted enough flexibility be able to add new features as I come up with them; I wanted control over the hardware and the software that runs on it. That means I wanted some sort of general-purpose computer with some sort of easily customizable operating system, probably Linux. I rummaged around my house for a machine, but everything I found was either too big, too slow, or already being used for something. Finding nothing good, I opened a beer (the first of several consumed during this project) and thought. I really didn't want to buy another system just for a quick hack. That's when I got to looking at my dusty Xbox.

The Plan

That Xbox, I thought, is pretty much just a PC wrapped up in some fancy plastic. It's no speed demon, sporting only a 733mhz Pentium 3 and a meager 64MB of RAM, but that ought to be enough for my purposes. I knew some enterprising hackers had gotten Linux working nicely on it, satisfying my requirement for flexibility. I hadn't used it recently, and if I broke it with my overzealous hacking, I'd only be out $150. After a little research (and another beer), I had a pretty good idea of what needed to be done to turn a stock Xbox into a mobile entertainment system. So here's what we're going to do:

First, we'll get an initial Linux install up and running on the Xbox. We'll build an adapter so we can connect USB peripherals to its controller ports. Then, we'll make the Xbox into a full-time Linux machine by replacing its BIOS. To do this, we'll have to make some minor modifications to its motherboard. After the BIOS replacement, we can upgrade its hard drive to make more room for tunes. Then, we'll modify the Xbox to run from the 12 volt power available in a car. Finally, we'll take a look at Redshark Player, a very basic music player interface I wrote for the project, and see how to install the entire system into a car.

The Build

Enormous Warning

The modifications described in this article will, at the very least, violate your warranty so hard it will run away, crying; at worst, there will be smoke, sparks, melting, demon spawn from a hell dimension, and other potential unpleasantness. Please read through the entire article before beginning. Then, read the additional resources I've cited from people who actually know what they're doing. Also, think long and hard about the potential for turning your pretty gaming machine into a charred, reeking doorstop before picking up that screwdriver.

Xbox, Meet Linux. Linux, Meet Xbox.

After careful research, it turns out that Microsoft doesn't really appreciate people installing other operating systems on their video game console! Who knew. Fortunately, despite their best efforts, it's still pretty easy to do so, if you have the right information. The guys at the Xbox-Linux project (http://www.xbox-linux.org) provide a brilliant set of tutorials that will tell you everything you need to know. There are a couple of routes you can follow during your install, depending on whether you want to turn your console into a full-time Linux machine or retain its game-playing abilities. The install would go a little easier if you have a modchip installed; I didn't, and installing one would probably be beyond my meager soldering abilities. Happily, they provide a method that lets you boot Linux with a software-only hack, no hardware mods required. Sold!

The technique I employed is commonly referred to as the MechWarrior hack, described here. The original version of MechWarrior, an Xbox launch title, contained an exploitable overflow in the game load/save code. When loaded, a properly crafted savegame stored onto an Xbox memory cartridge will crash MechWarrior and allow arbitrary code to run. The payload of the exploit then modifies Dashboard, the Xbox's front-end UI, to add an menu option for running a Linux kernel located either on the Xbox's hard drive or on a disc in the DVD drive. An important thing to note is that if you have ever used Xbox Live, the MechWarrior hack will no longer work. Microsoft pushes down an update to Dashboard when you sign up for Live to prevent the exploit from working. If you've used Live, you'll need to use one of the more in-depth install techniques involving a modchip.

This works well enough for a start, but it's a limited approach; booting Linux is a two-step process. You have to wait for Dashboard to start up normally, then manually select the “Linux” option; also, since the Dashboard lives on the standard-issue hard drive, you're stuck with it, and it's pretty measly. These limitations are the result of the stock Xbox BIOS, and the fix is simply to get rid of it! The Xbox-Linux project provides a replacement bios called Cromwell and a BIOS flasher utility amusingly called Raincoat (rimshot please). The trick to this is that Raincoat runs under Linux, so the strategy is to get an initial Linux system running using the MechWarrior hack, then flash the BIOS so we'll have full control of the system.

To flash the BIOS, we first have to make it writable, and for that, we'll need to do some soldering. By default, the contents of this chip, called a TSOP (I really don't know what that stands for), cannot be overwritten. Conveniently, though, the motherboard engineers made it possible to enable writing just by connecting two pairs of points on the board. The only difficult part about actually doing this is that like most things on a motherboard, the points you have to connect are absurdly tiny. To get the job done, I purchased a Weller WP35 soldering iron with a 1/32" conical tip (Weller part number ST7) and a magnifying glass. My previous iron, a cheapo from Radio Shack, wasn't going to cut it. The TSOP Flashing HOWTO on Xbox-Linux.org will tell you where these points are located on your particular flavor of Xbox. On the version I have, one pair of points is on top of the motherboard, and the other pair is on the bottom. This meant I had to completely disassemble the system to get the board out. If you're interested in the gritty details of this, read the sidebar “Field-Stripping Your Xbox”.

These pads we have to connect aren't very far away from each other, so I chose to bridge them with a bit of solder. The technique I found that worked fairly well was to melt a small amount of solder onto the tip of my iron, briefly touch it to one pad to heat it, then dragging the tip to the other pad, lingering there slightly then pulling away. Surface tension and luck seemed to work in my favor, as I was able to get a passable bridge in two or three tries. I'm sure there's a better way to do this, so by all means use a better technique if you know one. The completed bridge on the topside looks like this:

solder bridge (DSC00542)

With this step done, we're well on the way to making our Xbox a full-time Linux machine. We're just about ready to install our new BIOS, but to do that, we need a way to control our new system, and those big game controllers just won't cut it.

Adding Peripherals

Not surprisingly, an Xbox doesn't come with a keyboard. There's not much English composition to be done while playing Burnout 3, I suppose. Once again, those wily Xbox engineers have made life simpler for us in this respect. It turns out that those big, plasticy controller connectors are really just USB ports in disguise. All we need is an adapter to connect ordinary USB keyboards, mice, and whatnot to the Xbox's ports, and we're in business. I chose to make an Xbox plug to USB-B connector, so I can easily connect a hub for exciting multiple device action.

I started with an el-cheapo Xbox controller, and cut the plug off. We just need the connector; you also could harvest one from a controller extension cable. Then, I took a cable with a USB-B connector, and cut that off, too. I cut open the jackets of both cables, revealing the wires underneath.

spliced USB (AUT_0107)

Then it was just a matter of matching up the colors of the four wires, soldering them together, and sealing the whole thing up with heat-shrink tubing. The completed cable, attached to a hub, is shown below.

hub (DSC00660)

(Sticklers for detail will notice this is not the same cable as in the above picture. I made two.) You could make a much neater job of it if you don't splice the cables together like I did; if you bought the correct USB connector, like say a Jameco #174060CH, you could solder it to the end of the cut-off Xbox connector and be done. I did it this way because I had a spare USB cable laying around, and let's face it, I'm lazy. No matter how you put it together, now we can type! Let's get that BIOS replaced.

BIOS Flashing

Use the “Linux” option on your Xbox dashboard to boot into the minimal Linux system that you installed earlier with the MechWarrior hack. I'm going to mostly defer to the instructions at http://www.xbox-linux.org/TSOP_flashing_HOWTO. You must follow these instructions to the letter or you will be the owner of a very heavy black paperweight. The install process is roughly as follows. After booting into Linux, you need to get networking configured (a home network is helpful for this step). The minimal Linux install comes with an FTP server. You're going to carefully choose the appropriate BIOS image for your particular flavor of Xbox and FTP it to the Xbox from another machine. Then, using the “raincoat” utility, you'll first verify and then install that BIOS image into your Xbox's TSOP. Also there will be much praying to the computer gods to ensure it works correctly. If things went well, you'll see the following when you reboot:

cromwell boot screen (cromwell.tif)

Hard Drive Upgrade

Getting rid of that standard-issue BIOS lets us slam a new hard drive into the mix. I picked a 200GB Maxtor that I got for cheap at a local shop; anything will do, really, as long as it's an ordinary 3.5” drive with a Parallel IDE interface (sorry, no SATA, although that would make routing the cables easier). Dropping in the new drive is really the easiest part of this mod. Unscrew the stock drive from the plastic carrier we removed earlier, and screw in the new one. Set this unit aside for later reassembly.

hard drive carrier (AUT_0020)

Full Linux Install

At this point, you have to decide which Linux distribution you'd like to install. I'm personally a Gentoo fan, so I went with that. If you have a few Gentoo installs under your belt and are looking for a new challenge, this might be the way for you. There's also Xbox versions of Fedora Core (called XFedora), Debian (called Xebian), and Dynebolic to choose from. The Gentoo install works pretty much like installing on a normal PC, except the boot process is different. You make up an ordinary Gentoo install CD(I made one of the Universal install CDs with lots of prebuilt binaries...again, lazy.) One minor wrinkle is that depending on what flavor of Xbox you have, the DVD/CD drive in it may be very picky about what sort of recordable media it will read from. Mine likes Maxell DVD-Rs; your mileage may (and probably will) vary. This topic is covered nicely in the Xbox Linux Boot CD/DVD Burning HOWTO at the Xbox-Linux project.

Once you have a Gentoo CD or DVD burned that your machine will actually read, you can't just stick it in and have it boot. The bootloader on the standard Gentoo install CD knows nothing about working on an Xbox. (note: I understand there either is or was an Xbox-specific Gentoo in the works, along the lines of XFedora and Xebian above, but there seemed to be some sort of political nonsense going on between the developers that turned me off. Besides, I wanted to see how far I could get using the vanilla Gentoo CD). I got around this issue by not booting the Gentoo install CD at all! It doesn't matter much if you don't boot from a Gentoo install CD; as long as you can boot into a reasonably equipped Linux system of some sort (you need the filesystem creation tools, for one thing), you have all you need to bootstrap your install. I burned an Xebian install CD, booted that, then put in the Gentoo CD and started following the steps in the Gentoo Handbook. I prepared my drives, unzipped a stage tarball, and all that jazz. For a kernel, you'll need to emerge sys-kernel/xbox-sources. You'll probably also want to get sys-boot/raincoat for future BIOS upgrades. Don't bother installing Grub, the usual Linux bootloader; we burned the bootloader into the BIOS earlier. Do set whatever partition you put your kernel on as bootable, though; Cromwell likes that. To let it know how to boot your system, you'll want to create a file called 'linuxboot.cfg' in either the / or /boot directories of your bootable partition. The format of this file is pretty similar to a GRUB config file. Minimally, it will look something like

title TitleForYourKernel
kernel /where/your/kernel/lives
append kbd-reset root=/where/your/root/lives
default TitleForYourKernel
Note: It seems to freak out pretty bad if you don't include that kbd-reset line.

Once you've got it to boot by itself, you can tweak and season the system to taste, as is the Gentoo way.

Power Supply Replacement

Initially, to get the Xbox running in my car, I tried hooking it up to an AC inverter, turning the twelve volts DC from the battery into 120 volts AC. This is a extremely bad idea. Running the Xbox in this fashion produces a current draw around 35 amps, which is more than an average car's electrical system can provide while running the rest of the car's systems. Unless you have an extremely beefy motor vehicle with electricity to spare, or if you perhaps enjoy your car dying and stranding you in front of a biker bar (ask me how I found this out), you will not be able to run your Xbox this way for long. Inverters are wasteful and inefficient. So how can we make this work?

If you look in the Xbox case, you'll notice the power supply, occupying the rightmost quarter of the case. It's pretty close to an ordinary PC ATX power supply, turning 120VAC into the variety of voltages required by the motherboard. If we could only get a power supply that worked from 12VDC, surely that would be more efficient than the inverter technique! It turns out that smart engineers have already worked out this problem for us. I chose a power supply from Mini-ATX.com called the M1-ATX. It's specifically built for automotive usage, and produces a maximum draw of just 10 amps. This is well within the abilities of most cars. Your voltage may vary, of course. If we were dealing with an ordinary motherboard, this would be a drop-in replacement. Of course, Microsoft had to make things tough for us. The Xbox's power supply connector is a little off-spec. The old (version 1.0 and 1.1) boards have a connector reminiscent of the old AT connectors; the new (1.2 and up) boards have an ATX connector, but IT IS NOT ATX COMPLIANT. Do not connect an ordinary ATX power supply to this connector, or magic smoke will get out. Specifically, the +5V standby voltage (+5VSB) coming from the ATX supply must be stepped down somehow to +3.3V before connecting to the motherboard. In my case, I built an adapter to go from an ATX male connector (to plug into the M1-ATX), to the Xbox's power connector by cutting the connector off the stock Xbox supply. I could have ordered a new one and crimped it on to make a neat harness, but I'm still lazy (and impatient). So I cut the plug off the stock power supply, which looks like this:

xbox power supply plug (DSC00554)

Then, following the pinout found at the Xbox-Forums Case Modding FAQ, I grafted it onto the cable that came with the M1-ATX, and came up with something like this:

new xbox psu (DSC00666)

The +5VSB signal is run through a little board I built with a 3.3V voltage regulator (an LM 3940IT-3.3, Jameco #192524) and some filtering capacitors, which converts the signal to what the Xbox needs nicely. This is the bit rather unprofessionally wrapped in duct tape in the above photo. The only good place I could find to put it was on top of the PSU, and I had to insulate it somehow.

voltage converter board (DSC00598)

None of the mounting studs for the stock power supply fit the new one, so, I got some little plastic standoffs from Radio Shack, screwed them to the power supply, and epoxied them to the bottom of the case to make new mounts. I had to cut little holes in the metal RF shield to let the standoffs pass through.

Finally, I built a little cable to carry +12V in, ground, and an ignition sense signal for the M1-ATX (not currently used), and ran the cable out the hole where the AC cord used to go.

xbox rear view (DSC00699)

Now we've got an Xbox that runs Linux and can run from car power. Now what do we do with it?

The Front-End

We've got to be able to interact with the system somehow, so we need a screen and maybe some buttons. A trip to the local pawn shop yielded this:

cheap LCD (DSC00663)

It's a 7" color LCD panel, meant for car installs. Finally, one piece of hardware in this project that's actually supposed to go in a car! The good news is that it's cheap, fairly compact, and easy to connect - the Xbox is supposed to hook up to a TV after all. The bad news is that the quality is fairly awful. I guess for fifty bucks you can't complain much. For some reason, it doesn't have power and video input jacks itself; you first plug your inputs into an odd little adapter box, then plug *that* into the cable that comes out the bottom of the LCD...wierd...For input, I picked up a little numeric keypad.

keypad (DSC00667)

I was in the mood to write my own little player front-end, so I did. I wanted something neat-looking, with a very straightforward way to browse around my music collection. It's also important that the front-end could display clearly on that wretched LCD. For fun, I decided to try out a new environment to implement the front-end. I finally settled on writing it in Python and the Pygame library. I had a little experience with Python but none with Pygame, which is a SDL (Simple DirectMedia Layer) binding for Python; the combination of SDL and an interpreted scripting language makes rapid prototyping (read as: hacking) multimedia apps like this very pleasant.

redshark screenshot(rs_screenshot_2.gif)

The front-end, named "Redshark Player", doesn't do a whole lot. (It's named "Redshark" after my old car, which was in turn named after the car in Fear and Loathing.) The top line shows elapsed time. Below that is the browser - directories first, in brackets, then the files. It's old-school, reminiscent of a Apache directory listing. The browser starts in a "root directory" defined in a config file; I chose to store all my tunes in /var/sharktunes, with each album stored in a subdirectory under it. The bottom line shows the current directory, the number of subdirectories in brackets, and the number of files in the current directory. It's sparse and very functional. You can scroll around with the arrow keys on the keypad and start playing a song by pressing Enter. Once the song you picked finished playing, the next one on the album starts. Also, the whole thing is rendered in nice, large anti-aliased fonts which look great even on that awful LCD. I'm planning on expanding it to add playlists and some other usability features.

An interesting note - since Python is interpreted, and Pygame has versions for both PC and Mac, it was dead easy to develop Redshark on my OS X box, then copy it over to the Xbox for testing. The program runs and looks identical on both machines.

The Install

I figured it would be a good idea to set the system up so that I could hide the Xbox itself somewhere out of the way, and just keep the front-end parts (the LCD and keypad) up front. To pull this off, I needed a way to get all the signals back and forth between the two halves. To start with, I got really long USB, video and audio cables, some two-conductor wire for power, ethernet, and some two-conductor flat cable (ordinary phone cord - more on what that's for in a couple paragraphs). Then, using several bags of zip ties, I put all the cables together into one long snake.

cables (dsc00648)
All these cables...

cable snake (dsc00653)
...turn into one big cable. (Horrendous continuity error - I switched from silver to white phone cord between these two pictures. I didn't want to cut up an already terminated cable.)

To hide some of the mess, I made a "junction box" from one of those ubiquitous Radio Shack project boxes. The junction box has a cigarette lighter adapter to power the whole system; power is distributed to the Xbox and to the LCD through a terminal strip. The box also has a 4-port USB hub on it, for plugging in the keypad, thumbdrives, and other fun things. Everything plugs into this box, which makes things reasonably neat.

Since the Xbox may be located somewhere inaccessible, you might not be able to reach the power switch to start the system. To fix this, I made a remote starter switch. I soldered a wire to the second pin from the bottom on the Xbox's front panel PCB. This wire is fed outside the case to the 6-pin molex connector. Then it's fed over the phone cord in the cable snake (remember that?) to a jack on the junction box. There, it's connected to a pushbutton which shorts to ground when the switch is closed. Grounding this signal on the front panel PCB signals the Xbox to start or stop. Nice!

starter jumper (dsc00679)
The remote starter wire soldered to the front panel LCD.

junction box 1 (dsc00685)
The junction box. On top, there's the power switch, the starter switch, and a spare switch for something I haven't thought of yet. On the back, there's 4 USB ports, video in, Xbox power out, Xbox start signal (phone jack), and Xbox USB in (the latter four items being connected to the cable snake).

junction box 2 (dsc00681)
The insides of the junction box. Note the USB-A to USB-B adapter being used as a socket, to connect the USB cable from the cable snake to the hub.

front of car (dsc00695)
The LCD panel and junction box mounted to the front of the car. The LCD is attached to the glovebox door with a spring hinge; the junction box is simply wedged between the transmission tunnel and the passenger seat. It's a good thing I don't do this for a living. Also shown is a full keyboard attached to the front USB hub; it's a Logitech NetPlay keyboard, originally intended to be used for certain Playstation 2 games. It's just an ordinary, if small, USB keyboard, which works very nicely. It's currently being used for song selection because the numeric keypad I bought quit working...

The original plan was to mount the Xbox itself in the trunk for safekeeping. I even made an aluminum tray with foam padding to hold the Xbox secure in the trunk. However, after some testing, I started to worry about adequate airflow. The Xbox gets a bit toasty in operation, and I'm not sure I want to mount it in an enclosed space until I can work out some kind of ventilation. So, I ended up just sitting the box on the back seat. There's enough cable (15 feet of it!) to put the Xbox pretty much anywhere. This works well enough for now, and makes the system more accessible for tinkering. Once I stop fiddling with it quite so much, and figure out a scheme to get some better airflow to the trunk, I'll go ahead and mount it permanently.

Future Directions

I've got a couple more ideas I want to play with now that I've got the basic platform established. A GPS receiver could be attached to form the basis of a navigation system using GPSDrive. Also, I've thought about building a rolling wireless access point - connecting a 3G cellphone, and sharing its Internet connection out over a wireless adapter. Also, I'd like to make aspects of the music player more robust. Currently, you put new music onto the system by copying it to a USB storage device (a thumbdrive, USB hard drive, or something), plugging it into the Xbox's hub, and manually copying the files over at the console prompt. Some sort of automatic import feature would be neat. The original plan was to leave the system running after the car was turned off, then send music to it over WiFi, but power requirements made this impossible (you'd drain your battery in short order running with the engine off).

Conclusion

The biggest lesson I learned over the course of the project is that an Xbox is perhaps not the best sort of computer to put in your car. It takes a fair amount of modification to beat the console into something even remotely usable. In point of fact, being lazy and not wanting to buy another computer for the project lead to a heck of a lot of extra work. If I were going to start over, I'd probably buy one of those shiny new Mac Minis and stick it in my glovebox. Even so, it was a fun little project that ended up being not quite as little as I originally expected. I'd also like to think that I've learned a bit about fabrication and hardware modding, mostly by screwing things up repeatedly until I got something that worked. I'm reasonably happy with it, being my first fairly extensive modding project. Also, it's pretty rewarding to drive around town, listening to music coming out of a system you put together! That big black slab of plastic is good for something other than Halo after all.

Have fun,

--riney

Thanks to Nafees bin Zafar for editorial assistance with this article.

Downloads

Get Redshark Player

References