Installing and using mvpmc

Robert Kulagowski, mailto:rkulagow@rocketmail.com

2005-11-15, v0.00.05

1. Introduction - What is the MediaMVP

2. How to use this guide to install the mvpmc

3. Configuring your boot host for DHCP and TFTP

4. Configuring your compile host

5. Obtaining an original dongle.bin

6. Obtaining mvpmc

7. Confirming that everything works

8. Tips and tricks


1. Introduction - What is the MediaMVP

The MediaMVP is a small, diskless Linux computer which obtains its operating system via TFTP. From the information page at http://www.hauppauge.com/pages/products/data_mediamvp.html:

"MediaMVP is a Linux based digital media receiver based on a powerful IBM PowerPC processor. It includes a hardware MPEG decoder to process digital video movies, while music and digital pictures are software decoded by MediaMVP's processor. It receives the digital media from a PC via an Ethernet LAN, decodes the media and outputs video through composite and S-Video connections, and audio through stereo audio output connectors."

The mvpmc project uses the MediaMVP hardware and replaces the software that the MediaMVP runs. Because the MediaMVP boots completely from the network, changes made to the software aren't permanent - you can always switch back to using the Hauppauge-supplied software with the Windows server.

This HOWTO is for version 0.2.0 of mvpmc and for CVS.

2. How to use this guide to install the mvpmc

There are a few different ways to getting the mvpmc software running on your system. The easiest is to download a pre-compiled version of the software and to install that on a system running dhcp and tftp.

The second method is to download a copy of the software from CVS and compile it on your own. This is more difficult, since it involves loading cross-compilers and other development tools, but will allow you to stay up-to-date with the most recent code committed to sourceforge.

If you're new to the mvpmc and just want to get the system running as quickly as possible follow the steps outlined in Configuring your boot host for DHCP and TFTP, Obtaining mvpmc, and Creating the dongle.bin.mvpmc.config file.

If you're more experienced, or want to run newer software, you'll follow the same basic sequence of steps with the addition of configuring a cross-compiler environment.

3. Configuring your boot host for DHCP and TFTP

The mvpmc performs a diskless boot from the network. If you are using a pre-compiled binary from the MVPMC project page you won't need to install the compiler as specified in the Configuring your compile host section.

3.1 Debian

# apt-get install dhcp atftpd

By default, the Debian DHCP server will not listen to any of the interfaces. Edit the dhcp configuration file and look for the line that looks like: INTERFACES="" and change it to something like INTERFACES="eth0"

# joe /etc/default/dhcp

You will also need to create a directory called tftpboot.

# mkdir /tftpboot
# chmod a+rwx /tftpboot

3.2 Mandrake

# urpmi dhcp-server tftp-server

Mandrake will create the tftpboot directory for you automatically.

3.3 Creating a TFTPBOOT shell variable

To simplify this HOWTO, execute the following command to create a shell variable for the actual location of your tftpboot directory:

Debian:

# export TFTPBOOT=/tftpboot
Mandrake:
# export TFTPBOOT=/var/lib/tftpboot

3.4 Configuring DHCP

You will need to edit your /etc/dhcpd.conf file. In the example below, we're setting up a subnet 192.168.10.100 through 192.168.10.250. The DNS servers are 63.240.76.4 and 204.127.198.4 Our default gateway is 192.168.10.1 and we are going to permanently assign IP address 192.168.10.57 to our MediaMVP. Most of these values are not used by the MediaMVP, but this is how you could use a linux DHCP server in your own environment.

NOTE: You must replace 00:0d:fe:00:a2:ab with the MAC address of your actual MediaMVP. If you use the MAC address in the example, your setup will not work.

option domain-name              "local";
option subnet-mask              255.255.255.0;
option domain-name-servers 63.240.76.4, 204.127.198.4;

allow bootp;
allow booting;

#option ip-forwarding    false;  # No IP forwarding
#option mask-supplier    false;  # Don't respond to ICMP Mask req

subnet 192.168.10.0 netmask 255.255.255.0 {
  option routers        192.168.10.1;
  range 192.168.10.100 192.168.10.250;
}

group {
  next-server 192.168.10.50;          # IP address of your TFTP server

  host mvp { # NOTE: Change the hardware ethernet to the MAC address of your actual MVP
           hardware ethernet 00:0d:fe:00:a2:ab;
           fixed-address 192.168.10.57;
           filename "dongle.bin.mvpmc";
           option root-path "/home/mvp,rsize=4096,wsize=4096,nolock";
  }

}

Make sure that dhcp is started.

Debian:

$ su
# /etc/init.d/dhcp start
# tail /var/log/daemon.log

Mandrake:

$ su
# service dhcpd start

4. Configuring your compile host

This HOWTO is developed on a machine running Debian unstable, but the basic configuration of each of the steps should be similar between distributions. It also focuses on running the MediaMVP with MythTV, so if you would like to see instructions on using ReplayTV please submit them.

Debian: Install required libraries and programs:

# apt-get install autoconf libtool bison flex wget unzip libjpeg62-dev
Mandrake:
# urpmi autoconf libtool bison flex wget unzip libjpeg62-dev

Download the mvpmc toolchain: http://mvpmc.sourceforge.net/dl/mvpmc_toolchain.tar.gz

$ su
# mkdir -p /opt/crosstool
# chmod a+rwx /opt/crosstool
# exit
$ wget http://mvpmc.sourceforge.net/dl/mvpmc_toolchain.tar.gz
$ tar -xzvf mvpmc_toolchain.tar.gz
$ cd mvpmc_toolchain
$ ./mvpmc-uclibc.sh
The crosstool scripts will download a number of packages from the Internet, so it may take a while. When everything has finished building, you should see something like this:
powerpc-405-linux-uclibc-hello2
/opt/crosstool/powerpc-405-linux-uclibc/gcc-3.3.3-uClibc-0.9.23/lib/gcc-lib/powerpc-405-linux-uclibc/3.3.3/../../../../powerpc-405-linux-uclibc/lib/libstdc++.so:
undefined reference to `Sqrtf'
collect2: ld returned 1 exit status
Yes, this is an error, but the build has actually succeeded.

5. Obtaining an original dongle.bin

dongle.bin is the name of the Linux kernel and ramdisk that Hauppauge supplies for the MediaMVP. The mvpmc project creates a new version of this file, replacing Hauppauge's frontend software with mvpmc.

You will need to place a copy of the Hauppauge-supplied dongle.bin file into your tftpboot directory. The mvpmc build procedure will be looking for the software in that location.

Download the Hauppauge Windows server software from http://hauppauge.lightpath.net/software/mediamvp/mediamvpsetup_24_23096_web.exe and extract the dongle.bin file:

$ wget http://hauppauge.lightpath.net/software/mediamvp/mediamvpsetup_24_23096_web.exe
$ unzip -Ln mediamvpsetup_24_23096_web.exe dongle.bin
$ cp dongle.bin $TFTPBOOT

6. Obtaining mvpmc

6.1 Pre-compiled

Download the pre-compiled binaries from sourceforge from the links in the Downloads section of the webpage. Make sure that you grab dongle.bin.mvpmc-0.2.0 and copy it to your tftpboot directory.

$ cp dongle.bin.mvpmc-0.2.0 $TFTPBOOT

Please note that the filename in your tftpboot directory must match the filename configured in dhcpd.conf; if you download dongle.bin.mvpmc-0.2.0 or any other pre-compiled file, you will either need to rename the file, update dhcpd.conf or use a symlink. See the Tips and Tricks section for an example of using a symlink.

Once you are done downloading and copying the software, jump ahead to the Creating the dongle.bin.mvpmc.config file

6.2 CVS

If you will be using CVS, you will need to do the following steps. Anytime you are prompted for a password, press ENTER.

$ mkdir mvpmc
$ cd mvpmc
$ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc login
$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc co build
$ cd build
$ mkdir release
$ cd release
$ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc login
$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc co mvplib
$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc co mvpmc
$ cd ..
You must now run autoconf to create the configure file:
$ cd ~/mvpmc/build
$ autoconf
Now, time to compile. The first command is one long line.
$ CC=/opt/crosstool/powerpc-405-linux-uclibc/gcc-3.3.3-uClibc-0.9.23/bin/powerpc-405-linux-uclibc-gcc \
./configure --with-mvpmc-mediamvp --with-mvpmc-host
$ make populate
$ make configure
$ make

When the compile is complete, copy the mediamvp/dongle.bin.mvpmc file to your tftpboot directory.

$ cp mediamvp/dongle.bin.mvpmc $TFTPBOOT

6.3 Creating the dongle.bin.mvpmc.config file

When the MediaMVP is booting, it will try to download the dongle.bin.mvpmc.config file from the tftp server. If you would like your MediaMVP to automatically start the mvpmc application, you could make your config file look like the example below. In this case, 192.168.10.50 is the IP address of the masterbackend MythTV server. We are creating a mount point called /var/myth and then mounting the directory using NFS. The -r parameter instructs mvpmc to look for the recordings in /var/myth/video

rdate -s 192.168.10.50
mkdir /var
mkdir /var/myth/
mount -t nfs -o nolock,rsize=4096,wsize=4096,nfsvers=3 192.168.10.50:/var/myth/ /var/myth/
mvpmc -f /etc/helvR10.fnt -s 192.168.10.50 -r /var/myth/video &

See the NFS section of the MythTV HOWTO http://www.mythtv.org/docs/mythtv-HOWTO-21.html#ss21.9 for examples on how to configure NFS.

The mvpmc software can also use the Myth protocol directly rather than using NFS. If you would like to use the Myth protocol, the dongle.bin.mvpmc.config would look like this.

rdate -s 192.168.10.50
mvpmc -f /etc/helvR10.fnt -s 192.168.10.50 &

Once you have created the file, copy it to $TFTPBOOT:

# cp dongle.bin.mvpmc.config $TFTPBOOT

7. Confirming that everything works

The /var/log/daemon.log file will show that DHCP has started. When the MediaMVP boots, you should see something similar to this in your logs:

Nov 25 14:09:48 masterbackend dhcpd: DHCPDISCOVER from 00:0d:fe:00:a2:ab via eth0
Nov 25 14:09:48 masterbackend dhcpd: DHCPOFFER on 192.168.10.57 to 00:0d:fe:00:a2:ab via eth0
Nov 25 14:09:48 masterbackend in.tftpd[1470]: connect from 192.168.10.57 (192.168.10.57)
Nov 25 14:09:48 masterbackend tftpd[1470]: Trivial FTP server started (0.6.2)
Nov 25 14:09:48 masterbackend tftpd[1472]: Serving dongle.bin.mvpmc to 192.168.10.57:3909
Nov 25 14:10:04 masterbackend dhcpd: BOOTREQUEST from 00:0d:fe:00:a2:ab via eth0
Nov 25 14:10:04 masterbackend dhcpd: BOOTREPLY for 192.168.10.57 to mvp (00:0d:fe:00:a2:ab) via eth0
Nov 25 14:10:05 masterbackend dhcpd: DHCPDISCOVER from 00:0d:fe:00:a2:ab via eth0
Nov 25 14:10:05 masterbackend dhcpd: DHCPOFFER on 192.168.10.57 to 00:0d:fe:00:a2:ab via eth0
Nov 25 14:10:05 masterbackend dhcpd: DHCPREQUEST for 192.168.10.57 from 00:0d:fe:00:a2:ab via eth0
Nov 25 14:10:05 masterbackend dhcpd: DHCPACK on 192.168.10.57 to 00:0d:fe:00:a2:ab via eth0
Nov 25 14:10:05 masterbackend tftpd[1473]: Serving dongle.bin.mvpmc.config to 192.168.10.57:2048

8. Tips and tricks

If you wish to maintain multiple versions of the dongle.bin file, it's easy to use a symlink. For example:

# cd $TFTPBOOT
# ln -sf dongle.bin.mvpmc-0.2.0 dongle.bin.mvpmc

This will allow you to have multiple versions of the code available, and you may switch between them by updating the symlink.