Monday, March 3, 2008

This Blog Has a New Owner

It's really sad that for some reason, the previous owner of this blog abandoned the blog, all the content, and all the people coming from digg.

Yes, that's right, I am not the person who knows how to install mythtv on an xbox, and I am not the person who originally started this blog. What I do know, being a web developer myself, is that I hate broken links, and I hate information being lost because of said broken links.

I came across this abandoned blog (from digg) and lo and behold, there is no blog anymore. It was pretty funny that because the blog was no longer registered to anyone, blogspot had a big button that said, "register this username". I of course jumped at the opportunity to revive the blog, knowing that people are still going to trickle in from digg, so here it is. I will try my best to inform others about mythtv on xboxes, or at least direct people to the information about how to accomplish the task.

I considered myself qualified to take over this blog because of a few reasons. I am not just some average Joe who thought it would be cool to check out a digg link about xboxes... I have actually been very interested in creating a xbox mythbox for several months now, and I have been preparing to attempt this project myself. As of March 03, 2008, I have acquired and prepared the following items:
  • 1 broken xbox controller for xbox-to-keyboard cable
  • 1 old usb hub for xbox-to-keyboard cable
  • 1 MechAssault xbox game (Part No. X08-82264 being the necessary game version)
I still have no xbox. eBay and craigslist are going to be my helpers in obtaining one. I have decided that I will be blogging about my experience setting up an xbox mythbox. More to follow.

Install Guides

Following my introductory comments, is a digg comment on the digg entry that linked to this blog. I thought it would be more visible if it were here where the digg link goes to.

I would like to correct the digg entry about mythTV on xbox 360's: MythTV will NOT work on xbox 360's!!
(although things could have changed since I first read about MythTV. please correct me if i'm wrong!)

Additionally, here are some links to assist with the MythTV on xbox process:

http://www.xbox-linux.org/wiki/Main_Page
http://www.ps.masny.dk/projects/linux/mythtv-0.4b-xbox-HOWTO.html




by shinynew on 07/10/2006
geocities sites go DOWN!

Full text, sorry for the length bury me if you want.
Introduction

A mythtv setup consists of one or more servers (PCs with video cards), and one or more clients. I have a mythtv server and a couple of clients running on PCs. The main problem is to fit a Mythtv client in a typical media center, where you don't want to have a large noisy PC running. So the XBOX is a perfect fit, it's really a PC but without a noisy fan and it fits in a typical media center shelf. The XBOX isn't powerful enough to be a Mythtv server, and there's no (easy) way to
install a TV card in the XBOX. But it should work ok as a client.

Mythtv is a Linux application, so we'll install Linux on the XBOX, and then we'll install Mythtv.


Prerequisites

1. A running Mythtv server and a LAN with sufficient speed, either a fixed LAN or a 54Mbps or better wireless network. I used a 54Mbps wireless network. I originally set up my Mythtv on Ubuntu using this HOWTO: http://www.quietglow.com/docs/ubuntumythtv.html
2. An older XBOX, not XBOX 360, but the older kind. Stay away from the newest versions. I bought mine on Ebay for $110 or so.
3. The MechAssault game for XBOX, the original, not the platinum version. I bought mine on Ebay for < $10. 4. A linksys wireless game adapter WGA54G (Ebay $60 or so). 5. A special USB to XBOX cable. I bought mine on ElectricQuarter.com for about $6.00 XBOX USB cable, Wireless adapter, MechAssault Preparing the XBOX I used the "software" method to prepare the XBOX for Linux. You can see a detailed HOWTO here. But here is what I did: Download the "MechInstaller" savegames. Go to http://sourceforge.net/project/showfiles.php?group_id=54192&package_id=91497&release_id=177464
and choose to download MechInstaller-1.0-FATX-Images.zip (use the latest version). I use Ubuntu,
so after the download I used FileRoller to extract the MechInstaller-1.0-FATX-128MB.img file.
My USB memory stick is a 128MB stick.

Plug in your USB memory stick and install the MechInstaller image on the USB disk with the
following command:
sudo dd if=MechInstaller-1.0-FATX-128MB.img of=/dev/sdb
/dev/sdb may not be the right device for you. Find out the right device first by choosing
System->Administration->Disks.

Connect the USB memory stick to your XBOX using the special usb/XBOX cable and start the XBOX
without a CD in the drive. Copying is done by using the savegame management features on the
original Xbox Dashboard. You will need to navigate to your USB stick and copy each savegame on
it one by one to your HDD. The MechInstaller savegames should have little penguin icons on them.

Now restart the XBOX with the MechAssault game in the CD drive. Then choose "CAMPAIGN", and then
"Install Linux". This will take some time. Afterwards, your Xbox is fully Linux-compatible,
and there is an item "LINUX" in the Dashboard main menu which boots a minimal Linux system.

You are done with the preparation phase!

Preparing the wireless game adapter (WGA54G).

Connect the game adapter to any PC using the LAN cable that came with it. Configure your LAN
interface with a fixed IP in the 192.168.1.X subnet (X can be anything you want except 5 or 250).
Point your browser to http://192.168.1.250 and you should get a prompt to logon to the
configuration page. Use the password "admin" with no username.

If you can't get this to work then get a paperclip, unfurl it and use it to press the reset button
on the game adapter. Push and hold for a few seconds until the lights flicker to show that the
game adapter is reset. Then try the admin page again.

When you get into the admin page make sure you connect to your wireless network. I configured a
fixed IP address of 192.168.1.5. When you're done connect the LAN cable to back of the XBOX.


Installing Linux

I used Xebian. The complete howto is here. Download Xebian from here. Use the latest available
version. I chose
dist-1.1.4-xbox.tar.gz.

Extract the .iso file:

tar xzvf dist-1.1.4-xbox.tar.gz

The .iso file is dist-1.1.4-xbox/1.1.4-xbox.iso.

Use the .iso file to burn a DVD. The XBOX prefers DVDs. If you don't have a DVD burner you could
try a regular CD-R, but I don't know if this will work. Stick a blank DVD+R or DVD-R in
the drive, Right mouseclick on the .iso file and choose "write to disk".

Power on the Xbox without a disc in the drive, wait for the Dashboard to appear, and then insert
the Xebian disc. My XBOX has a Thompson DVD drive. You can find out which DVD drive your XBOX has
by going to this page.
My Thompson drive refused to read a standard DVD+R disk so I then tried to use a CD-RW, and this
worked. In theory Thomson drives should read DVDs fine, but this seems to be a case where you need
a bit of trial and error.

If you get the XBOX to boot off the Linux installation image, you'll eventually get to a screen
with icons etc. This is the fluxbox desktop which is the default in Xebian.
This is just Xebian linux running off the LIVE-CD, it's not installed on the HD yet.

Now you'll need a way to logon to the Xebian system and enter commands with a normal keyboard,
(don't try to do it with the game controllers etc.).

You could simply try to connect a USB keyboard to the USB cable you have. I prefer to use a laptop
and a crossover cable. You could just plug the XBOX into your network router, but I have a
wireless LAN so did the following:

Connect a laptop to the XBOX using the crossover cable.
Configure the LAN adapter in the laptop with a fixed IP address:

IP address: 192.168.0.11
Subnet mask: 255.255.255.0

This means your laptop is using 192.168.0.11, whereas the XBOX is 192.168.0.10.
If your laptop is using Linux, then use ssh to logon, If you're using Windows then download PuTTY
and use this instead.

ssh root@192.168.0.10
Password: xebian

You should get in and get a # prompt. Now type XBOXLinuxInstall and press Enter.
Now you'll get a series of questions:

I installed Linux inside the Gamesave partition (E:). I chose a root filesystem size of 1990MB
instead of the default value of 2000MB. and I chose the defaults for all the rest. I did this
to stay within the total size of E: which is 2250.5MB. Swap by default is 250MB.

This runs for some time, and you'll see the list of files being copied from the CD to the hard
disk. At the end of the script you'll be prompted for the network configuration. I used:

IP address: 192.168.1.10
Subnet mask: 255.255.255.0
Gateway: 192.168.1.10

This is now a fixed ip for use within my wireless LAN, where we already set up
the wireless game adapter. Now the script is finished.
Type
# reboot
and the XBOX will reboot, take out the CD and choose "Linux" in the Dashboard. This will boot
the new Linux system from the hard disk.

Plug in the game adapter to the XBOX using a normal LAN cable. Try to ping 192.168.1.5 (the
game adapter itself) from another PC on the local wireless network. If this doesn't work then
repeat the section about configuring the game adapter. When you get this to work then try to
ping 192.168.1.10.

If you're security concious, then follow the Xebian post-installation instructions.
You are done with installing Linux!!


Installing the MythTV client.

There is a very good easy MythTV on Xebian HOWTO. In my case all the assumptions held for going
ahead with this HOWTO. I already have a couple of PCs running mythtv clients on my network, so
MySQL etc. is set up to accept connections over the network.

Here's what I did from my Ubuntu PC:

ssh root@192.168.1.10
Login with the root password.

vi /etc/apt/sources.list

add the following lines to the end of the file:

deb http://alexfisher.me.uk/debian sarge main
deb http://www.debian-multimedia.org sarge main

Save the file.

tzconfig

Set the timezone of the XBOX.

apt-get update
apt-get install ntp-simple ntp-doc ntp-server
/etc/init.d/ntp-server start
cd /etc/rc2.d/
ln -s ../init.d/ntpdate S24ntpdate

Now we're ready to install MythTV:

# There's a bug here in the installer
mkdir /etc/mythtv/
chmod 777 /etc/mythtv/

apt-get install mythtv-frontend

This prompts for the host of the MySQL server. I typed the Ip address of my MythTV/MySQL server:
which is 192.168.1.4.

I'm just going to use the default "live" username on the xbox to run mythfrontend.
I want to start the frontend now to test it but to start the frontend I need to be able to
control the desktop. So I'm going to use VNC:

# apt-get install x11vnc
# su - live
$ x11vnc -display :0

Then on your local (ubuntu) system type:
$ vncviewer 192.168.1.10

Now you get a window containing the fluxbox desktop. Now just click on the "Terminal"
icon, start a terminal session and type
$ mythfrontend

This will fail. Just ignore the errors and exit. Now try

$ cd .mythtv
$ vi mysql.txt

Edit this file and make it look exactly like the one on your other mythtv clients.
I just use a hardcoded ip address in mine for the server name.
Now try

$ mythfrontend

Again. This time enter the language and then you'll see the main mythtv menu!

To setup your DVD remote to work with mythtv do the following (as root):

cd /tmp
mkdir lirc_temp
cd lirc_temp
wget http://bit.blkbk.com/mythtv-xbox.0.4.5-beta.tar.gz
tar xpzvf mythtv-xbox.0.4.5-beta.tar.gz
cp live/lircrc /home/live/.lircrc
ln -s /home/live/.lircrc /home/live/.mythtv/lircrc

To set up autostartup of myth and the vnc server do this (from the HOWTO):
Add the following lines to /home/live/fluxstartup.sh file:

# Disable dpms (EnergyStar) features
/usr/bin/X11/xset -dpms
# Disable screensaver
/usr/bin/X11/xset s off
# Start VNC server
x11vnc -display :0 &
# Start the mythtv frontend
mythfrontend &

NOTE: This fluxstartup.sh file is a little different from the guide I mentioned above. I think
they have an error in their guide.
Now kill the /usr/bin/X11/X process and let the desktop restart. This will automatically bring up
the mythtv frontend, and you'll also be able to use the vncviewer remotely. I found that after
a while I don't really use the vncviewer, so I commented it out from the file. This will save
some precious memory resources on the xbox.

To configure the system to shutdown from the frontend, do this (as root):

# chmod +s /sbin/halt

Then from the mythfrontend go to Utilities/Setup -> Setup -> General -> (Hit three times)
And enter the "Halt command:" as /sbin/halt
Now the shutdown should work even though you run as "live".

I also use some additional mythtv plugins, so I did this (as root):

apt-get install mythvideo
apt-get install mythmusic
apt-get install myththemes

I have my music and video on an NFS share. So I did this:

vi /etc/hosts

Add the host gct3102 and it's ip address to the list.

mkdir /gct3102
vi /etc/fstab

Add the following line:

gct3102:/usr/local/archive /gct3102 nfs rsize=8192,wsize=8192,timeo=14,intr

This specifies the NFS mountpoint /gct3102 which is the same as local directory /usr/local/archive.
Now try this:

mount /gct3102
ls /gct3102

You should see the files on the remote server. I use /gct3102/Video and /gct3102/Music to store my
video (including video grabbed from video podcasting) and music. To view them in MythTV
go to:

Main Menu -> Utilities/Setup -> Setup -> Media Settings -> Music Settings
-> General Settings

And set the "Directory to hold music" to /gct3102/Music (or whatever you use).
Then instead of "Music Settings" go to "Videos Settings" -> General Settings.
And set the "Directory that holds videos" to /gct3102/Video (or whatever).

To make sure mplayer plays most media files do this (as root):

vi /etc/modules.xbox
Comment out the joydev line. We're not going to use the joystick in linux and this module makes
the most up to date mplayer crash on startup when initializing lirc.

rmmod joydev
apt-get install mplayer-386
apt-get install w32codecs
cd /tmp
wget ftp://mplayerhq.hu/MPlayer/releases/codecs/all-20060611.tar.bz2
bunzip2 all-20060611.tar.bz2
tar xvf all-20060611.tar
mkdir /usr/lib/win32
mv all-20060611/* /usr/lib/win32

vi /etc/mplayer/mplayer.conf
Change the sound driver setting from alsa to oss. This will prevent problems when playing some
windows media files. Comment out the old setting and add a new line to specify oss:
#ao=alsa
ao=oss

This should let you play lots of different formats. Also since you upgraded to the newest mplayer
you'll get a working DVD-remote when using mplayer from MythTV.

Install mythgallery if you want and use the flickr download in a cronjob as described here.


Now you can just shutdown, install the XBOX in your cabinet below your TV,
hook it to your main TV and use it with the DVD remote.

You're done!