[alsa-devel] [PATCH] ALSA: pcm_lib: avoid timing jitter in snd_pcm_read/write()

David Dillow dave at thedillows.org
Sun Jun 27 16:29:27 CEST 2010


On Sun, 2010-06-27 at 12:29 +0900, Jassi Brar wrote:
> On Sun, Jun 27, 2010 at 7:13 AM, David Dillow <dave at thedillows.org> wrote:
> > This is solved by using runtime->twake as the number of samples needed
> > for a wakeup in addition to selecting the proper wait queue to wake in
> > snd_pcm_update_state(). This requires twake to be non-zero when used
> > by snd_pcm_lib_{read,write}1() even if avail_min is zero.
> 
> http://mailman.alsa-project.org/pipermail/alsa-devel/2010-June/028786.html

Hmm, yes, I should have search the archives a bit. I originally tuned
out the thread you listed as a request for parameter help, and missed
your original postings.

I think my patch is pretty close to preserving the existing semantics as
it doesn't change poll() at all, but I do see a case where the user
could get a read/write back prior to avail_min samples being ready. I
think that's fixable -- if the user is requesting a read/write of less
than avail_min samples, then we have to wait for avail_min regardless.

Takashi, is your concern about semantics the proper honoring of
avail_min in all cases, or preserving the current behavior of waiting
for two periods when avail_min is set to the size of one period?

Dave



More information about the Alsa-devel mailing list