New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Almost running MythTV backend on Bubba Two

A collection of tips on howto tweak your Bubba.
Post Reply
bk
Posts: 12
Joined: 03 Mar 2009, 14:05

Almost running MythTV backend on Bubba Two

Post by bk »

Disclaimer: I am no great Linux expert and this howto does some hacks to get around apt package conflicts. It also involves the compilation of about a million lines of code on Bubba Two. So if you break anything in the process, don't blame me.

This howto explains how I almost got the MythTV backend running on a Bubba Two. The one remaining problem I have is that mythbackend has to be configured using mythtv-setup which is a graphical program. I have not been able to get that to work. If someone has some ideas, I would be grateful to hear about it. The bottom of this post describes what I have already tried. Before installing MythTV, you may want to check out the howto on using DVB-T to get a TV signal to use with MythTV: http://forum.excito.net/viewtopic.php?t=1665. This howto does not explain how to set up MythTV in general, which can be a jungle in itself.

There are two main challenges to getting MythTV to run (apart from setting up mythtbackend). The first is apt package conflicts and the second is that the Freescale processor in Bubba Two does not have the Altivec instruction set extension. Because of these two issues, we need to compile the transcode and the mythtv packages.

You may wish to install the screen program or use nohup for the compilations so they keep running even though you log out from the Bubba Two.

Ok, let us get started. First, make a user called mythtv with the Bubba interface.

Do the following as root.

Make a group called mythtv:

Code: Select all

addgroup mythtv
Don't skip these step as the deb package needs the mythtv user and group.

When building, we will use fakeroot, so install it:

Code: Select all

apt-get install fakeroot
Insert these two lines in /etc/apt/sources.list:

Code: Select all

deb http://debian.three-dimensional.net/debian-multimedia/ etch main
deb-src http://debian.three-dimensional.net/debian-multimedia/ etch main
Then run:

Code: Select all

apt-get update
gpg --keyserver keyring.debian.org --recv 07DC563D1F41B907
gpg -a --export 07DC563D1F41B907 | apt-key add -
apt-get update
MythTV needs a bunch of packages, so run:

Code: Select all

apt-get install debhelper libqt3-mt-dev libdvb-dev liblame-dev libmysqlclient15-dev libfreetype6-dev libavc1394-dev libvorbis-dev liblircclient-dev libartsc0-dev libasound2-dev libxinerama-dev libdts-dev libiec61883-dev libxxf86vm-dev po-debconf libxvmc-dev libdvdnav-dev libimlib2-dev libxext-dev libjack0.100.0-dev texi2html ccache linux-kernel-headers libgl1-mesa-swx11-dev fftw3-dev python-support libx264-dev liba52-0.7.4-dev libxvidcore4-dev libfaad-dev libfaac-dev xserver-xorg-video-via libfribidi-dev libqt3-mt-mysql pwgen
(takes about 5 minutes)

We also need the quilt package, but it conflicts with the debhelper package. So rather than using apt-get to get it, we download it:

Code: Select all

wget http://ftp.fi.debian.org/debian/pool/main/q/quilt/quilt_0.45-6_all.deb
It depends on a couple of other packages that we install:

Code: Select all

apt-get install diffstat gawk
We now force the installation of quilt:

Code: Select all

dpkg -i --force-conflicts quilt_0.45-6_all.deb
As a non-root user (e.g. as mythtv) get the mythtv source:

Code: Select all

apt-get source mythtv
We need to disable the Altivec instructions, so find this in the mythtv-0.21/debian/rules file:

Code: Select all

        CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --enable-lirc --enable\
-audio-alsa \
        --enable-audio-oss --enable-audio-jack --enable-audio-arts --enable-dvb \
        --enable-ivtv --enable-firewire --enable-joystick-menu $(CONFIGURE_OPTS) \
        --enable-opengl-vsync --with-bindings=perl --compile-type=profile \
        --enable-libfaad --enable-libfaac --enable-libmp3lame --enable-liba52 \
        --enable-libx264 --enable-libxvid --enable-libfftw3 --enable-pthreads
Edit the last line to:

Code: Select all

        --enable-libx264 --enable-libxvid --enable-libfftw3 --enable-pthreads --disable-altivec
We are now ready to build. But beware that MythTV has about 870,000 lines of code including header files. So the build will take a long time. Thus, you may wish to use nohup or screen now. Run this from the mythtv-0.21 directory:

Code: Select all

nohup dpkg-buildpackage -rfakeroot -uc -us -b -d &> mythlog.txt &
Follow the output for a while to see that everything is going well:

Code: Select all

tail -f mythlog.txt
When the compiling starts you can just stop tail and log out.

After about 11 hours, come back and you may have a deb package ready, otherwise check the above output log.

We can now run:

Code: Select all

apt-get remove quilt
Then we should be rid of conflicts again.

But we are not done yet. MythTV depends on the transcode package, but again due to conflicts and Altivec issues, we need to compile it. (Since you probably don't want to transcode on Bubba Two anyway, you may be able to remove the dependency in the MythTV debian/control file and skip the following. I have not tried that.)

This package depends on libavcodeccvs51-dev, libpostproccvs51-dev, and libavutilcvs49-dev. But they conflict with libavcodec51 and libavutil49. We will fix that.

First, we get the packages that transcode depends on and that we have not already installed when making mythtv:

Code: Select all

apt-get install libmjpegtools-dev libquicktime-dev libgtk1.2-dev libxml2-dev libdv4-dev libdvdread-dev pvm-dev libpopt-dev libxft-dev libxaw7-dev libmpeg2-4-dev libsdl1.2-dev libtheora-dev nasm liblzo-dev libmagick9-dev dpatch libjpeg-dev libfame-dev libxv-dev autotools-dev libavcodec-dev libpostproc-dev libavutil-dev xterm
As a non-root user (e.g. as mythtv) we then get the source:

Code: Select all

apt-get source transcode
The dependencies are found in the file transcode-1.0.2/debian/control. We edit that file, removing the string "cvs" (found in three places). This removes the conflicts.

We then edit the transcode-1.0.2/debian/rules file. Remove this line:

Code: Select all

        CFLAGS += -Wa,-maltivec
This disables Altivec intructions.

Finally, it seems that there is an error in the file transcode-1.0.2/export/aud_aux.c. These two lines:

Code: Select all

    register_avcodec(&ac3_encoder);
    register_avcodec(&mp2_encoder);
Should be replaced with:

Code: Select all

    avcodec_regisiter_all();
We are now ready to build:

Code: Select all

nohup dpkg-buildpackage -rfakeroot -uc -us -b -d &> translog.txt &
The transcode package "only" has 185,000 lines of code so building takes about an hour. Again, it might be a good idea to watch the translog.txt file until compilation begins, to make sure everything is right.

When the deb packages are ready, we can now install mythtv-backend, starting with the dependencies:

Code: Select all

dpkg -i transcode_1.0.2-0.12_powerpc.deb
dpkg -i libmyth-0.21_0.21-0.11etch1_powerpc.deb
dpkg -i mythtv-common_0.21-0.11etch1_all.deb
dpkg -i mythtv-backend_0.21-0.11etch1_powerpc.deb
dpkg -i mythtv-database_0.21-0.11etch1_all.deb
You probably also want some documentation:

Code: Select all

dpkg -i transcode-doc_1.0.2-0.12_all.deb
dpkg -i mythtv-doc_0.21-0.11etch1_all.deb
Now that MythTV is installed, we need to run mythtv-setup. This is where my problems really start. When I first installed MythTV, the following worked fairly well. After I made a clean install of Bubba to make this howto, it doesn't work any more. The idea is to get X access to Bubba. Find this line in /etc/ssh/sshd_config:

Code: Select all

X11Forwarding no
Change the "no" to "yes". Due to the packages we have already installed, that is all we need. Restart ssh:

Code: Select all

/etc/init.d/ssh restart
You can now log in to bubba while allowing X forwarding:

Code: Select all

ssh -X username
To check that it works, try running xeyes.

After logging in using "ssh -X", you can start mythtv-setup on bubba. After a little while, this will show a gray user interface. After another four minutes of waiting, a large icon resembling some sort of tool will appear. Unfortunately, the menu is missing. It is actually active, but just not shown. It has these entries:

Code: Select all

1. General
2. Capture cards
3. Video sources
4. Input connections
5. Channel editor
6. Storage directories
You choose by using the up/down arrows and press enter to select. Do this while not being able to see what you are doing and you will get to the different setups. On my first install, the setup menus worked fine. On my second (present) install, all text is missing from all menus.

For MythtTV to work, the time zones has to be identical. The problem is that local time is 23 seconds off on Bubba due to some leap second issue. Go to this thread: http://forum.excito.net/viewtopic.php?t=1664, and check if you have the problem. If you do, fix it as Peter suggests.

If you get MythTV setup working, you probably want to de-select any kind of transcoding on bubba. If you need transcoding, you might consider using another computer as slave backend.

I have not been able to get the png previews of recordings to work. For me that is no big loss, though.

I also had a problem setting up the DVB-T channels. I tried a few different ways with some crashes, but found that if you create a transport for the appropriate frequency and then scan using that transport, it works. If your country is available in the menu that might also be worth a try (mine is not available).

So regarding the mythtv-setup issues, I have tried the following with ssh -X:
  • Tried different themes (presumably with different fonts)
    Installed msttcorefonts
    removed the --enable-opengl-vsync option from the configuration
In all cases, the graphical interface has no text.

My next idea was to use vnc to connect, but I could not figure out how to do that. If someone is familiar with vnc, a howto would be most welcome.

When I made my first install, I got through the setup and then MythTV worked apart from the time difference issue which I now know how to fix. So I believe that the only remaining issue is the setup.

I must say I don't understand why you have to use a graphical program to configure mythbackend.

Anyway, if anyone has some suggestions, please let me know.
jonj1
Posts: 51
Joined: 24 Oct 2008, 15:33

Re: Almost running MythTV backend on Bubba Two

Post by jonj1 »

Hi bk,

If you get this working I'd like to hear your experience with it.

For the gui configuration, sometimes 'ssh -Y' has worked for me when 'ssh -X' doesn't for some reason. If the GUI needs 3D graphics support it won't work with VNC. That said, to get a vnc server up and running:

On bubba as root:

Code: Select all

apt-get install vnc4server jwm
There are other window managers besides jwm, but this one is about as light-weight as they come for a low memory footprint.

On bubba as regular user:

Code: Select all

vncserver -depth 16 -geometry 1124x740
From the client machine:

Code: Select all

vncviewer bubba:1
There are GUI viewers for windows/mac/linux to make this part easier, and the number needs to match the output of the previous command

To kill the session (bubba, regular user):

Code: Select all

vncserver -kill :1
If you don't get a usable vncserver with the first attempt, edit '/home/user/.vnc/xstartup' to match this:

Code: Select all

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
rxvt -bg black -fg gray &
# x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &
jwm &
Then kill the session and create a new one...
Post Reply