# Linux – How to configure PulseAudio to input/output via ALSA

alsaaudiolinuxpulse-audioskype

How do I configure PulseAudio to use only a single ALSA device for input and output?

The default PulseAudio configuration causes PulseAudio to open all ALSA devices when it starts. This makes it impossible to use PulseAudio together with other ALSA clients. Many people prefer PulseAudio to ALSA, but other users find it frustrating. For better or worse, PulseAudio has become a standard and several popular Linux applications, such as Skype and Firefox, only support audio output via PulseAudio.

Some users prefer to work with audio clients that output directly to ALSA, others output to another audio framework like JACK, but want to have JACK access ALSA directly. For these users, it is easy to free up all the ALSA devices by uninstalling PulseAudio. However, removing PulseAudio makes it impossible to use audio in Skype and Firefox.

A better solution would be to come up with a configuration that gets PulseAudio to "play nicely" with other ALSA clients, outputting to only a single device, which would be specified in its configuration, or even just the ALSA default device. How can we do that?

You don't configure PulseAudio to use the ALSA default device. Instead, you configure ALSA to use pulse as the default device:

pcm.!default pulse
ctl.!default pulse


In that way, ALSA applications that are not aware of PulseAudio will use PulseAudio via that indirection layer.

The reason you need to do this is that PulseAudio always uses ALSA as backend, and on startup opens all ALSA devices, and since most ALSA devices can't be opened multiple times, this will cause all ALSA applications that try to use an ALSA device directly when PulseAudio is running to fail.

If you have a legacy application that for some reason doesn't work, you can use pasuspender to temporary suspend PulseAudio to run this particular application.

I was actually in a similar situation like you are now, I used ALSA for a long time, and was happy, and was then forced to switch to PulseAudio. PulseAudio has in principle a nicer, more general structure than ALSA (streams and sources/sinks), and though sometimes it has warts, one can live with it.

You can debug problems by starting pulseaudio manually and adding -v flags, like pulseaudio -vv start etc. Log messages go to the syslog. If you want to switch devices, pavucontrol is an easy-to-use GUI, and if you want more direct control, you can use pacmd or pactl (I never figured out why there are two programs) as a commandline CLI. Use the help argument for more details. If you prefer files, everything easily scriptable.

I also recommend to have a look at the available modules.