[alsa-devel] How can I make sure the period size is a multiple of 16?

Trent Piepho xyzzy at speakeasy.org
Thu Sep 6 19:14:27 CEST 2007

On Thu, 6 Sep 2007, Timur Tabi wrote:
> Eliot Blennerhassett wrote:
> > You need to add some constraints to your driver, in the open callback.
> > E.g.
> > snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 16);
> Thanks.  snd_pcm_hw_constraint_step() is not documented anywhere, and the
> comments in the source code don't provide any clues, either.  Even the "ALSA
> Driver API" document just lists the function, but doesn't actually tell you
> what it does.

I still haven't figured out what the "condition bits" do.  It's always 0 every
time one of the constraint functions are called.  I looked in the ALSA core
code, and it seems that if you specify some condition bits they must match
some flag bits in the hw params for the constraint to apply.  But the flags
bits just get copied from user space, so there is no clue in the kernel code
what they are or what they do.

More information about the Alsa-devel mailing list