Xbox Linux USB HOWTO

From Xbox-Linux

basert

This page is also available in: Deutsch

(originally by Ulf Lamping, 13 January 2004)

This document will explain, how you can attach some standard USB hardware to the Xbox controller port(s) to use it with Xbox-Linux. It will not explain how to use or program USB with linux in general, as this is not the target of this document.

Table of contents

Contributions

This document includes contributions from:

  • Michael Steil (XPAD internals and other things)
  • Ian Rutson "lists AT rutson DOT co DOT uk" (link to: "How to add 2 USB

ports to a Joytech XBOX controller")

  • Paul john (using USB sticks as memory cards)

If I should have forgotten someone, this was no intention! x

Disclaimer

(XLrN: Done.)

Note: If you don't want to make your own you can buy one by searching on Google for USB Adapter for XBox(Female)or Xbox USB Or if you want click Hereand (http://www.google.com/products?q=xbox+usb+&btnG=Search&hl=en&show=dd) Here (http://www.google.com/products?btnG=Search&hl=en&show=dd&q=usb+adapter+for+xbox+female)


USB in general

In this chapter, you will find a small general overview of USB (Universal Serial Bus), which will be helpful to understand the rest of the text. For more detailed information about USB, see:

  • [1] (http://www.usb-info.com/) (small USB overview)
  • [2] (http://www.usb.org) (USB organization, e.g. look for the developer pages there to get USB specs)

USB versions

USB is currently available in two different versions, V1.1 and V2.0, with the following maximum transfer rates as the main difference:

  • USB 1.1: 1,5MBit/s (LOW SPEED) and 12MBit/s (FULL SPEED)
  • USB 2.0: 480MBit/s (HI SPEED, not supported by the Xbox)

USB V2.0 is usually needed only for devices requiring very high transfer rates (e.g. mass storage). As the Xbox peripherals do not need high transfer rates, the Xbox is supporting V1.1 transfer rates only. However, USB devices are backward compatible, so USB2.0 devices should also work with the Xbox, of course they will only use the slower 12MBit/s transfer rate.

USB connectors

Two different kinds of USB connectors are used, Type A and Type B.

A typical USB connection from a PC to a peripheral device:

Host (e.g. PC) Device (e.g. flatbed scanner)
Type A female Type A male Cable ;-) Type B male Type B female
USB bracket usb type a male usb cable usb type b female usb b male

Table: Typical USB connection from a PC to a peripheral device (e.g. flatbed scanner)

Note: A lot of devices, (e.g. mice, keyboard, etc.) have fixed cables at the device end, without any connector there. So Type A connectors are more often seen than Type B ones!

By the way: USB V1.1 and V2.0 use the same connectors.

USB cables

A standard USB cable has 4 wires in it, plus shield:

  • red: VCC (5Volt, max. 100mA/500mA)
  • black: Gnd
  • white: D0-
  • green: D0+ (I've seen a blue wire used instead here by some USB cables)
  • shield: Drain-wire (usually connected to the case)

The power wires (red and black) are usually a bit thicker, than the data ones (white and green). The maximum current without anything done before is only 100mA, but the device can request the host to "give more power". If the host confirms this request, a maximum current of 500mA is possible.

USB hubs / repeaters

Remember: USB cables should not exceed a maximum length of 5 meters without any active components (hubs/repeaters) between two ends.

An USB hub will usually enable you to connect more than one device to a single USB host port. So it will have a single cable (from 20cm to 2 meters) with a Type A male connector and 2 to 4 Type A female connectors, usually built into the hub.

An USB repeater on the other hand will only have one Type A male, and one Type A female connector (so it is a special kind of a hub), with usual a 5 meter cable between the two connectors.

A maximum of 127 devices can be connected to a USB host (like the Xbox) but unless you can lay your hands on a 30-port hub, you are limited by the number of ports on a hub times 4 (the number of Gameports on the Xbox) because the Xbox bios does not support more than one hub per Gameport.

Please read the specs at http://www.usb.org to find out about more specific information about other USB limitations (and please let me know, so I can add it here :-).

Xbox controller connection

The connection to the Xbox controller (XPAD) is electrically a normal USB 1.1 connection (it is using the same voltage levels and transfer protocol as other USB hardware). However, the Xbox controller connection differs in two ways from a normal USB connection:

  1. Xbox connectors are not standard USB connectors
  2. the Xbox cable has a non standard fifth (yellow) wire in it. This wire can be cut off on both ends (Xbox and XPAD), the Xbox controller will work perfectly well without it. However, if you use this wire for your own purposes, be sure to cut it on both ends.

The yellow cable itself outputs a 3.3V CMOS compatible signal, which is a 15.734kHz pulse train, which is synchronised with the HSync signal of the xbox composite video output. This enables it to be used for light pens or guns.

The standard XPAD cable is indeed a chain of two cables, a small connector cable (about 20cm) from the Xbox plug to a female connector and the cable fixed at the XPAD (about 2 meters) which has a male connector. The small connector cable shown below:

xpad inline release cable

Figure: Small connector cable between Xbox and XPAD cable

Xbox connectors

Microsoft calls the connector between this two cables the inline release. It is intended to prevent pulling the Xbox from a table or such, if you pull too much :-)

Xbox XPAD
Xbox female Xbox male Cable (~ 20cm) "inline release" female "inline release" male Cable (~ 2m) ------
usb special female usb special male usb special cable usb inline female usb inline male ub special cable xpad

Table: Connection between the Xbox console and an XPAD controller

XXX: The connector at the Xbox side is not known to me, so I'm even not sure what the female and what the male side is. I will call the connector of the Xbox female and the cable side male. If someone else does know the correct names of the connectors, please let me know.

The "inline release" connector is looking a bit like a mini-DIN connector (known from the PS/2 keyboard connectors used at PC's). But neither this one, nor the connector at the Xbox itself are standard connectors. Currently no retailer is known, where such connectors can be purchased.

[EDIT by James Mazikowski]

The reason there is no place to purchase such connectors is the fact that these are MICROSOFT proprietary connectors. This means the only way you can get them is buy the MICROSOFT product, namely the XPAD or another XBOX controller like a DDR DancePad. [/EDIT]

[EDIT by DiamondX] Madcatz makes inline connector extentions. I have seen them at gamestop for about $5. It has a female on one end, and a male on the other. It is about 2-3 meters long. [/EDIT]

[EDIT by ShotSkydiver] Here's the link to purchase it: Gamestop (http://www.gamestop.com/Catalog/ProductDetails.aspx?product_id=25718) [/EDIT]

The Xbox cable shown above consists of the usual four USB wires plus the special yellow one mentioned above, plus shield:

  • red: VCC (5Volt)
  • black: Gnd
  • white: D0-
  • green: D0+
  • yellow: special Xbox (lightpen??)
  • shield: Drain-wire (usually connected to the case)

The four wires (red, black, white and green) are like the standard USB ones described above.

XPAD internals

The USB topology of a gamepad looks like this:

 hub
 |-- gamepad
 |-- memory card A
 `--- memory card B

That is, every gamepad contains a USB hub, which up to three devices are connected to. There's always the actual gamepad device, and optionally two memory cards in the two memory card slots.

Connecting USB hardware to the Xbox

To connect additional USB hardware to the Xbox for use with Xbox-Linux, you need at least one standard USB connector. As described above, the used protocol is identical to a usual USB device, only the connectors are different.

To use Xbox-Linux, you will usually want to attach two USB devices: a keyboard and a mouse. You could build a "special cable connection" for every device you want to attach, but as USB hubs are really cheap now, it will be easier to build a single "special cable connection" and then connect an USB hub to the Xbox, offering four or more USB ports for general purpose. Depending on the power consumption of the devices you want to attach, this could be a cheap passive hub without its own power supply. This should always work if you only attach a keyboard and a mouse. If you want to play Xbox games with the XPAD, you cannot connect it through an USB hub! The standard Xbox BIOS is only able to handle one chained USB hub, but the XPAD itself has a hub already built in, so this would be the second in a chain.

However, if you connect the XPAD by one of the four ports at the Xbox as usual, and the additional USB hardware on another port, this should work perfectly for both Xbox games and Xbox-Linux.

The Xbox doesn't seem to have a problem with USB hardware which it doesn't know being attached to the Xbox controller ports. So you don't have to unplug this additional USB hardware if you want to use the Xbox for games and such.


Buy a prebuilt cable

The following merchants offer a complete manufactured cable (USB Type A female, Xbox connector male) for a reasonable price (around $10 before shipping usually).

  1. Mid-west Games (http://www.midwest-games.com/usbadforxbox.html) USA (North Dakota)
  2. Electric Quarter (http://www.electricquarter.com/xboxkeyb.htm) USA (New Hampshire)
  3. Llama's Adventures (http://secure.llamma.com/catalog/product_info.php?cPath=27&products_id=80) USA (Minnesota)
  4. Console Plus (http://www.consoleplus.co.uk/product_info.php?pName=usb-adapter-cable-for-xbox) UK
  5. E-Bay (http://search.ebay.co.uk/USB-Adapter-for-Xbox_W0QQfkrZ1QQfromZR8) UK

Advantage: This is the easiest way of doing the whole task.

Disadvantage: You have already heated your soldering iron, and you don't want to wait for snail mail from asia, do you? ;-)

You can buy a Phantasy Online keyboard that comes with a xbox-connector from the makers of Action Replay for $20, which is a good option if you don't already have a usb keyboard. Another option if you are going to do a Linux installation and haven't got a memory card yet, Mega X-key's come with a usb-to-xbox cable.

Solder a suitable cable yourself

Remember: a USB cable length should not exceed about 5 meters in total, between two USB hubs (without a USB repeater), keep that in mind if you build your own USB cables!

If you're on a budget and don't want to buy an extension cable, see This Tutorial (http://www.xbox-linux.org/wiki/DIY_USB_Gamepad) for a fully illustrated guide to converting an xbox gamepad into a usb gamepad with only a usb plug and some time. If you want a neater solution, see below...

The Xbox-Linux webpage mentioned an Xbox extension cable with the special connector that can be plugged directly into the Xbox. Unfortunately, I couldn't get such a cable, but only one with the inline release connector :-( If you use such a cable, you can not plug in this connector directly. You must always unplug/replug between the XPAD and the USB hardware (this is really not a good solution, if you want to switch between Xbox games and Xbox-Linux more often).

Independent of what kind of cable you can get, the following method is the same for both kinds of cable. If you have the choice of buying an extension cable with Xbox or with inline release connectors, choose the Xbox connectors, as you can use it in parallel to the XPAD.

Buy an XPAD extension cable (with a male and a female "inline release", or Xbox connector, as mentioned above) and an USB extension cable (with a male and a female USB Type A connector). Cut both cables in the middle (or where you like :-). You should have four cables now ;-) You need to use the cables with the XPAD male and the USB Type A female plugs.

Remove the cable sheath for some centimeters and solder together the wires matching their colours (red with red, ...) but leave the yellow one of the XPAD cable unconnected. Some USB cables use a blue instead of the green wire, so connect the blue with the green one, this should also work.


It is a good idea to isolate the wires by shrinkdown plastic tube. Also use this shrinkdown tube around the whole cable to get some more mechanical stability.

Some people remarked, that their cable wires (especially the XBOX extension one) had different colours than I described above. So I will try to add the pinouts here.

If you look at the connector side (NOT the so called "solder side") of the connectors, where you can see the "pins":

Xbox "inline release" male, this will be plugged to the XBOX connector cable:

USB inline male pinout

Figure: XBOX "inline release" male pinout

USB Type A female, where you would plug an USB keyboard, mouse or hub connector into:

USB type A female pinout

Figure: USB Type A female pinout

So simply solder together the four matching colours ,(the Xbox cable uses 4 colors: Red, Blue, Green, White. Some USB cables use 4 Colors: Red, Black, Green, and Blue. Use the following as a reference. If only one wire is a different color, then leave it for last, and connect it to the remaining wire (not the yellow!)
Red -> Red
Green -> Green
Blue -> Black
White -> White)

keep the yellow LP (LightPen) wire unconnected.

A ready to go "self soldered" cable will look like this:

usb homebrew cable

Figure: Self soldered Xbox to USB adapter cable

Another option is to purchase a cheap controller and splice a USB Type A female connector on after the XPAD connector (if present). Besides USB extension cables, Type A female plugs are found in USB -> PS/2 adapters, which normally come with USB mice (although exposing the wires in these adapters can be difficult).

Advantage: If you solder together the two leftover cables (XPAD female and USB Type A male), you can use the XPAD controller with a PC (see chapter below or This Tutorial (http://www.dangray.org/xbox.html) for details).

Disadvantage: If you want to continue to use the Xbox for games and such, you may have a problem here. Depending on which extension cable you choose, you must always unplug and replug things, as you cannot connect both the Xbox controller and a USB mouse/keyboard at the same time unless you have a spare cable.

Solder an USB female connector directly to the Xbox

Buy a Type A USB female plug (not a one for soldering directly into a printed circuit board!).

The easiest way is to buy an USB bracket for a PC mainboard (should be available from your local computer store).

USB bracket

Figure: USB bracket with two Type A USB female plugs

Unscrew one of the usual two USB female plugs from the bracket. You should now have a small cable (about 20cm) with a female USB plug at one end, and a connector for the mainboard at the other. Cut the connector for the mainboard from the cable.

usb a female

Figure: Single Type A female plug, screwed off from a USB bracket

Disassemble the Xbox: remove all cables, open the case, remove harddisk and DVD-drive. The mainboard and the power supply may stay where they are. When you installed your modchip earlier, you have done this before :-).

The next step is to get the USB cable through the case inside the Xbox.

So look for one of the two XPAD connector "holders" (the ones which are the controller ports attached to), I would prefer the one for controller 3 and 4. You need to get it off the Xbox, to be able to get the USB cable in from the outside. Remove the two screws which are holding it, and unplug the small 12pin connector from the mainboard. Then remove the complete holder by using some force bending it upwards.

I have inserted my USB cable from the bottom of the front side through one of the many holes there, (it is a bit tricky, to get the cable through the hole in the shield). Remember to keep some space for the original controller plug, it should be reattached again afterwards :-).

usb xbox connector

Figure: Xbox bottom view, with a USB female connector

Now simply cut the four wires coming from the mainboard, and solder them to the ones of the USB cable (as explained before: red, black, white, green). Afterwards isolate the single wires using shrinkdown plastic tube.

Fix the USB cable with a cable tie, but keep in mind, to be able to insert the harddisk again later.

Reattach the USB holder (don't forget to plug in the connector to the mainboard), and put everything else back where it belongs.

usb internal plug

Figure: Internal Xbox view, showing the wiring of the USB cable (in front you see the white unplugged power connector)

Advantage: No unplug/replug needed when you switch from Xbox games to Xbox-Linux and back.

Disadvantage: The task is a bit more tricky, but not very hard to do. One of the controller ports can no longer be used for an Xbox controller. But unless you are using all four controllers, this is no disadvantage at all.

Using USB memory sticks as Xbox memory cards

As this information is a bit off the general topic of this document, I will add it here to have complete info in one place.

Some USB memory sticks are known to work as "memory cards" for Xbox gaming (to save games level info on it), but others are known to fail for this purpose.

Most likely, simple memory sticks that act as a single partition will work, but memory sticks that act as a fixed disk (and come with a partition table and one or more partitions) will not work.

On the developer mailing list, Paul Bartholomew wrote (2003-02-22 07:35):

I've had lots of trouble getting any USB memory sticks or memory card
readers working on my Xbox (for use in the Xbox OS/with Xbox games).
Because nobody else was having troubles, I was sort-of thinking that it may
have been something wrong with my setup (bad cables, etc).

Well, I've just received a couple of "Memory in Black" (by PQI) USB memory
sticks (a 32MB and a 128MB).  They both work fine.  Someone on the list had
suggested this particular device.  I purchased them from here:
http://store.yahoo.com/eperipheralcom/memoryinblack.html

The 32MB formats to 2014 blocks, and the 128MB to 8061 blocks.  This implies
a block size of 16K (I believe I've read this on the list previously).

To save others from purchasing memory devices that *don't* work, here's a
list of ones I've confirmed to be incompatible with Xbox:

  Lexar Jumpdrive 64MB USB memory stick
  Sony Micro Vault 128MB USB memory stick
  ZIO! Compact-Flash to USB adapter
  Sandisk ImageMate combination Compact-Flash/SmartMedia to USB adapter

ePeripheral now sells standard SanDisk Cruzer Minis, not Memory In Blacks. The Cruzer Mini does work with the Xbox, but local computer stores tend to have better prices for these sticks than ePeripheral does.

Formatting memory sticks

If the filesystem on the device is not FATX, the Dashboard will automatically reformat the drive to accept savegames. So no, you do not need to format your stick before inserting it into the Xbox. Note that the Xbox does not ask for confirmation before formatting, so do not insert memory sticks with PC files unless you want the stick erased! The only sure way of getting files to the Xbox is to use one of the following:

  1. a disk image, like the MechInstaller exploit.
  2. software that can read the Xbox filesystem.

Thankfully, most computers will prompt before reformatting an Xbox-formatted stick or an actual memory card (through a reverse adapter).

USB hardware and Xbox-Linux

Some words about the USB hardware, which can be connected to Xbox-Linux.

Xbox specific USB hardware

  • The "Xbox controller pad" (XPAD) can be used inside Xbox-Linux as a normal USB joystick. (use the driver from the Xbox-Linux project)
  • The "Xbox DVD playback kit" can be used as an IR remote controller inside Xbox-Linux using the LIRC project (use the driver from the Xbox-Linux project)
  • The "Xbox memory unit" is currently not supported by Xbox-Linux
  • The "Xbox communicator" (audio headset) is currently not supported by Xbox-Linux

(XXX: Is this really true? Need some advice from the experts at this topic here! Also maybe add a bit more details about using the different hardware.)

The XPAD (and in Xebian the DVD remote) can be used as a mouse.
You *may* be able to access an XBox memory unit, especially if it's a USB stick you used to transfer the MechAssault files with. Try: mount -t fatx /dev/sda /mnt/usb where /mnt/usb is an empty folder to access the memory unit. No quarantees :-(.

Standard USB hardware

Xbox-Linux does not use a special USB stack, but uses the normal linux USB stuff. So all general informations for using USB hardware/software in linux are suitable for Xbox-Linux as well. As usual, you have to think about the kernel version (2.4 or 2.6 necessary for USB-Mass storage) and other things, but this is no special Xbox-Linux stuff.

Mice and keyboards don't seem to cause big trouble. The standard functions will usually work well. Whether special functions (e.g. special keys) of mice or keyboards will work together with Xbox-Linux or not depends on the drivers you use for it.

Some people are reporting problems with optical mice. Currently it's not clear what the problems are, so there is no advice available about which mice should work and which not :-( So if you want to buy this kind of hardware for Xbox-Linux, you should find a dealer which will take it back if it does not work.

In rare cases, it seems the Xbox-controller setup during boot can interfere with your USB devices. If you experience problems, try powering on the Xbox with your USB peripherals disconnected. After Xbox-Linux has booted, "hot-plug" your device and see if that resolves the problem. (We've had a report on Logitech Cordless Desktop LX500 showing this behaviour.)

Whether other USB hardware will work or not depends on a linux driver being available (and your linux knowledge to install it).

It is generally a good idea to look for information at the "usual places" , such as the Linux USB Project (http://www.linux-usb.org/), before buying some USB hardware for linux.

Using the Xbox Control Pad as a joystick on a Windows PC

As this information is off the general topic of this document, it is added here for completeness. Using the experimental Xbox Controller drivers here, (http://www.redcl0ud.com/xbcd.html) the Xbox Control Pad can be used as a standard joystick under Windows.

Additionally, you will need a PC Xbox Adapter, which can either be soldered yourself, as explained earlier in this document and in this tutorial (http://www.xbox-linux.org/wiki/DIY_USB_Gamepad), or purchase it through a retailer such as Lik Sang (http://www.lik-sang.com/info.php?category=83&products_id=2701).

For full details of how to convert an Xbox control pad into a USB control pad yourself see this tutorial (http://www.xbox-linux.org/wiki/DIY_USB_Gamepad), it has full instructions and illustrations.

Installing the Xbox Controller driver on Windows

Remember that these drivers are still experimental, but they work exceptionally well. The drivers are only available for Windows 98/2000/XP. Also included in the download (http://www.redcl0ud.com/files/XBCDv107.exe) is a small application to adjust the Xbox Control Pad functionality. Save the uncompressed files in a folder where you'll remember it (in case you need to point to it again later). Note also that these drivers are unsigned, so Windows XP is particularly grumpy about allowing the installation. Ignore it and you'll be fine.

Once the drivers are installed and the Xbox Control Pad is attached via the cable to USB, Windows will begin identifying the devices. The Xbox Control Pad shows up as about three devices: a joystick, an input device, and a USB hub. This can be confusing, but just acknowledge them as they happen. Sometimes, Xbox Memory Units are also shown as storage devices, but the FATX system doesn't seem to work well within Windows, so ignore that one.

Remember where you put the install folder, as if you ever unplug the Xbox Control Pad, reboot, and later want to use it again, you'll sometimes need to point to the device driver (SYS file) to have Windows re-recognize it.....

Using the Xbox Control Pad as a joystick under Mac OS X

Darrell Walisser has written an Xbox controller driver for Mac OS X, available on his .Mac page (http://homepage.mac.com/walisser/xboxhiddriver/).

Summary

It's not too hard to attach USB hardware to the Xbox-Linux, once you have solved the connector problem. Whether a special USB device will work, or not, is usually a case of linux in general, but not a special Xbox-Linux topic. So if you can manage to start linux on your Xbox, you should be able to use the wonderful world of USB devices ;-)

Annother way is to create a USB adapter that can plug into Xbox Controller like the way mike chambers (http://mesh.typepad.com/blog/2005/01/creating_a_usb_.html) did it.