Alsaequal

Alsaequal is a real-time adjustable equalizer plugin for ALSA. It can be adjusted using an ALSA compatible mixer, like alsamixergui or alsamixer.

Alsaequal uses the Eq CAPS LADSPA Plugin as it's default equalizer but you can change it to use almost any LADSPA plugin, like mbeq from the swh-plugin package. Though alsaequal is primarily intended to be used as an equalizer you should be able to use it to control any LADSPA plugin. It's similar in functionality to the LADSPA plugin provided with ALSA but allows for real-time controls as opposed to static controls defined in the asoundrc file. If you have any issues using alsaequal with other LADSPA plugins you can contact me at charles@thedigitalmachine.net for help.

New in the Latest Release

Fixed compatibility issues with some applications that were giving an "unable to find library" error.

Download

alsaequal-0.6

Installation

Download the latest version of the plugin and:
tar xvjf alsaequal-x.x.tar.bz2
cd alsaequal-x.x
make
sudo make install

Dependencies

CAPS LADSPA Package, it's also available as a package in Ubuntu, i.e. "sudo apt-get install caps"
ALSA Development headers and alsa-lib -- you may already have it as part of your linux distro, you can install in Ubuntu with "sudo apt-get install libasound2-dev"
If you want to try out mbeq you will also need the swh-plugins, i.e. "sudo apt-get install swh-plugins".

Usage

After installing you will have to modify your local .asoundrc alsa configuration file, adding something like this. If you're not using sound card 0 modify "plughw:0,0" accordingly.


ctl.equal {
  type equal;
}

pcm.plugequal {
  type equal;
  # Modify the line below if you don't
  # want to use sound card 0.
  slave.pcm "plughw:0,0";
  # or if you want to use with multiple applications output to dmix
  # 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;
}
					

You can play audio through alsaequal by addressing the plugin by name, e.g. with mpg321
mpg123 -a hw:equal 06.Back_In_Black.mp3
Note: The "hw:" before the "equal" is a work-around for an mpg321 specific bug, with other applications you can probably use "equal" as the card name. Or just set equal as the default card.
or with mpg123
mpg123 -a equal 06.Back_In_Black.mp3

If you set equal up to be your default card you can just use,
mpg123 06.Back_In_Black.mp3
Many audio application won't let you select a plugin module as your sound card so setting it as your default will be the only way to get it to work with those application.

You can adjust the frequency response of the equalizer by using an ALSA mixer, e.g.
alsamixer -D equal
or if you prefer a gui
alsamixergui -D equal
Unfortunately a lot of mixers don't support control of plugins, so you will probably have to use either alsamixer or alsamixergui.

The mixer settings are stored in a file called .alasequal.bin in your home directory, you can change the filename using the controls keyword in asoundrc (see below). You can also copy this file to store different settings. If you change the LADSPA plugin you will have to delete this file.

Gentoo User's

You can find step by step instructions for using alsaequal with Gentoo on Patrick's blog post, it has some good ideas for non-Gentoo distros too; like using dmix as the output so you can play from multiple sources at the same time.

Other alsaequal Tutorials

Some folks have been kind enough to mention alsaequal in their blogs, which you may find useful:
Howto Install from Source on Debian / Ubuntu
More Debian / Ununtu Info
Using with MPD
Arch Linux Related

Help

If you need any help you can reach me at: charles@thedigitalmachine.net.

More Advanced Stuff:

If you want to try out alsaequal with other plugins the complete alsaequal configuration (asoundrc) structure follows:


ctl."name_equal" {
  type equal;
  controls -- filename used to store the equalizer settings,
    the default is $HOME/.alsaequal.bin
  library -- location of the LADSPA library, the default is
    "/usr/lib/ladspa/caps.so"
  module -- module name within the LADSPA library, the default
    is "Eq"
  channels -- number of channels, the default is 2
}

pcm."name_pcm" {
  type equal;
  slave.pcm -- sound card to output to, will probably have to
    be a plug since alsaequal only supports
    floating point numbers, a "plug" will convert
    the data type, outputting directly to hw won't;
  controls -- filename used to store the equalizer settings,
    the default is $HOME/.alsaequal.bin
  library -- location of the LADSPA library, the default is
    "/usr/lib/ladspa/caps.so"
    module -- module name within the LADSPA library, the default
    is "Eq"
  channels -- number of channels, the default is 2
}
					

You will also probably need to pump the data through a plug to change the format to float, which is all alsaequal supports.


pcm."name_pcm_plug"{
    type plug;
    slave.pcm "name_pcm";
}
					

For instance, if you want to try out mbeq (which some folks prefer) you can use the following asoundrc. You will of course have to install the swh-plugins package.


ctl.equal {
  type equal;
  library "/usr/lib/ladspa/mbeq_1197.so";
  module "mbeq";
}

pcm.plugequal {
  type equal;
  slave.pcm "plughw:0,0";
  library "/usr/lib/ladspa/mbeq_1197.so";
  module "mbeq";
}

pcm.!default {
   type plug;
   slave.pcm plugequal;
}