Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Music Media

Streaming MP3 For Linux Server Guide 53

A reader writes: " Does Howard Stern boil your bacon? Do you wish there was a station that only played songs by the Bouncing Souls? After reading this guide, you can show the world that Howie ain't got game, and that songs about soccer(football) are where it's at. The purpose of this document is to describe the process of using Linux-based tools to setup a server used for streaming MP3 data. Find out how to setup your own with this full guide"
This discussion has been archived. No new comments can be posted.

Streaming MP3 For Linux Server Guide

Comments Filter:
  • um,

    ./configure --reconnect=auto

  • I know this isn't exactly on topic.... But maybe someone here will know.

    I have a server colocated on a nice fat pipe. The only problem is, I'm stuck on a dial up. I've been wondering if anyone knows of a way to do MP3 streaming like the article talks about except have the source data coming from another MP3 stream? The reason is I want to be able to listen to some of the various MP3 stations out there, but as more and more people get cable/DSL/etc, I find that the streams are greater than my bandwidth will allow for. I figured a good solution would be to just stream it through my remote server and downgrade the quality a bit so I can tune in.

    Suggestions?

    Thanks!
  • MP3 streams are already compressed. The MP3 system is your basic spectral transform-quantize-encode system. To compress the streams, re-encode them at a lower bitrate with an MP3 encoder designed for this (e.g. Fraunhofer).

    (LAME is still illegal in the United States [mp3licensing.com]).
    Tetris on drugs, NES music, and GNOME vs. KDE Bingo [pineight.com].
  • Make sure you obey the DMCA Broadcast Rules [myplay.com]... "A mix cannot contain more than three tracks from the same album in a three-hour period". Then again, if you're willing to follow the DMCA, just post your mix up on myplay [myplay.com].
  • I hadn't tried eBay, I was more concerned with what I could pick up in relative volume locally. Also, it's not only the cost of the machine as much as the hard drive (need a large, relatively new one) and sound card (can't skimp too much there). The dollars and cents of it are that you need to have your selling price come in under $300 (CDN) for it to make economic sense to this particular market. I've been meaning to try a DX4/100 to see if they were fast enough -- unfortunately I have to buy one as a proof-of-concept and I've been sluggish to fork over the dough.
  • I don't know about USA, but from what I remember about Canada's SOCAN fee structure for radio stations it is fairly reasonable. This is going back a few years but I think SOCAN wanted 1-2% of the radio station's operating budget for licensing.

    Working at a community radio station with an annual budget of about $120,000 we were able to get away with throwing a few thousand bucks SOCAN's way and playing whatever we wanted.

    Do web sites w/streaming audio work like this? If so, is there a lower limit on what is to be paid? It seems to me a non-profit organization could run pretty cheap and keep fees to a minimum.

    Or was it only OK because we were broadcasting analog signal?
  • First of all, I'd like to say that the user comments on this article have been atrocious. Yeah, I'm going to get flamed for this, but hell, this whole thread has been nothing but "WTF is Slashdot posting HOWTOs", but not a real discussion. Email the people that run the site if you're really that pissed off.

    Anyway....

    I've had a question for a while, but wondered if anyone here knew any details. If I stream in an "Internet Radio" type situation, do the same rules that apply for radio apply for Internet streaming? For example, let's say I start an Internet radio station, I play music, sell advertising, etc. Do I still have to track songs and pay royalties? When I worked at a radio station, we had to track what we played on a computer or on paper, and the station paid royalties on it. Anyway, just curious if anyone had any insight on this.
  • Apache::MP3 [perldoc.com] allows for directory listings, playlists and shuffled play. Why be a radio station? We already have thousands if not millions of these. On-demand, baby, on-demand.
  • I have a really big MP3 collection (more than 15GB of all my own stuff, ripped from my CDs). I spend a LOT of time on the road, generally with either a broadband or V.90 connection, and it isn't feasible/possible to bring all my music with me wherever I go. Rather, they are sitting on a server in my home office.

    As I'm not a coder, I would pay serious cash for someone to write a Web interface to my MP3s that would present a dynamically-generated list of all of the several thousand MP3s (broken into several pages), with checkboxes next to each MP3 listed. I'd check the boxes of all the ones I wanted to listen to, and click Submit. It would then make the playlist on the fly from that submission, and fire up a streaming server with that playlist. I'd then point Winamp to it, and I'd have ALL of the MP3s I want to listen to, and NONE that I don't, streamed to me wherever I am.

    (I'd put some sort of access protection on the stream, to make sure [a] I get all the bandwidth, and [b] so RIAA can't sue me.)

    Better yet, does something like this already exist? Am I the only one that wants something like this?

    --
  • Another tool that you can use to stream MP3 via multicast (using the open standard RTP/RTCP protocol) is "liveCaster [live.com]". This tool can take its MP3 input either from files, or from a HTTP stream (e.g., one from icecast/shoutcast).

    One benefit over "Obsequium" is that liveCaster implements RTCP (RTP's companion status reporting protocol), and (optionally) sends SDP announcements for its session. liveCaster also optionally supports an alternative, more loss-tolerant payload format [live.com].

    liveCaster (and the RTP plugin for Winamp [live.com]) is built from the Open Source "LIVE.COM Streaming Media [sourceforge.net]" library.

  • by Robotech_Master ( 14247 ) on Saturday December 23, 2000 @04:40PM (#541739) Homepage Journal
    There's a fellow working on a simplified streaming MP3 webserver, at mp3mystic.com [mp3mystic.com]. It generates .m3u files on the fly for files I want to play, then streams them for me--sort of like my own personal MyPlay [myplay.com]. I've been trying it out, and it works pretty well for letting me access the files I want to, when I want to, from where I want to. When I'm running Windows, anyway.

    I'd love to know how I could do something similar with Apache for when I'm in Linux instead.
    --

  • *YES* In Canada you deal with SOCAN. In the United States you have the pleasure of dealing with ASCAP, BMI and SESAC. Write up those playlists, pay those royalties..
  • by sheldon ( 2322 ) on Saturday December 23, 2000 @12:31PM (#541741)
    This guide has a copyright:

    "This document is copyright © 2000-2001 by Ray. You are encouraged to redistribute it. However you may not modify this document, if you intend to redistribute it in any manner."

    Why can't I modify it?

    What if someone introduces some new utility in the future which makes this job even easier? What if it's in error? Should I redistribute a faulty document?

    Apparently, all of the Linuxlookup guides are copyrighted in this fashion.

    Interestingly Linuxlookup.com doesn't quite buy into the whole Open Source thing, at least not when it comes to their creations.

  • Don't waste your time w/ a DX4/100. I've got an AMD 486/133 and it has trouble w/most mp3's in stereo at 44Hz. Mono is fine, but that's not what you're looking for.

  • Not only didn't he look at shoutcast, he didn't look at javashout (which sucks btw), he forgot to mention that shout-8.0 has timing bugs when working with icecast, read the phorum at icecast.org if you don't belive me. As far as i know, the only version of shout that doesn't fuck up is shout 0.4.1.

    He doesn't talk about tons of freakin weird features in icecast, or the advangates of shoutcast. for instance, icecast can't do meta streaming correctly (track title info). i've never seen it list on shoutcast.com correctly. it's own meta streaming protocol is not supported. shoutcast has a much better web interface, it also scales better. it generates usagfe charts (i think).

    He doesn't talk about how to relay your stream from live365, he doesn't talk about listing on shoutcast.com. lots and lots of crap. damit, i should write my own freakin FAQ.

    btw: this is Justin Frankel writer of Winamp i'm replying to, right?

    -Jon
  • you *could* do this with out programming by using something like pc-anywhere and seting up your winamp playlist. from winamp you can easly stream the station out. just go to shoutcast.com and figure it out. it shouldn't take more then a few hours to get something working if you have some clue about computers.

    you'll want to use a really crappy bitrate, like 24kbits, which will sound like am-radio. it's a shame you couldn't use something like MSAudio for that, as it sounds much better at lower bitrates.

    you *could* also do something much more elaberate with unix, php, icecast, etc.. however the biggest problem i see is re-encoding the mp3s on the fly to something like 24kbit, i think the new version of icecast does handle this, but i can't say for sure, in any account any support it would have would be flaky, and probably pipe through lame of something (lame is not a mp3 encoder, lame)

    -Jon
  • As I said, it does use the Real Player plugin. There is a Unix version available [real.com], but I don't know if it will work with Linux. I'm actually going to be taking my second stab at running Linux over the holidays, so needless to say I don't have enough experience to tell you whether or not it will work.

    - Stealth Dave
    --

  • by Weezul ( 52464 ) on Saturday December 23, 2000 @12:37PM (#541746)
    Unfortunatly, P2P is not really the same as radio. Lissining to radio means that you *want* a DJ to chose the songs for you. The truth is that there are fundamentally three parties involved in the music lissening process: the data provider, the DJ, and the lissener. These parties may be devided up in many diffrent ways. Examples:

    1) "Data provider == DJ == Lissener" is the traditional mp3 and CD system.

    2) "Data provider == DJ != Lissener" is the trditional radio system.

    3) "Data provider != DJ == Lissener" is the fast download system you are describing.

    4) "Data provider == Lissener != DJ" is the system used by my artificial intelegence based mp3 player Smartplay [gtf.org]. It only playes songs from your drive, but it uses a simple AI to guess your mood and it had a more efficent user interface to help keep you from waisting a lot of time skipping songs.

    Anyway, there is really nothing keeping us from a "Data provider != DJ != Lissener" system. This would mean that the DJs would broadcast URLs and mixing instructions, but not necissarily the mp3 data it's self, and the download sites would wait for a significant portion of the lisseners to login before starting the multicast download of the song. The point is that you would not need to have a lot of bandwidth to be a DJ and the lisseners computer can hack together the playlists from multiple DJs to allow for even greater variety.

    I tend to think that a hybrid of the "Data provider != Lissener != DJ" and the artivifial intelegence selection of DJs (ala smartplay's selection of songs, but for whole DJs instead---based on what they were plaing right now and your mood) would be the very best solution.

    Jeff
  • Let me get this straight: You have a main computer you can set up to play continuously. You want to run a cable from it to your stereo, where you will decode this audio when you want it. You will not have the capability of selecting songs, etc. from the stereo, just of opting to play what is being broadcast.

    Wouldn't it be a lot easier just to run a piece of wire from the output of the computer's sound card to the aux input of the stereo? Seems like this would give you the same functionality.

    You could even dispense with a wire. Radio Quack has a little 2.4 GHz transmitter/receiver pair for this purpose (also handles video, but I just don't use this capability). You can also get low power stereo FM transmitter kits, if you feel handy with a soldering iron, but the good ones cost about the same as the 2.4 GHz preassembled solution.

    If the second computer has no effective user interface w/r/t the music then it is entirely redundant. Why use a computer when a piece of wire will do the same job?

  • well i couldn't find a 24/7 metalica station at live365 [live365.com], but i did find 150 stations that play metalica here [live365.com]

    -Jon
  • I actually did use shoutcast, and it DID use quite a few more resources than icecast. I was using shoucast for over 6 months and since I decided I wanted to actually do other things with that machine I tried my alternatives.
  • > I couldn't get the 486 to decode the MP3s fast enough

    I believe the streaming server doesn't have to encode anything.

  • I never had a single problem with my mp3 streams coming up choppy, so I never said anything. I have had my icecast stream running(using Shout) very excellentatiously since October, without a single problem. The guide never claimed to be an end all solution. Just a start. You readers are like a pack of wild dogs, but I guess thats what I like about you. Keep up the good work!:) ps - I hope you guys don't think I'm mad. I'm just playin'
  • by booch ( 4157 )
    Where does the MP3 get decompressed then? On the client? That doesn't seem right, but what the hell do I know.

    Yes. You want to make the stream as small as possible to allow it to travel over the network taking as little bandwidth as possible. So the stream is encoded by the server and decoded by the client. Generally the stream is made up of pre-encoded MP3 files, because encoding is more compute-intensive than decoding, and a 486 couldn't handle that. Basically, all streaming servers do is read from disk and write to a network pipe.

  • Darn it, now you've gone and confused me again. :)

    Where does the MP3 get decompressed then? On the client? That doesn't seem right, but what the hell do I know.
  • er... yeah. Good point. I'm considering the modified lrp solution for the following (admittedly feeble) reasons:

    1) Geek factor. 'Nuff said.

    2) I'm concerned that the sound quality (already down to mp3 levels) might degrade over a 30-foot cable, especially when coming out the back of a soundblaster.

    3) My original idea was a webradio receiver (before I nixed the interface). I'm still kicking around some possible tiny interfaces, say an LCD display and a mouse to cycle through preprogrammed 'stations'. Failing that (and that's pushing my technical skills), I could always boot from different floppies to get different stations, or ssh in and change the station manually. Heck, I could even put a PalmPilot cradle there and work something out.

    4) Just looking for some experience developing a linux-based appliance.

    I do like your 2.4GHz transmitter idea. I'll price them - thanks!
  • by Eloquence ( 144160 ) on Saturday December 23, 2000 @08:52AM (#541755)
    Note that the copyright situation for streaming MP3s is not much different than for serving them directly. (After all, it is no problem to capture the bitstream and save it.) So unless you're paying royalties or serving only free MP3s, you might as well run a decent MP3 FTP or webserver, or fire up Napster or the P2P sharing application of your choice [infoanarchy.org].

    Napster can be used like a streaming audio directory if you have enough bandwidth and find users with the right speed. I have played a lot of songs while d/ling them. Pretty cool: 1) Search any song you like, 2) find fastest location, 3) play live. For maximum speed, Kazaa [kazaa.com] is quite cool, it bundles downloads from several locations to achieve higher speeds.

    --

  • This was a good article, but when I had tried to set up an mp3 server, if I didn't compress the streams, they were very choppy. Unless you have an OC3 or whatever, you need to compress them.

    I found a guide here [linuxdoc.org] that shows how.

  • There is a very similar effort for BeOS that has culminated in beosradio

    http://www.beosradio.com

    It is done using SoundPlay, an MP3 player for BeOS and some plugins for streaming.

  • Ok guys, I'm the webmaster of a french webradio (http://www.bide-et-musique.com). Since the last 6 months I've been batteling with all the programs I found to make a good webradio under linux.

    This was really really hard getting something good.

    First I tried icecast, as an open source believer this was my first choice. Believe me I've tried everything, but this is a lot of trouble if you want to stream the name of the song too. The main problem is that if the listener gets out of sync, he won't be able to reconnect correctly automatically. This is VERY VERY annoying and makes icecast practically unusable on my setup. Perhaps I did something wrong, but I never had an answer to my pledges for help to the authors.

    So I'm stuck using shoutcasts server, and believe me this is really sad for me, because some of icecast features where relly nice for me, like multiple streams in the same server.

    Ok after the server you'll want to have some interactivity with the listener, this is where the stream program shows. I was not satisfied with what I found on the net (and I tried everything). So I ended up using libshout, which is GREAT, really. You've got like 5 functions, and it works incredibly good. My streams are up now since 3 weeks, with no problems, no mem leaks, no nothing.

    So for me a good setup for interactive streaming is : shoutcast (unless icecast is fixed, then icecast is 100% the best choice), libshout and some little programming skill, a database for the streaming program to get the files from and of course a nice web site. Those understanding french will see that my site is really interactive.

    Of course you'll have to pay RIAA/ SACEM (france)/ whatever hellish company if your country, but that's another story 8(

    J-F Mammet
    bidemaster@bide-et-musique.com
  • I wonder what Bill Hicks would think of a 24/7 stream of his material?

    (Yes, I know, off-topic, sorta.)

    -=-
  • I've been running and tweaking it for the better part of 2000 (this IS old news). Be prepared to get your hands very dirty - icecast needs more people working on it; updates are painfully slow and insignificant, and most importantly the support is BRUTAL (just look at the messageboards and count the number of unanswered questions - you will find they are in the majority). Until there's more people using it and helping out others, you're pretty much on your own. Also be prepared for dropped connections, messy mountpoints and troubles getting your stream listed on some [*cough*shoutcast*cough*] yp directory servers. I'll use it and support it as long as I can - but it is not for the faint of heart - CVS and your coding skills will come in very handy.
  • I've had icecast working fine for a long time now... it's clunky, but it works. Now I want a practical way to stream mp3's to my stereo downstairs.

    Here's what I'm thinking - take a basic 'distribution' from the Linux Router Project, strip out most of the networking, add mpg123 and set it to start playing the stream at startup. Then run Cat5 cable from my study to the living room.

    The idea is that I could stream mp3's continuously from my main computer, and just power up the one in my stereo cabinet when I wanted to hear the stream. Because it's LRP-based, it runs from a write-protected floppy - I can just power it off when I'm done with it.

    Any thoughts from the crowd? Am I way off base here? I want an appliance, and LRP seems to be the closest thing to it. I'm looking at using a 486-66, but if it lacks the horsepower to decode the stream, I have a 486-120 available. I'd love to hear what Slashdotters think of this - if I'm way off base, you could save me a lot of time experimenting....

  • Here is a project that is putting a streaming server onto a floppy distribution [rimboy.com]. It's alpha right now, but kind of cool that you can run such a thing off of a floppy disk and a 486.
  • surely bill nye would be down with the stealthdaverocks radio station...

    just out of curiousity.. does this work with linux?
    thanks john

    use LaTeX? want an online reference manager that
  • Uhh no.. the shoutcast server does no such transcoding either.. i.e. you can use shout with shoutcast server if you want to.. -Justin
  • There are some services already existing that allow you to do this. Specifically, take a look at the Soundbooth [wallofsound.com] at Wall of Sound [go.com], an offering from the Walt Disney Internet Group [wdig.com] (formerly GO.com [go.com]). It has a very cool interface which allows you to choose what types of songs to play on your station, as well as being able to choose specific artists and songs to be played. You can also choose how often these are played when you set them up AND on-the-fly as they are playing.

    The bad part is that the player runs off of Real Player [real.com] which has problems with Netscape 4.x (I haven't tried NS6/Mozilla with this yet, although that's my preferred browser these days). But it is still very cool!

    Disclaimer:
    For those of you who may not have guessed this already, I do work for the Walt Disney Internet Group, albeit in a completely different division (and building for that matter) than Wall of Sound. But that doesn't make it any less cool! Almost everyone in our department uses it instead of downloading MP3s or listening to CDs. If you like modern rock and classic rock, check the StealthDaveRocks station! (I warned you there would be a shameless plug! ;) Go to the Member Made [wallofsound.com] stations and enter "StealthDaveRocks". I've been using it since the internal beta stages, and I can definitely say it rocks!

    Additional Disclaimer:
    My opinions are my own, and are not sanctioned by Disney, Bill Nye the Science Guy, or the U.N. Security Council.

    - Stealth Dave
    --

  • It all depends on the bit rate of the MP3. I have an old 486DX4-100 that will play the 64k/22khz stream from my main machine with no problem. However it starts to choke with 128k/44khz ("standard") mp3 files.
  • I saw a post earlier that tried to ask this question but it came across funny. So I'll try to ask it myself.

    The earlier versions of Real's streaming server supported one incoming stream from somewhere to feed several outgoing streams. Essentially, I could park a server on a high bandwidth connection and then broadcast from my home PC sitting on 33.6k - the server would relay the incoming feed to many clients. Most of the radio stations that have a streaming server do something like this, because I don't believe their high bandwidth server is IN the radio station itself.

    This is, in fact, how modern Radio works - they don't actually broadcast right from the buiding where the studio is. They cable / microwave it out to a transmission tower somewhere else.

    Do either of these MP3 streaming solutions support relaying an incoming stream from a remote location? Is there a free / GPL / etc solution that does?
  • I tried something similar recently w/ mpg123 and a '486. I couldn't get the 486 to decode the MP3s fast enough -- even with mpg123 niced to the max. There is a market for these MP3 players in restauraunts &c but the cost factor for even a first generation pentium makes it not worth the effort. A 486-based solution would make it economically viable.

    Anyone have any luck decoding MP3s on prehistoric hardware??
  • MaxQuordlepleen writes:

    but the cost factor for even a first generation pentium makes it not worth the effort. A 486-based solution would make it economically viable.

    You are mistaken, an old socket 5 and even a few socket 7 pentium motherboards with a p90 or p100 cpu can be found on ebay for less then $20. I would rather pay $20 for a p100 then pay $10 for a slower 486.

    I have used a p100 (OC'ed to 125mhz by upping the bus speed to 83mhz) to play mp3s via winamp under win98, and I experienced no problems as long as I wasn't stressing the CPU in other ways. This was a bloated windows solution, I'm sure you have enough power to stream with a stripped down dedicated linux system. Just don't try to rip with an early pentium, unless you are really, really patient.

    Just my $.02
  • Isnt there a linux port of Darwin Streaming server, the open source version of apple's quicktime server? If there isnt get working on it! www.darwin.org [darwin.org]
  • by darthpenguin ( 206566 ) on Saturday December 23, 2000 @08:39AM (#541771) Homepage
    In the latest issue of linux journal, there is a vey good article on how to set up your own mp3 streaming server using all open source tools. It's a very good read.


    -mdek.net [mdek.net]
  • eh am I the only one that's wondering why this was posted? when have howtos been news.. or is this some breakthrough i'm not aware of?
  • by xdeadbeef ( 218700 ) on Saturday December 23, 2000 @08:46AM (#541773)
    ...says that Icecast "devours fewer CPU cycles and uses less memory?".. Maybe he should actually do some testing if he wants to make those claims... -Justin
  • This has been around forever. Why is slashdot reporting a simple howto? Do a search on google for streaming MP3 server, and you will find a simple server with a README file on how to install it. RTFM people.
  • I like my MP3s steamed with some butter, garlic, and a few Frauenhaufer execs shredded on top.

    Oh. stReaming MP3s. My mistake. But MP3 recipes are important, too...

  • by kcarnold ( 99900 ) on Saturday December 23, 2000 @08:43AM (#541776)
    Stream Vorbis! Once they get RTP/RTSP encapsulation working right (soon, some proof-of-concept has already been done), Vorbis is the free (and often higher-quality) alternative to MP3. After the new year, you'll have to pay <large sum of money> for MP3. You have been warned.
  • I nominate a hundred or so people to stream Metallica 24/7! =)
  • I have an extra computer with 40gigs of space setup as an mp3 jukebox. I am using samba to load the mp3s onto the computer from my windows (sorry) machine to the linux machine. Then I am using MP3MASTER that I found at freshmeat to play mp3s. It works really well, it has a webpage interface that you can play your mp3s with, so you just set that as your startpage and whenever you want to pick mp3s to play, you just open your browser and get a well organized list to pick from. You can allow other people to pick songs from the net, or just yourself. Then connected to the soundcard of the linux box is a home speaker setup. Eventually I want to throw this setup into an FM radio if that Low Power license thing ever becomes a reality. There is also a plug-in to make the playing songs go into an icecast stream. I now have mp3s playing randomly 24/7 in my house, and am really satisfied.

    -NG
  • by yerricde ( 125198 ) on Saturday December 23, 2000 @09:43AM (#541779) Homepage Journal
    Icecast requires that your MP3 files already be at the bitrate at which you will stream them (normally 32 kbps). Shoutcast, OTOH, uses a licensed MP3 codec to downsample from 192 kbps to 32 kbps, which Icecast can't do because of some stupid patent [mp3licensing.com].
    Tetris on drugs, NES music, and GNOME vs. KDE Bingo [pineight.com].
  • Isn't it obvious? Howard Stern definitely boils Hemos' bacon ;)

Brain off-line, please wait.

Working...