Build a Multi-Output MP3 Server?
z80 asks: "I'm rebuilding my house and I am thinking about fitting speakers in every room of the house and pulling some massive amount of cables in the walls. I also want to control and send the output to each set of speakers from the same source, and was thinking that a PC, with 4-6 soundcards, would do the trick, and there are of course a couple of questions I have. What kind of hardware would be required to be able to stream up to six different MP3's through six soundcards at the same time ? Can it even be done? What kind of software can be used to do it? Which OS? How can it be remotely controlled? With respect to the last question, I'm thinking about mounting a couple of flat displays around the house connected to old PC's that run some sort of connection (VNC maybe) to the mp3 server." This is a topic Ask Slashdot tackled three years ago. Now, with applications like Ardour showing off the power of Open Source frameworks like JACK, it seems like building such a machine might not be as hard as it once was. For those of you who have managed to build something like this, what did you do and what hurdles did you have to navigate before things were working? How would you set up a machine to run independent audio to 4 or more rooms?
The best place for questions like this is the AV Science Forum. Lots of people doing all sorts of home-theater/home-audio projects. Look in the "Home Theater Computers" section.
There are several options for what you're looking to do these days. My brother is doing a similar thing, but he's using 802.11b for control (through Girder) and PocketPCs for remotes!
http://www.avsforum.com/avs-vb/
Hahaha you asked 'Which OS?' on /. I guess you weren't looking for an unbiased opinion :P
I got a +5, Troll
Get an M-Audio Delta 410.
It has 4 inputs, and 10 outputs.
Common sense is not so common.
One of the side effects of not having commercial drivers and applications that use the features is that you can usually get at least two channels off of a 5.1 soundcard. The front pair of speakers and the rear pair of speakers are generally treated as seperate DSPs by the audio driver. Look around for audio drivers that treat the cards this way, and when you find one get 3 cards for a total of 6 outputs. (You're looking for a card thats supported in linux, but not too-well supported. Don't forget to check alsa's list of cards)
After that, just figure out how you're going to get the controls to work.
If I have been able to see further than others, it is because I bought a pair of binoculars.
what did you do and what hurdles did you have to navigate before things were working?
My Wife.
While the idea of using several soundcards and OSS is quite sound, this is a problem which has already been solved by professional audio installers several times over, with equipment custom-tailored for this exact purpose. IMHO, you should get a professional consultation from a home theatre/automation business. The difficulty is not the soundcards or even the software, it's integrating functional control panels (with displays) into each room that will prove to be the most difficult. While you certainly *can* do this with off-the-shelf parts, the pros will always do this sort of thing better.
Good luck!
Bad idea. It's MP3... just put an MP3 player in the room and use network cable. You can buy an old Vectra (that would do this fine) for like $50. Or you can use dedicated audio widgets like the very open mp3elf.
Most command-line MP3 players (mpg123, for example) have options to specify the sound device. This would allow you to control which room the music was sent to.
CPU-wise, decoding a bunch of MP3s should be no problem at all; mpg123 typically uses only 1-2% CPU on a modern machine. I don't think you'll run into PCI bandwidth limits either (guestimate 1.4 megabits per second per output).
You may need to create your own player front-end, to select songs/playlists for each room.
or does anyone else find it strange that sometimes Slashdot editors remember a story being posted 3 years ago, yet other times post the same story twice (or more) in a single day!?!?
The Ethernut is more for a doityourselfer, the Slimp3 is existing product. They operate over ethernet which is not quite within scope for the abovementioned project, but might meet the same goals.
I haven't gotten around to either of these yet, but the Slimp3 in particular sounds quite cool.
-jbn
Yeah, you may be able to hack something together with a single PC and multiple sound cards in a few months of Sundays. But you could also just buy, off-the-shelf, as many of these dandy little things as you need. A single server can service as many of them as you'd care to stack up. They would be easy to add on as you require them, without having to run any speaker cable at all--a wireless bridge or a single CAT5 run works peachy. DHCP enabled, supports multiple server OSs (mine is off my Debian box but they have Windows or Mac installers as well), wireless remote, Web, or command line interfaces all supported.
I've only got one, but it works awesome and if I ever decide I want to put a different sound system into another room, I can just buy another module and hook it up to the same server--instant access to all the MP3s and playlists that I've already created. The sound quality is great and it take hardly any resources, either server-side or network. I highly recommend it.
No relation to Happy Monkey
Seriously, they call it Bob. It's the ZR8630AV - and he's got a sister named Glory - the ZR4630.
Glory is a 4-source, 6-output, 30 watts per channel audio distribution center. Check out http://www.nilesaudio.com/products/zr4630.html for more information.
We use these a lot where I work now, and they're slicker than snot.
"If there's hope, it lies in the proles..."
One six minute Ogg file at 256 kB/sec takes up about 10MB of space, which translates to 10 hours of music per gigabyte. At about $1/gig, a 100 GB hard drive will cost around $100, and will hold 1000 hours of music, without having to rotate anything. Figure an average of 4 minutes a file, and you're looking at 15,000 songs, compared to 19 on a CD. A 50-pack of CDs costs $17, for 34 cents, and you'll need about 789 70-minute CDs, for a total cost of $268.26.
Since the CD option costs more per-song and is more inconvenient (since you have to change the CDs every 70 minutes), I'd judge it inferior.
Sigs are like bumper stickers.
I have to admit, I'm a head-over-heels lover of my SliMP3s.
/. ticker every 15 minutes on each unit, just because I can.
The reasons you should be too:
It's platform independent, but is also really tightly integrated into your itunes/musicmatch/winamp playlists. A single server, whatever your religion, can saturate the network before the server gets bogged down. This said, I recommend a Mac server, just because iTunes is amazing, and I really don't like having to deal with Linux config when I'm not being paid to.
$200/unit, and all the playlists on your network can be streamed from one location. At 10/100 speeds, it'd take about 15-20 of the things to saturate your network, if they were all running at the same time.
All of your libraries and playlists will be shared and distributed thruout the house. Doesn't matter if you're going to a boom box with a ghetto-wired cassete adaptor. Run cat5 to the room (cheap), and choose the most suited amplification method, from powered speakers, to a MacGyvered boom box, to a proper receiver.
The company is super cool, comes out with feature updates constantly, and the server software is open source, should you choose to use the built-in Perl powered httpd server versus just using a remote.
I'm not an employee of Slim Devices, just an insanely happy customer. That's a whole lot of elegance in a small, inexpensive package.
And it plays a mean game of Tetris, gives my weather report, and does a
I program these types of systems for a living. Usually, everything I work on is HUGE. To put in in perspective, I recently finished the control system in the Chuang Residence. Alfred is very much into the latest and greatest - and had a 3 million dollar home theater put in (seats 7) as well as A/V distribuition (30 zones) throughout the house (61" HD plasma at the foot of his bed!).
So, it depends on the signal that you're routing.
Amplified: Great! it'll probably go as far as you need it. If you're going over a few hundered feet and don't care about the quality (think outdoor speakers), you'll want to look into doing with 70 volt transformers and matching speakers. (the higher voltage will drive the signal much farther, but the audio quality goes to hell). Generally with amplified signals the farther you go the quieter it gets.
Line level (non-amplified signal): Will often work just fine. Since it uses a much lower voltage it is much more succeptable to noise. The two biggest things to watch for are interference and ground loops. You get interference from power sources, running motors, wireless devices, etc. If you convert the signal to balanced it'll be less succeptable to interference (a balanced signal provides a ground reference). Small converters are available from several sources. Ground loops are caused when there is a voltage difference between the "ground" plane on either end of the wire. Often, you'll hear a slight 60 Hz hum. The PROPER way to eliminate this is to make sure all your equipment uses the same ground. If it's all on the same circuit in your house, then you're probably OK. If not, there are small inline devices to eliminate this as well. Look for "Hum Buckers" or "Electo-Optic isolators". Line level will go a suprising distance but you'll want a distribution amp to go over about a hundred feet. Keep in mind that the farther you go, the better chance of having noise problems.
Digital: Bleh! I really want this to work, but I haven't seen a successfull installation with more than 20 feet of wire! I worked one job where they tried both optical and copper but couldn't get it reliably (trying at about 75 feet of signal). When the signal degrades, the audio just goes away - not quiter or noisier. It suprises me that the optical signal won't go farther - it's light dammit! The issue seems to be that the TOSLink cables are designed around a plastic core that is easier to work with - but attenuates too much over distance. Having a device to rebuild the signal every 20 feet is problematic to say the least.
Never never never smoke crack before geometry class!
Sure, if you've got more money than brains, you could do that.
But if you're going to wireless speakers (which invariably suck because there's another stage of conversion or modulation, then transmission, then demodulation), you could simply use centrally-located older machines (ie. cheap) and use wireless keyboards or other means to remote control them.
Lots of the solutions under consideration seem to involve having VNC hosts and other junk like that. Why? I don't get it. Here's how this former professional audio technician would do it:
Remember, sound quality is dependent on the electronic quality of the sound card you're using, not on the CPU speed of the processor. Generally, if it can play an MP3 without skipping, it's fast enough. DO look for *old* Creative Labs 16-bit ISA sound cards where the output amplifiers are in 8 pin DIP packages with "LM741" on them; in under 10 minutes you can bring them to almost the sound quality of the finest $2000 CD players.
And don't do stupid things that say "I think car audio is KEWL" and run unbalanced line-level audio all over the house unnecessarily. Run Cat-5 all over the house; run the sound card outputs to the amplifier as neatly and as shortly as possible in each room.
If you do it that way and have a good quality stereo system (ie. the speakers are actually made of wood and the amp claims it's only 50W but seems to weigh over 75lbs anyway), your fidelity will be limited mostly by the quality of the MP3s you're playing.
Fire and Meat. Yummy.
I have had a house-based MP3 server running over NFS for years now... My solution has been to have a stereo near each computer that has local ethernet access, and just run the output from each computer's sound card to the stereo next to it. I have customized shell scripts for Linux, FreeBSD and Mac OS X that take the best advantage of the system's ps, mpg123 and kill programs -- if you would like a copy (and instructions for use), email me.
While this setup allows for independent songs to be played on each system (which is great for most purposes), there are times when you want to play the same song on each system -- in essence, creating a "concert" around your house. To do this, I set up Icecast on a Linux machine, gave it all of the MP3s to play, and then connect to it from each other computer via mpg123. This approach does work, but the result is less than excellent -- each connection can be timed up to a second or so off from the other ones, which creates a really weird echo effect in the house. While this can be fun for a little while (standing between two stereos you get a "live" effect from studio material), it gets old real quick.
My proposed solution to this would be find a low-power FM transmitter that you can hook up to one machine -- play MP3s from a soundcard into the FM transmitter, then tune each other stereo to the FM frequency that the transmitter is using. I must admit that I haven't tried this, so I don't know how well it would work -- I do know that the signal would sound synchronized because radio waves travel at the speed of light. I know that Griffin Technology makes the iTrip, which is an FM transmitter specifically made for Apple's iPod. It claims to only have a 10-30 foot range though (limited by FCC regulations), so I'm not sure how well it would work. I'm sure there's a company or two out there that makes a low-power FM transmitter that would work well on any output source, in any situation.
Slashdot's first reaction to VMware
We used a PII 400 and got a very reliable 5 output stream box using a multi-output card that isn't manufactured any longer. I tried a number of these cards and most of them worked well. [ As an aside, the MOTU high-end units are excellent if you are going to put the output into high-quality amps and speakers, but they are expensive.]
From the software side, we used a custom, multi-threaded MP3 player compiled using Intel's optimizing compilers (which mad a huge difference on the PII) and used a graphical front end with a screen-per-room display showing the album art (scanned in by the user or installer) along with the tracks, play lists, etc.
We did run into a control problem, even though most of our customers were using systems with centrally located gear, which was that getting a PC to run with multiple distinct (and user-uninterruptable) displays simultaneously was expensive and difficult. To supplement this, we created a serial-based interface which allowed for play lists, random play, and basic start/stop/skip controls for each room and could be combined with the GUI over a commercial home control system (like Crestron or AMX).
Basically, we would watch the serial port for commands and respond to the control system by flipping individual windows that corresponded to the room that was controlling the system at the time. The control system, in turn, would put show the screen output in a kind of touch screen mode and send mouse locations over the serial port back to our controller. This worked, but was expensive and complex to handle, since only one room could have control over the GUI at the time. For things like displaying the playing tracks and album along with the next track and providing basic control of the start/stop/skip/repeat sequences, we could send text to the control system over the serial port and it would be displayed on the screen in text fields (allowing the main display to be required only for play-list management). This helped quite a bit.
The control piece was far and away the most difficult part of the project, but since you only have to satisfy yourself, and not the marketplace, I'd suggest that you might find an 802.11-capable PDA as a controller might be useful (and fun to work on). Of course, then you have to either develop your own control protocol or use some kind of CGI and a web server to do the control, but if you separate the players into individual threads or processes that can be easily located, you should be able to send messages (UNIX signals, perhaps) to them and get the level of control that you need.
From a technical perspective, any OS that has preemptive threading and good interprocess communication should be fine for building this kind of system. We found that by creating our own player (despite the need to license the decode patent from Fraunhofer if we were to sell it commercially), we were able to get a finer control of the playback features (such as pause/skip/repeat) than by using single-shot mp3 play commands that were available at the time. I'd suggest looking for how you can get those useful features if you decide to use existing commands in a Linux environment.
Of course, on a Macintosh, you can do the playback through QuickTime, which is going to be easy and highly-controllable, so you have that oppotunity too.
In the end, we found that the customers who got it loved it, but that the installers we were trying to sell to weren't interested in buying a product that required some set-up.
O