View Full Version : [ubuntu] Streaming m3u through ubuntu server with no GUI

June 20th, 2011, 05:06 PM

This is my first ever post for help so be easy on me if I'm in the wrong place or dont provide enough details :?

About a year ago I installed Ubuntu Server 9.10 Karmic on a machine at my work to act as a file/print server and ftp host. I managed this with a lot of googling and reading of forums and it's still all working exactly as it did on day 1!

Now I would like to use the server to stream a local radio station through speakers into the workshop. I have again googled but have not managed to come up with a solution for a server sytem with no GUI...

The radio station streams in a m3u format.

Thanks in advance for any help you can give,

June 20th, 2011, 06:31 PM
You want to use the server to stream the radio station to another device in the workshop, or you simply want to plug the speakers into the server and play the radio stream?

June 20th, 2011, 08:18 PM
Thank you for your reply.

I simply want to plug speakers into the server and play the music through them.

June 20th, 2011, 09:36 PM
sudo apt-get install mplayer-nogui
man mplayer
mplayer www.radiostation.com:8888://playlist.m3u

One of my favorites: Groove Salad

mplayer http://somafm.com/groovesalad.pls

Once you get that working, then you will want to checkout music player daemon:

apt-cache search mpd
sudo apt-get install mpd

mpd has many clients to control it remotely, so it's convenient to put mpd on the server and use any other machine on the network to control it (start/stop/volume, change playlist, etc). It will play any music stored locally on the server or music stream URL's.


June 20th, 2011, 10:15 PM
Thank you. I will try that tomorrow morning.

June 21st, 2011, 05:57 AM
Then you will need to install some sound related stuff.

sudo apt-get install alsa alsa-tools mplayer

Then add your user to the audio group

sudo adduser $USER audio

You might need a reboot here.

Then just

mplayer <address_of_stream>

If that doesn't work you may simply need some codecs, post back.

June 21st, 2011, 02:58 PM
Well I installed mplayer and tried to play the radio, it all seems to be working on the screen but no sound is coming out the speakers!

I have never played any music on this server and the only noise that has ever come out the speaker before was 'beep' like when you press the left cursor before input text on the command line.

Now I'm thinking there must be soming wrong with the audio modules or drivers??

I've followed the troubleshooting guide here


and found that I can't play the front_center sound although again on screen it looks like it's doing it right.

I've got as far as uploading my sound information to an alsa project webpage here,


I dont know if you're able to see whats wrong by looking at the web page.


June 21st, 2011, 03:27 PM
aplay -l

Try all the sound jacks. Sometimes they are miswired.


Turn up the volume.

June 21st, 2011, 08:22 PM
Thanks. Got some time before I came home tonight. Tried all the jacks and I had previously turned all the volumes up on Alsamixer, still no sound.

Don't know why but I decided to reboot the machine and now it works! Wish I'd tried that an hour earlier. Anyway I can now play the radio station through the server.

Only had time for a quick look at mpd. I think I'll have to try and find walkthrough for installing... Could you recommend one or give me a few pointers? I only want to use it for this 1 radio station.

June 21st, 2011, 08:46 PM
Only had time for a quick look at mpd. I think I'll have to try and find walkthrough for installing... Could you recommend one or give me a few pointers? I only want to use it for this 1 radio station.

If you only want to listen to the radio, stick with mplayer. No need for mpd.

June 21st, 2011, 10:26 PM
sudo apt-get install mpd mpc

mpd allows remote control from several machines. You can control mplayer remotely by logging in and killing the process:

sudo killall mplayer

You can also adjust the volume with alsamixer. mpd allows web-based, cli-based, and widget-based control from any machine on your network.

June 22nd, 2011, 08:09 PM
Thank you for your help. All working now.