Purpose: Have you been addicted to XMMS to play your music files on your Linux system? If you are and looking to continue to do that you might be well prepared for a change in the way you have been using XMMS.  XMMS2, the new version of XMMS, is completely re-written from scratch to support the client-server model. It is a much more complex program (but still simple to use) than what it use to be before. The purpose of this post is to quickly explain how you can play music with XMMS2 without going into the details of client-server model. If you wish to learn more about it visit the XMMS2’s home page.

What got changed?

Earlier to play music on XMMS (older version of XMMS2) all you need to do was:

  1. apt-get install xmms
  2. Launch XMMS from the menu or command line
  3. Play music and you are done.

You use to get a pretty graphical interface like this one:

Old XMMS player

Old XMMS player

However don’t be surprise if you don’t see something like this with the new XMMS2.

OK, let’s get started with XMMS2 assuming you are using a Debian or a Debian-based distro like Ubuntu and are logged in as root.

Step 1:  Install XMMS2

The upcoming new version of Debian i.e. Lenny (5.0) has XMMS2 and so did Etch (4.), the current stable version of Debian. Lenny no longer has the old XMMS which use to ship with Etch.
# apt-get install xmms2

Let’s look at some of the files that are installed by default.

debian:# xmms2 (tab)
xmms2           xmms2d          xmms2-launcher

Let’s see what do each of them do:

xmms2d – Daemon/Server that needs to be launched first

xmms2 – Client for XMMS2 which connects with xmms2d (daemon)

xmms2-launcher – script which basically launches xmms2d

Step 2: Launch the daemon

In order to play music the first thing that you need to do is launch the daemon by giving the following command from a regular user account and NOT root:

user@debian:~$ xmms2-launcher
Log output will be stored in /home/user/.cache/xmms2/xmms2d.log
xmms2 started
user@debian:~$

In case if you tried to launch it from the root account you will get an error message like this one:

debian:~# xmms2-launcher
Log output will be stored in /root/.cache/xmms2/xmms2d.log
startup failed!
debian:~#

Here is what the log file has to say:

--- Starting new xmms2d ---
PLEASE DON'T RUN XMMS2D AS ROOT!
(if you really must, read the help)
/root/.cache/xmms2/xmms2d.log (END)

Step 3: Launch the client

You are still couple of steps away from listening to your favorite music. Now you need to launch the client (xmms2). Simply giving the command:

user@debian:~$ xmms2

won’t work and all you will see if the help options. Instead try this:

user@debian:~$ xmms2 add /root/sound_test.mp3
Added /root/sound_test.mp3
user@debian:~$

Basically we added some music file to the XMMS2 library.

Step 4: Play the music

Finally we can now play the music. Just give the command:

user@debian:~$ xmms2 play

Yes that’s right. Not fancy GUI (so far). Just play music from command line.

Not hearing anything?  Go to the basics  – have you plugged your speaker or earphone? :D

Also make sure that your Master Volume control is not set to mute. This is a very common problem that I have faced. Just use any mixer program like aumix or amixer to make sure that your Vol and PCM are set to decent level. If you are in a GNOME, then you can simply click on the Volume icon on the top left corner of your screen.

To stop music:
# xmms2 stop

To see volume level:
#xmms2 volume_list
left = 77
right = 77

To set the volume level:
# xmms2 volume 50
left = 52
right = 52

Note: Not sure why does it increment by 2 more.

Step 5: Looking for something fancy?

There are many client version GUI that are written for XMMS2. Debian has one for GNOME.

# apt-get install gxmms2
# gxmms2

You should see something like this:

gxmms2

There are many clients available for XMMS2.  Debian use two of them: gxmms2 and abraca.

Step 6: Support for your type of music file

In the above example we played an MP3 music file. We were lucky that XMMS2 by defaults installs the support for MP3 files by installing the MP3 decoder in the form of a plugin package called xmms2-plugin-mad.

Depending on your music type file you can find which plugin you need. Look at the “Other Hits” section. There is a long list of plugins and I am sure you will find that you are looking for.

Additional Notes:

So far I have not been able to find out a way by which we can play music as a ‘root’ user. In case if I find one I will make sure I will update this post or create a new entry.

As usual, please leave a comment/feedback if you have any. Comments encourages bloggers to post more and keep their spirits high.

Also don’t forget to rate this post below.

Be Sociable, Share!