[alsa-devel] Is snd_pcm_hw_params_set_period_time_near the same as sampling period?

Guilherme Longo grlongo.ireland at gmail.com
Thu Jul 23 17:24:32 CEST 2009

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  

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;
           period_frames = buffer_frames / 4;

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



More information about the Alsa-devel mailing list