[alsa-devel] [PATCH] pcm_lib.c: Fixed inaccurate calculation of hw_ptr_interrupt in snd_pcm_update_hw_ptr_interrupt function

Clemens Ladisch clemens at ladisch.de
Thu Aug 20 10:42:46 CEST 2009


Shine Liu wrote:
>     I carefully read the pcm_lib.c and pcm_native.c but I didn't found
> any alignmnet constraint API. Althought there's a function called
> snd_pcm_hw_constraint_step, but this function can't be used in the
> situation referred in the last mail which one hw parameter should be
> aligned to the other hw parameter.

The period size, the buffer size, and the number of periods are all
related, so you can align the period size to the buffer size by
restricting the number of periods to be an integer:

  snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);


HTH
Clemens


More information about the Alsa-devel mailing list