[alsa-devel] Alsa timing question

Clemens Ladisch clemens at ladisch.de
Wed Aug 31 22:07:25 CEST 2011

Raymond Toy wrote:
> Clemens Ladisch <clemens at ladisch.de> wrote:
>     The defaults for dmix's period_size, period_time, and periods are 1024,
>     -1, and 16.  They can be overridden by setting the configuration values
>     defaults.dmix.DRIVER.period_size/period_time/periods, where DRIVER is
>     the internal driver name (the name between the colon and the hyphen in
>     /proc/asound/cards, or the file name in /usr/share/alsa/cards/).
> Thanks for the info.  Can this be done programmatically?

Not really.  You could define your own device, but it wouldn't work together
with any open default dmix device.

> However for the application, I don't want to have to tell the user to set
> up dmix.

If you know that you're using dmix, and which hardware device is actually
used, you could use a PCM slave timer to get notifications of period
interrupts.  (The dmix plugin also uses this mechanism, but then rounds
the events to the application's period size.)

For PulseAudio, there seems to be no choice but to use a period size that
is somehow aligned to PA's internal timer granularity.


More information about the Alsa-devel mailing list