Introduction
Determining your needs
Basic Hardware
Audio
Video
Video Card Configuration
LIRC
Input Devices
TV/HDTV Tuner Cards
Installing Linux
HTPC Software
HTPC Tips and Tricks
Conclusion

Linux HTPC How-to

Audio

Sadly, one of Linux's greatest features, driver support for thousands of devices, lacks in the HTPC sound and video card area. This is because there are few companies produce that good HTPC hardware, and even fewer that have cards that are supported under Linux. The good news is that there is a way to do this, but you don't have as much choice on the hardware you'll need to use.

First, what you don't have much choice over

The biggest driver problem falls under the sound category. There are a number of choices for sound cards, but only a few work well for HTPC.

Alsa or kernel module

I always try kernel modules first, then ALSA. But in kernels 2.6.x and newer, Alsa is what the kernel uses, so I recommend starting with ALSA now. ALSA auto detects your sound cards, sets up the configuration, and plus it has a few nice extra features over what stand alone kernel modules offer.

What do you really need the sound card to do?

Not much is really the answer. The best way of transmitting audio from any device to another is by way of a PCM stream. PCM stands for Pulse Code Modulation, which basically means sending digital bits of data instead of analog frequencies. As everyone knows regarding digital Vs. analog, with digital, you don't lose information when sending it. You either get it, or don't. Analog signals vary on how good the quality is. That's why you're always adjusting your TV antenna and why some channels come in better than others. With a PCM stream you're guaranteed a perfect audio sound.

If PCM sounds new to you, I'll explain some types of PCM streams and things should click. So the great Dolby Laboratories have come up with amazing sound technology. Their latest is DTS (Dolby Theater Sound). Dolby Digital is another one of their technologies that most people know, and Sony has their SDDS technology. All of these are digital PCM audio streams, and that is what we want to handle.

CD's, DVD's, HDTV, DVD-Audio, all use PCM streams of some sort. If you are using "RCA" (Normally black wires with red, white, and/or yellow ends) connectors from your CD or DVD player to your AV Receiver or TV, you're sending an Analog signal and therefor not hearing the best audio quality. You would be amazed at how much you're sacrificing by using analog if you ever do a sound test. So our goal is to never use these again. What we will use instead is something that supports S/Pdif, as S/Pdif is how we transport a PCM stream.

S/Pdif (Sony/Philips Digital Interface) is the standard that is used to send a PCM stream from one device to another. There are two types of S/Pdif interfaces. Coaxial and fiber. Coaxial works just fine, but coaxial S/Pdif is considered inferior, and if you just pick the right card for no extra cost, your friends can no longer claim you don't have the "Best". Truthfully, since coaxial and fiber interfaces are both digital interfaces, and no loss can occur, the only truth to coaxial being inferior is there could be a slight delay in timing on the sound if you are using a long cable -- But I suggest fiber/TOSLINK if your AV receiver supports it. Also, you do need a 5.1, 6.1, or 7.1 AV Receiver that supports DD and/or DTS. This AV receiver is the hardware that powers your speakers and does the DD/DTS decoding. (The AV receiver is not considered part of the HTPC FYI).

Motherboard Audio Support.

The S/Pdif interface is much simpler than what a normal sound card is designed for. It takes the data from your computer/audio data and sends it out the S/Pdif interface, just like a network card does for network data. You don't need a full sound card at all to do this really. This is why I earlier recommended a motherboard with an NForce chipset. Most NForce motherboards support the TOSLINK optical out right on the motherboard. You will probably have to buy the adaptor bracket in addition to the board, but NVidia has released drivers for their TOSLINK interface and it works perfectly under Linux. If you have any other motherboard, chances are slim to none that it will work. You'll need to find out if your motherboard's Digital audio chip is supported under Linux. Right now this is mostly limited to the C-Media CMI 8738 chipset. A number of motherboards support this chip, such as Asus, but it depends completely on the model of your motherboard. If you have the NForce chipset, I'd recommend this audio option first. If not, you'll save a lot of time by choosing from the other cards below.

Audiophile cards

Right now, the only audiophile card that is reported to work is the M-Audio 2624 card. This card is running $100+ (US$) currently. It has TOSLINK optical out, low signal to noise ratio, and also 6 channel analog outputs for supporting "future audio" configurations.

High End Sound Cards

The next choice are the Sound blaster brand. The Audigy2 and Extigy can support DVD-Audio 192kbit audio, which is the next generation "CD/DVD", TOSLINK optical out, firewire, and a remote. If you're willing to dish out the nearly $200 for one of these to get that little bit of extra sound, go ahead, but without high end speakers, you won't notice anything.

All you really need is a S/Pdif interface anyway, why get things you won't use? Good point. That's why I chose this option myself. I Google'd for "sound card Alsa 8738". The results turned up 2 cards, the Nightingale and the AudioExcel "TheaterExcel" (The AudioExcel card is also branded as the Chaintech 6 Channel Sound Card Model AV515M). Both are about 3 years old. Since everyone was sold out of the Nightingale cards, I bought the Audiotech card from newegg.com for $23.00 including shipping. 3 days later I dropped the card into my system, ran alsaconf to configure it, followed the "Enabling S/Pdif" notes under ALSA's sound card matrix listing for the 8738 chipset, and sound was done. In less than 5 minutes (including boot time) I was listening to 5.1 DTS sound on my AV Receiver. (If you use Xine, see Xine's FAQs about enabling S/Pdif (5.1 sound) in Xine, it defaults to 2 channels).

*Note: I spent over 20 hours researching to find which chipset is supported and that have TOSLINK output. The only cards I have found that do are the ones mentioned above. If anyone finds more cards that work, let me know so I can include them here.

*Note: Fiber cable isn't cheap. It runs anywhere from $2-$5 a foot. When I purchased my sound card, it came with a 5 foot cable, which is all the length I needed. If you have to run a long length of fiber it could be expensive. I did get some gigabit Ethernet fiber to test as it is cheaper if you find a good deal, but it does not work with AV equipment. , as it's all (basically) the same, and see if that is cheaper. "Monster Cable", which I never recommend anyone buy because it's overpriced, and/or totally pointless and useless to buy it, such as with fiber or coaxial S/Pdif. (Hint, if you're ever sending digital signals, it's worthless) If you're spending $2k+ on speakers, buy it at that point, it helps on Analog/Speaker wire a little, but that has nothing to do with the HTPC part.