[Index] [TitleIndex] [WordIndex

General Info

If you're interested in setting up an extremely quiet Home Theater PC, then you should consider setting up a Compact-Flash or USB thumbdrive based system. Compact-Flash memory cards implement a hardware and software interface which is identical to IDE, so all that's needed is a simple adapter card to use one as a drop-in replacement for a hard drive. CF-IDE adapters are cheap and readily available from places like EBay, DealExtreme, or Mini-Box. Note that some old CF-IDE cards are missing data lines and do not support proper DMA, so make sure you get one from a seller that at least claims their card does support DMA. And if you run into problems with your card, be prepared to toss it and buy a better one.

Be aware that CF cards come in many different speeds, and are overall slower than traditional spinning media. The storage capacity of CF cards is also far, far less than any hard drive out there, so it really is only suited to be used as the boot filesystem for an HTPC. Still, a CF-based system is fairly inexpensive to build, extremely quiet, and easily complemented by a remote network fileserver or even external storage such as USB hard drives. An added advantage of a CF-based system is the fact that it is trivially simple to copy the entire filesystem for backup before you experiment with changes.

The instructions below refer to a Compact-Flash filesystem, but the instructions are essentially the same for a system that boots from a USB flash-drive.

Installing and Configuring a Compact-Flash Based Freevo Box

In the following instructions, I'll describe how I set up a CF-based Freevo HTPC. In my case, I used an Epia M10000 motherboard and Ubuntu 8.10. You are free to use whatever you like, but make sure that your system can support IDE drives-- especially for booting!


  1. A HTPC (case, motherboard, power supply, mouse, keyboard, CD/DVD ROM, etc.)
  2. OS install disk (Ubuntu 8.10 server alternate install)
  3. CF-IDE adapter that supports DMA
  4. A Compact-Flash card (2GB or better, depending on the footprint of your OS)

Preparation of Hardware

  1. Perform all the usual setup of the system (install motherboard, connect power cables, hook up CD/DVD ROM, etc.)
  2. Insert the Compact-Flash card into the CF-IDE adapter, taking care to align the slots on the sides of the card and adapter (it can really only fit one way without forcing)
  3. Insert the CF-IDE adapter into the IDE slot on your motherboard, taking care to not insert it backwards (most likely the CF-IDE adapter will have a blocked pinhole to match the IDE connector on your motherboard, encouraging you to orient it correctly)
  4. Boot up your system and hit the hotkey to drop into your BIOS configuration
  5. Examine the BIOS setup screens to confirm that the system can detect the CF-IDE adapter (if there are problems, check the orientation of the card and the adapter, test the CF card alone on another machine, try a different CF-IDE adapter, etc.)

Installation of OS

  1. Boot from Ubuntu server installer
  2. Select language
  3. Press F4 to select install options; choose the "Command Line" installation option
  4. Follow the instructions to install Ubuntu as usual
  5. Pay particular attention to the selection of hard drive during installation, since you want it to install to your CF-IDE adapter
  6. Reboot as prompted; if all goes well, you will boot from your cool little CF-IDE adapter

At this point, you now have a functional system running off the CF-IDE adapter. From here, we go on to install everything we need for a fully functional Freevo system.

Update System

First up, update all the base packages:

  1. Log into your CLI Ubuntu 8.10 system
  2. Update and upgrade all packages via the usual "sudo apt-get update ; sudo apt-get upgrade"

Install and Configure Sound Support

Next up, we need to install sound support:

  1. Execute "sudo apt-get install alsa-utils" (several other required packages will also be installed)
  2. Installation of alsa does not automatically configure your sound card, so do an "asoundconf list" to see the available sound hardware
  3. Using the name of the sound hardware from the previous step, set the alsa default sound card; in my case, my sound hardware was called "V8235" so I executed "asoundconf set-default-card V8235"
  4. Ensure your user is part of the "audio" group; my username is "rrwood" so I executed "sudo adduser rrwood audio"
  5. To have the change in group membership take effect, log out and log back in again
  6. Execute "alsamixer" to set the audio levels and ensure that your sound channels are not muted (use the left/right arrow keys to navigate between channels, press "m" to unmute a channel, use the up/down arrow keys to set the channel volume, press escape to exit; note that there are a number of channels beyond the right edge of the screen)
  7. Test your sound by playing one of the sounds in /usr/share/sounds/alsa/ like this: "aplay /usr/share/sounds/alsa/Front_Center.wav"; if everything is working correctly, then you should hear a woman's voice say "Front Center"
  8. Save your sound configuration like this: "sudo alsactl store"

Install and Configure X

Now that sound is working, it's time to get a functional X setup working:

  1. My Epia M10000 has a Via Unichrome graphics chip on the motherboard, so I need to install the X.org Unichrome driver. You'll need to determine the appropriate driver for your hardware; the full list can be viewed via "apt-cache search xserver-xorg-video"
  2. Once you have determined the correct video driver for your system, install it. In my case, I executed "sudo apt-get install xserver-xorg-video-openchrome". Once again, many additional packages will be installed.
  3. X.org needs the hal package installed to find the mouse, so I needed to install it: "sudo apt-get install hal"
  4. In addition to the basic X.org setup, I like to install the Openbox window manager so I can start up X.org as a regular user: "sudo apt-get install openbox"
  5. I also like to be able to start X.org manually using the "startx" command, so I also installed the xinit package: "sudo apt-get install xinit"
  6. Finally, rxvt is a nice, light terminal app: "sudo apt-get install rxvt"
  7. With all the X.org packages in-place, the last thing to do is to set up an appropriate .xinitrc file. I just use vim to create a file containing the single line "exec openbox", though you might also want to include a line like "rxvt &" before that in order to start an rxvt terminal up automatically. In the past it was necessary to include a "#!/bin/sh" at the start of the .xinitrc file, but that appears to no longer be necessary. Similarly, it no longer seems necessary to make the .xinitrc file executable via "chmod u+x .xinitrc".

  8. After installing all the required X.org packages and setting up your .xinitrc, you should be able to start up X from the console using the startx command. If things don't work, then take a look at the /var/log/Xorg.0.log file and look for any error ("EE") messages.

Install Freevo!

Now that sound and X are working, it's time to install Freevo and all its dependencies:

  1. Execute a "sudo apt-get install freevo" This will install a lot of packages, so be patient.
  2. The install will ask you a number of questions about Freevo; answer them appropriately for your system (e.g. screen resolution, TV channels, whether to start Freevo at boot, etc.)
  3. The python 2.5 install in Ubuntu has a small issue with the location of an important XML package, so Freevo will not start until you do this: "cd /usr/lib/python2.5/site-packages ; sudo ln -s oldxml/_xmlplus/" Be careful on the spacing of the ln parameters-- you are trying to create a symbolic link called "_xmlplus" in the /usr/lib/python2.5/site-packages directory, and have it point to the /usr/lib/python2.5/site-packages/oldxml/_xmlplus directory, so either use the ln command exactly as shown, or be sure you know what you're doing.
  4. With all of the above done, you can test Freevo by starting up X (startx), and issuing the "freevo" command in a terminal. If there are any problems, you'll see the output and will have to address them.
  5. If Freevo starts up correctly from your X session, then all should be well. If you chose to have Freevo start up automatically at boot, then you might want to try rebooting now to test that it works as expected.

Auto-Mounting USB Storage Devices

Now that your Freevo box is up and running, you are probably going to want to make some content available. An easy way to do this is to set the system up to automatically mount/unmount USB drives, thus allowing you to watch movies you've downloaded. I like the usbmount package for this, since it is small, has minimal dependencies, and is really easy to configure. You might also be interested in ivman or some other auto-mount solution.

Installing and configuring usbmount is easy:

  1. Install usbmount: "sudo apt-get install usbmount"
  2. Configure usbmount by editing the file /etc/usbmount/usbmount.conf. The file is very well commented, so it should be simple to configure to suit your needs. Don't forget that you need root privileges to edit the file: "sudo vi /etc/usbmount/usbmount.conf"
  3. Since most USB thumbdrives are formatted as VFAT volumes, you will probably want to configure usbmount to support VFAT partition types. Look for the "FILESYSTEMS" line and add "vfat" to the list of supported types (there will probably be entries for ext2 and ext3 already).
  4. The config file warns that VFAT filesystems can be corrupted if not properly unmounted. In my case, I chose to deal with this by mounting the filesystems as read-only. To do this, I modified the "MOUNTOPTIONS" line to read as follows: MOUNTOPTIONS="ro,sync,noexec,nodev,noatime" Note the inclusion of the read-only option, "ro". By doing this, I can easily remove a USB thumbdrive without having to go through the hassle of syncing and unmounting the drive. More importantly, my wife and children can insert and remove USB thumbdrives without having to sync and unmount them!

Note: the change to the "MOUNTOPTIONS" line affects all filesystems handled by usbmount. If you want to be more selective, you can modify the "FS_MOUNTOPTIONS" line and specify options that only apply to VFAT partitions. In my case, I want all removable storage devices mounted read-only by deafult, but you may feel differently.

Adding Hard Drives

Even though you have your system booting nicely from a CF-IDE card, you may end up wanting to add a hard drive at some point. To do that, you'll have to do something along the following line:

  1. Physically install the drive
  2. Boot up and check that Linux sees your drive (perhaps do a "dmesg | less" to see all the startup log messages, or just do a "sudo fdisk -l" to list all the drives available)
  3. Partition the new drive via "sudo fdisk /dev/sdb" (assuming that the new drive shows up as /dev/sdb)
  4. Create a filesystem on the new drive. Assuming you created a single partition and want to make the new filesystem ext3, then you'd do something like this: "sudo mke2fs -j /dev/sdb1". To make things simple, I'd recommend you also label the new filesystem with a unique and distinctive name, so do something like this: "sudo mke2fs -j -L WD500GB /dev/sdb1". The "-L WD500GB" switch tells mke2fs to label the new filesystem as "WD500GB" (obviously you can pick any name you like as the label). Having a label for the filesystem makes it much easier to set up the /etc/fstab file to automatically mount the disk.
  5. Create a mount-point for the new drive. I chose to mount mine at /media/wd500, so I did this: "sudo mkdir /media/wd500"
  6. Edit /etc/fstab to auto-mount the new drive at boot. This requires adding a line like "LABEL=WD500GB /media/wd500 ext3 defaults 1 2" to the end of the /etc/fstab file.
  7. Test the mounting of the new disk by doing a "sudo mount -a". If all goes well, the new drive will be mounted where you wanted it (/media/wd500 in my case). You can easily list all the mounted volumes via "df -h".
  8. You will need to set the ownership for the new drive or the directories on the drive. A simple approach would be to create a directory on the new drive (e.g. "sudo mkdir /media/wd500/movies") and then assign ownership of the new directory to the freevo user like this: "sudo chown freevo:freevo /media/wd500/movies". You could also do some more elegant tricks with groups and permissions, depending on your personal preferences.

If the disk you are attaching is already formatted, you may wish to use it as-is. You may still want to label the disk for easier auto-mounting; this can easily be done via the e2label command (e.g. sudo e2label /dev/sdb1 WD500GB).

In addition to disk labels, Linux also supports disk UUIDs. You can use the blkid command to list existing disk UUIDs ("sudo blkid") and then use the UUID of the disk to configure /etc/fstab (e.g. add a line like this to /etc/fstab: "UUID=12345678-90ab-cdef-1234-567890abcdef /media/wd500 ext3 defaults 1 2".

(More to be added tomorrow.... Configuring Freevo to minimize writing to the flash file-system, suspend of system, etc.)

2014-02-15 05:35