How to force ALSA applications to use JACK

From ArticleWorld


JACK is quickly becoming the new standard in Unix sound processing tools. Due to its very low latency and support for many advanced features, even the ALSA developers have decided to fully support JACK through the ALSA API.

This is why ALSA includes a JACK plug in, which allows any ALSA application to use the JACK toolkit without re-compilation. The expense is a very slight CPU overhead.

Here is how to use this.

Procedure

  • Install and configure JACK, either from source or using your distribution's package manager and repositories. Make sure it is up and running.
  • Open ~/.asoundrc or /etc/asound.conf in your favorite text editor and copy the following lines:
pcm.jackplug {
    type plug
    slave { pcm "jack" }
}

pcm.jack {
    type jack
    playback_ports {
        0 alsa_pcm:playback_1
        1 alsa_pcm:playback_2
    }
    capture_ports {
        0 alsa_pcm:capture_1
        1 alsa_pcm:capture_2
    }
}
  • Restart the ALSA init script (either by re-running it, or by simply restarting your computer).

Notes

Some people recommend replacing jackplug with !default. Some applications will refuse to work in this case though.