TiVo and broadband routers dont have a whole lot in common, except for the OS that powers them: Linux. Between its versatility, power and always-improving driver support, its now possible to put together a Linux-based home server in a small-footprint case that can store and display your digital photos, rip and then serve up audio, play MPEG videos (and DVDs), and even act as a TV/TiVo. How versatile you want this server to be depends on what gear you already have in your A/V rack. But at a minimum, this can be a great place to store your digital images, rip and store all your music, and have them all in one central location, both for your living room entertainment, and for viewing/listening from any other PC on your home network.
So with introductions out of the way, lets get down to business and get your home media jukebox up and running.
This story is organized into the following sections:
- Design Goals & Parts List–What to buy and why.
- OS and Samba Installation – getting the basics installed
- Installing and Configuring the Freevo software
Design Goals
& Parts List”>
The overarching design goal with this server was to make it cheap, give it a 10-foot UI, and have it be easy for anyone in the family to use without constant hand-holding by the sysadmin (you).
Heres the bill of materials list:
|
Our selection of components may be altered, depending on how intensely youre going to be working this server. Below we describe our configuration, and provide alternate configurations options to give you more power:
Key Components and Alternate
Options”>
Case: We chose the Yeong Yang A201-X03, because of its slender form-factor, and its slender price-tag. One of Shuttles XPC case/mobo combos would also work nicely here, but itll set you back another $150, and we decided to save that money to keep our bill of materials cost as low as possible.
Other good candidates for cases on a box like this are CoolerMasters 600 Series and Antecs new home theater PC case, both of which have the same dimensions as typical home A/V gear components. This means the server can live in your entertainment centers component rack. But again, the issue with both of these cases is cost, since the CoolerMaster is going for around $230 and the Antec home theater PC case is expected to also carry a pretty stiff price tag, compared to the Yeong Yang case we found.
Motherboard: We opted for an nVidia nForce 1 motherboard, leveraging its built-in Ethernet, audio, and even its built-in graphics — if you dont require TV output. If you want to route this boxs output into your TV via an analog video output, fear not, well address that later in this article.
The primary advantage of using nForce 1 is how little else this system requires in terms of add-in components. A small form-factor case, a CPU, some memory, a hard-drive and a CD spindle of some kind, and youre good to go. The only difference between having this box capable of performing TV/TiVo functions, rather than being just an audio-only animal, is the cost of a TV tuner card. But even with that addition, the bill of materials cost is below $520, if you dont need a dedicated display (monitor).
CPU: We chose an AMD AthlonXP 1.47GHz, because its cheap, and this box doesnt have to be a screaming performer to get its job done. For real-time encoding of video, such as recording TV using Freevo, you wont want to have anything less than a 1.47GHz Athlon CPU. This CPU should provide plenty of horsepower for this task. The goal of a rig like this is to be an absolutely reliable, crash-free, and versatile consumer electronics appliance. However, if you decide to do media ripping and encoding, thats another story. To save money, we recommend that you perform that work on your high-performance system, and then copy the resultant output over to the server once the encoding work is done. That choice is yours, and is essentially a function of how much you want to invest in this servers CPU. If youre looking for a faster, but still cost-effective CPU, consider the Athlon XP 2700.
Memory: We went with 256MB of memory for a simple reason: its all you need for this type of server.
TV Tuner Card: For the tuner card, there are essentially two options: Hauppauges WinTV PCI, or ATIs TV Wonder. Both use the BrookTree decoder chip, and so both rely on the same bttv driver that ships with Red Hat. We went with the Hauppauge for our config, because we found it for about $10 less than the ATI card. The Hauppauge card also has support for stereo audio, whereas the TV Wonder from ATI only supports mono audio currently. If stereo audio isnt a high priority, then either of these cards will get the job done.
You could use an ATI All-in-Wonder card for this server, and if you have an older model whose 3D GPU is now a senior citizen, that might be a good candidate for this rig. As a rule, many types of home servers are great for installing aging hardware, giving it a second life.
Graphics: Integrated on the motherboard. Were not worried about 3D performance, and you dont need a ton of GPU MIPS to listen to music or watch TV.
Hard Drive: If you plan on TiVoing a lot of video, you may want to consider a really big honkin hard-drive, like one of Western Digitals 200GB monsters. But if this box is going to be audio-only, you can put in an 80GB drive, and even leaving 20GB free for the OS, which is way more than it needs, you can rip and store over 400 CDs at a bit-rate of 320Kbits/sec (4.4:1 compression) using your codec of choice. Although its getting long in the tooth now, MP3 does very well at this bit-rate.
Sound Card: We used the motherboard-down audio found in the nForce chipset, which for our purposes will do just fine. Unfortunately, theres currently no driver available that can take advantage of the nVidia MPCs ability to encode Dolby Digital in real time. Instead, the audio processor looks like an AC 97 codec to the OS, which provides basic audio services.
In Part Two of this story, well be showing you how to configure Ogle, a DVD player application, which should be able to use the included S/PDIF output to hand off a Dolby Digital or DTS stream to an external decoder.
DVD-ROM: Were going with Toshibas SD-M1712, and used in conjunction with the Ogle DVD player (mentioned above), this media box can also play your DVD movies.
Media App: We came across the Freevo project page on SourceForge, and after downloading it and installing it, we were impressed with its polish and current state of development. Its not 100% ready for prime-time, but its got a lot of the bases covered. It lets you watch TV, record TV, play back wave and MP3 files, watch digital video clips, and view digital still images. And its UI works well on a standard TV. Installation is pretty simple, since the three RPMs you need to install it include all the needed helper apps.
OS and Samba Installation
We opted for Red Hat 8.0 for this system, although SuSE 8.1 would also be a fine choice. We did a Custom install, where we went through and chose only those packages wed need to keep the OS footprint to a minimum. Youll definitely want to install Samba, which Red Hat calls “Windows Server.” Samba lets you connect the Linux box with your Windows machines, so you can transfer files back and forth. Youll also want to install all the Gnome-based media players, or KDE-based media players if you want to run KDE. Red Hat runs its own polished version of Gnome by default.
There is one VERY important detail to remember during the OS installation process when prompted for which boot-loader you want to use, be sure to select LILO, rather than GRUB, which is Red Hats default boot-loader. For a reason we have yet to determine, the GRUB boot-loader wont work with the nForce chipset, whereas LILO works without a hiccup.
After the OS installation completes, the good news is that youve got all the drivers you need on your hard-drive. However, you will want to download the latest version of Samba, 2.2.8, because previous versions have a pretty serious security hole that will leave you very vulnerable to attack. If youre behind a NAT (broadband) router, this is much less of a concern, but its so easy to download and install the Samba 2.2.8 RPM, that its just something you should do.
Remember to do all your system tweaking logged in as root, and then once thats all done, login as a non-superuser to prevent any accidental trashing of vital system settings/components.
To get Samba up and running, install the RPM (Red Hat Package Manager), and then bring up the Server Settings utility (Red Hat Menu=>Server Settings=>Services and click the ballot boxes for both SMB and SWAT (the Samba Web Administration Tool). For SMB, click on the Start button in the utility to start the SMB service.
Change hostname to something other than “localhost.” Wed suggest something like “media-furnace.” To do this, bring up the Network control panel (Red Hat Menu=>System Settings=>Network) and go to the DNS dialogue tab. Where you see the field for hostname (itll say localhost.localdomain), change this field entry to whatever you want the name of this server to be.
Now youre ready to run SWAT and configure your Samba server and its shares. We suggest first creating the directories youre going to want to share. On our system, we created the following directories:
“/media/music/media/video/media/digital_pics“
To run SWAT, bring up a Mozilla browser window (Red Hats default web browser), and type:
“http://media-furnace:901 (the convention is http://servername:901) where “servername” is whatever youve named your server.“
You will then be prompted to login, and do so as root and provide the systems root password.
Now that youre in, go ahead and create your user accounts and shares. For more on how to do this, see our recent story on building a Home Linux Server.
Network and Audio Driver
Configuration”>
Although the server will now boot and run, you dont yet have audio and networking services from the nForce chipset, and the drivers for the Hauppauge WinTV card are going to also require some tweaking. At press time, were still unsure as to why the Hauppauge drivers arent loaded, given that Red Hats Anaconda installer recognizes the WinTV hardware, but were still investigating.
Youll need to get the nVidia nForce chipset driver onto the server, but youre in a bit of a Catch-22 here: you cant download it, because your networking driver isnt working yet, and the driver wont work until you download it. Kind of like bringing home a DVD player that comes with a DVD that shows you how to install it…
There are two ways around this problem: either download the driver on another machine and burn it onto a CD-R or CD-R/W disc so you can copy it to the server or, download the driver on the second machine and copy it to a floppy. Youll then need to temporarily put a floppy drive in the server to be able to copy the RPM to the servers hard disk. The RPM is quite small, by the way, weighing in at a mere 88KB.
Once you get it loaded onto the server, using either of the above-mentioned methods, run the RPM, and once it completes its run, reboot the system, and the nForce Ethernet driver will now be ready for action. The audio driver will be almost ready for action, but will require one small tweak.
The nVidia audio driver tweak is a very simple one. Using Red Hats GUI, navigate over to the /etc sub-directory, and find a file called MODULES.CONF. Open this file using gedit, and find the following line:
“alias sound-slot1 i810_audio“
Youll need to change this line to read:
“alias sound-slot0 i810_audio“
Next, save the file and exit gedit. Reboot the system, and youll now have working audio hardware.
To verify that the audio driver components have loaded, bring up a command-line session, and type lsmod. At this point, the output of lsmod should look like this:
Module Size Used by Tainted: P nls_iso8859-1 3516 0 (autoclean)ide-cd 33608 0 (autoclean)cdrom 33696 0 (autoclean) [ide-cd]i810_audio 25224 1 (autoclean)ac97_codec 13384 0 (autoclean) [i810_audio]soundcore 6500 2 (autoclean) [i810_audio]radeon 94008 0 autofs 13348 0 (autoclean) (unused)nvnet 30368 2 ipt_REJECT 3736 6 (autoclean)iptable_filter 2412 1 (autoclean)ip_tables 14840 2 [ipt_REJECT iptable_filter]mousedev 5524 1 keybdev 2976 0 (unused)hid 22244 0 (unused)input 5888 0 [mousedev keybdev hid]usb-ohci 21288 0 (unused)usbcore 77056 1 [hid usb-ohci]ext3 70400 2 jbd 52212 2 [ext3]
Video Driver Configuration
Before you install Freevo, (this is the application that ties everything together, which well discuss in detail below), its a good idea to get the Hauppauge WinTV cards driver working. For this, were going to write a simple Bash script that will load the needed Loadable Kernel Modules (LKMs). Using gedit, or your text editor of choice, create the following script.
Bash shell script
“#!/bin/shinsmod i2c-coreinsmod i2c-devinsmod i2c-algo-bitinsmod tunerinsmod tvaudioinsmod tvmixerinsmod videodevinsmod bttv card=10“
This script uses the insmod command to load the needed LKMs in the correct order. For you Windows-heads, LKMs are like drivers.
The last line of the script passes a parameter to insmod to tell it which card the bttv LKM is being loaded for. bttv supports several BrookTree TV encoder chips, and the Hauppauge WinTV uses the Bt878.
Save the script as something like lvm (load video modules). I suggest saving this script in the /etc/init.d directory so it will be available to run at bootup along with other services. Next, in a command-prompt shell, go to wherever youve saved the script file and type the following:
“chmod +x lvm“
Chmod changes the permissions of a file, and using the +x switch makes the script executable by all users.
Next, we want to execute this script on startup. To do that, we have to place a link to it in the /etc/rc5.d sub-directory, which is where scripts get executed on startup in RunLevel 5, which is a full multi-user run mode with networking and X-Windows. To create this link, bring up a window in Gnome, and go to the /etc/init.d sub-directory (or wherever youve placed the bash script). Right-click on the file, and drag it onto the desktop. Youll be asked if you want to move, copy, or link to this script. Select “link here.”
Now, in that same window, change to the /etc/rc5.d sub-directory, and drag the script link from the desktop into this sub-directory.
Next, you need to rename the script using the following convention– Look at all the scripts that begin with the letter S (these are services scripts, which get executed after kernel scripts, which begin with the letter K). Find the last script that begins with the letter S, which is usually S99local. Verify that this is the highest-numbered script beginning with S. If yes, rename the link to your bash script to:
“S100lvm“
The script will now execute on startup, and the needed LKMs will be available to Freevo.
To verify that the LKMs will load correctly at startup, reboot your system, and then go to a shell command prompt, and type
“lsmod“
to verify that the LKMs loaded. Here is the partial output of lsmod, and all of these modules need to be present in order for the TV portion of Freevo to work correctly:
Module Size Used by Not taintedbttv 71424 0 (unused)videodev 8288 2 [bttv]tvmixer 4944 0 (unused)tvaudio 14940 0 (unused)tuner 11456 1 i2c-algo-bit 8840 1 [bttv]i2c-dev 5668 0 (unused)i2c-core 19236 0 [bttv tvmixer tvaudio tuner i2c-algo-bit i2c-dev]soundcore 6532 7 (autoclean) [tvmixer nvaudio sound]
Install the Freevo Software
Click Here
Freevo is an open-source suite of applications that turns a Linux box into a multimedia appliance. With Freevo, you can watch and record TV, watch digital video clips, play wave, MP3 and OGG audio files, as well as view digital pictures. Be advised that parts of Freevo — like any good open-source project — remain a work in progress. Specifically, the ability to record TV is still a bit shaky, although TV viewing works fine. This article will cover TV viewing only – look for Part 2 next week which details adding in TiVo-like recording functionality and TV-Guide-style functions.
Installing Freevo is simply a matter of downloading these three RPMs:
And optionally, you can download an RPM that will allow Red Hat to boot directly into Freevo:
“freevo-boot“
You then install them in the above order, and Freevos bits wind up in the /usr/local/freevo/ sub-directory.
Freevo will now start, although TV functionality will only work if the needed LKMs for the WinTV card are loaded and Freevos freevo_config.py config file is properly configured with a correct channel list for your cable service. Currently, Freevo supports traditional analog cable, but doesnt yet support satellite TV service.
To create a shortcut for Freevo on the Red Hat desktop, right-click anywhere on the desktop, and select “New Launcher.” The config screen looks like this:
Youll want to specify the /usr/local/freevo/ path, and choose the freevo executable. You can choose whatever icon you want, we just chose one thats multimedia-looking.
Customizing FREEVO
The next chore is to edit the freevo_config.py file to get Freevo to operate with your hardware and to tell it your local channel lineup. Also, its important to point to the directories you want it to scan to find video clips, audio files, and digital pictures.
Open freevo_config.py using gedit or your text editor of choice, and perform a text-string search for the following entry:
“DIR_MOVIES =“
Here is where you set the directory you want this menu option to reference. In our case, our config file looks like this:
“DIR_MOVIES = [ (Movies & Video, /media/video) ]“
This tells Freevo that our movies are stored in the /media/video subdirectory, and to call it “Movies & Video in the user interface. If you want to have subdirectories within this subdirectory, Freevo will let you navigate through the directory tree to find video clips stored in different subdirectories.
Next, do a text string search to find the following text to tweak the directory pointer for music:
“DIR_AUDIO =“
In our config, we set it to point to /media/music:
“DIR_AUDIO = [ (MP3 Music, /media/music) ]“
And finally, perform a text string search to find the following text to tweak the directory pointer for digital pictures:
“DIR_IMAGES =“
Our entry for this points to /media/digital_pics
“DIR_IMAGES = [ (Digital Pics, /media/digital_pics) ]“
Theres also a directory pointer for recorded TV clips, as well as games if you want to run the MAME emulator for playing old-school coin-op and console games. Well chose not to configure that for now and save it for Part 2, but the same convention we just showed above applies. Youll need to download xmame and game ROMs separately, however.
We also wanted to tweak the onscreen display (OSD) controls, and adjust the pointer, because the one supplied in the initial setup is wrong. So make this change:
OSD_DEFAULT_FONTNAME = usr/local/freevo/skin/bluebold.ttf
Now, the all-important TV device setup, without which Freevo wont be able to use the TV tuner card. Youll want to verify the device name using dmesg. To run this command, bring up a command-prompt box (Red Hat Menu=>System Tools=>Terminal) and type “dmesg