book collections email follower instructable user
Picture of Linux music server controlled by an Android device
Goal:

A Linux computer that acts as a music server for files like MP3 and FLAC. It will also play Pandora radio and everything can be controlled by an Android device so there's no need to connect the computer to a monitor.

Needed:

Linux computer (personally I'm using a Raspberry Pi, http://www.raspberrypi.org/ for 35$)
A device running Android, like a phone or tablet
A local network where the Android device and Linux computer are connected
An external sound system or speakers connected to the computer
A couple of minutes to set everything up

Linux:

There are many different Linux distros out there and this guide will explain how to set it up on Debian based distros (such as Ubuntu, Linux Mint, Raspbian etc.). It's of course possible to set up on any distro but depending on what package manager the distro uses, the commands will be different. The guide will assume that you have already installed Linux on your computer.

Step 1: MP3, FLAC etc. (MPD)

Picture of MP3, FLAC etc. (MPD)
MP3, FLAC etc. (MPD):

For music files like MP3 and FLAC we will use MPD, http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki. This is a daemon that can be controlled remotely by a number of different clients. It's included in most major Debian based distro's repositories so all you need to do to install it is open a terminal (shell) on the linux computer and write:

sudo apt-get update && sudo apt-get install mpd

After it has installed we tell it where to look for our music files by editing the configuration file:

sudo nano /etc/mpd.conf

Scroll down to the line "music_directory" and change the path within the parentheses after this line to the path where your music files are, for example:

music_directory         "/home/user/Music"

Then scroll down to the line that says

bind_to_address         "localhost"

And change it to the ip or host of the computer on the local network, if you don't know what your ip is you can open a new terminal and write:

ifconfig

Look for the line that says "inet addr" followed by something similar to "192.168.0.2". Those are the numbers that you should add instead of "localhost" in the config file:

bind_to_address         "192.168.0.2"

Normally this is everything you need to do to get MPD working and the sound output defaults to the default ALSA sound card. If you are using a different sound framework or want to change the sound card you will have to change the "Audio Output" section of the config file yourself (there are too many combinations possible to list them all here), there are examples included in the config file and more information can be found at http://mpd.wikia.com/wiki/Configuration.

After you have edited the config file, close it by pressing "ctrl + x" and choose "y" to save the file. Then restart MPD by writing:

sudo /etc/init.d/mpd restart

Controlling MPD (MPDroid):

To control MPD we will use an Android app called MPDroid. You can search for it on Google Play or use this link:  https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid

Install it as normal on your Android device and start it up. Go to the settings dialog and select "WLAN based connection". Choose the network that you are connected to and select "Host". Here you enter the ip address of the Linux computer (same as we entered in the config file above).

Go back to the main settings dialog and tap "Update". After a while the music should show up in the file list.
SujithK73 years ago

How many players are available, If configured this way? Will this set up support airplay?