summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-10-17 10:12:42 +0200
committerTakashi Iwai <tiwai@suse.de>2010-10-17 10:12:42 +0200
commit57e35381bc13e6f18ac1ec255ca61ba1a5103e13 (patch)
treeaed6bb84a9a4427dd34c982b2330a885c79a0161 /sound
parent363129ea90e0835b8552b797714cd200f674e287 (diff)
parent0db710230589b5571c23f59250eabc9504b17c98 (diff)
Merge remote branch 'alsa/devel' into topic/misc
Diffstat (limited to 'sound')
-rw-r--r--sound/drivers/aloop.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index 3c0088272095..838ad86311b8 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -171,6 +171,10 @@ static void loopback_timer_start(struct loopback_pcm *dpcm)
dpcm->pcm_rate_shift = rate_shift;
dpcm->period_size_frac = frac_pos(dpcm, dpcm->pcm_period_size);
}
+ if (dpcm->period_size_frac <= dpcm->irq_pos) {
+ dpcm->irq_pos %= dpcm->period_size_frac;
+ dpcm->period_update_pending = 1;
+ }
tick = dpcm->period_size_frac - dpcm->irq_pos;
tick = (tick + dpcm->pcm_bps - 1) / dpcm->pcm_bps;
dpcm->timer.expires = jiffies + tick;
@@ -531,7 +535,9 @@ static struct snd_pcm_hardware loopback_pcm_hardware =
.channels_max = 32,
.buffer_bytes_max = 2 * 1024 * 1024,
.period_bytes_min = 64,
- .period_bytes_max = 2 * 1024 * 1024,
+ /* note check overflow in frac_pos() using pcm_rate_shift before
+ changing period_bytes_max value */
+ .period_bytes_max = 1024 * 1024,
.periods_min = 1,
.periods_max = 1024,
.fifo_size = 0,