mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 14:00:58 +07:00
ALSA: pcm core - Avoid jiffies check for devices with BATCH flag
The hardware devices with SNDRV_PCM_INFO_BATCH flag can't give the precise current position. And such hardwares have often big FIFO in addition to the ring buffer, and it screws up the jiffies check in pcm_lib.c. This patch adds a simple check of info flag so that the driver skips the jiffies check in snd_pcm_period_elapsed() when BATCH flag is set. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
2008f137e9
commit
3e5b50165f
@ -249,6 +249,12 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
|
|||||||
new_hw_ptr = hw_base + pos;
|
new_hw_ptr = hw_base + pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* Skip the jiffies check for hardwares with BATCH flag.
|
||||||
|
* Such hardware usually just increases the position at each IRQ,
|
||||||
|
* thus it can't give any strange position.
|
||||||
|
*/
|
||||||
|
if (runtime->hw.info & SNDRV_PCM_INFO_BATCH)
|
||||||
|
goto no_jiffies_check;
|
||||||
hdelta = new_hw_ptr - old_hw_ptr;
|
hdelta = new_hw_ptr - old_hw_ptr;
|
||||||
jdelta = jiffies - runtime->hw_ptr_jiffies;
|
jdelta = jiffies - runtime->hw_ptr_jiffies;
|
||||||
if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) {
|
if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) {
|
||||||
@ -272,6 +278,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
|
|||||||
hw_base -= hw_base % runtime->buffer_size;
|
hw_base -= hw_base % runtime->buffer_size;
|
||||||
delta = 0;
|
delta = 0;
|
||||||
}
|
}
|
||||||
|
no_jiffies_check:
|
||||||
if (delta > runtime->period_size + runtime->period_size / 2) {
|
if (delta > runtime->period_size + runtime->period_size / 2) {
|
||||||
hw_ptr_error(substream,
|
hw_ptr_error(substream,
|
||||||
"Lost interrupts? "
|
"Lost interrupts? "
|
||||||
|
Loading…
Reference in New Issue
Block a user