2

Various examples on the web, as well as the output of aplay -L, indicate that I have an ALSA device named "pulse" which I can use as a shim to let ALSA-compliant applications output to Pulseaudio.

Presumably this outputs to the default PulseAudio sink by default.

How do I create an ALSA device which outputs to another PulseAudio sink?

2

The source tarball for "alsa-plugins" contains a file which describes the options to the pulse PCM plugin:

alsa-plugins-1.1.1/doc/README-pulse

It lists the following parameters for PCM devices

  • server (name of the PulseAudio server to use)
  • device (name of the PulseAudio source or sink)
  • fallback (PCM to use when we can't connect to PulseAudio server)

The mixer control plugin (e.g. ctl.X) also accepts the parameters "source" and "sink", which are not recognized by the PCM plugin.

The file alsa-plugins-1.1.1/pulse/pcm_pulse.c also lists the additional parameters for PCM plugins:

  • handle_underrun
  • comment

Here is an example of an ~/.asoundrc which outputs to a named PulseAudio sink using the device parameter:

pcm.pulse_test {
    type pulse;
    device "my_sink";
}
  • 1
    BTW, you can also easily switch the Pulseaudio sink of the ALSA application with pavucontrol or pamcd; there's no need to specify one pulse endpoint in ~/.asoundrc for every Pulseaudio sink you want to use. I think the Pulseaudio connection database even restores the sink that was last used for a specific ALSA application, though I may remember that wrongly. – dirkt Mar 13 at 12:01
  • Do you know of a way to specify the device as part of the PCM string, just like you can with plughw:0,0? For example ecasound -o alsa,pulse:device=DEV, but that doesn't work... – Metamorphic Sep 4 at 16:58
  • You cannot specify the device when you use the ALSA wrapper to access Pulseaudio. You need an application that can access Pulseaudio directly to do that. – dirkt Sep 4 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.