Skip to content

Commit 57e3538

Browse files
committed
Merge remote branch 'alsa/devel' into topic/misc
2 parents 363129e + 0db7102 commit 57e3538

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎sound/drivers/aloop.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ static void loopback_timer_start(struct loopback_pcm *dpcm)
171171
dpcm->pcm_rate_shift = rate_shift;
172172
dpcm->period_size_frac = frac_pos(dpcm, dpcm->pcm_period_size);
173173
}
174+
if (dpcm->period_size_frac <= dpcm->irq_pos) {
175+
dpcm->irq_pos %= dpcm->period_size_frac;
176+
dpcm->period_update_pending = 1;
177+
}
174178
tick = dpcm->period_size_frac - dpcm->irq_pos;
175179
tick = (tick + dpcm->pcm_bps - 1) / dpcm->pcm_bps;
176180
dpcm->timer.expires = jiffies + tick;
@@ -531,7 +535,9 @@ static struct snd_pcm_hardware loopback_pcm_hardware =
531535
.channels_max = 32,
532536
.buffer_bytes_max = 2 * 1024 * 1024,
533537
.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,
535541
.periods_min = 1,
536542
.periods_max = 1024,
537543
.fifo_size = 0,

0 commit comments

Comments
 (0)