Music 2.0: Pitchfork
Pitchfork is the solution to all of my problems, well almost all… Pitchfork allows me to stream my music over my Local Network, and over the internet, with a nice and responsive interface that facilitates access to my songs.
Installing MPD
Since Pitchfork is based upon MPD, which will take care of streaming the data to the various clients and maintain the song database, we will first have to set it up. Sadly my distro (OpenSuSe 10.2) doesn’t have a version of MPD in its package management, so I had to download the sources and compile it myself:wget http://www.musicpd.org/uploads/files/mpd-0.12.2.tar.bz2
tar -xvjf mpd-0.12.2.tar.bz2
cd mpd-0.12.2/
Now we have the sources, and we have to check that we have all the dependencies. Depending on how you are going to use MPD you have to have the following packages (along with their devel packages):
- libshout: because we will be streaming the songs to an Icecast server
- oss: as far as I know this is the most widely used and best supported. If it doesnt work take a look here
- libmad: for mp3 support
- libogg: for OGG Vorbis support
- libvorbis: for Metadata support for Vorbis formats
- libid3tag: Metadata support for mp3.
Now it’s time to get to the actual compilation:
./configure
make
sudo make install
After the configure step, you’ll see a list of options that are turned on or off, if something is missing it probably means that you are missing some development packages.So now we have mpd installed, the next step is to configure it. First you have to move the example configuration to the correct location:
sudo cp doc/mpdconf.example /etc/mpd.conf
Then we edit it according to our needs, especially the location of the Songs, Logfiles and Database should be changed:
music_directory "/storage/Music/"
playlist_directory "/storage/Music/playlists"
db_file "/var/lib/mpd.db"
log_file "/var/log/mpd.log"
error_file "/var/log/mpd.error"
pid_file "/var/run/mpd.pid"
The pid_file has to be uncommented since we will run MPD in daemon mode, and we want to shut it down later. Now let’s create these files and change the owners:
sudo touch /var/lib/mpd.db /var/log/mpd.log /var/log/mpd.error /var/run/mpd.pid
sudo chown mpd /var/lib/mpd.db /var/log/mpd.log /var/log/mpd.error /var/run/mpd.pid
“mpd” being the user that will later run the daemon (if you don’t have an mpd user refer to your distro documentation on how to create one. It is really important that the mpd user is in the sour). Next we have to set some more settings:
user "mpd"
audio_output {
type "oss"
name "Direct OSS output"
}
audio_output {
type "shout"
name "Icecast Stream"
host "localhost"
port "8000"
mount "/mpd.ogg"
password "youricecastpassword"
bitrate "96"
format "44100:16:1"
}
mixer_type "oss"
mixer_device "/dev/mixer"
mixer_control "PCM"
mixer_type "software"
Initializing the database:
This will insert all your songs into the database for faster access. Now MPD is set up and should work. Try with
mpd --create-db
MPD will complain that it can’t connect to the Icecast server (which we’ll setup a few lines below this, but everything else should work fine.sudo mpd
Installing Icecast
As I said, my Music resides on a fileserver, and I want the songs to be streamed directly to my other machines, so what’s better than Icecast, an opensource streaming solution, used by many internet radios out in the wild. Luckily most distros have it in their packagemanagement software (I know openSuSe hasInstalling Pitchfork
Installing pitchfork is pretty straight forward. All you need is this:- PHP 5.1.3 or newer
- PHP-Pear
- DOM2 capable browser (firefox, konqueror, opera, safari, etc)
wget http://pitchfork.remiss.org/files/pitchfork-0.5.2.tar.bz2
tar -xvjf pitchfork-0.5.2.tar.bz2
cd pitchfork-0.5.2/
chmod a+rwx config/
The rest of the configuration is done through the browser, just point your browser to http://localhost/pitchfork-0.5.2/ if you installed pitchfork on the computer you’re currently on, or replace localhot with the IP of your server. Change whatever you’d like to change (but it should not be necessary as the important configuration is done in MPD itself), and then press Save and you’ll be taken to the Pitchfork interface. Voila, it’s all done Installing mpdscribble (optional)
I’m a huge fan of Last.fm, but sadly I can’t update my profile using the Player, because the songs are streamed to it. So why not use the MPD to update them for me? For this purpose I will be using mpdscribble:wget http://www.frob.nl/projects/scribble/mpdscribble-0.2.12.tar.gz
tar -xvzf mpdscribble-0.2.12.tar.gz
cd mpdscribble-0.2.12
./configure
make
sudo make install
Now create the basic configuration
mkdir ~/.mpdscribble
It is suggested that mpdscribble is run as your user since it has read access to your username and password-hash. Edit the configuration file ~/.mpdscribble/mpdscribble.conf as follows:
username = "lastfm_username"
password = "md5sum of lastfm password"
Where the md5sum can be found using either this tool or the command line md5sum tool:
echo -n "your_lastfm_password" | md5sum
And that’s it, mpdscribble is set up and ready to be run:
mpdscribble &
Further reading
5 Responses to “Music 2.0: Pitchfork”
Leave a Reply

thak’s cool links » Music 2.0: Pitchfork on May 17th, 2007
ICE on May 20th, 2007
Fading Roses & Raging Viruses » Blog Archive » Pitchfork on June 6th, 2007
.the darch site » Blog Archive » how to install mpc on windows on June 12th, 2007
Pitchfork dead? | Coding Passion on December 7th, 2008