pcm: direct: allow users to configure different period sizes

This patch allows the effective period size to be a multiple of the
slave-pcm period size.
Allowing only exact multiple of original period size is achieved by
borrowing code from the kernel hwrules implementation.

This patch is intended to save cpu workload when for example, the
slave operates with very small periods but a user does not need that
small periods.

This feature is enabled by default and can be disabled by adding
config option 'var_periodsize 0'.

Signed-off-by: Alexander Jahn <ajahn@de.adit-jv.com>
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Joshua Frkuska 2016-12-30 11:56:15 +05:30 committed by Takashi Iwai
parent 9ed4075f05
commit 0a61c79681
5 changed files with 84 additions and 10 deletions

View file

@ -1040,6 +1040,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
dmix->state = SND_PCM_STATE_OPEN;
dmix->slowptr = opts->slowptr;
dmix->max_periods = opts->max_periods;
dmix->var_periodsize = opts->var_periodsize;
dmix->sync_ptr = snd_pcm_dmix_sync_ptr;
retry: