Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230095
b: refs/heads/master
c: 59ff878
h: refs/heads/master
i:
  230093: e7a19bd
  230091: 3eab2db
  230087: ed59598
  230079: 07d6525
v: v3
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Nov 22, 2010
1 parent 1b09e94 commit 02d0928
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 075140ea8bf1405057c072a84ccf4e0d3f2c76f5
refs/heads/master: 59ff878ffb26bc0be812ca8295799164f413ae88
18 changes: 16 additions & 2 deletions trunk/sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,23 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
(unsigned long)runtime->hw_ptr_base);
}

/* without period interrupts, there are no regular pointer updates */
if (runtime->no_period_wakeup)
if (runtime->no_period_wakeup) {
/*
* Without regular period interrupts, we have to check
* the elapsed time to detect xruns.
*/
jdelta = jiffies - runtime->hw_ptr_jiffies;
hdelta = jdelta - delta * HZ / runtime->rate;
while (hdelta > runtime->hw_ptr_buffer_jiffies / 2 + 1) {
delta += runtime->buffer_size;
hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary)
hw_base = 0;
new_hw_ptr = hw_base + pos;
hdelta -= runtime->hw_ptr_buffer_jiffies;
}
goto no_delta_check;
}

/* something must be really wrong */
if (delta >= runtime->buffer_size + runtime->period_size) {
Expand Down

0 comments on commit 02d0928

Please sign in to comment.