[pulseaudio-discuss] Wait on sound cards before starting PA, and stream routing
David Henningsson
david.henningsson at canonical.com
Mon Aug 16 12:38:12 PDT 2010
We had a problem with PA a few days ago which I analyzed as the following:
PA started up for the first time, i e without a .pulse directory.
Due to racy startup conditions (we're all trying to boot up as quick as
possible nowadays), sometimes the start order was as follows:
1) Sound card #2 was probed and announced from the kernel
2) PA was started up and found sound card #2
3) Some client or module asked for the fallback/default device
4) Since there was no current default device, it was auto-set to sound
card #2
5) Sound card #1 was probed and announced from the kernel, but was not
selected as default - even if the priority was higher, since the default
had already been set.
My workaround was to write a simple wait-on-file-access module that
waited for /dev/snd/controlC0 and /dev/snd/controlC1 before continuing,
and then I placed that one on the top of /etc/pulse/default.pa for this
particular hardware. I found it the least ugly workaround at the time,
and should upstream be interested in merging this module, I'd be happy
to prepare a git patch for either master or stable-queue as you see fit.
The long-term solution - and this is more my own thoughts than an
official standpoint from Canonical - probably would include writing
something that takes on the entire problem of deciding stream routing,
because now we have many modules which all try to solve their piece of
the puzzle, but instead end up shooting each other's feet.
I know Colin have done a lot of work in this area already (thank you
Colin!), and so Colin, it would be nice to have a little status update:
- Did the implementation turn out the same way you described in your
February blog post?
- Is this ready for testing in pulseaudio git master?
- What remains until this is ready for everyday usage?
--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
More information about the pulseaudio-discuss
mailing list