All of lore.kernel.org
 help / color / mirror / Atom feed
* Alsa timing question
@ 2011-08-25  0:10 Raymond Toy
  2011-08-25  7:15 ` Clemens Ladisch
  0 siblings, 1 reply; 13+ messages in thread
From: Raymond Toy @ 2011-08-25  0:10 UTC (permalink / raw)
  To: alsa-devel

I'm working on an application where I'd like to have relatively fixed timing
between calls to snd_pcm_writei.  As an example, of this I used the sample
pcm.c code from <
http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a65>.
 I placed a simple function to write out the time (from clock_getttime)
before each call to snd_pcm_writei in write_loop.  With a sample rate of
48kHz and a buffer time of 128000 and period time of 42667, what I see is
that most calls to snd_pcm_writei are spaced about 50 ms apart.  This makes
some sense, but I was expecting the calls to be about 42.67 ms apart.
 However, about every 6th call, the time is just 200 us or so.  Why is that?


Is there any simple way to make the calls spaced more closely to 42.67 ms
apart?  Do I need to do something more complicated to achieve this?

Ray

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-08-31 20:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25  0:10 Alsa timing question Raymond Toy
2011-08-25  7:15 ` Clemens Ladisch
2011-08-25 15:52   ` Raymond Toy
2011-08-26  8:02     ` Clemens Ladisch
2011-08-26  8:29     ` Olivier Guillion - Myriad
2011-08-26 15:56       ` Raymond Toy
2011-08-27  8:08         ` Olivier Guillion - Myriad
2011-08-27  9:15           ` Jassi Brar
2011-08-29 18:41           ` Raymond Toy
2011-08-29 20:24   ` Raymond Toy
2011-08-30  7:49     ` Clemens Ladisch
2011-08-30 19:04       ` Raymond Toy
2011-08-31 20:07         ` Clemens Ladisch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.