2003-10-01
01 Oct 2003 17:00
Getting ripped
Assuming that you care about accurate CD ripping, with no clicks or glitches, the package you want to use is cdparanoia. On Gentoo, emerge cdparanoia.
Once you’ve got the audio off the CD, to get the best quality MP3s you should use LAME—emerge media-sound/lame. It has a bewildering variety of options for changing everything from the bit rate to the precise filters and psychoacoustic modeling algorithms used. You can spend weeks testing different settings, or you can do what I do and use one of the presets that have been worked out by audiophiles on Internet forums.
The --alt-preset default option gives MP3 files that I find it pretty much impossible to tell from the original CD. However, the resulting files are pretty large, averaging around 180kbps in many cases.
A more compact option is --r3mix. This is close to CD quality, but on occasion it won’t quite manage to reproduce the original sound precisely. It averages around 160kbps.
While classical music snobs like to think that the majestic sweep of the orchestra is difficult for MP3 to reproduce, it’s actually electronic music that’s hardest to encode accurately. The reason is, most audio processing relies on Fourier transforms, which break down sound waves into a summation of sine waves of different frequencies and amplitudes. Physical instruments generally produce audio with sine-like waveforms. Unfortunately, techno relies heavily on square waves and triangular waves, and pure square and triangle waves don’t break down into sine waves cleanly—you actually need an infinite number of sine waves to reproduce a square wave.
So, I tend to use --r3mix for general rock and pop, and call out --alt-preset standard when dealing with electronica and particularly detailed all-digital recordings.
iTunes has a horrible MP3 encoder. If you have music encoded from CD using iTunes, you would be well advised to re-rip using LAME --r3mix, which beats iTunes at similar bit rates. In fact, LAME MP3 also clearly beats iTunes MP4 files at comparable bitrates.
Tagging
The id3v2 package (emerge id3v2) provides a robust command-line utility for dealing with ID3 tags, in both version 1 and version 2 formats. However, the ID3v2.4 format isn’t yet supported—only ID3v2.3. If you have MP3s encoded with iTunes… well, you probably ought to re-encode with LAME. But if you won’t or can’t, you should at least convert the ID3 tags to v2.3, so Linux applications can deal with them.
Glue
Getting ripped, tagging, and now glue… so far it’s an average day in the life of a suburban punk. But if you try the entire CD to MP3 process once using the raw command-line tools, you’ll realize it’s a colossal pain. Apple’s iTunes does a great job of making it simple, even if the results aren’t very high quality; so I set out to look for something iTunes-like on Linux that would glue together all the command-line tools.
I’m told that the grip program is great if you have an X desktop. However, I didn’t want to install X and Gnome on the Linux box, and an X server on the Mac, just to rip CDs—so I searched for a terminal-based alternative.
The best tool I’ve been able to find is called mp3c. Conveniently, there’s a Portage ebuild for it, so you can just emerge mp3c. You’ll need to configure it before setting off to rip your CD collection. By default it uses what can only be described as the wrong ripper and the wrong MP3 encoder, at least for anyone concerned with audio quality.
I configured mp3c to use LAME for encoding. I also made it add the ID3 tags directly using LAME, instead of using id3v2 to do it afterwards; that way you don’t need to shunt the entire file down by 4K to add the frame that the ID3 tag is stored in. (That’s what iTunes is doing when it gives you a slow-moving progress bar as it adds ID3 tags to a huge MP3.)
Anyway, you can download my .mp3crc file and make a few small edits where appropriate. Once mp3c is set up, you can insert a disc, push F if necessary to force it to refresh and fetch the disc track details, then hit 3 to rip and encode.
Playback
It’s useful to be able to play back MP3s from the command line. Most of the more elaborate jukebox software calls command-line MP3 player software for the actual audio playing.
The most commonly-used program is mpg123. A higher quality free software alternative is mpg321, which uses a standards-compliant integer MP3 decoder library called MAD. The difference in sound quality is quite amazing. You guessed it, emerge mpg321 on Gentoo.
(The Whamb music player on OS X also uses the MAD decoder, and beats iTunes in sound quality. Unfortunately, I haven’t been able to find out how to make Whamb read an MP3 library via Rendezvous; the documentation is severely lacking.)
Streaming and Rendezvous
Assuming you’re a Mac user like me, what you really want is for any Mac in the house to be able to access the MP3 library on the Linux box straight from iTunes, with no configuration required. To achieve this we require a piece of software called daapd. It can use its own Rendezvous code, or you can use Apple’s open source Rendezvous implementation.
How it works is quite simple: The daapd software scans your MP3 library when it starts up, reading in the ID3 tag information and building its own database. It then starts a lightweight HTTP server, almost the same as any old web server except that it’s on a different port, and uses persistent HTTP connections—that is, it keeps a single session open rather than opening a new connection for each file transferred.
iTunes finds the daapd on your jukebox server because the jukebox server broadcasts its name and network address using Rendezvous. Hence as well as starting daapd when the jukebox boots, you also start a Rendezvous broadcast service.
The daapd program itself is easy enough to build—download it, unpack it, run the configure script, then make. Unfortunately, it needs four libraries. If you installed mpg321 like I suggested, you should already have the MAD libid3tag. If you’ve somehow manage to install Linux and not end up with zlib, emerge sys-libs/zlib. You can download the other libraries, daaplib and libhttpd-persistent, from the daapd web site.
The Apple Rendezvous package you want for Linux is in the mDNSPosix directory of the source archive. The Makefile should work without any changes; make os=Linux. The binary you need is built as build/mDNSResponderPosix. I copied it to /usr/local/bin/mdnsresponder; you’ll need to do the same for my scripts below to work.
Once you’ve installed all three, rc-update add daapd default will make everything start up when you boot Gentoo. To check it manually, type /etc/init.d/daapd start.
(Note that other Linux distributions use different tools and slightly different locations for startup scripts. If you’re not using Gentoo, you’ll need to consult the appropriate documentation.)
One problem you might have is that daapd tends to crash and core dump if you feed it corrupt MP3s. Whereas most MP3 players can cope with a little corruption, the ID3 tag libraries in daapd seem to be less robust than they might ideally be. If you find that daapd is crashing, I suggest editing the source to put in a few debug-type print statements to report each filename as it is opened, so you can find and eliminate the bad MP3s. Of course, if you’re ripping your music from CD, you shouldn’t have any problems.
(If you have gigabytes of stolen music containing hundreds of partly corrupt files which cause daapd to crash, well, I have no sympathy.)
Now the fun part begins
At this point you should be ready to rock… or blues or punk or classical or whatever. Now you’ll find out how long it takes to rip your entire CD collection. I’d already done most of mine over the course of several months, and had CD-Rs with the files on. Even so, I had to copy all the files onto the hard drive, and make sure all the ID3 tags were correct.
One thing you might want is a script to tidy up a whole bunch of tagged MP3 files, so that they’re all filed as /var/music/Artist_Name/Album_Name/dnn-Track_Name.mp3 where d is the disc in a multi-disc set, and nn is the track number. It’s also useful if the directory names and filenames have no spaces or other special characters in, as a lot of command line software is awkward to use—or even chokes—when your filenames have ‘special’ characters in. Finally, it’s useful to make them 31 characters or less, so you can burn them on CDs without problems.
I searched for a while for a suitable script, and eventually gave up and wrote my own, which I call mp3mv. It’s in Perl. You edit it to configure it; there are only two parameters, the source and destination directories, which should be distinct. It then does the right thing, as described above. Any files it can’t read the ID3 tags from, it leaves alone. It also leaves any non-MP3 files or directory structure in the source directory alone. To delete empty subdirectories under /var/music without the risk of deleting any files, the following incantation should work:
find /var/music -type d -exec rmdir \{\} \;
The script needs three Perl libraries from CPAN. As a reminder, g-cpan.pl MP3::Tag is the Gentoo way to install a Perl library.
Music everywhere
So, hopefully now you have daapd and mdnsresponder running on a set of cleaned-up MP3 files. Fire up iTunes, and make sure you have “Look for shared music” checked under the Sharing section of the preferences panel. You should see your jukebox machine appear as a blue shared music library in the left pane of the iTunes window. If so, the mdnsresponder part is working… Click on the icon, and if daapd is working you’ll get a list of available MP3s.
2003-09-09
09 Sep 2003 17:00
Finishing Gentoo install
That’s about it. I picked metalog for my system logger. GRUB works fine on M10000. Here’s an example grub.conf:
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo Linux
root (hd0,0)
kernel (hd0,0)/boot/bzImage-2004-03-10 root=/dev/hdc3 noapic
title=Gentoo Linux previous kernel build
root (hd0,0)
kernel (hd0,0)/boot/bzImage-2003-12-06 root=/dev/hdc3 noapic
Notice a couple of things: Firstly, I label the kernel bzImage files with the date when I build them. Secondly, each time I update grub.conf to try a new image, I also update the second entry to list the most recent kernel that actually worked properly, so that if something goes disastrously wrong I can reboot, hit down arrow and enter, and have a working box again.
You might find you don’t need the noapic flag, depending on the BIOS version of your system and how buggy it is.
So, now you have a Gentoo Linux box. You should be able to install your choice of shell, text editor, and so on, using emerge.
2003-09-08
08 Sep 2003 17:00
Kernel and ALSA sound
The standard Gentoo 2.6 kernels work perfectly well on an EPIA M-series. I’ve been running 2.6 since 2.6.0, and not had any crashes. I even have sound working. The only issue is that right now, lm-sensors doesn’t work with 2.6.
Building a kernel is where Linux installation generally becomes difficult—when you make menuconfig there are all kinds of obscure prompts filled with jargon.
You could take the easy way out, and autobuild a kernel like the one on the Gentoo boot CD. However, that’ll give you a kernel full of unnecessary code for features your EPIA will never have, and a kernel modules directory full of drivers for hardware you’ll never use.
Luckily for you, I spent the time going through every Linux 2.6 kernel option and did my best to optimize for the EPIA M10000. I set up some of the features of the EPIA board as optional modules, so you can have USB and Firewire at a moment’s notice if you want them, but not have the drivers sitting in memory if you’re not using them. You also get the benefit of not having drivers for hundreds of sound cards, video cards and other add-ons you’re never likely to plug into your EPIA’s one PCI slot, and not having worrisome warnings or errors during bootup.
So, you’re welcome to download my 2.6 kernel configuration. Once you’ve picked and installed your choice of kernel sources, copy my kernel config file to /usr/src/linux/.config and type make oldconfig and my kernel configuration will be used as a starting point for yours. If your kernel version is significantly more recent than mine, it may have some new features which make oldconfig will ask you about; in that case, the defaults are generally safe in my experience.
Once you’ve done the make oldconfig, you can make menuconfig and tweak anything you want, safe in the knowledge that you’re doing so from a sensible starting point for a kernel that’ll actually boot an M-series.
Note that if you decided to use XFS or JFS, you’ll need to turn those options on. I don’t use XFS or JFS anywhere, so I turned them off for my kernel.
Also, note that obviously I can’t guarantee that my kernel config will work for you, or that it’s the best possible. Linux is such a moving target that I’m pretty certain details will change in less than a year when 2.6 is widely used. So, no guarantees, but my config may save you a few hours of work.
Autoloading modules
Step 21 of the Gentoo install (whew!) is setting up /etc/modules.autoload.d/kernel-2.6. It’s not enough to build and install the kernel modules; you also have to explicitly tell the kernel to load them when it boots.
If you used my sample kernel configuration, you can download my kernel-2.6 file and model yours on it. I’ve commented what the various modules actually do and why you need them.
Which brings us to the final tricky bit...
Sound
At the time of writing, sound under Linux is one of the worst parts of the OS. Earlier kernels had basic built-in sound support. Next, OSS was developed to provide full sound functionality. Unfortunately OSS was proprietary commercial software. Now, the latest in sound is ALSA, the Advanced Linux Sound Architecture.
It doesn’t work in 2.4 kernels in my experience, but I finally got it to work in 2.6, so I’ve removed the information about the viaudiocombo binary-only driver. That’s the way you’ll want to go if you want to stick with a 2.4 kernel, but I strongly recommend going with 2.6 instead.
You can download my ALSA setup from /etc/modules.d/alsa.
It appears that different EPIA machines with supposedly the same hardware need different values for the dxs_support parameter. I’ve seen people recommend all kinds of values. I found out which one worked for me by a simple process of elimination. If it doesn’t work for you, you’ll need to do the same. Tedious, but hopefully the bugs will be worked out soon.
2003-09-04
04 Sep 2003 17:00
Customizing make.conf
The file /etc/make.conf is the central customization point for Gentoo’s portage package system. It allows you to set compiler flags and other package-related preferences for your Gentoo system.
First, the USE flags. These override the defaults in /etc/make.defaults. Mine were initially:
USE="acpi alsa cdr -cups curl -foomaticdb -gnome -pdflib perl samba sse -xmms -xv usb -X -gtk -qt -motif"
Some explanatory notes:
acpi is Advanced Computer Power Interface. Turning it on lets Gentoo put the EPIA into even-lower-power mode when it’s idle.
alsa is the Advanced Linux Sound Architecture. You’ll also want to add the following further down the file:
# This specifies the correct ALSA card settings for building anything # relating to Linux sound, as per the Gentoo ALSA howto. # http://www.gentoo.org/doc/en/alsa-guide.xml ALSA_CARDS="via82xx"
That’ll make sure Gentoo only builds sound drivers for the VIA hardware you actually have, rather than littering your hard drive with drivers for a hundred other sound cards.
cdr turns on CD burning support. If you didn’t get a CD-RW, use -cdr to turn it off.
cups is the Common UNIX Printing System, also used on OS X; foomaticdb is some kind of printer capabilities database thing. I turned both off as I didn’t need to print from my MP3 server.
curl is a handy command-line program for fetching files from the web.
gnome is the GNU graphical desktop environment for the X window system. Unless you plan on using your EPIA as a desktop system, you don’t need or want it.
pdflib, well, I assume if you have PDFs to make or view, you’ll use Mac OS X.
samba is Windows SMB file sharing, which also interoperates well with Macs. NFS is another option, but I found Samba easier to get working.
sse is an additional set of CPU instructions added to the Pentium III and Pentium 4 by Intel. The VIA C3 in Nehemiah systems does support SSE, even though it doesn’t support MMX or 3DNow!, two other add-ons common in modern x86 CPUs.
xmms, xv, gtk, qt and motif are other X window related things you probably don’t need.
Suitable flags for the C3 are:
CFLAGS="-mcpu=i686 -O3 -pipe -fomit-frame-pointer -march=i686 -msse -mfpmath=sse"
I’ve been running with my kernel and C libraries compiled with the above flags for months now, with no crashes, so you can consider them safe.
I also uncommented the line to set CXXFLAGS to the same as CFLAGS. Finally, I turned on two portage features:
FEATURES="userpriv usersandbox"
Call me picky, but I don’t like running entire compiles as root. With sandboxing and user privileging turned on, portage will drop into a restricted mode to build the software, and only go back to root for the final install once everything worked.
Everything else in make.conf I left as default.
If you’re doing the full three-stage install, after editing make.conf you’ll kick off the bootstrap process. Bootstrapping uses the GNU compiler toolset to rebuilt itself from source, optimized as you’ve just specified.
2003-09-03
03 Sep 2003 17:00
Filesystem choice
Linux is all about choice, and when it comes to partitioning and formatting your hard drive you have a lot of choices to make.
The Gentoo recommendations for partition sizes are reasonable; in fact, their suggested /root partition is downright generous. You’ll be able to keep three or four kernels on there when tweaking things; this is good, as it makes it easy to go back to a known good kernel if you break something.
For the main (root) filesystem, I chose to use ReiserFS. Reiser is the most Mac-like filesystem available for Linux. Like Apple’s HFS+, it uses balanced B*-Trees for the directory information, meaning it will easily handle directories containing thousands of files (or thousands of subdirectories) without slowing down. I think this is important for a music server that will likely have a subdirectory for every artist whose music you listen to.
ReiserFS also has an interesting feature called tail re-use. If you’ve ever used Apple’s old HFS, you probably noticed that even the tiniest file would take up a few kilobytes of disk space. This is because filesystems need to divide the disk into clusters, and map whether clusters are used or not. It would obviously be implausible to map each byte individually, and there’s a finite limit to how many clusters a given filesystem can contain, based on how wide a number is used to number the clusters. Hence as the hard drive size goes up, the cluster size goes up. On large drives, it wasn’t uncommon to see tiny 1K preference files eating up 8K of space on an HFS drive.
While HFS+ is better than HFS at avoiding wasted space, Reiser’s tail re-use attempts to sidestep the problem by flagging the wasted space in the final cluster of files, and using that space for storing the tail ends of other files. (If you don’t like this idea, the feature can be turned off in /etc/fstab.)
ReiserFS also has filesystem journaling, like HFS+ under OS X 10.2 and higher. (It’s a hidden option in 10.2 Jaguar, on by default in 10.2 Server, and on by default in all versions of 10.3.) Journaling attempts to ensure that even if there’s a power outage or a sudden crash, the filesystem doesn’t become corrupted.
Of course, there’s a price to all this cleverness—ReiserFS has higher CPU usage than other Linux filesystem types. While I was sensitive to CPU load issues with EPIA systems, I decided it was worth it to be able to deal happily with tens of thousands of MP3 files in thousands of directories.
ReiserFS also has something of a reputation for instability and data corruption. Unfortunately, its author seems to value features over stability, and is a member of the “release early, debug later” school of software development. As a result, lots of Linux early adopters experienced filesystem corruption. Because of Reiser’s cunning tail re-use, even apparently read-only files could get random junk written into the middle of them; and the fsck tools for fixing up ReiserFS filesystems were widely derided as near-useless.
My feeling is: don’t let that put you off. ReiserFS as shipped in Gentoo has given me no problems at all, and plenty of other people have had the same experience. Even on the problematic SMP server mentioned earlier, the random lockups experienced during the middle of installing software didn’t seem to result in filesystem corruption. Yes, Reiser was once buggy and dangerous; so was OS X, and look at them both now!
At the time of writing, Linux kernel 2.6 is released, as is Reiser4, a major new version of ReiserFS. Once again, it is reported that Herr Reiser has put speed over reliability, so I’d strongly recommend avoiding the temptation to try Reiser4 until (say) 2005.
2003-09-02
02 Sep 2003 17:00
Gentoo installation on M10000
I’m not going to go through the entire Gentoo install step by step, as I think their documentation does an excellent job of that. What I will do instead is provide a few extra hints, and configuration files suitable for a VIA EPIA M10000 (Nehemiah) system.
As far as timing goes, a full three-stage install on an EPIA should go something like this:
- Boot from the Gentoo CD, configure network if appropriate, partition and mount hard drive, unpack sources.
- Type emerge sync.
- Go away and make coffee, and perhaps a spot of brunch. (Allow extra time if you don’t have broadband.)
- Return to the computer, edit /etc/make.conf, and start the bootstrap process.
- Go out for the rest of the day.
- Late that evening, go back to the computer and emerge system.
- Go to bed.
- Wake up the next morning and get coffee. Tweak kernel options while drinking coffee.
- Start a full kernel build.
- Go out for lunch.
- Return in the afternoon and install your kernel.
If it seems like a lot of work, well, bear in mind that you don’t have to sit and watch it. Yes, the computer will be slogging its little guts out, but that makes for a really good burn-in test of the hardware. Assuming your EPIA survives the entire Gentoo build and install process and ends up bootable and operable, you can be pretty sure your hardware is sound and properly assembled.
The first tricky decision will be whether you need any special options to boot Gentoo. I believe you’ll find that simply hitting return works.
I had the box plugged in via ethernet to a firewall router that was handing out DHCP addresses, so I didn’t have to do any network configuration either. If you have an Airport setup, chances are it’ll be the same for you.
If you want to use a wireless connection with the EPIA, things may be a little tricky. You’ll probably need to boot with gentoo dopcmcia to recognize a wireless PC card, even if it’s in a PCI carrier.
GRP is the Gentoo Reference Platform, a bunch of pre-built binaries not at all optimized for the VIA C3. You’re probably not using it and can skip that part of the instructions.
One of the peculiarities of Linux is that it generally doesn’t use the system BIOS to access devices, so the names or numbers of disk drives under Linux don’t always match what you’d see under Windows, or when configuring the machine through the BIOS setup screens. In the case of the M10000, on mine Linux saw IDE2 as the primary IDE controller, and IDE1 as the secondary. That meant I ended up with:
/dev/hda: Master device on IDE2, my CD-RW drive.
/dev/hdb: Slave device on IDE2; nothing.
/dev/hdc: Master device on IDE1, my hard drive.
/dev/hdd: Slave device on IDE1, nothing.
It isn’t important to have your hard drive be /dev/hda; I only mention this so you won’t be surprised or worried if it turns out not to be. Just adjust the Gentoo instructions as appropriate. I used hdc wherever they said hda.
Here’s what the important part of my fstab ended up looking like:
/dev/hdc1 /boot ext3 noauto,noatime 1 1
/dev/hdc3 / reiserfs noatime 0 0
/dev/hdc2 none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
2003-09-01
01 Sep 2003 17:00
Gentoo Linux Revisited
Earlier I explained my reasons for choosing Gentoo Linux. Having used the system for a while now, I’ll summarize its advantages and disadvantages:
On the plus side:
Portage is excellent. It’s very easy to install pretty much any package you want; with a single command portage will locate the source, download it, configure it to your tastes (determined from a single global configuration file), build it, install it, and then remove any old version that has been obsoleted. It’ll also do the same for any other packages that the chosen package requires.
There are also simple commands to upgrade anything you have installed for which a newer version is available; to search for packages and describe what they do and what versions are available; and to look for packages that aren’t needed and can be removed.
Gentoo is generally pretty up-to-date. Despite its reputation as a “bleeding edge” distribution, the current recommended kernel is a fairly conservative few point versions behind. If you really want the bleeding edge, there are non-default ebuild files for building the latest versions of pretty much anything.
It’s fast. I was pleasantly surprised with the performance of Gentoo on my M10000; it has no problems serving a music stream while doing a full kernel compile.
It’s easy. The really good news is, you pretty much don’t have to do anything special to get Gentoo running on the M10000. The one exception is sound, which we’ll come to later...
And now, the minus side:
Portage bloat. Right now, every Gentoo system has ebuild instructions for compiling every possible package. If (like me) you have zero interest in hogs like sendmail, bind and emacs, you nevertheless have to have hundreds of kilobytes of package information about them on your hard drive.
Yes, hard drives are cheap. (Get the 160GB Seagate!) Still, portage could use a diet.
SMP problems. I tried setting up an IBM Netfinity with Gentoo and a RAID array. Bad move. For whatever reasons, Gentoo’s SMP just doesn’t seem stable with EVMS on IBM SMP hardware. The system would randomly lock up when placed under moderate load, with not even a kernel dump for debugging.
For this project, it doesn’t matter. Gentoo is very stable on EPIA hardware. I just wouldn’t recommend it for a mission-critical SMP server. After a few days of hacking around with different kernels and EVMS versions, I gave up and installed RedHat—which worked perfectly out of the box.
[As an aside, if you find yourself forced by circumstance to use RedHat, you can get a port of APT to RedHat at freshrpms.net. Debian apt-get makes RedHat package management suck a lot less.]
Slow install times. If you go for a full three-stage install, so as to get all your binaries optimized for the VIA C3, you can expect the entire process to take a couple of days from start to finish. If you’re happy with generic 386 binaries, of course, things go a lot faster.
As well as Gentoo, you’ll need some MP3 server software. There are lots of choices out there; check FreshMeat for a list. A quick search on ‘juke’ will bring up a few pages of listings.
My main goal was to serve up MP3s to all the Macs in the house, so I wanted seamless iTunes integration. I got it with the aid of Apple’s Rendezvous/ZeroConf implementation, and daapd.
2003-08-02
02 Aug 2003 17:00
Testing
Once you’ve finished assembling the machine, I suggest plugging it in and powering it up once before going to the effort of holding all the wires out of the way, putting the case lid back on, and screwing it into place. Plug in keyboard, monitor and AC cord, and push the power switch on the front.
The first thing you’ll hear should be the power supply fan start. If you don’t hear that, either you have a dead PSU, or you didn’t connect the case switches properly.
Next the PC will probe the IDE devices. You should see the CD-ROM drive LED flicker once, then the hard drive LED. If you got a Barracuda then you probably won’t hear the hard drive spin up or seek, but you might hear the CD-ROM. If the LEDs don’t flicker, check that the drives are plugged in correctly, and try to determine if they’re spinning up and just not being seen by the PC, which would mean general motherboard problems or IDE cable problems.
Next, if all goes well you’ll see something on the screen. If not, check the monitor’s plugged in, turned on, brightness turned up, and so on. If there’s still no screen display, it could be monitor problems or PC problems. Distressed beeping from the PC means problems with the video hardware or the RAM—all-in-one motherboards like the EPIA use part of the system RAM for video, so if the system RAM is bad you won’t get any video output.
![[An exciting PC BIOS screen]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/13bios.jpg)
The final hurdle is to push the appropriate key and jump into the BIOS setup screen. If you get that far, take a look to see that the PC recognized the hard drive and optical drive. Also, check if the total memory is about right, once you allow for 64MB being deducted for use as video RAM.
At this stage, you might be tempted to fiddle with the BIOS settings. I found that the defaults were pretty reasonable, except that USB keyboard support is disabled.
My next test was to connect the machine to the ethernet and boot KNOPPIX, which is a bootable CD containing a complete Linux install and various applications.
![[and shows a splash screen]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/14knoppix2.jpg)
Depending on version, KNOPPIX may require the ’noapic’ cheat to be happy. Basically, when the initial screen appears inviting you to push F2 to help, you type knoppix noapic to boot with APIC disabled. APIC is advanced power management, so you can do without it for testing purposes.
For me, KNOPPIX booted, found all the hardware, found the network, got an IP address, and there I was with a full Linux desktop and Internet. I browsed the web a bit, then prepared for the next stage—the OS install…
2003-08-01
01 Aug 2003 17:00
Assembling the Hardware
Before you start assembling the PC, make sure you have the necessary tools. You will need a set of long needlenose pliers, assorted Philips crosshead screwdrivers in normal sizes, and a set of Philips head jeweler’s screwdrivers, the kind you might use to repair a pair of glasses.
I also strongly recommend that before you start, you get a good night’s sleep. Start the assembly with a clear head and a mug of coffee. Be calm, slow and methodical. Spending an extra ten minutes being careful during assembly can save you hours of problems later on.
I didn’t use a wrist strap or any other elaborate anti-static precautions. By all means use one if it’ll make you feel less anxious, but I’ve worked with electronics for years, never used a wrist strap, and never damaged anything.
I’m not guaranteeing you won’t destroy something, of course, but in general it’s quite possible to build a PC safely without wearing a wrist strap. Just make sure you touch something metal and grounded, like a metal faucet or radiator, to discharge any static before you start. Also, try not to touch the connecting parts of stuff, like the connecting edge of your RAM stick. You might also want to avoid doing the work in a room with a nylon carpet, during a dry New England winter.
![[A photo of the PC case]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/1case.jpg)
Here’s the Checkercube 2215 case. As you can see, it’s a “cube” case with a square front; it’s slightly deeper than it is tall and wide, however. It looks brown in the photo, but it’s a glossy black color in real life.
The circular holes at the front are clearly designed to look like filtered ventilation holes. However, they provide next to no ventilation, so I really wonder why they didn’t just leave the front featureless. On the left side you can see the strip of holes which provides the actual airflow for the case.
![[The back of the case]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/2caseback.jpg)
The back of the case shows three fan holes. The large 8cm fan is the power supply fan, though the PSU does draw some air through the machine too. An 8cm fan is important for keeping the noise tolerable, though the PSU supplied with the case isn’t the quietest in the world.
The two smaller fans are for cooling the rest of the PC. One fan provides more than enough cooling for an EPIA under heavy load in 35 celcius midsummer temperatures. I hear you can even run an EPIA fanless, but I haven’t tried it myself and you do so at your own risk.
Note also the rectangular backplate slot, allowing use of any Mini-ITX board.
![[Inside the case]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/3caseinside.jpg)
Here’s the inside, showing the drive bays, power supply, and associated spaghetti. As well as all the necessary cables, you also get a bag of assorted screws and a sheet of paper with an “exploded” view of the case components, presumably intended to show you how to disassemble and reassemble the thing.
One good idea is to empty out all the screws and group them together by shape and size. You can then count them up and compare with the list on the piece of paper, and thus work out the intended purpose of each type of screw, rather than (say) using PCI card slot screws to strip the thread on your hard drive’s screw holes.
The motherboard
Anyway, enough about the case; here’s the VIA EPIA M10000 mainboard. You can see the edge of a CD case on the right, to give you an idea of the size of the board. The board is basically an entire computer; you can see all the ports lined up along the back, the single PCI slot on the left, the two IDE connectors at the bottom, and just above them the single RAM slot.
The thing with the fan on it is the C3 CPU. Above it is a rectangular strip looking rather like the underside of a LEGO brick, which is the standard motherboard power connector. To the left of the CPU, a Savage 8 graphics processor lurks under a big heatsink. Above that is the floppy drive connector, for those diehards who still use such things.
Don’t worry if you can’t make out the details from this image; the EPIA motherboard comes with an excellent user manual which documents every connector on the board, provides a step-by-step connection guide, and describes all the BIOS settings.
The motherboard also comes with a set of IDE connectors, a plate with holes for the connectors which would otherwise protrude from that big rectangular hole in the back of the case, and some software CDs which will be completely useless if (like me) you’re planning to run UNIX on the box.
Beginning the assembly
Fancy Lian-Li cases come with motherboard trays that slide out. This case doesn’t, so the first task is to put the blanking plate into the back of the case, maneuver the motherboard into place so that the various ports are lined up with their matching holes, and then screw the board down securely to the bottom of the case.
Once you’ve done that, you’ll be starting to realize how fiddly it’s going to be to plug all those cables in. Now you know why I said you would need the needlenose pliers. First, though, let’s connect the LEGO-like power connector. Match up the clip on the side of the plug with the bit it clips to on the socket, then push it in. It’s quite tough, but you need to be careful not to bend the motherboard too much because you can break the delicate electrical tracks that way. Since the power connector is at the edge of the board, you should be able to support the edge of the board with one hand as you ease the connector in with the other.
Now would be a good time to add the RAM, before you start running cables everywhere. The RAM is notched so you can’t put it in the wrong way. Just open the white clips at the ends of the slot, line up the RAM, and gently push it in vertically. I found it much smoother to insert than most other motherboards of my experience, so you shouldn’t have too many problems. If the white clips didn’t already snap into place themselves, use them to hold the RAM in place.
You can connect the cables in pretty much any order, so long as you remember to connect them all, ideally to the right places. I started with the case cables: because of the design of the VIA motherboard, they had to go all the way from the front of the case to the back left corner. It was quite a stretch, and they were barely long enough, so it seemed a good idea to connect them up first and then lay all the other wiring on top.
![[Case cables, connected]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/4casecables.jpg)
The case cables connect the power switch, reset switch and LEDs to the motherboard, so they’re pretty important if you want the machine to power up. There aren’t any solid standards for how the pins on the motherboard should be arranged, so the case provides a separate tiny connector (or pair of connectors) for every individual wire, and you’ll need to match them up with the pins by refering to the VIA manual. Each wire’s pin connector will then need to be gripped firmly, and gently pushed down onto the correct pin.
This is where the needlenose pliers come in. The final result is shown in the photo. Note that not all of the pins end up connected to something.
For those with no electronics experience, some hints:
"NC" in the motherboard manual means “Not Connected”; in other words, that pin isn’t connected to anything, so don’t use it.
“VCC” is the “power in” connection, and GND is ground.
If there are multiple pins with exactly the same label, it doesn’t matter which you use. Often connector blocks have multiple ground or VCC connections, and you can use whichever is most convenient or neatest.
LEDs and speakers need to be connected the right way around. The colored wire is + and the white one is -. Switches generally don’t need to be connected a particular way around, but if you have a suggested polarity you may as well go with it.
![[The USB cables and diagrams]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/5usb.jpg)
I picked the USB cables as the next task, as they were also fairly tight length-wise, and fiddly. The photo shows the helpful diagram in the VIA manual, and the two sets of wires you need to connect, one set for each front USB port. This time you’ll be left with one unconnected pin.
Again, for those without electronics experience, +D on the pins matches USB2+ or USB3+ on the board, -D on the pins matches USB2- or USB3- on the board. Make sure one cable goes to all the USB2 pins in the left column, and the other to all the USB3 pins on the right.
![[Firewire cables]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/6firewire.jpg)
If you were really observant earlier, you might have noticed that the case seemed to have two slots at the back, but the motherboard only had one PCI slot. The explanation is that one of the case slots is for additional connectors. The EPIA comes with additional Firewire and USB ports suitable for the slot, and if you want to use the Firewire ports you’ll need it, because there are no Firewire ports mounted on the back of the motherboard.
I suggest using the rightmost slot (looking at the back of the case) for Firewire, as that’s the one that doesn’t line up with the PCI slot. The case slots are pre-cut metal, and can be knocked out easily to make way for Firewire. Be careful not to cut yourself on the sharp metal.
![[Screwing the Firewire
connectors into place]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/7screwing.jpg)
Once you’ve done something about the bleeding, you’ll need to hold the connectors in place while you use a screw to fix them there. This is where the jeweler’s screwdrivers come in: because of the case design, it is completely impossible to get a normal-size screwdriver into the right place.
As you can see from the photo, there’s another problem too. The power supply’s cables emerge at exactly the right place to get in the way as you do this. If you ever manage to put a PCI card in the machine, I’d be interested to know how. Some kind of right-angled screwdriver, perhaps?
![[All the fiddly cables]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/9fiddly.jpg)
The two Firewire cables you just added plug in to pins on the motherboard via another set of fiddly connecting wires. Once you’ve done that, the back corner of the motherboard should look something like this.
The good news is, that’s the last of the fiddly connectors.
The drives
![[The lower hard drive cage]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/8hdcage.jpg)
Now for the hard drive. I suggest fitting it in the lower hard drive cage, so the floppy slot is left free for whatever you might want to do with it later. (There are all kinds of cool things you can fit in floppy bays, such as vacuum fluorescent displays and control panels with volume knobs.)
The cage unscrews and slides out. Assuming you got a Seagate, slide it in with the connectors away from the end of the cage shown in the picture, and the drive circuitry down, and you should find that the holes in the cage line up nicely. Gently use drive mounting screws to fix the drive into the cage.
Next, slide the cage and drive back into place and put the fixing screw back in. Be careful with the case cables and front USB cables, which will end up trailing under the drive.
![[Hard drive DIP switches]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/10hddip.jpg)
Note that hard drives have so-called DIP switches on them which determine whether the drive expects to be “master” or “slave”. Each IDE cable can be used to connect two devices, and if you connect two devices which both expect to be “master”, you’ll get problems.
Most modern drives also come with a third option, “CS” or “Cable Select”. That means the drive chooses whether to be master or slave based on where it’s connected on the IDE cable.
The Seagate drive came set up as master, but I switched it to cable select in case I felt like adding another drive later. There’s a diagram on the top of the hard drive which shows which pins mean “master”, which mean “slave” and which mean cable select. Switching DIP switches around is another good use for needlenose pliers.
![[Optical drive optional
connectors and DIP switches]](http://www.xciv.org/~meta/Technology/Projects/MP3 Server/images/11cdrom.jpg)
Fitting the optical drive is much like fitting the hard drive. Unscrew and pop out the blanking plate from the front of the case, slide the drive into the drive bay, and use mounting screws to hold it there.
Like the hard drive, the optical drive has DIP switches for master/slave selection. There are also connectors for digital and analog audio, and this is where things get a little complicated.
An aside: CD audio and PCs
There are basically two ways a computer can play an audio CD. The first one is to put the CD-ROM drive into audio mode, and have it send the audio signal out via special audio connections. These are routed to the sound processor, which mixes the CD audio in with the audio generated by the computer.
The second way to play an audio CD is to have the computer rip the audio data into memory, filter it if necessary, and then use it as audio data to pump through the sound processor.
Which is the best? Well, the biggest problem with method #1 is that computer CD drives are not engineered for high audio fidelity. What makes the situation worse is that the analog signal travels down a thin, mostly unshielded cable. It goes right through the insides of your computer, which are busy emitting all kinds of electrical noise. The result is crappy sound.
If you have a good sound card, method #2 can give you true hi-fi sound from your computer.
It almost goes without saying that by default, Windows uses method #1 to play CDs, and Macs use method #2.
If your optical drive was a retail package, it probably came with suitable analog audio connectors, and there’s certainly no harm in connecting them. If you got an OEM drive, you may not have received the connectors. Don’t let that worry you. Even if you’re one of the Microsoft-impaired, you can still get a plugin that makes WinAmp play CDs by ripping the audio data, rather than using analog playback.
The analog audio cable can be inserted either way around; the pinouts are cunningly designed so it doesn’t matter.
Next, you want to connect the hard drive to one of the motherboard IDE connectors, and the optical drive to the other. You could put both on one IDE cable/connector, but then they would share bandwidth. Putting them on separate IDE connections means there’s at least a theoretical chance that the computer will be able to access both simultaneously—which is good, if you’re planning to rip audio from CDs and encode it to MP3.
The motherboard came with its own set of IDE cables, and retail optical drives usually come with cables too. All the cables I got were notched and color coded, so you couldn’t plug them in the wrong way around. The colored end of the IDE cable plugs into the motherboard; the connector in the middle is the slave, and the one at the other end is the master.
The final task is to plug in the hard drive and optical drive using “Molex” power connectors from the power supply. These can be pretty stiff, but they only go in one way around.

The final result has a lot of cabling in a confined space. I strongly suggest tying up the loose cabling to keep the space above the motherboard as clear as possible. This helps improve airflow, and keep the system cool.
2003-07-08
08 Jul 2003 17:00
Purchasing
I bought almost all the components from NewEgg. I’ve had no problems ordering from them, and their prices are almost always the lowest around. Even when they’re not the very cheapest for every item, they always seem to be the cheapest place you can buy everything from.
Well, almost everything. They didn’t have the M10000 in stock, so I ended up buying that from Monarch Computer Systems.
The grand total for everything, including shipping, was $538. Not bad—compared to the $479 Martian NetDrive, my system would have a much better CD drive (including CD-RW capability), more expansion space, a nicer case and a bigger hard drive, but no wireless.
A few days later the front room was full of boxes. It was time to assemble my new system…