Xbox Frontend Compile with SVN

From MythTV Official Wiki
Jump to: navigation, search

Time.png Outdated: The information on this page may no longer be relevant to the current release of MythTV, 34.0. Please consider helping to update it. This page was last modified on 2009-11-29.

Credits

  • based on the email by AJM who noted down the steps he used
  • original WIKI by Richard Dale Feb 2006


Xbox Frontend Compile with SVN HOWTO

This HOWTO assumes that you are using the Xebian 1.1.4 xbox edition.


Install Xebian 1.1.4

Use the Xebian Howto for details.

Approximate time needed for this step: 30 minutes

For faster compilation, try installing Xebian on a standard PC or VM environment such as vmware or qemu. Most of the instructions below still applies. After compiling the packages, just install them on the real xbox machines.

Setup a Xebian VMWare environment for compilation

This is optional, if you want to compile debian packages on another computer under vmware runnning xebian. See notes here [[1]]

Xebian Stable - Run an update then an upgrade

Approximate time for this step: 15 minutes (requires around 90MB of downloads)

NOTE: stable now points to etch, so if you still want to use sarge, change stable to sarge.

By default, Xebian 1.1.4 uses the stable respositories. Let's get all of the modules updated in the stable distribution then upgrade any stable modules too. To do this update then upgrade, Xebian looks at the file /etc/apt/sources.list then contacts the Internet to download the modules.

Xebian 1.1.4 is based upon Debian 3.1. Unfortunately Xebian didn't update the apt sources correctly to remove the Debian non-US sources which are now obsolete. Xebian appears to have the .AT (Austrian) mirrors preconfigured too.

You should be logged in as root.

If you are in the US, edit the file /etc/apt/sources.list so it looks like this:

 deb http://http.us.debian.org/debian/ stable main contrib non-free
 deb-src http://http.us.debian.org/debian/ stable main contrib non-free
 deb     http://security.debian.org/ stable/updates main contrib non-free
 deb-src http://security.debian.org/ stable/updates main contrib non-free

If you not in the US, it will be far quicker if you use a local mirror site. See the Debian Mirrors page.

For example, in Australia, I use:

 deb http://ftp.ii.net/debian/debian/ stable main contrib non-free
 deb-src http://ftp.ii.net/debian/debian/ stable main contrib non-free
 deb     http://ftp.ii.net/debian/debian-security/ stable/updates main contrib non-free
 deb-src http://ftp.ii.net/debian/debian-security/ stable/updates main contrib non-free


After modifying the sources, run:

 apt-get update

then

 apt-get upgrade

During the upgrade, you will be asked whether you wish to Use the kernel framebuffer device interface for xserver-xfree86. Say Yes. Here's why: The Xebian 1.1.4 distribution had it enabled in the file /etc/X11/XF86Config-4, so we think you should too.

Add experimental (etch) branch of Xebian to sources

In this step we tell Xebian to use the experimental branch of Xebian for obtaining our prerequisite modules for MythTV. This experimental branch is required for us to compile MythTV SVN. We will also add the Marillat source, which is required for MythTV.

Edit /etc/apt/sources.list and add the following lines if you are a US user:

 deb     http://http.us.debian.org/debian/ testing main contrib non-free
 deb-src http://http.us.debian.org/debian/ testing main contrib non-free
 deb     http://http.us.debian.org/debian/ sid main contrib non-free
 deb-src http://http.us.debian.org/debian/ sid main contrib non-free

 deb     http://www.debian-multimedia.org/ sid main
 deb-src http://www.debian-multimedia.org/ sid main

If you're a non-US see the previous step for mirror sites. eg. For Australia, I used:

 #################
 #Stable
 #################
 deb     http://mirror.pacific.net.au/debian/ stable main contrib non-free
 deb-src http://mirror.pacific.net.au/debian/ stable main contrib non-free
 #################
 # Security
 ################# 
 deb     http://mirror.pacific.net.au/debian-security/ stable/updates main contrib non-free
 deb-src http://mirror.pacific.net.au/debian-security/ stable/updates main contrib non-free
 #################
 # Etch
 #################
 deb     http://mirror.pacific.net.au/debian/ etch main contrib non-free
 deb-src http://mirror.pacific.net.au/debian/ etch main contrib non-free
 #################
 # Marillat
 #################
 deb     http://www.debian-multimedia.org/ sarge main
 deb-src http://www.debian-multimedia.org/ sarge main
 deb     http://www.debian-multimedia.org/ etch main
 deb-src http://www.debian-multimedia.org/ etch main

Run apt update to get the new package lists

apt-get update

Approximate time for this step: 5 minutes

Important.png Note: If you receive an error such as "E: Dynamic MMap ran out of room", try creating the file /etc/apt/apt.conf.d/00Cache with the following contents:

APT::Default-Release "stable";
APT::Cache-Limit "141943904";

Then execute an apt-get clean and apt-get update.

Install dependencies for building MythTV

MythTV relies on a number of libraries (eg for displaying graphics images, decoding MP3 soundtracks etc.). We can run the following to get most of the dependencies:

apt-get install libdbd-mysql-perl libdbi-perl libmysqlclient12 libnet-daemon-perl libplrpc-perl mysql-client mysql-common pwgen ttf-freefont
apt-get install qt3-dev-tools liblame-dev liblame0 liblircclient-dev alsa-oss libqt3-mt-dev libqt3-mt-dev gcc g++ libqt3-mt-mysql libqt3-i18n
apt-get install subversion
apt-get install distcc
apt-get install libqt3-compat-headers 
apt-get install xmltv 

If, during this process, you are asked which X Server to use, then there's probably been too many packages upgrade. You should elect xfree86 NOT xserver-org, as xserver-org hasn't yet been released as a working package for use with the xbox (as at 7 March 2006 anyway).

Then reboot for good measure since many of the fundamental libraries have been upgraded.

shutdown -r now

At this time, it may be an opportune time to backup your Xbox Xebian file system so you don't need to go through the above steps and downloads in the event of something bad happening. If you used the GameSave partition in the Xebian installation, you can boot back to your dashboard (which hopefully has an FTP server) then transfer the rootfs file from E:\debian\ to somewhere else.

The following _might_ need to be run as well - not sure yet

apt-get install alsa-base alsa-utils alsa-oss udev 

Approximate time for this step: 30 minutes (200+MB downloaded)

Install subversion and MythTV source code

Install subversion on the Xbox:

apt-get install subversion

Download MythTV source code SVN, plugins and themes /usr/src directory

 cd /usr/src
 mkdir mythtv
 cd mythtv
 svn co http://svn.mythtv.org/svn/trunk/mythtv 
 svn co http://svn.mythtv.org/svn/trunk/mythplugins
 svn co http://svn.mythtv.org/svn/trunk/myththemes

Install distcc (optional, but recommend)

The Xbox is underpowered and lacking RAM to do compiling. By using distcc we can use the resources of other Linux boxes on the network to compile MythTV.

Install distcc on your xbox by:

apt-get install distcc

You must start the distccd on the Xbox with:

distccd --daemon --allow 127.0.0.1

Install distcc on each of your other Linux systems. The binaries are small and can be downloaded from here. I had success with the Red Hat/Fedora DistCC RPMS

On each of your other Linux systems run the distcc server - note that this does not need to be run as root.

distccd --daemon --allow <insert xbox ip address>

On the Xbox that has the source code type

export DISTCC_HOSTS='localhost computer1 computer2' 

Replace computer1, computer2, etc., with the names of the computers or IP's on your network running the distcc server (distccd).

For future reference when you want to use distcc just add -j 6 CXX=distcc onto the make statement parameters.

Note, if you start getting strange error messages, you should ensure that gcc is the same version on both systems. gcc v3.x and v4.x and not compatible with distcc. I had to upgrade to gcc v4.0.2 on both systems and the errors went away.

Compile MythTV

cd mythtv
./configure --prefix=/usr/local --disable-backend

If you are using distcc from the previous step. -j 4 is the number of simultaneous compilers to run. Running two per CPU in your distributed "cluster" seems to be the most efficient.

export DISTCC_HOSTS='localhost 192.168.88.201'
make -j 4 CXX=distcc 

otherwise use the following (and be prepared to wait quite a long time):

make

Once the compile is complete:

sudo make install (or su; make install)

Since we have installed MythTV in various parts of /usr/local, we have to tell Xebian to look for shared libraries (such as libmyth) in this folder. Edit /etc/ld.so.conf and add the following line

/usr/local/lib

Then run the command

ldconfig

Then let's logout of root for now too

exit

Compile MythTV Plugins

cd ../mythtvplugins
./configure --disable-all --enable-(what applications you want on your front end)

then run the following if you use distcc:

make -j 4 CXX=distcc 

otherwise just:

make

then to install

su
make install

Install MythTV Themes

The themes are really just a file copy process.

cd ../myththemes

Edit the file myththemes.pro and add the line to the TOP of the file:

PREFIX=/usr/local
./configure
su
make install
exit

Configure MythTV

Start the mythtv frontend

$ mythfrontend

It should give you a stack of errors. After it does so, kill mythfrontend then edit the file /home/live/.mythtv/mysql.txt Change the line DBHostName= so it reflects the IP address of your back end... eg:

DBHostName=192.168.88.201

If you use digital sound, you need to go into the setup and change your sound device from /dev/dsp to ALSA:digital

If you use a recent SVN (approximately later than 1 March 2006), the Open GL Painter used for the menus doesn't work with the Xbox very well. When you start mythfrontend use the following command line instead:

mythfrontend -O UseOpenGLPainter=0