Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Linux > Other Tips, Tricks and Tutorials

April 17th, 2007, 10:00 GMT · By Mihai Marinof

Streaming Audio Using MPD and Icecast

SHARE:

Adjust text size:


MPD with Pitchfork and XMMS
Enlarge picture
Music Player Daemon (MPD) is a music player which allows remote access for playing music and managing playlists. Together with Icecast, it integrates perfectly within a 'headless'-type computer (without a monitor), allowing control and providing playback over a network or over the Internet. Basically, it allows you to listen to your favorite music from anywhere, as long as you have a client that controls MPD (changes the song, volume etc) and a player that supports the Ogg format, like Amarok, XMMS, Winamp and so on. MPD also makes a great music player, especially if you're a console junkie or you restart the X server often.

INSTALLING MPD

Open a terminal and type the following (skip the first command if already logged-in as root):
CODE
$ su -
Enter root passwd:
# yum install mpd

CONFIGURING MPD

Open the /etc/mpd.conf file using your favorite text editor and change the required paths. Use your regular user's home directory:
CODE
music_directory "/home/USER/music"
playlist_directory "/home/USER/music/playlists"
db_file "/home/USER/.mpd/mpd.db"
log_file "/home/USER/.mpd/mpd.log"
error_file "/home/USER/.mpd/mpd.error"

In the same configuration file, set the user MPD on which it will run, the address and port to listen to (only if you have multiple interfaces and will like MPD to only be available on one interface), and the shout output:
CODE
user "USER"

bind_to_address "127.0.0.1"
port "6600"

audio_output {
type "shout"
name "Stream short description"
host "localhost"
port "8000"
mount "/mpd.ogg"
password "hackme"
quality "5.0"
# bitrate "128"
format "44100:16:2"
# user "source" # optional
# description "My Stream Description" # optional
# genre "jazz" # optional
# public "no" # optional
}

Of course, you'll have to replace USER with the name of your regular user. Next, create the directories by running these commands as user:
CODE
$ cd $HOME
$ mkdir -p music/playlists
$ mkdir .mpd

You can also switch between the quality and bitrate options but don't activate both at the same time. If quality is activated, the output will have a variable bitrate, whereas the bitrate option allows you to choose a static one.

INSTALLING AND CONFIGURING ICECAST

Open a root terminal and type:
CODE
# yum install icecast

After installation, open the icecast configuration file, /etc/icecast.xml and replace localhost with the hostname MPD is running on:
CODE
localhost

If you're going to run a public Icecast server, you should also replace all the occurrences of 'hackme' with decent passwords and change the password in the mpd.conf under audio_output as well.

INSTALLING A WEB-BASED MPD CLIENT

Pitchfork is a modern webinterface to MPD as it supports many features such as volume adjusting, managing playlist, modify server settings, album art, lyrics fetching and so on. You can also listen to your Icecast server through Pitchfork.

Before installing Pitchfork, make sure you have a webserver installed, as well as PHP and PHP-Pear by opening a root terminal and typing:
CODE
# yum install install httpd mysql-server php php-mysql php-gd php-pear

Next, download the latest version of Pitchfork from HERE and save it anywhere on your disk. Then open a root terminal and extract it to the web directory (change the version number if it's newer in your case):
CODE
# cd /var/www/
# tar xfj /where/you/downloaded/pitchfork-0.5.1.tar.bz2
# mv pitchfork-0.5.1 pitchfork

Now copy the pitchfork configuration file from the doc directory to the apache's conf.d directory:
CODE
# cp /var/www/pitchfork/doc/pitchfork.conf /etc/httpd/conf.d/pitchfork.conf

Make sure the paths from Alias and Directory are set correctly to /var/www/pitchfork.

Open Firefox (or other DOM2 capable browser: konqueror, opera but NOT iexplore) and go to http://hostname.or.ip.address.of.the.server/pitchfork. Here, set the configuration options based on the mpd.conf file and click Save.

RUNNING MPD AND ICECAST

Before starting, remember to put some mp3 or ogg files in the /home/USER/music directory.

Finally, from a root terminal, type:
CODE
# service httpd start
# service icecast start
# service mpd start

In the browser pointed at pitchfork, add some files to the playlist and click play. Also, add the http://server.hostname:8000/mpd.ogg URL to your music player (XMMS, Amarok etc).

Enjoy!
FILED UNDER:
icecast
mpd
fedora
shout

TELL US WHAT YOU THINK:

34,335 hits · 1 comment · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


Screencast Guide: Capure Your Linux Desktop on Video!

Building a Live Fedora CD

Fedora Core 6 Post-Install Guide

Mounting Remote Directories through SSH

Manage Several Desktops with One Keyboard

READER COMMENTS:


Comment #1 by: Dragnucs on 22 Oct 2011, 15:54 UTC reply to this comment

The link to Pitchfork is broken.
Here is the link from the offical website : http://sourceforge.net/projects/musicpd/files/mpd/0.16.5/mpd-0.16.5.tar.bz2/download?source=files

Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM