summaryrefslogtreecommitdiff
path: root/src/pcm/pcm_direct.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-03-24 14:53:41 +0000
committerTakashi Iwai <tiwai@suse.de>2006-03-24 14:53:41 +0000
commit09c5db44a4665eac7dd658291bb2fd5d85e469d7 (patch)
treec8701c7f203423a1197fe53059fbeccd58a80675 /src/pcm/pcm_direct.c
parent1a9c520529b9f56f46b38671838b2a870f083c13 (diff)
downloadalsa-lib-09c5db44a4665eac7dd658291bb2fd5d85e469d7.tar.gz
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.
Diffstat (limited to 'src/pcm/pcm_direct.c')
-rw-r--r--src/pcm/pcm_direct.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index 81544889..74475707 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -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;