All of lore.kernel.org
 help / color / mirror / Atom feed
* Is snd_pcm_hw_params_set_period_time_near the same as sampling period?
@ 2009-07-23 15:24 Guilherme Longo
  2009-07-24  8:50 ` Clemens Ladisch
  0 siblings, 1 reply; 2+ messages in thread
From: Guilherme Longo @ 2009-07-23 15:24 UTC (permalink / raw)
  To: alsa-devel

Hi mates.

I am trying to understand a piece of a code  I am  studing .
What does exactly the functions snd_pcm_hw_params_set_period_time_near  
sets?

In my understand period time should be the time between 2 consecutive 
samples, but the following code does not appears to be calculating that.

buffer_time = 500000  // What I believe that means 0.5s as US is the 
unit used.

if (period_time == 0 && period_frames == 0) {
       if (buffer_time > 0)
             period_time = buffer_time / 4;
       else
           period_frames = buffer_frames / 4;
}

Is this period time the same as period describled in here:

http://www.fon.hum.uva.nl/praat/manual/sampling_period.html

Thanks!

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

* Re: Is snd_pcm_hw_params_set_period_time_near the same as sampling period?
  2009-07-23 15:24 Is snd_pcm_hw_params_set_period_time_near the same as sampling period? Guilherme Longo
@ 2009-07-24  8:50 ` Clemens Ladisch
  0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2009-07-24  8:50 UTC (permalink / raw)
  To: Guilherme Longo; +Cc: alsa-devel

Guilherme Longo wrote:
> I am trying to understand a piece of a code  I am  studing .
> What does exactly the functions snd_pcm_hw_params_set_period_time_near  
> sets?

The period time.

> In my understand period time should be the time between 2 consecutive 
> samples,

In ALSA, a period is the interval between consecutive interrupts from
the sound card; this is the same as a fragment in OSS.

When the application tries to write/read more than than would be
available, ALSA waits until the next period boundary before checking
again.


HTH
Clemens

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

end of thread, other threads:[~2009-07-24  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 15:24 Is snd_pcm_hw_params_set_period_time_near the same as sampling period? Guilherme Longo
2009-07-24  8:50 ` 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.