Roaming Media
Portable music doesn't need to be restricted to headphones. Here's a step-by-step how-to on setting up a music system that follows you around the house like a puppy.
Like many of you, I store all my music digitally on a central server in my home. The problem is when I walk from room to room, my music doesn't come with me. I could carry around an iThingy or put it on my phone, but I'd rather not have to wear headphones, and no matter how awesome they are in their class, tiny phone speakers still are tiny phone speakers. Fortunately, I have a lot of computer hardware lying around from past upgrades, so it was fairly easy for me to come up with some small, older systems for each area of my house. Now, instead of listening to music on a little device, I use a device to tag my location and have the music follow me wherever I go.
The system is easy to build and uses mostly off-the-shelf open-source programs. In addition to the player and control system, you need a way of tagging your location in the house. I use the Bluetooth radio on my phone, but you also could use RFID tags, Webcams with motion detection or facial recognition, or pretty much anything else that will let the system know where you are. For this setup though, I'm assuming you're using a Bluetooth device.
The central piece to this project is a server-based music player. I am using the Music Player Dæmon (MPD), a wonderful server-based system released under the GNU General Public License and available from the repositories of most Linux distributions. Install the software with your favorite package management system. In addition to this player, you need to set up a streaming system. Icecast fulfills this requirement and also is widely available. Install it as well.
Configuring MPD is fairly straightforward. The default file for your
distribution is probably very similar to the example below, but you may need to change a
few things. The music_directory entry should point to the
directory that contains the music files and one
bind_to_address
should contain the non-loopback name or address of the server. If it
binds only to 127.0.0.1, outside boxes may have trouble connecting to it.
The audio_output section defines where the music goes when it
plays. In this case, you want to transcode it to Ogg format and send it to
the Icecast server on the same host (although you could run these on
different systems if it makes sense for your setup). Within this section,
the port and password must match the configuration for the Icecast server,
and the mount will define the portion of the URI after the server name.
For simplicity, I've left it at /. If you start MPD after
this configuration file is set up, it will be missing the Icecast socket
to play to, so you need to set that up next. I've added some comments
to the configuration below to help document the options there:
music_directory "/data/arown/files/audio" #Point this at
the top level of your music directory. If you have more than
one, a directory of symbolic links may help you.
playlist_directory "/var/lib/mpd/playlists" #The following
files must be writable. I suggest making the directory owned
by the user running MPD.
db_file "/var/lib/mpd/database"
log_file "/var/lib/mpd/log"
state_file "/var/lib/mpd/state"
user "mpd" #This is the user that the MPD
program runs under. I highly suggest making this a nonroot user.
bind_to_address "templar" #Place your machine name here, not
"localhost" or "127.0.0.1" if you want to reach the MPD
server from another machine.
bind_to_address "/var/lib/mpd/socket"
port "6600" #This is the client control port for
starting and stopping the MPD player as well as building
playlists and changing server side volume.
log_level "verbose"
input {
plugin "curl"
}
audio_output {
type "shout"
encoding "ogg" #This is the media type for the stream,
if your player wants MP3, use encoding "mp3" and be sure you
have the proper tools to transcode to MP3 on your box.
name "MusicPuppy"
host "localhost" #The name of the box
that the Icecast server is hosted on.
port "8000" #The port of the
Icecast server.
mount "/" #This is the part
of the URI after the hostname. I have left it to "/" for
simplicity, but often things like "/music.ogg" are used
to make it clearer to the user.
password "passthis" #The source password to the
Icecast server. You probably should change this to something
complex because you'll never have to type it in.
bitrate "128" #The bitrate to transcode to. You
may want to raise or lower this based on your CPU, bandwidth
or your quality preference.
format "44100:24:2" #This is three variables:
44,100 represents the sample frequency, 24 is the bitwidth,
and 2 is the number of audio channels. Experimenting here
may give you better or worse quality, depending on your audio
hardware and number of speakers.
}
filesystem_charset "UTF-8"
In order to finish off the server portion, you need to configure Icecast to stream the music it receives from MPD. The sample Icecast configuration file is quite long, but I've cut out the areas that I've changed.
Make sure that the source-password here matches the password from the MPD server. This allows the MPD server authorization to stream music to Icecast:
<authentication>
<!-- Sources log in with username 'source' -->
<!-- This password must match the MPD password above -->
<source-password>passthis</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>passthis</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>passthis</admin-password>
</authentication>
Be sure that the bind addresses and ports are correct. The bind address can be localhost if the MPD server is on the same box. The port must match the port from the MPD configuration above:
<listen-socket>
<port>8000</port>
<bind-address>127.0.0.1</bind-address>
</listen-socket>
While you're in this configuration file, change the default passwords from "hackme" and "hackmemore" to something more secure, and check the location of the logs for debugging. Mine are in /var/log/icecast, but yours may vary.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- What's the tweeting protocol?
- New Products
- RSS Feeds
- Readers' Choice Awards
- Dart: a New Web Programming Experience
- Reply to comment | Linux Journal
12 hours 37 min ago - Reply to comment | Linux Journal
15 hours 10 min ago - Reply to comment | Linux Journal
16 hours 27 min ago - great post
17 hours 2 min ago - Google Docs
17 hours 24 min ago - Reply to comment | Linux Journal
22 hours 13 min ago - Reply to comment | Linux Journal
22 hours 59 min ago - Web Hosting IQ
1 day 33 min ago - Thanks for taking the time to
1 day 2 hours ago - Linux is good
1 day 4 hours ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.



Comments
roaming media
At heart, you think that music would not be restricted to headphones?
I and thousands of people hate Guando we conduct a public one and comes with a rude caxinha music without earphone oudido. Nobody is obliged to hear what he hears, then he would have to be educated to use their own handset oara substencia. But his lesson is well guarded and let's see if we can adopt it.
I thank the great audience that this site has and ask administrators the opportunity to leave my site where you realize the work of research and dissemination. My goal is not to create spam, but I publicize my work. Thank you cadeira universitaria
music play
I agree with you grade and gender roxelly. Music in public place is to listen with headphones adestramento de cães
Roaming
How does the off-the-shelf open-source programs? You disagree in part to talk about in-room-room. I really liked the article and I will look further. I leave my site Primeira Página do Google
Very interesting
I will try to use MPD as for your directives.
Thanks for the little tutorial.