It is also used for one of the two purposes, as local daemon or as network daemon. MPD don’t use many resources. It is designed to make its job in background playing music from its database.
For connecting with MPD and managing music there are many options and clients. CLI clients, GTK clients, Qt clients and even from VI.
MPD uses flat file databases for maintaining the basic music collection info.
After starting, MPD loads it’s database into RAM and has no need for searching through HDD. Usually the music is saved in ~/Music directory and MPD will check that folder as first when making the database. If you have your music collection in some other folder, add its path in the mpd.conf file, usually located in the directory /etc.
MPD`s client/server nature gives it some advantages over all-round music players. Clients can communicate with MPD not only locally on the same computer, but they can also communicate over network.
In this way you can access and listen to all your music but without the need to have it physically with you. Also it does not require an X server to run or to be installed, it runs fine from console and there are plenty of ncurses based MPD clients. Every user over the network can have it’s own client connected to the MPD server, sharing the same database but every user will listen to his favorite songs.
As said, there are many MPD clients, for any taste and they also come for various devices and operating systems. Also Android. With that in mind we could build our own music streamer. If you have some cool hardware like Raspberry Pi, then you’ll have more benefits. But for this simple project every computer connected to Internet will work.
What we need?
1.) working computer with Linux
2.) Internet connection
3.) Android device
4.) Around 45 minutes
As said, MPD is an open source software and can stream audio to any device connected to the computer and it can also be controlled from any device. For making a music streamer using MPD the first thing that you have to do it’s to install MPD. It is usually available in the main repositories of all the most common distributions.
1.) Debian and Debian derivate
apt-get install mpd mpc
2.) OpenSuse
zypper install mpd mpc
3.) Fedora
yum install mpd mpc
4.) Arch
pacman -S mpd mpc
5.) Gentoo
emerge mpd mpc
Note, mpc is a client for MPD. mpc connects to a MPD and controls it according to commands and arguments passed to it. If no command is given, the current status is printed (same as ‘mpc status’).
When you finish the installation of MPD become root, or use sudo, to open with your favorite text editor the file /etc/mpd.conf file for editing.
You should see something similar to this:
music_directory "/home/user/Music" # Your music dir. playlist_directory "/home/user/.mpd/playlists" db_file "/home/user/.mpd/mpd.db" log_file "/home/user/.mpd/mpd.log" pid_file "/home/user/.mpd/mpd.pid" state_file "/home/user/.mpd/mpdstate" #user "user" audio_output { type "alsa" name "My ALSA Device" device "hw:0,0" # optional format "44100:16:2" # optional } audio_output { type "fifo" name "my_fifo" path "/tmp/mpd.fifo" format "44100:16:2" } # Binding to address and port causing problems in mpd-0.14.2 best to leave # commented. # bind_to_address "127.0.0.1" #port
This is default mpd.conf. Change paths to your music collection and path to .mpd folder. Save it, exit and test MPD.
Start it with the command
/etc/init.d/mpd start
. Before adding it as a default daemon to the system, you need to do some more editing in the mpd.conf file so open it again. In the section bind to address change localhost variable to any and add the http streaming section:
audio_output { type "httpd" name "My HTTP Stream" encoder "vorbis" # optional, vorbis or lame port "8000" # quality "5.0" # do not define if bitrate is defined bitrate "128" # do not define if quality is defined format "44100:16:1" }
Save the changes, restart the daemon and add it to system default daemons, the one that starts at boot.
Selecting your client depends on your specific needs. If you would like to control music from your laptop or workstation you can use Sonata or ncmpcpp. Sonata is a nice and popular GTK client for MPD while ncmpcpp is one of the most popular ncurses based MPD clients.
If you decided to build an simple, small and discrete music server you can use one of the many MPD clients for Android.
Two of the best apps are in my opinion Droid MPD and MPDroid. Both of them are very simple to configure.
When you configure these applications you usually need only to add your IP adress.
Local IP to remote control it at your home and your public IP if you want to stream music everywhere to your Android device.
We are now at the end, the only step left is to play, listen and enjoy our music with the new build music server/streamer.
Open your client, choose your favourite song and relax..
Raspberry PI + MPD and MPDroid as client:
“Jajuk is software that organizes and plays music. It is a full-featured application geared towards advanced users with large or scattered music collections. Using multiple perspectives, the software is designed to be intuitive and provide different visions of your collection.”
Jajuk has many interesting features and being developed in Java is available for Linux (it’s available as package in the main distribution), Windows and Mac OS X.
I found this great project some time ago (I’ve been the first Italian translator), but my work and laziness brought me away, today I’ve met again with Bertrand and he’s been so kind to give me some of his time for this interview.
Q: Hello Bertrand, thanks for your time on this interview. First question: can you tell us about yourself? How old are you? Where do you live? What do you do for living? And when and why did you start using Linux?
A: Thanks Riccardo for your interest into our project and thanks again for the good Italian translation you made few years ago.
What about myself ? I’m a 34 years software architect. I live in France / Brittany (Nantes) with Frédérique and my two children : Pierre and Lise. My current client has been the French Tax Office (DGFiP) for three years now. I’m a Linux user since around 1997 (Slackware) and I’m now a Xubuntu happy user since 3 or 4 years, I really like the XFCE Desktop Environment.
Q: And now about Jajuk, how and when the project started ? and where did you took the name ?
A: Jajuk project started in summer 2003 when I was struggling with some KDE jukebox (it improved since then ) that performed global rescan of the entire collection at each start up. I think I can say that no serious jukebox existed then. The initial specification [1] was done by the end of 2003 and we began to code them with another guy from my company (Sébastien Gringoire) who rapidly left the project to work on a photo manager. Jajuk 0.1 has been released on SF in march 2004. “Jajuk” means either “Java jukebox” (the “serious” name) or “Just another jukebox” (geeky way).
[1] http://jajuk.svn.sourceforge.net/viewvc/*checkout*/jajuk/trunk/jajuk/src/site/resources/specs.pdf?revision=2256
Q: Why should an user that is used to Amarok, Banshee or Exaile give a try to jajuk ? Can you tell us the features that make you proud of it ?
R: All applications you cited are excellent, and you can add the excellent aTunes project too (same technology than Jajuk). I must admit that I don’t know them much because I’m a big Jajuk user but it seems that most users are happy with them. I would just advice them to try Jajuk if they experience performance issues with a very large collection or if they are looking for specific features like Digital DJ, Prepare Party, Duplicate Finder, automatic rating system etc. or if they like the jajuk “way” of perspectives and views [2].
[2] http://jajuk.info/index.php/Perspectives_and_views
Q: Can I ask you to go a bit deeper in these specific features of Jajuk? like Digital DJ ?
A: DigitalDJ (see http://jajuk.info/index.php/Using_digital_djs ) automatically generates playlists according to rules (transition between genres, proportions, ratings, …). Once programmed, the DJ is available in a single click.
Prepare Party (http://jajuk.info/index.php/Prepare_Party) is an advanced wizard allowing to export jajuk collection into ready to play support (like an external drive) along with a generated playlist.
We also have a pretty advanced rating system (http://jajuk.info/index.php/Jajuk_rating_system) taking into account relative play times, number of launches and user preferences. It also provides a banning function.
Jajuk also provide many features I find very useful for my own use like the slimbar (with integrated search box) or the finish album function : when listening random tracks, you specially like a track and you want to finish the album ? just click on the Finish album button !
Q: Just a curiosity, what’s the biggest list of songs that Jajuk is managing for what you know ?
A: Some users reported collection of more than 200GB of MP3 files, probably more than 20K songs but bigger collections probably exist. Jajuk is designed to properly handle multi-hundred GB collections without significant performance lost compared with smaller collection (the start-up would only take few more seconds). The searches inside Jajuk should remain almost instantly.
Q: Do you know (more or less) the number of active Jajuk users and if they are spread in the worlds equally ?
A: It is difficult top say because Jajuk is now available in several Linux repositories like Debian, Ubuntu and Mandriva, as torrents or sometimes directly downloadable from few Freeware websites. Moreover, many users just had a try or downloaded several times. Jajuk has been downloaded more than 400K times from SourceForge since its creation. Maybe could we estimate the total number of downloaded to 500K times and 20% of actual users =~ 100K users.
World repartition changed a lot with years. Current version (Jajuk 1.9 aka “Killer Queen”) seems to be largely downloaded by Spanish native language countries (Spain, Mexico…), USA and Germany (see [3]) but fewer by French people. It also seems like Italy (number #2 in Killer Queen downloads) really likes it (in spite of the very outdated langpack, I suppose Italians use the English langpack).
[3] http://sourceforge.net/projects/jajuk/files/jajuk/stats/map?dates=2010-11-13+to+2010-12-20
Q: Jajuk is made in Java so this means it “should” run on any operating system, are there some difference between the different OS, like between Windows 7 and Ubuntu ?
A: This is a good question because Java/Swing (GUI library) is REALLY platform-agnostic inside a window but everything near to OS-borders is difficult (like systray, keystrokes, mouse clicks behaviours, windows maximalization or multi-headed, fullscreen mode, special path handling…) and we had to write a few OS-specific if/else code but this is a negligeable amount of code and we managed to handle properly Gnu/Linux, MS Windows and Mac OSX specific behaviours. In Killer Queen, thanks to a newly available Leopard environment, we greatly improved the OSX support. The packaging is also pretty different between OSes (we provide a generic java installer, .deb and .rpm files for Gnu/Linux, .exe setup for windows and .dmg volume for OSX). All of them are built automatically every night (see out CI server at [4] for bleeding-edge builds) except for the .dmg OSX file (we only provide .app daily builds files) because of the very proprietary and non-CLI Mac build tools.
[4] http://integration.jajuk.info/hudson/
Q: More related to Java than Jajuk, what’s your opinion on recent facts regarding the Java world and Oracle ?
A: This is a difficult question… few ideas though:
– Jajuk is mostly written in Java/Swing. It is a pretty large and proven code base (more than 100 Kloc with comments, see [5]). It will not be ported to another language (at least by myself).
– I hope Harmony project will continue so we would still have two major Open Source JVM implementations. Google uses it for Android AFAIK so it may continue, but (unfortunately) mainly supported by Google.
– If Oracle refuses positive cooperation with the community (note : like Sun did slightly before Oracle, see the age of KDE-related bugs for instance), it is still possible to fork OpenJDK (GPL V2), and create a new JVM (not TCK-compliant so not “Java-compliant” but “Community-compliant”). Everybody want to avoid this but I prefer a truly Open JVM with OpenJDK backports and community patches than an Oracle-locked OpenJDK. OpenJDK could take the same way than OpenOffice.Org and LibreOffice.
[5] http://nemo.sonarsource.org/dashboard/index/org.jajuk:jajuk
Q: Back on Linux, jajuk is available in some distribution in the standard repository, and this is great; a further (big) step could be to become the standard music player of a big distro, for example I’m sure some would love to have a Java based application instead of one based on Mono, did you ever consider this ? Or do you had some question or proposal in this direction ?
A: Are you thinking about Banshee ? I don’t know, I ‘m not sure Jajuk should become a default music player for two main reasons: first is that it is very powerful but it is probably over-skilled for a limited usage (even if it can handle it) : it is designed to be an “advanced” jukebox. The second reasons is that Jajuk philosophy is to manage a closed list of devices scanned regularly by Jajuk. It is not designed to play files located outside of these devices (like you may do with any player from an explorer application contextual menu for instance): audio files have to be located in known devices to be properly handled by Jajuk. It is for me one of the main differences between a player and a jukebox. To sum up, I’ll say that Jajuk could become the default *jukebox* application on some distros but along with another default *player* application.
Q: And regarding the Project, I noticed the nice team at work with you, Do you think that the readers of this article could help you in some fields ? And if so where should they check to contact you or get more informations ?
A: See [6] to contact us. Help wanted page is available from [7]. We need more developers to accelerate Jajuk roadmap (we have more than 150 tasks in the FIFO!, see [8]) but development of a feature is only 20 to 30% of the work : we also need testing, documenting, translating, packaging these features too. Note that most tasks doesn’t require any programming skill but only time, organization and a close project monitoring. I personally spend around 80% of my time doing others tasks than coding. We also need some translations upgrades, like the Italian langpack ! (see [9]).
[6] http://jajuk.info/index.php/Contact_Us
[7] http://jajuk.info/index.php/Help_Wanted
[8] http://trac.jajuk.info/wiki/TicketStatsTask
[9] http://jajuk.info/index.php/Translator_Guide
Q: Anything you might like to add?
A: Thanks for your time you spent with me for this interview, it was a pleasure. We love getting users feedback, they can leave comments about Jajuk at [10]. We really hope your readers will enjoy Jajuk and that it will be used in many houses for the Christmas party night !
[10] http://jajuk.info/index.php/Give_Feedback
Thanks for your time Bertrand, jajuk is really an interesting project and I’m sure that some of my reader will try it, in the meantime check these screencast: http://jajuk.info/index.php/Demos
]]>