Building your own gstreamer-lame plugin on Debian GNU/Linux (or, "How do I rip mp3s with Sound Juicer?")

Maybe this is all pretty obvious stuff, but I looked high and low for a how-to like this, and couldn't find it. The best I could find was someone suggesting the use of alien on an rpm. This didn't fill me with a sense of security. So, if you were trying to figure out how to build your own, I hope this page helps. Remember, I'm not saying this is the best way to do this. But it worked well enough for me.

How-to

Since Debian can't ship lame for legal reasons, there is no gstreamer plugin for it. This means that you cannot use soundjuicer (or rhythmbox, which it plugs in to) to burn mp3s. Yes, ogg vorbis is better and free, but if you want to, say, give your music to someone who has an iPod, then the ability to burn mp3s is still pretty nice.

So, here's how I did it. I'm assuming that you're running Debian Sid, though Sarge and Ubuntu would probably work here as well.

  1. First, add Christian Marillat's unofficial repository to your sources list.
    deb ftp://ftp.nerim.net/debian-marillat/ unstable main
    
    This has packages for mplayer, gmplayer, and codecs, as well as lame. Okay, now once that's in your sources.list, use apt (or aptitude, or synaptic) to get the following packages: lame, lame-extras, and liblame-dev. (I don't think that lame-extras is actually necessary here, but I don't feel like building again without it to check. Feel free to try it without it though.)
  2. Now, you'll also need the gstreamer plugin sources. If you're using Debian, just do it the easy way. First cd to a directory where you want the sources to be. Then type
    apt-get source gstreamer0.8-misc
    
    This will download the sources, apply the Debian patches, and so on. (We're not really going to be using the Debian packaging utilities here, but it's still nice to be able to get the source from the command line.)
  3. I should remark at this point that I didn't keep track of all the build dependencies, so I can't tell you the extent of the development libraries you'll need to download. It's not huge. In any case, just pay attention to any errors you get on configuring and act accordingly. Everything you need, if there is anything missing, should be available through apt.
  4. Now, I'm assuming you're in the directory where you typed "apt-get source." cd into the gst-plugins0.8_0.8.X.X directory, and type configure (specifying the correct prefix):
    cd gst-plugins0.8-0.8.6 
    ./configure --prefix=/usr
    
    It will take a few moments, and possibly fail. If it fails, look at what it says you're missing, download it, and start again.
  5. Finally, when the configuration is successful, you should have a short list of plugins it can build, and a much longer list of plugins it can't build. The only thing we care about here is that lame is on the list of can-builds. If you have liblame-dev, it should be.
  6. Assuming it says it can build lame, just go into ext/lame and build the package:
    cd ext/lame
    make
    
    Now you have two options for installation. You can either run "make install" as root, as you normally would. The Makefile has an "uninstall" target, so that should be pretty safe. Or, you can run checkinstall, which will let you build a debian package. If you do run checkinstall, though, three points to remember: (a) make sure you give your package a name like "gstreamer0.8-lame," which won't conflict with any existing packages; (b) give it a version number -- checkinstall doesn't and dpkg gets mad; (c) either run checkinstall with the "--nodoc" option, or with an alternate doc directory (e.g. "checkinstall -D --docdir=/usr/share/doc/gstreamer0.8-lame"). [Thanks to Lovadina Nicola for this tip]
  7. Check to make sure that libgstlame.so is in /usr/lib/gstreamer-0.8. It should be if you set the prefix correctly in the configure step. Now just run
    gst-register-0.8
    
    to make gstreamer aware of the new plugin, and you should be ready to go. Next time you start up sound-juicer (or whatever) the mp3 option should be available and functioning.

UPDATE (11 Apr, 2005): For some reason, the new releases of sound-juicer have made enabling mp3-burning a much clumsier operation. I mainly use goobox these days, so I hadn't noticed. But one helpful soul named Christian has sent me an email in which he offers these directions:

  1. Launch gnome-audio-profiles-properties
  2. Add a new profile, name it something like "Cd-quality, lossy, compatible"
  3. Set the pipeline to:
    audio/x-raw-int,rate=44100,channels=2 ! lame name=enc quality=0 preset=1001 
    
    (this is for high-quality, standard preset, see 'gst-inspect-0.8 lame' for options)
  4. Set the fileextention to mp3
  5. Make sure the "Active" checkbox is active
  6. Set a description if you like
  7. (Re)start sound-juicer

Links

Here is some other stuff of interest:

Contact Me

< jr2075 (at) columbia.edu >