An equaliser that works with MPD and ALSA

A few months ago I was looking for a way to lower the amplification of the lower frequencies while listening to music on extremely bass-heavy in-ear headphones. The only way to accomplish that, seemed to be using JACK. Since that seemed overkill to me, I gave up.

Today I found a solution that does not require JACK: Charles Eidsness’ ALSAEQUAL. This is how you get it working with MPD on Gentoo:

  1. `emerge alsaequal`
  2. Create an .asoundrc file in the home directory of the user that runs MPD on your system (see `grep "^user" /etc/mpd.conf`) with the following content:

    ctl.equal {
      type equal;
    }
    
    pcm.plugequal {
      type equal;
      slave.pcm "plug:dmix";
    }
    
    pcm.equal {
      # Or if you want the equalizer to be your
      # default soundcard uncomment the following
      # line and comment the above line.
    # pcm.!default {
      type plug;
      slave.pcm plugequal;
    }
    

    (copied from the ALSAEQUAL website – modified so that dmix is being used, which allows playing multiple audio sources simultaneously)

  3. Find the audio_output section in your /etc/mpd.conf where you currently configure MPD to use ALSA’s default device. Change it so that it looks like
    audio_output {
      type    "alsa"
      name    "equal"
      device  "plug:plugequal"
    }
    
  4. `/etc/init.d/alsasound restart && /etc/init.d/mpd restart`
  5. Play a track with MPD, then run `alsamixer -D equal`*. Modify any of the frequency band sliders and observe the effect.

Other applications will be unaffected by the equaliser, if you don’t change the .asoundrc according to the comment, and if you don’t configure them to use the ‘equal’ ALSA device.

*) Note that alsamixer needs to be run as the user that runs mpd. See Ian’s comment for details.

Update (2012-06-16): Having the .asoundrc in place causes Skype to crash after a few seconds (see also this Gentoo Forums post).