How-to enable jack in mplayer (Ubuntu Gutsy)

December 16, 2007

In my last how-to we played a multichannel video with surround audio (coded with ac3) using mplayer and jack. Jack (the audio server and router) is perfect to use with firewire audio interfaces. However, the Ubuntu Gutsy mplayer is not jack enabled by default.

To see the list of audio backends:

mplayer -ao help

However, it is very easy to compile a new mplayer .deb package jack enabled. First, create a temp dir (for example debs) and change to it. Install libjack with it’s development headers

sudo apt-get install libjack-dev

Install all the packages to build the mplayer-nogui package. This is done in a single command:

sudo apt-get build-dep mplayer-nogui

Now just get the source package and build it (the -b option is for build). This will take time.

sudo apt-get -b source mplayer-nogui

The mplayer build system automatically searches for libjack headers and when found configures its build system to use jack.

Finally install the new packages (dpkg complains with an error error processing mplayer which you can ignore):

sudo dpkg -i *.deb

To use it, choose the jack audio driver with -ao jack. A nice feature is that it automatically connects all the outputs to the physical device inputs.

mplayer -ao jack someaudiofile.mp3

If your file have more that 2 channels:

mplayer -ao jack -channels 5 surround.wav

As a final note, I’ve checked that debian (not ubuntu) package is jack enabled by default. The reason is that their packaging scripts differ a little bit (specifically debian/control file). The Ubuntu one don’t define the jack-dev build dependency.

Advertisements

4 Responses to “How-to enable jack in mplayer (Ubuntu Gutsy)”

  1. Serge Says:

    Hi,
    I’m on UbuntuStudio 7.10, with the default driver freebob, and the default configuration. I only make sudo addgroup serge disk.
    jackd works well with a Terratec Phase 24.
    But I haven’t jack in mplayer despite your how-to.
    jackd is not in mplayer -ao help
    I’m only a simple user in Ubuntu and I like hear fun music!
    I need mplayer to have sound in sample on amazon.fr
    Thank’s for your help!
    Serge

  2. Serge Says:

    Hi,
    My first OS is ubuntu, my second is UbuntuStudio.
    With Ubuntu mplayer works with jack! With UbuntuStudio no.
    Why ? Because mplayer with jack is in the backports repositories ! And my ubuntu was with the backports, so i upgrade with the backports on UbuntuStudio.
    Why do simple, if there is a complicated method ( proverbe français )
    Serge


  3. Your webpage is a very good summary of your activities. great!

    Wiko looks like very interesting.

  4. Supra Bullet Says:

    I was initially extremely pleased to discover this particular web-site.I want to to thanks for your time for the excellent read!! I ACTUALLY positively taking advantage of every single little bit of it and I had you bookmarked to check out brand-new items you writing.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: