How to add MP3 support to your Linux Distribution?

By root
root@linuxmint.com

June 21, 2006

Problem

You've just installed a new Linux distribution on your computer and it won't play your MP3 files? All your songs are encoded in that format and you don't know what to do? Well, don't worry. This is a common problem in Linux and it has a simple solution.
 
Most Linux distributions made the choice not to include MP3 support by default, for instance: Ubuntu, SUSE, Fedora, Debian...etc.

A minority of distributions do support MP3 though, for instance: Mandriva, Mepis, PCLinuxOS...etc.

Reason

You might wonder why these distributions decided not to include mp3 support. After all, mp3 is one of the most widely used format to encode music and a lot of people like to copy their songs from their mp3 players to their computer and vice versa. Since so many people use MP3 it seems unreasonnable not to include it in the distribution.

The  reason is simple. It has to do with patents. MP3 is a compression technology which technique/algorithm was patented by its creators. People didn't know much about this when this format became famous, and since it was free of cost it got very popular. Nowadays a lot of us use MP3. Everybody's music files are stored in this format, and thus it cannot be played without using the MP3 decryption algorithm which itself is patented. In countries which allow algorithms to be patented, this can be a problem since the creators of MP3 can actually prevent you from decrypting your own music files, or even demand that you pay money to use their algorithm. People used the MP3 technology to save their audio data, and they are now relying on a company to exerce the right to access it. This is commonly refered to as vendor-locking.

Here is a very interesting text from Richard Stallmann about this:

"Imagine that each time you made a software design decision, and especially whenever you used an algorithm that you read in a journal or implemented a feature that users ask for, you took a risk of being sued. That's how it is today in the US, because of software patents. Soon it may be the same in most of Europe [...]

In the US and some other countries, free software for MP3 is impossible; in 1998, US developers who had developed free MP3-generation programs were threatened with patent lawsuits, and forced to withdraw them. Some are now distributed in European countries -- but if the European Patent Office makes this planned change, they may become unavailable there too. [...]

Copyright 1999 Richard Stallman
Verbatim copying and redistribution of this entire article is permitted provided this notice is preserved."

When it comes to distributing a free operating system and adhering to free software principles, there is simply no room for patented technologies and restrictive licences.

Ubuntu justifies their choice by saying:

"Ubuntu strives to make every piece of software available under the licensing terms laid out in the Ubuntu License Policy. Patent and copyright restrictions complicate a free operating system's ability to distribute software that will support proprietary or non-free formats. Because of its commitment to only include completely free software by default, Ubuntu does not support proprietary media formats 'out of the box'."

Fedora says:

"MP3 encoding/decoding support is not included in any Fedora application because MP3 is heavily patented in several regions including the United States. The patent holder is unwilling to give an unrestricted patent grant, as required by the GPL. Other platforms might have paid the royalty and/or included proprietary software. Other Linux distributions not based in a region affected by the patent might ship MP3 decoders/encoders or they might have included proprietary software. However, Fedora Core cannot and does not ship MP3 decoders/encoders in order to serve the goal of shipping only free and open source software that is not restricted by software patents."

General Solution

The best solution is to avoid using MP3 altogether. There are other formats which are free and also more efficient than MP3 at encoding audio files. The most popular of them is called OGG Vorbis.

Of course, you probably already have a large collection of MP3, and even if you started converting them, your MP3 player probably doesn't support OGG. You are a victim of vendor-locking, and the consequence of this is: it will not be easy for you to stop using MP3.

Fortunately, it is quite easy to add MP3 support to your Linux distribution. In fact, the players which are installed in your Linux system are well able to read MP3, all they need is a plugin, which will contain the decompression algorithm. It is this plugin that you need to install.

Add MP3 support in Ubuntu 6.06 - Dapper Drake

In Ubuntu 6.06, make sure you added the Universe and Multiverse repositories and install the package gstreamer0.10-plugins-ugly.

Add MP3 support in Fedora Core 5

Make sure you added the LIVNA repository. Then, depending on your players:

Add MP3 support in SUSE 10.1

For xine-based players (e.g. amarok, if you have the package "amarok-xine" installed and selected the "xine" engine in its configuration, which is highly recommended anyway), you should add the Packman [1] repository to your list of installation sources and install the package "libxine1".

For MP3 support in k3b, the popular CD/DVD burning application, upgrade to the latest k3b version from the Packman repository and install the package "k3b-mad".
 
Last but not least, also add the Guru [2] repository to your list of installation sources and install the "libtunepimp-mad" and "libtunepimp-faad2" packages. Note that you'll also find the latest amarok version in the Guru repository, amongst others.
 
[1] http://packman.links2linux.org
[2] http://linux01.gwdg.de/~pbleser/

Note: Thanks to Pascal for this solution (see comments).


Your player probably DOES support Ogg Vo

By Nostromo

June 22, 2006

"your MP3 player probably doesn't support OGG"
That's simply not true. Most players support Ogg Vorbis natively, the others just need a plugin.
The best way to go is to convert your MP3 files to Ogg Vorbis.

20:09:38


By root

June 23, 2006

2006-06-23

Yes, I was referring to MP3 player devices. For instance, the one I have is an i-bead 100 and it doesn't support OGG by default. It is also hard to find a firmware for it that would support OGG as the performance of the player itself are not good enough to decompress this format.

Eventually I'll have to buy a new portable player, but until them I can't really convert my music files to OGG. I'm stuck :)


Information not accurate for SUSE Linux

By Pascal Bleser

June 25, 2006

Good writeup, especially on the patents, but unfortunately the information for SUSE Linux is not correct: the w32codec-all package has nothing to do with MP3 de/encoding (it's actually for proprietary video codecs for MPlayer, xine, kaffeine, ...).
 
For xine-based players (e.g. amarok, if you have the package "amarok-xine" installed and selected the "xine" engine in its configuration, which is highly recommended anyway), you should indeed add the Packman [1] repository to your list of installation sources - but then, install the package "libxine1" from Packman instead.
For MP3 support in k3b, the popular CD/DVD burning application, upgrade to the latest k3b version from the Packman repository and also install the package "k3b-mad".
 
Last but not least, also add the Guru [2] repository to your list of installation sources and install the "libtunepimp-mad" package (as well as "libtunepimp-faad2" if you're on SUSE 10.1). Note that you'll also find the latest amarok version in the Guru repository, amongst others.
 
[1] http://packman.links2linux.org
[2] http://linux01.gwdg.de/~pbleser/

07:46:22


By root

June 25, 2006

Bonjour Pascal,
 
Thanks for the feedback. I've corrected the mistake in the article and replaced it with the solution you described.
 
Regards,
Cordialement,
root.

09:49:21


Copyright 2006 http://linuxmint.com/