- HOME
- ▸ recipes
- ▸ security
- ▸ 59301408
- ▸ Build an MP3 Music Server
Build an MP3 Music Server
A media server is good for office morale. By offering CD-quality sound and a wide range of other uses, your MP3 server can be the answer to workplace "ear pollution" brought about by canned music, endlessly repeating CDs, and piped-in radio stations. Also, having access to organized media content not only makes that content easier to maintain, but can also transform your client's workplace into an impressive, media-rich environment. Good use of media can also reduce both training costs and support/sales efforts. Best of all, a media server can serve-up the music your clients want, the way they want to hear it.
In this Recipe, I'll show you how to build a PC designed to serve up MP3 files. I'll also use it to illustrate the basics of media serving. Because I appreciate the benefits of reuse, I'll also tell you how to repurpose a white-box PC as a media server. Along the way, I will introduce you to some amazing software and strategies to plan your media server and organize your content. I'll also offer insights into how some creative companies are using their media servers to create a media-rich, hip work environment.
How It Works
The availability of rich media content, increased network bandwidth, and efficient Web-based applications make it possible -- even easy -- to offer media content almost anywhere. Audio and video files are now streaming into homes and offices, traveling across the Internet and on local LANs, finding their destinations to deliver sights and sounds of amazing quality.
The way we think about media is changing. The premier example: MP3, short for MPEG Layer 3. Thanks to MP3, much music is now stored as data. Advances in compression methods, popularly called "ripping," have drastically reduced the size of an audio file, while maintaining close-to-original-CD quality. In fact, MP3 is so successful, the commercial availability of MP3 music files (and the marketing machines that deliver them) is quickly replacing other traditional forms of music buying and listening.
MP3 files are convenient. They can be downloaded from a central site, sent as e-mail attachments, stored in portable players, or played on a PC by applications called, appropriately enough, MP3 players. Popular MP3 player applications include Windows Media Player and WinAmp .
A final component: Web technology, which is more convenient and faster than downloading. Web tech provides a means to stream high-quality MP3 files (and other media file types) from media servers to their destinations.
Five Fundamental Facts About Media Serving
Before I show you how to build an MP2 Media Server, we need to establish the basic concepts of media serving. Here are five concepts you should know before you start building your media server:
- Media files can be large-- sometimes very large: A typical pop song takes up 40 MB or more in CD Audio (CDA) format, which is used on many commercial music CDs. Fortunately, MP3's average compression rate is 10:1. This means the average song file will be reduced to about 5 MB. While that's an improvement, 5 MB is still pretty large, especially when you consider that a typical media server will store not just one song file, but many.
- Different encoding methods will yield different file sizes and quality, as shown in the table below:
- Song Length
- CDA File Size
- MP3 at 128 Kbps
- MP3 at 192 Kbps
- 2 min., 24 sec.
- 24 MB
- 2.2 MB
- 3.3 MB
- 3 min., 51 sec.
- 39 MB
- 3.5 MB
- 5.3 MB
- 4 min., 16 sec.
- 43 MB
- 3.9 MB
- 5.9 MB
- To be useful, a collection of media files must be organized: Server software provides a repository for media files that can be organized for on-demand access. A central repository also reduces the duplication and confusion that occurs when users download and store multiple copies of the same media file.
- Media content requires real-time delivery: Unlike other file types, audio and video content suffer noticeable dropouts or pops and clicks if the flow of data is interrupted. To avoid this, media servers must supply a constant stream of data. Besides good old HTTP, more advanced server software can also take advantage of special protocols like RTSP (Real Time Streaming Protocol) and RTP/RTCP (Real-Time Transport Protocol/Real-Time Transport Control Protocol) to move files that require real-time delivery more efficiently.
- Servers can use delivery techniques like streaming: When MP3s are streamed, the listener doesn't need to wait for the download to complete; instead, the tune starts to play as soon as the first bits of playable information are passed from server to client. As the song plays, more data continues to arrive just before it needs to be played. Then, when one song finishes playing, the server begins to send the next song on a play list. In this way, each new song is ready to play as soon as the previous song finishes.
- Server software provides flexibility: Software residing on a media server can broadcast music on an office LAN to local PCs, effectively creating an in-company radio station. It can also service listeners throughout a facility using their favorite players, "skins" (decorative graphics for the player), and play lists. Finally, media-server software can act as a central jukebox that plays either selections weighted by users' votes or randomized selections.
A media server can serve up many types of media files, not just MP3 audio files. I've listed the more popular ones below, along with their filename extensions and brief descriptions:
Server Hardware
For this recipe, I'll follow the same good server-building practices you've seen in other TechBuilder articles. I'll also keep an eye toward saving money with careful parts selection.
For any build project, the primary consideration is the purpose for which the box will be used. This server has the job of acting as a secondary media server to support streaming MP3 music files around an office, with, perhaps, some Web-serving duties, too. For a larger operation, consider more memory, disks with as much cache as possible, and RAID arrays to support faster disk access. But for our purposes, we simply want to hear some good tunes, have them available anywhere we are working, and be able to get to them with relative ease.
The parts list below contains my choices for hardware and, in some cases, alternatives. In each case, I've briefly explained my reasoning and the component's approximate cost:
Pentium 4 2.4GHz.
865GBF/PERL
KVR400X64C3A/256
LTR-52327S
WD2500JD
Want to use an existing PC as your media server? It's a good idea if you or your client has a PC that fits the bill. Here are some issues to consider:
- Form factor: For our reuse purposes, a bigger box is better. Hopefully, your client won't need to touch their media server hardware often. But when they do, a physically larger box will mean easier access, better cooling, and more room to add disk when required. Also, larger fans provide better cooling, and operate more quietly, than compact units.
- LAN speed: To qualify for reuse in this application, the PC-based server's network interface should be as fast as your client's network will support. 100Mbit/sec. is common and adequate.
- Disk capacity: While you may be able to add a new disk to an older system, some older machines may not be able to address drives over 120 MB. Should you encounter this problem, check to see if a BIOS update will help. Also, make sure the IDE cables support the fastest transfer rate your disks can attain. Older IDE cables can slow down your new disk.
- Consider RAID (redundant array of inexpensive disks) to achieve higher server performance, increase disk space, or provide redundancy. For server use, the best choices are RAID levels 0, 1, and 5. The Intel motherboards I used for this Recipe do supprt RAID, but older motherboards may require a RAID PCI card. The faster speeds and improved reliability you can achieve with RAID make this technology well worth whatever additional time and expense may be involved.
- System Memory: Make sure your server has at least 256 MB of the fastest memory your system will support. You'll need even more if you expect the server to be busy. Check the motherboard manufacturer's Web site and manual for details.
- Cooling: Cooling is critical for all PCs, but especially important for a media center. Long, repeated disk accesses really heat up a box. So make sure your fans are clean, clear, and operating up to speed. Also, since servers are frequently housed in closets, make sure the close is well ventilated. If necessary, add vents to circulate cooler air from outside the closet. But don't get carried away and vent in outside air; that can be dangerous to your equipment during especially hot and humid summer weather.
- My landlord may not like it, but I've even trimmed closet doors slightly at the top and bottom to increase air circulation and decrease the "oven effect" of heat build-up. Also, if your closet has become a machine room for more than one PC, consider installing a bathroom-type exhaust fan to force heat out of the room and draw in cooler air from other rooms. Finally, train your clients to switch off the monitor in the closet whenever it's not needed.
The Right Software
You'll need just two major components of server software: the OS and the serving application itself. The Linux vs. Windows server debate is still very much one of culture. If you're comfortable with Xandros, Fedora, or Mandrake, then Linux is a fine choice. If not, then Microsoft Windows2000/2003 Professional, configured with NTFS, offers all the professional server features you'll need. Windows XP is an affordable choice for simple server operations, too. The important point is to choose an OS you will be comfortable supporting.
Next is media server software. For this recipe, I've selected a server-software product called Andromeda. I like both its ease of use and its unique ability to organize media (and other) files for easy access. Also, Andromeda works with both Linux-based and Microsoft OSes. Through an existing Web server, Andromeda creates Web pages based on directories of media files. The price you pay for Andromeda will be based on whether you will use it for personal, community, or business applications.
There are plenty of other server products, many of which offer more advanced serving and broadcasting of media files. The following list offers a selection along with a brief description of each:
Putting It All Together
With all your server builds, you'll want to follow good assembly and configuration practices. There are several excellent articles in the TechBuilder collection to help you, including Building a World-Beating Web Server . Good server-building practices translate into a solid media server that is always available and easy to maintain.
- Assemble Components: For hardware, the major server issues are access to data and cooling, so we chose fast, efficient disks with large cache and housed them in an efficiently designed case for optimal cooling. Also, install disks with optimal cooling in mind. Consider using every other bay until you run out of space. A highly integrated motherboard minimizes the assembly work here, as well as heat potential of additional PCI cards.
- Install OS: Set up disk partitions so that the OS is on a partition by itself. In this way, data streams will not be interrupted by calls to the OS. Eliminate excessive drain on CPU and memory by turning off all unnecessary features in BIOS and turn down unwanted start-up or background processes.
- Consider Security: Different OSes present different security issues. Whatever OS you work with, make sure you have the most recent patches. You'll want to make use of your OS's Firewall protection and turn off protocols like standard FTP and Telnet in favor of SSH or similar secure shell tools.
- Install Media Serving Sofware: Here is the procedure we used to install and try out Andromeda:
- 1). Download the single PHP or ASP script from the Andromeda . (A trial version is available.)
- 2). Make a directory under your Web server for the Andromeda software and your media content. (By default Andromeda looks in and below its install directory for content.)
- 3). Copy the andromeda,php script to your new directory. For Linux, remember to check/change permissions on the directory and the script.
- 4). Copy some MP3 files to your new directory. You can direct Andromeda to point to other directories, as well.
- 5). Point a Web browser to andromeda.php at your web site. Your MP3's will appear nicely organized and ready to be streamed to you individually, by directory, or with a playlist.
Once set-up, a file called andromedaPrefs.txt can be added to change how Andromeda works and how content is displayed. Different "skins" are also available free from the Andromeda site to change its look and feel.
With its one, all-inclusive PHP script, Andromeda is easy to install and configure. Its strong points are the ability to organize your MP3 content and display them for easy access. It also does a nice job of building Web pages of whatever media content you dump into your directories. And it's easily adaptable for a more sophisticated look. Have a look at electro-harmonix, a commercial site built solely with Andromeda.
Double Duty
Can your new server perform other services? While it's true that any processes not essential for server operations can negatively impact server performance, the answer ultimately depends on your client's environment. A lightly loaded media server can also be used as an occasional or light-duty workstation, or as a print server. A well-stocked media server can also be configured to work with a company's Web server to serve up sales presentations, educational materials, and training content. While providing a central source of music programming for waiting rooms and common areas, the server can even be the source of music for on-hold telephone calls.
One company we know has created its own "mock" commercials and has recorded their popular office manager introducing songs like a professional disc jockey. When customers call the company, they hear this, mixed together with programmed music content. A familiar voice at "My Company Radio" introduces them to new products and services. It's a unique way to get and keep customers.
Liven-up your surroundings! A soundcard in either the server or a client PC can be used to supply high-fidelity music programming for waiting rooms and other common areas. An audio cable is needed to connect the jack on the sound card (marked "line out") to the input of an amplifier. The amp, in turn, gets connected to speakers installed on the wall or ceiling.
Now that you have your own media server, why not have play lists for each day tailored your moods: maybe, start the day off with something light and save that high-energy music for making it through the long afternoons? Holidays, naturally, would have their own play lists. Why not create a special "TGIF" song-block just for Friday? With a new MP3 and media server, your clients are in control.
ANDY MCDONOUGH is a professional musician, composer, voice actor, engineer, and educator happily freelancing in New Jersey. He enjoys listening to his collection of jazz MP3s.
