Wednesday, December 29, 2010

How to get mpg321 working with Fedora Core 14

mpg321 is a very popular command-line mp3 player for Linux platform. I use mpg321 for mp3 audio clips playback with Granule.

Needless to say, mpg321 has been a reliable piece of a very useful software for ages and it took me by surprise when all of the sudden, it began to crash left and right under my recently installed Fedora Core 14 that I run as VirtualBox's guest OS.

At first, I naturally assumed that VirtualBox was a culprit to my woes. However, a quick test with Rhythmbox ruled out that hypothesis of mine.

To make a long story short, mpg321 relies on a cross-platform audio library, libao, to play mp3 files. Recently, some internal data structure of libao changed when its latest release was let out in the wild, and mpg321 has not been updated to reflect the change (if you are interested, is a matter of backward compatibility issue entangled with  using uninitialized memory -- learn more from Bug #580062).

The workaround is to uninstall the official mpg321 release, and then download and compile the source code yourself:
  • Uninstall official mpg321,
    sudo rpm -e mpg321
    
  • Download latest source code for mpg321 from its Source Forge download page.
  • Unpack the source code:
    tar xvfz mpg321-0.2.21-1.tar.gz  
  • Install dependency development packages:
     sudo yum -y install libmad-devel libid3tag-devel
    
  • Configure, compile, and install mpg321
    cd mpg321-0.2.21-1
    configure
    make
    sudo make install
    
  • You should have now problem now playing your mp3 files:
    mpg321 music.mp3

No comments:

Post a Comment