[pulseaudio-discuss] ALSA plugin "device" parameter

Lennart Poettering lennart at poettering.net
Thu Mar 19 06:20:05 PDT 2009

On Mon, 09.03.09 14:34, Sean McNamara (smcnam at gmail.com) wrote:

> As explained in the readme file:
> 1. The purpose of the "device" parameter is somewhat of a mis-nomer
> :)

Is that so?

> 2. If you are specifying the "device" parameter to an ALSA PCM (a
> playback stream), it is equivalent to specifying a PulseAudio sink.

No. Can be both a sink and a source.

> 3. If you are specifying the "device" parameter to an ALSA CTL (a
> capture stream), it is equivalent to specifying a PulseAudio source.

No. Alsa ctl devices are 'control' devices, i.e. mixers and stuff. 

> PA sinks and sources are uniquely qualified by index and by name. The
> name usually doesn't (shouldn't?) change between boot-ups, whether or
> not HAL initializes your device in one order or another. However, we
> can't rely on the stability of sink/source indexes in PA at all.
> Fortunately, we specify devices by their sink/source name in this configuration.
> If you want to make a static configuration in /etc/pulse/default.pa
> that will let you have stable mappings between sink names and
> ALSA<->Pulse PCMs, you can do this (illustrative example, but using
> this verbatim won't get you a working config):

Uh? module-hal-detect gives you stable mappings anyway.

> In /etc/pulse/default.pa:
> 1. Comment out module-hal-detect
> 2. Add
> load-module module-alsa-sink device=hw:0 sink_name=foo
> load-module module-alsa-source device=hw:0 source_name=bar

Everytime someone uses "hw:0" or "hw:0,0" as ALSA device strings I
kill a kitten. Promised.

Use "front:0" or suchlike. Using hw: makes no sense in 99% of all cases.

Generally, PA sink/source names should be perfectly stable. ALSA
device indexes and PA sink/source indexes are not stable Don't rely on

It is usually a better idea to simply make use of PA's save/restore
stream device feature instead of losing yourself in weird
configuration files. If an application connects to the wrong device
simply fire up pavucontrol and move it to right device and then PA
will remember.


Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

More information about the pulseaudio-discuss mailing list