21. Reboot once more so MPD will read its new
22. Log in and type alsamixer on the command line.
This will bring up a GUI with a slider in the middle
of the screen. Raise the value three quarters of the
way up and then click the Esc key to terminate
23. To make sure the kernel modules necessary to
output sound from the RPi are loaded, type the
following command in a shell window: sudo
24. Lastly, type amixer cset numid= 3 1 to route sound
to the 3. 5 mm jack on the RPi.
25. Reboot one more time and look closely at the
messages that stream by on the monitor. Make
sure you don't see any errors when the MPD
server automatically starts up. If you do,
something is wrong and you will need to figure
out what that is and fix it.
Now, it’s time to find out if our Internet radio/music
file player is working. For this test, make sure there are
music files on the Flash drive which is plugged into the
USB hub. Then, plug some headphones into the 3. 5 mm
jack on the RPi. Type the following command in a shell
window: mpc add http://64.40.
99.2:8088. Then, type mpc play.
If all is well, you should hear the
Beatles Internet radio station.
Next, type mpc clear to stop
the server from playing the Internet
radio station. Then, type mpc
update to force the MPD server to
build a database of the songs on
the Flash drive. Type mpc listall and
you should see all the songs listed
that are on the Flash drive.
Then, type mpc add followed
by one of the file names you saw
with the listall command. Finally,
type mpc play and you should hear
the song you just added.
If these tests are successful,
you are ready to go. You can
power-down your RPi and remove
the USB keyboard, mouse, and the
USB hub. Remember to plug your
USB Flash drive containing your
songs back into the RPi and
connect the audio cable to your
To control your MPD server
remotely, you can use my iPhone/
iPod Touch app (MpdClient) or any
other MPD client application you
Songs On A USB Flash Drive
The MPD server used in conjunction with the RPi can
play many different audio file formats. If you would like a
complete list of supported files, type mpd --version at a
command line prompt. This means you can put a variety
of audio file types on your Flash drive, and MPD should
have no trouble indexing and playing them all.
MPD does not require any kind of directory structure
for music file storage like some other music library
programs do (like i Tunes). All files can be placed in the
root directory of your Flash drive and MPD will sort things
out. This is possible because MPD extracts song
information from metadata stored in the music files
When MPD is commanded to do an update, it
extracts information from the song files and stores it in its
private database. This allows for some very powerful
searching and sorting capabilities. Using the MPC client
we installed on the RPi for testing, we can list all the
available songs by typing mpc listall. Type mpc list artist to
see a list of all the artists with songs on the Flash drive.
Type mpc list album to see the albums the songs on the
Flash drive are associated with. Finally, type mpc list genre
to see the genres covered by the songs on the Flash drive.
August 2013 53