Recommended Hardware for Streaming MP3 Radio Stations?
Silent Node asks: "I am involved with a campus radio station where the web-site, e-mail, and pretty much everything else are hosted by third parties. In the interests of both cost savings, and control, we're considering purchasing our own server, and handling things directly.
Aside from hosting a nothing-too-wild web site, this server would also have to hadle about two-dozen Email accounts, a couple mailing lists, and...streaming audio. I have experience administrating Windows NT, which is why I don't want to use it for this many things on one box. Our consideration is to perhaps get a G4 and run Linux on it. I have a few questions related to this... Would it be 'easier' just to run x86 Linux? What sort of minimum specs would a server like this need (remember, being listener funded, price is a big deal)? What streaming media sofware choices would we have (MP3 streams would be prefferable, due to the wide distribution of players)? Do you forsee any 'hang-ups' I haven't mentioned (i.e.: is this even practical)?"
The major problem with the G4 is that LinuxPPC won't run on it yet. Soon, but not just yet.
Even when it does, I doubt AltiVec support is going to be in GCC for at least another year, and probably more like two, although now that Apple uses GCC to compile OSX it's quite possible that they'll contribute Velocity support themselves rather than wait for it to come "naturally." And they will contribute it if they write it; Steve Jobs is still reeling from his last skirmish with the FSF and I don't think he's willing to try closing modifications to GCC again.
This said, Icecast seems to be the way to go for a streaming server. QuickTime is your other major option, and while it works quite well there's the problem of the fact that there is no Linux QuickTime Streaming player, so you'll cut off a portion of your audience.
What I find off here is that no one has mentioned bandwidth, which is just as important as processor power. You probably already have significant bandwidth because of the Webserver, but you might want a separate connection for the new one (getting a 10Base-T on campus shouldn't be hard at all; of you're lucky you might be able to get 100Base-T). The college itself should have adequate bandwidth for your needs.
The gogo encoder is in the FreeBSD ports collection. A fine Japanese contribution by the way. This is from the Description
gogo, 'Gogo no coder' (which means 'afternoon coder'), is a very fast MP3 encoder based on lame-3.23 which is optimized for MMX, K6-2 3DNow! and Intel PentiumIII SSE. The latter is available when FreeBSD supports SSE. (Linux supports it.)
*** DON'T OVERCLOCK YOUR K6-2 ***
Gogo heavily uses the 3DNow! unit that almost is asleep usual, and the CPU becomes very hot even in normal clock. So overclock may cause serious internal errors or crazy results. Also, this may be same on PentiumIII.
You can download it from here. Other related interesting stuff like icecast , vic and vat has been ported to FreeBSD.
Feel free to try.
Hope this helps!
--
Why is it that slashdotters seem to ignore the fact that Mac OS X server has been out for some time now, and it's quite possible to buy Macs off the shelf with it preinstalled? I think that the G4 servers running Mac OS X server would be very nice for this job. A great combination of a good operating system and top notch hardware.
The prices shown on this page are not the edu prices, either.
A G4 probably is a bit of overkill, if you're streaming pre-compressed mp3's (which I assume you are), RAM is a lot more important than CPU. a PII -400 is enough to handle at least 600 simultaneous connections, as long as you have enough RAM (which would probably be 512MB to be safe). But if you want my advice, buy a nice layer-4 switch and have it do load balancing for you, and then have a series of celerons with 128-256MB RAM each, and if you ever need more power, you just plug another machine into the switch.
Here's a few things to check out-
1) Go to www.icecast.org and use their GPL'd icecast and liveice software to do the broadcasting.
2) The server horsepower depends on a few things: how many streams you want to run, are the streams mono or stereo and what encoder do you plan to use. Note that if you want to use one of the free encoders (such as LAME or one of it's patched versions), you won't be able to stream at less than 28.8kbps - you will need the Xing encoder at $19.95 or the Freanhoffer (?) at major $$. Note that the Xing uses MMX, which will give you a better encoding at the same CPU level, or a similar level of encoding quality at a lower CPU level.
3) If you use the Xing encoder, you'll need to patch the icecast software to work around a problem with the Xing encoder. It's a small, minor change that makes a big difference.
4) It doesn't make sense to run a high bit rate encoding if your listeners can't receive it. Don't encode a 28.8k signal for users unless they are using a minimum 56k modem. If they're using 28.8/33.6 modems, encode at 16k so they don't drop frames.
To give you an idea, I set up an MP3 broadcast for a local minor league baseball team over the summer. I pulled the signal in from the local AM radio station (mono only) to my sound card's headphone jack. Liveice grabbed the input and passed it on to Xing. Xing encoded it and then icecast broadcasted it. The hardware I used was:
Cyrix 200MX (o/c'd to pr-266) (Xing's MMX support made this work, otherwise go with AMD/Intel)
32 MB Ram
AWE 32 sound card
4.3 GB IDE hard drive
Xing encoder
NE2k clone
I streamed a 32k/44200 mono and a 16k/22100 mono signal at a CPU level of ~35%. This system was rock stable and managed easily. I set up a cron job to fire up just before the pregame program started, and stopped recording 4.5 hours later. I then moved a 'taped' version of the game over to a directory I set up for my web site so people who missed the game can download on demand and listen.