[pulseaudio-discuss] how can pulseaudio and direct ALSA work at the same time?

Sean McNamara smcnam at gmail.com
Sun Nov 9 09:08:49 PST 2008


What to Do:

1.   Please read the wiki. You need to configure the ALSA<->Pulse
plugin as specified in
http://www.pulseaudio.org/wiki/PerfectSetup#ALSAApplications

2.   You need to tell mplayer to use the ALSA<->Pulse plugin:
mplayer -ao alsa device=pulse t.mp3

Further Explanation:

"Direct ALSA" means, to me at least, accessing the "hw:0" or "front:0"
device in ALSA. Only the emu10k1 cards have well-supported hardware
mixing in ALSA; all other cards either don't have hardware mixing at
all (98% of them) or they have it, but ALSA doesn't support it (<1% of
them). Therefore, if you have a soundcard which lacks hardware mixing
support, only one application can access hw:0 or front:0 at any given
time. PulseAudio *is* that one application while it's running. That's
why the pulse plugin exists: it re-routes ALSA applications to use
pulseaudio under the hood.

So what you're really getting is "indirect ALSA", because you're not
directly accessing the hardware through the ALSA API. If that doesn't
work for you, you need to either suspend/kill pulseaudio, or get a
card that supports hardware mixing. Another option would be to run
pulseaudio itself under dmix, and dmix all other applications that
need to use ALSA. This usually results in pulseaudio exhibiting
sub-par latency and dropout characteristics, because the sound is
being mixed twice (once by pulseaudio, once by dmix), but YMMV.

HTH,

Sean


On Sat, Nov 8, 2008 at 7:43 PM, Péter Szabó <ptspts at gmail.com> wrote:
> Hi,
>
> Is it possible to run pulseaudio and direct alsa playback at the same
> time? `mplayer -ao alsa' and `mplayer -ao pulse' both work fine for me
> when run one after another, but while `mplayer -ao pulse t.mp3' is
> running, `mplater -ao alsa t.mp3' fails to start, I get Device or
> resource busy. Is there a configuration option that lets these work
> together? alsa dmix works fine for me: two instances of `mplayer -ao
> alsa' work cuncurrently.
>
> Thanks,
>
> Péter
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>



More information about the pulseaudio-discuss mailing list