Amarok/Archives/Amarok 1.4/User Guide/Ladspa HowTo

From KDE Community Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Ladspa HowTo

This HowTo will explain how to set up LADSPA filters for Amarok.

Because Amarok does not directly support LADSPA, we need to take another way: Tell ALSA to utilise the LADSPA filters.

  1. Install the LADSPA header file and your plugins.

- On Gentoo, this is done by emerging ladspa-sdk and e.g. tap-plugins)

  1. Edit your ALSA configuration file.

- This can be done globally by editing or creating /etc/asound.conf, or locally by editing or creating ~/.asoundrc.

1pcm.ladspa {
  type ladspa
  slave.pcm "plughw:0,0";
  path "/usr/lib/ladspa";
  plugins [
    {
      label tap_bs2b
      input {
        controls [ 3 1 ]
      }
    }
 ]
}

pcm.!default {
  type plug
  slave.pcm "ladspa"
} 

In this example, the bs2b plugin is set up. "pcm.ladspa" defines a new LADSPA filter, and "pcm.!default" redefines your default device, that means that every sound that is played through ALSA, will be played with LADSPA filters applied.

The settings:

  • path: This is where your LADSPA filters are located.
  • label: The name of your plugin.
  • input { controls [ .... ] } : This configures your plugins. There are some that don't need configuration, and some that will not work without. Your best chances to find the configuration option for your plugin would be Google, or having a look at the plugin's source code itself.

Now you probably want to add more than one filter. This is also possible:

1pcm.reverb {
  type ladspa
  slave.pcm "bs2b"
  path "/usr/lib/ladspa";
  plugins [
    {
      label tap_reverb
    }
  ]
}

pcm.bs2b {
  type ladspa
  slave.pcm "plughw:0,0";
  path "/usr/lib/ladspa";
  plugins [
    {
      label tap_bs2b
      input {
        controls [ 3 1 ]
      }
    }
 ]
}

pcm.!default {
  type plug
  slave.pcm "reverb"
} 

Here we connect the reverb plugin with the bs2b plugin from before (which sounds ugly, but is a nice demonstration that everything works :-) ). When you start at the default device, you can see that we now use the reverb device. Reverb itself uses the bs2b device, from which then the final step to the sound card is taken.

Finally, you just need to make sure that Amarok uses ALSA as its output (e.g. set the Xine-engine output plugin to ALSA).