polemon.org
 

Musepack

Musepack is an audio codec which is on par with Ogg/Vorbis, AAC and MP3. I wanted to do some testing, as it creates very good results in the upper bitrate ranges (160-180kb/s average).

Compiling Musepack

The compilation process under Linux for Musepack is mostly broken. I had to work-around parts of the build process, as there is little to no documentation at all.

I used Fedora 14 with zsh when making this manual.

In fact, there's two ways how to do it, I'll describe both. I assume you have things like compilers, autotools, cmake etc already installed, so I'll just focus on the quirks that come up when compiling those particular packages. I recommend using the cmake solution. It's full of work-arounds but the end result is better, as it installs all shared libraries, etc.

Note: Do only either Step 1a or Step 1b! Do not do both, one after another!

Note: Do only either Step 2a or Step 2b! Do not do both, one after another!

Step 1a: Download and Unpack

This get's you the latest version, that resembles a release more than anything else, so it's probably not gonna crash while using it:

  • Go to http://musepack.net/index.php?pg=src, and download the following files:
    1. Musepack SV8 libs & tools
    2. libreplaygain
    3. libcuefile
  • Then unpack them next to each other with tar.
  • Once you've done that, I recommend you rename the directory, so you don't have the revision number as part of the directory name:

Those are the links to the revision I used, yours might have a different revision Number):

~ $ wget http://files.musepack.net/source/musepack_src_r435.tar.gz http://files.musepack.net/source/libreplaygain_r453.tar.gz http://files.musepack.net/source/libcuefile_r453.tar.gz
~ $ tar xf musepack_src_r435.tar.gz
~ $ tar xf libreplaygain_r453.tar.gz
~ $ tar xf libcuefile_r453.tar.gz
~ $ mv musepack_src_r435 libmpc
~ $ mv libreplaygain_r453 libreplaygain
~ $ mv libcuefile_r453 libcuefile

Step 1b: Get sources from SVN

SVN sources may be broken sometimes, but in case you're interested in testing bleeding edge software, go for this:

  • Make sure SVN is installed.
  • Do a SVN checkout of of libmpc, libcuefile, and libreplaygain:
~ $ svn export http://svn.musepack.net/libmpc/trunk libmpc
~ $ svn export http://svn.musepack.net/libcuefile libcuefile
~ $ svn export http://svn.musepack.net/libreplaygain libreplaygain

Step 2a: Compiling without Cmake

This solution doesn't use cmake, but doesn't install some shared libraries as well. I therefore advise you to go for the other solution, and take a look at Step 2b instead.

  • After unpacking is done, go into the libreplaygain directory and build it with standard autotools:
~ $ cd libreplaygain
~/libreplaygain $ autoreconf -vif
~/libreplaygain $ ./configure && make && sudo make install
~/libreplaygain $ cd ..
  • Next, you need to compile libcuefile yourself, and create the lib archive:
~ $ cd libcuefile/src
~/libcuefile/src $ for file in *c; do gcc -I../include -c -o ${file%%.c}.o $file; done
~/libcuefile/src $ ar cru libcuefile.a *o
~/libcuefile/src $ cd ../..

This should work in most shells, like bash-4.0 or zsh.

  • Now you can use those libs when compiling Musepack:
~ $ cd libmpc
~/libmpc $ autoreconf -vif
~/libmpc $ CFLAGS=-I../../libcuefile_r453/include LDFLAGS=-L../../libcuefile_r453/src ./configure
~/libmpc $ make && sudo make install
~/libmpc $ cd ..

There! That's all there is to it! I don't recommend using this solution though, since it doesn't install most of the .so files that are needed for players, or include-files you may need when compiling software that needs those libs. I therefore strongly advise you, to go for Step 2b instead! It's a little bit ugly, but you get a better result.

Step 2b: Compiling with Cmake

This solution uses cmake as intended by the developers. Problem is, there are some bugs in the build process, that need to be worked around:

  • Take care of libreplaygain first. We need to copy the include-files ourself:
~ $ cd libreplaygain
~/libreplaygain $ cmake . && make && sudo make install
~/libreplaygain $ sudo cp -R include/replaygain /usr/local/include
~/libreplaygain $ sudo chmod -x /usr/local/include/replaygain/*
~/libreplaygain $ cd ..
  • Pretty much the same thing needs to be done with libcuefile:
~ $ cd libcuefile
~/libcuefile $ cmake . && make && sudo make install
~/libcuefile $ sudo cp -R include/cuetools /usr/local/include
~/libcuefile $ sudo chmod -x /usr/local/include/cuetools/*
~/libcuefile $ cd ..
  • Compiling Musepack needs to be done without cmake, as most of the CMakeLists.txt files are broken:
~ $ cd libmpc
~/libmpc $ autoreconf -vif
~/libmpc $ ./configure && make && sudo make install
~/libmpc $ cd ..

And you're done!

This will provide you with all mpc* binaries, as well as libcuefile.so, libmpcdec.so, libreplaygain.so, and their headerfiles.

Comment on usability

I worked through the build process the way it is most beneficial to me. There's another manual about it on the Musepack Trac, but it doesn't install the way I want it to, so I prefer my own solution. But in case you're curious about the official way, feel free to test it out, it shouldn't break anything.

 
musepack.txt · Last modified: 2011/01/12 05:39 by polemon
 
RSS • 2012 © --polemon Powered by: