Playing MP3s in KDE

Back to The Unofficial Fedora FAQ


  1. Q: I don't like XMMS; I'd rather use a KDE audio player such as Noatun or Juk. How do I enable MP3 support in KDE?
    A: The quickest way to do this is to upgrade your Fedora installation using packages from the KDE for Red Hat Linux project. Follow the instructions on that page to install the project's specially-crafted Fedora version of KDE, which comes with all MP3 support enabled.

    Alternatively, you can recompile KDE's multimedia functionality. Here's how to do that, in Fedora Core 2:

    1. Install the kdemultimedia SRPM (source RPM). You can get it from most Fedora mirrors in the fedora/linux/core/2/SRPMS/ directory. Download the file kdemultimedia-3.2.2-2.src.rpm. Once you've downloaded it, run the command rpm -ivh kdemultimedia-3.2.2-2.src.rpm as root to install the source code in /usr/src/redhat/.

    2. Download the official, non-Fedora-patched kdemultimedia package. You can get it from most KDE mirrors in the kde/stable/3.2.2/src/ directory. Download the file kdemultimedia-3.2.2.tar.bz2 and move it into /usr/src/redhat/SOURCES/ on your system. (Note that the kdemultimedia SRPM will have placed the file kdemultimedia-3.2.2-patched.tar.bz2 in that directory; that's the castrated source code that Fedora provides.)

    3. Install the dependencies needed to build the package. Run this command:

      yum install fontconfig-devel freetype-devel pkgconfig qt-devel xorg-x11-devel alsa-lib-devel arts-devel audiofile-devel esound-devel glib2-devel kdebase-devel kdelibs-devel libart_lgpl-devel libjpeg-devel cdparanoia-devel libmng-devel desktop-file-utils flac-devel gstreamer-devel libmusicbrainz-devel lame lame-devel libpng-devel libselinux-devel

      Also, you'll want the taglib and taglib-devel packages, which aren't available in the official or livna.org repositories at the time of this writing. You can get RPMs from KDE mirrors in the kde/stable/3.2.2/RedHat/Fedora/i386/ directory. When you've downloaded taglib-1.0-0.1.i386.rpm and taglib-devel-1.0-0.1.i386.rpm, execute the command rpm -ivh taglib-1.0-0.1.i386.rpm taglib-devel-1.0-0.1.i386.rpm to install them.

    4. Edit the RPM spec file to enable MP3 support. In the file /usr/src/redhat/SPECS/kdemultimedia.spec, make these three changes:

      1. Change %define build_mpeglib 0 to %define build_mpeglib 1.
      2. Change Release: 2 to Release: 2mp3.
      3. Change Epoch: 6 to Epoch: 7.
    5. Compile the RPM. Make sure you have the package rpm-build installed. (If you don't, run the command yum install rpm-build as root to install it.) Then, as root, run the command rpmbuild -bb /usr/src/redhat/SPECS/kdemultimedia.spec. It will take a long time. If there are build errors, make sure you've installed all the -devel packages listed above. If you're certain you installed all of those, take a look at the specific build error, copy-and-paste it into Google, and chances are you'll find out why the build failed.

    6. Install the newly-created RPM. The rpmbuild command, if successful, creates three RPMs in /usr/src/redhat/RPMS/i386/ -- kdemultimedia, kdemultimedia-debuginfo and kdemultimedia-devel. The one you're interested in is kdemultimedia. To install it, run the command rpm -Uvh kdemultimedia-3.2.2-2mp3.i386.rpm. (Using "Uvh" instead of "ivh" will upgrade the package, because it's likely already installed on your system.)

    7. You're done. Restart KDE, and enjoy full MP3 support in KDE apps.

    (Answer submitted by Adrian Holovaty. Thanks to strawman on #fedora for inspiration.)