The Services Layer
Part II: Home Entertainment
The Services Layer
The services layer can almost be thought of as a second foundation. Taken
together, these services form the source of all the information displayed in
the user interface.
1. Install the Advanced Linux Sound Architecture (ALSA)
Installing the Advanced Linux Sound Architecture is optional, but I recom-
mend it. Also, if you happen to be interested in using the digital outputs
to connect to a receiver, Fedoras default OSS drivers will not work. ALSA
makes up the audio system module of the services layer.
To install ALSA, execute:
$ su
# apt-get update
# apt-get install alsa-kmdl-$KERNEL
# apt-get install alsa-driver alsa-utils
You need to edit /etc/modules.conf to enable the kernel modules. Again, if
you’ve built your PC using the specified hardware, youll need to configure
ALSA to use the nVidia nForce2 driver. Begin by commenting out the exist-
ing OSS modules. For this system, add a
# to the beginning of the lines that
alias sound-slot-0 i810_audio
post-install sound-slot-0 /bin/aumix-minimal –f /etc/.aumix –L > /dev/
null 2>&1 || :
pre-remove install sound-slot-0 /bin/aumix-minimal –f /etc/.aumix –S >
/dev/null 2>&1 || :
(Your system might have slightly different lines, but they should be close
enough to identify them.) Then add these lines at the top of the file:
# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-intel8x0
# module options should go here
# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
# Save & restore settings
post-install snd-card-0 /usr/sbin/alsactl restore >/dev/null 2>&1 || :
pre-remove snd-card-0 /usr/sbin/alsactl store >/dev/null 2>&1 || :
hhpg.indb 162
11/24/2004 1:55:36 PM
The Services Layer
Chapter 8, Build a Linux-Based Home Theater PC
Save the file. Then create a new file called /home/htpcuser/.asoundrc and fill
it with the following text:
pcm.emu10k1 {
type hw
card 0
ctl.emu10k1 {
type hw
card 0
Now it’s time to reboot again. When the rebooting process completes, youll
need to adjust the volume because the ALSA installation sets all levels to
zero. There are a few tools that can correct this, but we’ll use the Gnome
Volume Control applet. On the Red Hat menu, choose Volume Control
from the Sound & Video submenu. Raise the sliders labeled Vol and PCM.
Now test the new ALSA configuration by playing a sample sound:
$ /usr/bin/aplay /usr/share/sounds/KDE_Startup.wav
You should hear the KDE startup sound. If you dont, verify the values in
/etc/modules.conf. If you are using a different sound card, you can determine
the appropriate settings by visiting the ALSA project’s sound card matrix
page at http://www.alsa-project.org/alsa-doc. You should also verify your
.asoundrc file while youre there.
2. Install MythTV
As mentioned in the overview, we’re going to use MythTV as the user inter-
face to our HTPC. MythTV is a fantastic open-source project that provides
a cohesive frontend out of what would otherwise be a bunch of discon-
nected parts. This is where using APT really pays off. Without it youd
be forced to build MythTV from scratch, accounting for a vast amount of
dependencies and sub-components. Not only is that time-consuming, it’s
also error-prone. With APT you can install a smorgasbord of applications
using a single command, like so:
$ su
# apt-get install mythtv-suite
You’ll see all the work Axel has saved you flash before your eyes.
3. Install tuner card drivers
It’s now time to install the TV tuner card drivers. We’ve chosen the
Hauppauge WinTV PVR-250 because it has a hardware MPEG encoder.
Using a hardware encoder dramatically reduces the burden on the CPU
during the recording process. (The installation process will be the same for
WinTV PVR-350/Freestyle cards as well.) Run the following command:
# apt-get install ivtv-firmware
# apt-get install ivtv-kmdl-$KERNEL
# apt-get install ivtv
hhpg.indb 163
11/24/2004 1:55:36 PM

Get Home Hacking Projects for Geeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.