- New project, new framework
- Thoughts on News and Copyright
- Changing an IP subnet is no small task
- Why would anyone pay for something that is based on Open Source?
- Creating PDF from code with FOP
- Hints of the future
- Thoughts of servers and maintenance
- Microsoft Submits Windows 7 for Antitrust Review
- Your own Internet Radio on Linux - Updated
- Frustrations with IE and JSON code
I have recently met a new friend who happens to be a DJ for The World Net Radio. I had the opportunity to see this friend set up for a DJ session and what it took to make the radio station work. But my friend is not a Linux user (yet), so I was seeing things from the Windows perspective. Tonight I decided to see if this could be done from a Linux perspective. I've had moderate success, so will detail what I've found seeing as the documents out there are a little sparse on details. The approach I'm using should work on any Linux system, however both my desktop and server are running Ubuntu. The server is running Ubuntu Feisty (about a year old now), while the desktop is running Gutsy. This approach has NO differences between these versions. UPDATE: A friend of mine (thanks Nicole!) contacted me and let me know that my statements below regarding Icecast are a little wrong. Icecast CAN do MP3's OR Ogg/vorbis files. It depends on what transmitter tool you use to the streaming server. In this case Ices0 can handle MP3's and Ices2 can handle OGG. The underlying icecast server can handle both. Nicole also pointed me to what she considers THE best HOWTO on setting up Icecast - http://www.gnuware.com/icecast/. I'm still playing with it. BackgroundIt should be noted that you need to pay attention to copyright issues if you are going to broadcast your music. The solution I'm presenting here are for use on your personal network or workstation. The next step to make this available over the Internet is a simple matter of port forwarding. My station is only intended for my personal use - regardless of where I am. Google is your friend in most cases. But more so when you know the right incantation (aka search phrase). I eventually arrived at "shoutcast on linux". SHOUTcast is a free (as in beer) audio streaming server. There is an alternative that is free (as in speech) called IceCast. I opted to use SHOUTCast because it could handle MP3 and/or OGG/Vorbis files. The current version of IceCast seems to be limited to OGG. Most of my collection is in MP3 format. Nuff said. Anyways, Google led me to http://www.gentoo.org/doc/en/shoutcast-config.xml, where I was able to ignore the Gentoo installation methods and follow along with the remaining document to learn what I needed. There are actually two components that are needed to get you broadcasting. The first is the streaming server (SHOUTCast in this case), and the second is a tool to feed the streams to the server. If you want to do live DJ-ing as well as recorded music/commercials, then you'll need a third component to pass the microphone inputs to your streaming server. This last part is where I stumbled a bit. The tool of choice on Linux seems to be Internet DJ Console. This tool looks promising, however it makes use of Jack, and Jack needs some further configurations that are beyond my current knowledge. (i.e. I don't know how to use Jack at this time, or how to setup my box for that level of audio processing). I'll be speaking to a friend to get some assistance here, and if it works out I'll do another post on the topic. In the mean time, I was able to get IDJC running, but it's not stable due to my Jack configuration. Let me know if you come across any other options. The two tools then that we will be using is the SHOUTCast server, and the SHOUTCast DSP Plugin (which "transmits" the current file to the streaming server). The DSP plugin reads from a playlist file. It then does the following:
InstallationWe will be tackling this from a very simple perspective. We'll assume that you'll be firing up the server manually as needed. In a production environment, you should set up a separate user account for running the ShoutCast server.
ConfigurationWe have two configuration files we need to edit. Use your editor of choice, but we'll start with the sc_serv.conf file located with the streaming server files. (in my case that would be /opt/shoutcast/sc_serv.conf) Streaming Server Configuration
All the other settings should be reviewed and set to something meaningful for your own use. General rule of thumb - if you don't understand the setting, don't change it. DSP Plugin Configuration
The remaining settings are set to reasonable defaults, but review them and make any changes you'd like. Build the PlaylistOur playlist file is a simple text file with one song per line. Each song entry is an absolute path to the song file. I cheated a little and used the following command: Where things get interesting is that you can easily write a script to add things to add entries to this file. The sc_trans_linux executable can be "bumped" to reload the playlist without affecting the current file. So in theory it should be possible to write a script to periodically insert a commercial, or pull a song from a different source. (details how to "bump" the executable are in the sc_trans.conf file - something along the lines of "kill -usr1 $PID" should do the trick. Let the streams flow!We're all set. We just need to start our services and connect a client tool to them to listen in. Run the following command, changing the paths as needed to match your setup: If all goes well, you should start seeing the output from sc_trans_linux. (you can send that process a HUP signal to stop it from sending output to stdout.) If you encountered errors, make sure the sc_serv file and the sc_trans_linux file are executable. Next we need to connect to the stream server. Open your browser, or Amarok, or what ever stream player you'd like. Point them at http://yourserverIP:8000/listen.pls. Again, if all goes well, you are listening to your music being streamed over the network. I have an occasional hiccup with Amarok where it won't play a stream. When this happens, I can just stop Amarok (ctrl-Q) and restart it, then try again. 9 times out of 10 this works fine. If that doesn't work, then my sound system is in an odd state, log out and/or restart to clean this up. (no just restarting Alssa wasn't doing it for me.. :) As an added bonus you can view some information about your server by pointing your browser to http://yourserverIP:8000. There is a login option where you can use the username of "admin" and the password you setup in the sc_serv.conf file. Once logged in, you can kick or ban listeners, or add them to the Reserved IP list (which means a user will be bumped if needed to let the reserved IP connect). Where to next?Next on my list is to try to figure out how to get the DJ features working, and/or write some scripts to better manage the play list. I'm now having visions of my own personal radio station where I can play the music I like, and even promote the community groups I'm involved with (or reminding me of upcoming events with the groups). Heck, if you are feeling really energetic, you can easily turn this type of server into a business and setup commercials for an income stream. Eitherway, it'd be fun just getting everything running right. And then perhaps I can convert that friend of mine to use Linux full time.
|
|||
