Fix noisy output of dmix with two periods

Fixed the noisy output of dmix with two (or less) periods.
The dmix tends to give noise or XRUN when running with two periods
because of its implementation nature.  To avoid this, the start
position is aligned to the period size, so that the updates are synced
with interrupts of slave PCM.
This commit is contained in:
Takashi Iwai 2006-03-24 14:53:41 +00:00
parent 1a9c520529
commit 09c5db44a4
2 changed files with 23 additions and 6 deletions

View file

@ -713,8 +713,11 @@ int snd_pcm_direct_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
int changed;
do {
changed = 0;
/* Set min/max size to [2:1024] since INT_MAX as the
* upper-limit results in a too big buffer on some apps.
*/
err = hw_param_interval_refine_minmax(params, SND_PCM_HW_PARAM_PERIODS,
2, INT_MAX);
2, 1024);
if (err < 0)
return err;
changed |= err;