Ubuntu Feisty Installation

From MythTV

Jump to: navigation, search

This page contains instructions for installing and configuring MythTV on Ubuntu Feisty Fawn 7.04.

See Ubuntu Installation Guides for installing on other Ubuntu versions.

This Howto is currently being written. Please do not attempt to use it at this time.

If you have any questions about this HOWTO, please leave a note in the Discussion Page.

Contents

Overview

This HOWTO assumes that you are at least minimally familiar with general Linux command syntax. It also assumes that you are reasonably familiar with installing a Linux distribution on a fresh hard-drive. Dual booting and VM-Ware installations are beyond the scope of this document.

This HOWTO is geared towards a minimal, from-scratch setup using the alternate installation CD image. Ubuntu and Kubuntu run xorg X Server and use Gnome or KDE window managers. If you choose to install a full-fledged desktop version, many of the packages listed in this install will already be loaded.

Download and Install Feisty Alternate

Download the Feisty Faun Alternate Install CD from your favorite site. Some examples include The Ubuntu Website

Or you can always get the Bit-Torrent for:

Modern 64-Bit Processors

AND

Older 32-Bit Processors


The Feisty Alternate CD uses a text-only installer (we're setting up as a special-use machine, remember), so there aren't a lot of options to get bogged down with. Before you put the install CD in the drive, though, you might want to read the next section on Hard-Disk Partitioning

Hard-Disk Partitioning

Depending on your chassis and motherboard, you may or may not have room for more than one hard-drive. As a general rule of thumb, you're going to need about 3-4 GB for the operating system, but 10 GB is probably a safer number, considering that we're going to be compiling some packages from source. If you decide to use the box for anything other than a MythTV frontend/backend, then you're also going to need space for user accounts.

Regardless of what else you do at this stage, remember that digital video requires massive amounts of storage space!. A typical Myth setup will use about 2.2GB/hour for 480i (NTSC SDTV) quality video, and 9GB/hour for HDTV. The more storage you can throw into your box, the better. You will also need a file system that can handle multi-gigabyte files sensibly. Both JFS and XFS fill this requirement, although most of the previous HOWTOs recommend using XFS. If you're really interested in what the differences are, check out the File System portion of the File Storage WIKI.

I also like to keep the / and <swap> partitions on a smaller disk that's separate from the rest of the video storage. This makes it significantly easier to backup, restore, and even replace the OS portion of the system without losing any videos or customization settings.

Since I have three hard-drives in my box at the moment, my setup looks slightly different than what I recommend in the next section. Here is what the 40GB PATA drive I use for my OS looks like:

Mount point Size Filesystem
/ 37.9Gb ext3
swap 2.1Gb swap


Finally, unless you like hunting for archive DVDs, you're going to need to setup a RAID0 with the disks or place them into a volume group with LVM so that one large filesystem can span across multiple disks to hold the recordings. RAIDs-3,5, and 10 are probably overkill though. While most modern motherboards have some form of built-in RAID controller, there are too many chipset-specific requirements for this HOWTO. LVM is more than adequate for setting up and managing a multi-disk filesystem. Of course, if you're in love with your RAID controller, feel free to use it.

Initial Setup and Install

The following steps are just a guide to installing using the Ubuntu Feisty Alternate CD:

  1. Install to the hard disk
  2. Choose a language: English
  3. Choose a location: <your country>
  4. Detect keyboard layout: Select Yes if you need to set up a non-english keyboard, otherwise select No and follow the next 2 steps.
  5. The origin of your keyboard: U.S. English
  6. Keyboard Layout: U.S. English
  7. Hostname: <one-word hostname> Don't use the default "ubuntu" unless this is the only Ubuntu-based machine on your network.
  8. Partitioning Method: Manual
  9. Create new 10.0GB partition for "/" of type "ext3" and bootable
  10. Create new 1.0GB partition for swap (1.0 GB or twice your RAM size, whichever is greater)
  11. Create new partition using the remaining space as Physical volume for LVM
  12. Select Configure the Logical Volume Manager
  13. Create a Volume Group named "storagevg"
  14. Create a 10.0GB Logical Volume named "homeslv" (Add another 10 GB each for any extra users you plan on adding later.)
  15. Format the "homeslv" volume as an XFS filesystem and mount it as /home
  16. Leave any remaining space in the Volume Group as free.
  17. Select your time zone: <your zone>
  18. Is the system clock set to UTC?: Yes
  19. Full name for the new user: <your name>
  20. Username for your account: <your login> (Do not use "mythtv")
  21. Choose a password for the new user: <secure password>
  22. Choose software to install: Hit "Tab" and select Continue
  23. Remove the installer CD and reboot the computer.

Setting 'root' password

The majority of the commands in this HOWTO must be run as root. For Ubuntu, this means prefixing each with 'sudo'. To open a shell as root and avoid typing 'sudo' repeatedly, login as your default user and type:

 sudo -i

Alternatively, if you insist on logging in as root, you can get root access by setting the root password:

 sudo passwd

It will first ask for your user password and then you can change the 'root' password

From now on you can log in by typing 'root' as user and the password you just added, you can also get 'root'-rights when your logged in as 'user' by typing the command

 su

Then it will ask for the 'root' password, so you never need to type 'sudo' before a command to get admin-rights.

Alternatively, you can enter into a root shell by typing

 sudo -s

Enter your user password, and you have a root shell, without having to set a root password.

Select Repositories

One of the many conveniences of the alternate-install CD is that all of the standard repositories are already enabled. Of course, since the standard repositories are located in the USA, we'll need to add the British and Medibuntu repositories if we want to be able to view DVDs or any videos that were compressed using non-free codecs. Make sure you're in a sudo or root shell and fire up nano like so:

 nano -w /etc/apt/sources.list

First add the Great Britain archive by inserting the following lines at the end of the file:

 deb http://gb.archive.ubuntu.com/ubuntu/ feisty main restricted universe multiverse
 deb-src http://gb.archive.ubuntu.com/ubuntu/ feisty main restricted universe multiverse

Then add the Medibuntu archive. Note: The following archive contains software that is illegal in certain countries, including the USA. Use at your own risk. If you are in the US, please contact your Congressional Representative about getting the Boucher-Doolittle FAIR-USE Act passed this session.

 ## MEDIBUNTU REPOSITORY (Unsupported.  May contain illegal packages.  Use at own risk.)
 ## Medibuntu - Ubuntu 7.04 "feisty fawn"
 ## Please report any bug on https://launchpad.net/products/medibuntu/+bugs
 deb http://medibuntu.sos-sts.com/repo/ feisty free non-free
 deb-src http://medibuntu.sos-sts.com/repo/ feisty free non-free

Finally, we'll need to remove the CD-ROM from the list of repositories. Comment out the 4th line of the file by adding a # so that it looks like this:

 #deb cdrom:[Ubuntu-Server 7.04 _Feisty Fawn_ - Alpha i386 (20070301)]/ feisty main restricted

Add Authentication Keys

Ubuntu uses GPG to authenticate packages before it installs them. Before Feisty can authenticate the Medibuntu packages, we'll need to add the repository's GPG key to apt's trusted list.

 wget http://medibuntu.sos-sts.com/repo/medibuntu-key.gpg -O- | sudo apt-key add -

Upgrade System to Latest Package Versions

Next we'll need to update the core packages to the most recent versions.

 aptitude update
 aptitude upgrade
 aptitude dist-upgrade

This is also an excellent time to make sure you're on the latest approved version of the kernel. (FIXME: What are the the pros and cons of using linux-image-generic vs linux-image-lowlatency)

 aptitude install linux-image-generic

Reboot the machine again to load the new kernel.

Finish Configuring LVM

If you only have one disk in your system, skip on down to Create a Logical Volume for the Recordings. Otherwise, we're going to need to run through a few more steps to finish setting up LVM.

Important: The next section assumes that you know how to identify disks and partitions under Linux. Please stop now if you are not familiar with partitioning under Linux.

As a rule of thumb, Kernel 2.x.x uses the following naming conventions:

  • PATA drives are listed as /dev/hd*
  • SATA, USB and SCSI drives are listed as /dev/sd*
  • Partitions are numbered 0-9.

If you do not understand what the previous section means, STOP IMMEDIATELY and ask someone in the #ubuntu IRC channel to walk you through identifying your hard-disks.

Prepare New Disks and Partitions

If you plan on dedicating an entire disk to LVM, use the following command line to register it as a physical volume. Make sure you replace the word <Drive> with the appropriate drive name.

 pvcreate -Z /dev/<Drive>


To add a partition to LVM, use this line. Make sure to replace the words <Drive> and <Partition> appropriately.

 pvcreate /dev/<Drive><Partition>

Assign Physical Disks to Volume Group

Next we need to add the physical volumes to the "storagevg" volume group we created during the CD install. Make sure to replace the words <Drive> and <Partition> again.

 vgextend storagevg /dev/<Drive>[<Partition>]

Create a Logical Volume for the Recordings

A new logical volume is needed to store the MythTV recordings. Assuming all the free space in the "storagevg" volume group is wanted for the "recordingslv" logical volume, we first need to find the amount of free space in the volume group. Once that is know, the new logical volume ("recordingslv") can be created.

Use the following command to find out how many free extents and space the storagevg volume group has:

 vgdisplay storagevg | grep "Free PE"
 Free  PE / Size       832 / 13.00 GB

This shows you the number of free extents and the amount of free space in GB. The logical volume can now be created with using either the extents (832) or the size (13G):

 lvcreate -t storagevg -l <physical extents> -n recordingslv
 lvcreate -t storagevg -L <size> -n recordingslv

Activate the logical volume:

 lvchange -a y storagevg/recordingslv

Format Volume and Mount at boot

Finally, the partition needs to be formatted as an XFS filesystem and the /etc/fstab file needs updated so that it will mount at boot time.

To format the volume, type:

 mkfs -t xfs /dev/storagevg/recordingslv

Create a mountpoint for it:

 mkdir -p /var/lib/mythtv/recordings

Then add it to the fstab file like so:

 echo "/dev/storagevg/recordingslv   /var/lib/mythtv/recordings   xfs   defaults   0   3" | tee -a /etc/fstab

Install MythTV Backend

One of the best features of the Feisty Faun distribution is that the MythTV packages are now pre-configured based on which MythTV role (master backend, backend, frontend) you're installing. Virtually everything is handled by the APT Package Manager.

Install Backends

Use one of the following commands to install the base MythTV backend server packages and all of its dependencies.

Install as Master Backend

To have APT automatically install MythTV as a Master Backend Server, which will setup mySQL and set the MythTV user account password, use the following command:

 aptitude install mythtv-backend-master

Install as Slave Backend

If you're installing a new backend machine to add extra tuners to an existing MythTV setup, you'll want to install mythbackend as a slave backend. Start by installing as a standard backend with this command:

 aptitude install mythtv-backend

After aptitude finishes installing the necessary packages, you'll need to tell the slave backend what password to use to access the MySQL database using the command

 dpkg-reconfigure mythtv-common

Configure Capture Hardware

Feisty now supports many of the more popular video capture boards directly out of the box. Check the Supported Hardware List to see if your board is already supported.

Alternatively, run the following command:

 dmesg | grep -i ivtv

If you see anything resembling:

 [   43.624128] ivtv:  ==================== START INIT IVTV ====================
 [   43.624132] ivtv:  version 0.10.1 (tagged release) loading
 [   43.624134] ivtv:  Linux version: 2.6.20-16-lowlatency SMP preempt mod_unload
 [   43.624135] ivtv:  In case of problems please include the debug info between
 [   43.624137] ivtv:  the START INIT IVTV and END INIT IVTV lines, along with
 [   43.624139] ivtv:  any module options, when mailing the ivtv-users mailinglist.
 [   43.624224] ivtv0: Autodetected Hauppauge card (cx23416 based)
 [   43.637886] ivtv0: Unreasonably low latency timer, setting to 64 (was 32)
 [   44.315718] ivtv0: loaded v4l-cx2341x-enc.fw firmware (262144 bytes)
 [   44.535145] ivtv0: Encoder revision: 0x02050032
 [   44.535148] ivtv0: Recommended firmware version is 0x02060039.
 [   44.597713] ivtv0: Autodetected Hauppauge WinTV PVR-150
 [   44.619453] tuner 2-0043: chip found @ 0x86 (ivtv i2c driver #0)
 [   44.623953] tuner 2-0061: chip found @ 0xc2 (ivtv i2c driver #0)
 [   44.668512] cx25840 2-0044: cx25843-23 found @ 0x88 (ivtv i2c driver #0)
 [   49.808488] wm8775 2-001b: chip found @ 0x36 (ivtv i2c driver #0)
 [   49.877061] ivtv0: Registered device video0 for encoder MPEG (4 MB)
 [   49.877357] ivtv0: Registered device video32 for encoder YUV (2 MB)
 [   49.877687] ivtv0: Registered device vbi0 for encoder VBI (1 MB)
 [   49.877884] ivtv0: Registered device video24 for encoder PCM audio (1 MB)
 [   49.878239] ivtv0: Registered device radio0 for encoder radio
 [   50.283781] ivtv0: Initialized Hauppauge WinTV PVR-150, card #0
 [   50.283952] ivtv:  ======================  NEXT CARD  ======================
 [   50.283955] ivtv1: Autodetected Hauppauge card (cx23416 based)
 [   50.284017] ivtv1: Unreasonably low latency timer, setting to 64 (was 32)
 [   50.917594] ivtv1: loaded v4l-cx2341x-enc.fw firmware (262144 bytes)
 [   51.137142] ivtv1: Encoder revision: 0x02050032
 [   51.137145] ivtv1: Recommended firmware version is 0x02060039.
 [   51.145169] tuner 3-0061: chip found @ 0xc2 (ivtv i2c driver #1)
 [   51.167606] cx25840 3-0044: cx25841-23 found @ 0x88 (ivtv i2c driver #1)
 [   56.108880] wm8775 3-001b: chip found @ 0x36 (ivtv i2c driver #1)
 [   56.179824] ivtv1: Autodetected Hauppauge WinTV PVR-150
 [   56.179826] ivtv1: reopen i2c bus for IR-blaster support
 [   56.227184] tuner 3-0061: chip found @ 0xc2 (ivtv i2c driver #1)
 [   56.354889] cx25840 3-0044: cx25841-23 found @ 0x88 (ivtv i2c driver #1)
 [   59.258075] wm8775 3-001b: chip found @ 0x36 (ivtv i2c driver #1)
 [   59.310284] ivtv1: Registered device video1 for encoder MPEG (4 MB)
 [   59.310593] ivtv1: Registered device video33 for encoder YUV (2 MB)
 [   59.310908] ivtv1: Registered device vbi1 for encoder VBI (1 MB)
 [   59.311106] ivtv1: Registered device video25 for encoder PCM audio (1 MB)
 [   59.632284] ivtv1: Initialized Hauppauge WinTV PVR-150, card #1
 [   59.632301] ivtv:  ====================  END INIT IVTV  ====================

then your card is already configured.

Install MythTV Frontend and Window Manager

Feisty now has an APT meta-package that automatically sets up a window manager, automatic login, and installs the frontend.

Run the command:

 aptitude install ubuntu-mythtv-frontend

Make sure the permissions on the /home/mythtv directory are set correctly as seen below.

 root@localhost:~$ ls -ld ~mythtv
 drwxr-xr-x 8 mythtv mythtv 4096 2007-07-31 22:00 /home/mythtv

If necessary, change the ownership on the directory with the command:

 chown mythtv:mythtv ~mythtv

Start Graphical Mode and Autorun Mythtv-Setup

Once the ubuntu-mythtv-frontend meta package is installed, you're ready to start the GDM login server. Type in

 sudo /etc/init.d/gdm restart

if the MythTV Splash screen appears, you're halfway home. Click "OK" to run the mythtv-setup program and follow through each of the setup pages.

Install and Configure Proprietary Hardware Drivers

Configure Hardware MPEG Decoding

Credits

Ubuntu Community's MythTV HOWTO

Personal tools