diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/drivers/aloop.c | 8 |
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) | |||
171 | dpcm->pcm_rate_shift = rate_shift; | 171 | dpcm->pcm_rate_shift = rate_shift; |
172 | dpcm->period_size_frac = frac_pos(dpcm, dpcm->pcm_period_size); | 172 | dpcm->period_size_frac = frac_pos(dpcm, dpcm->pcm_period_size); |
173 | } | 173 | } |
174 | if (dpcm->period_size_frac <= dpcm->irq_pos) { | ||
175 | dpcm->irq_pos %= dpcm->period_size_frac; | ||
176 | dpcm->period_update_pending = 1; | ||
177 | } | ||
174 | tick = dpcm->period_size_frac - dpcm->irq_pos; | 178 | tick = dpcm->period_size_frac - dpcm->irq_pos; |
175 | tick = (tick + dpcm->pcm_bps - 1) / dpcm->pcm_bps; | 179 | tick = (tick + dpcm->pcm_bps - 1) / dpcm->pcm_bps; |
176 | dpcm->timer.expires = jiffies + tick; | 180 | dpcm->timer.expires = jiffies + tick; |
@@ -531,7 +535,9 @@ static struct snd_pcm_hardware loopback_pcm_hardware = | |||
531 | .channels_max = 32, | 535 | .channels_max = 32, |
532 | .buffer_bytes_max = 2 * 1024 * 1024, | 536 | .buffer_bytes_max = 2 * 1024 * 1024, |
533 | .period_bytes_min = 64, | 537 | .period_bytes_min = 64, |
534 | .period_bytes_max = 2 * 1024 * 1024, | 538 | /* note check overflow in frac_pos() using pcm_rate_shift before |
539 | changing period_bytes_max value */ | ||
540 | .period_bytes_max = 1024 * 1024, | ||
535 | .periods_min = 1, | 541 | .periods_min = 1, |
536 | .periods_max = 1024, | 542 | .periods_max = 1024, |
537 | .fifo_size = 0, | 543 | .fifo_size = 0, |