Re: [Jack-Devel] ALSA PCM multi plugin and xruns

PrevNext  Index
DateTue, 11 Dec 2012 21:21:22 -0800
From Devin Anderson <[hidden] at gmail dot com>
ToPaul Davis <[hidden] at linuxaudiosystems dot com>
CcJACK <[hidden] at lists dot jackaudio dot org>
In-Reply-ToDevin Anderson Re: [Jack-Devel] ALSA PCM multi plugin and xruns
Follow-UpJörn Nettingsmeier Re: [Jack-Devel] ALSA PCM multi plugin and xruns
On Tue, Dec 11, 2012 at 10:56 AM, Devin Anderson
<[hidden]> wrote:

> Do you know offhand if `snd_pcm_link()` is supposed to synchronize the
> poll file descriptors such that the poll file descriptors of the
> master aren't set with events until both the master card and the card
> it's linked to are ready with I/O?  If so, then the bug is probably
> there somewhere.  If not, then I wonder how this synchronization is
> supposed to happen.

AFAICT, start, stop, drain, pause, suspend, resume, reset, and prepare
operations are all synchronized in the kernel via `snd_pcm_link()`;
however, I can't find any evidence that `snd_pcm_link()` (or any other
ALSA API call, for that matter) will make the poll operation for a
master device wait for I/O availability on its linked slave devices.

So, I guess the next questions are:

1.) Should `snd_pcm_link` make the poll operation of a master device
wait for I/O availability on its linked slave devices?  Why or why
not?
2.) Should ALSA handle this operation at all?  Why or why not?

I guess the answer to (1) is dependent on whether or not there is a
reason to sync start, stop, drain, etc. without syncing poll
descriptors.

Given that ALSA has configuration options for a multi device, I would
guess that at least one ALSA developer thought the answer to (2) was
"yes".  I'd be inclined to answer "yes", as this seems like a useful
operation, and doesn't seem like an operation that should be
re-invented by any userspace application that wants to sync multiple
sound cards.

I guess this is getting a bit off-topic.  Perhaps this discussion
should be moved to the ALSA developers list.

-- 
Devin Anderson
surfacepatterns (at) gmail (dot) com

blog - http://surfacepatterns.blogspot.com/
psinsights - http://psinsights.googlecode.com/
synthclone - http://synthclone.googlecode.com/
PrevNext  Index

1355289692.3277_0.ltw:2, <CAG7zqTpAYDCcO0=_oGYD-iMv-2PPsYt6X-R0TOH8gxOV0Abhyw at mail dot gmail dot com>