Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188931
b: refs/heads/master
c: 1c58306
h: refs/heads/master
i:
  188929: 158b969
  188927: 7056ffa
v: v3
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Mar 24, 2010
1 parent 9d5bf43 commit 50d50d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: fc8aa7b16a5fcfe9c6d0be9bb587f1fcedd9145f
refs/heads/master: 1c583063a5c769fe2ec604752e383972c69e6d9b
14 changes: 11 additions & 3 deletions trunk/sound/pci/cmipci.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,13 +941,21 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci
struct snd_pcm_substream *substream)
{
size_t ptr;
unsigned int reg;
unsigned int reg, rem, tries;

if (!rec->running)
return 0;
#if 1 // this seems better..
reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
ptr = rec->dma_size - (snd_cmipci_read_w(cm, reg) + 1);
ptr >>= rec->shift;
for (tries = 0; tries < 3; tries++) {
rem = snd_cmipci_read_w(cm, reg);
if (rem < rec->dma_size)
goto ok;
}
printk(KERN_ERR "cmipci: invalid PCM pointer: %#x\n", rem);
return SNDRV_PCM_POS_XRUN;
ok:
ptr = (rec->dma_size - (rem + 1)) >> rec->shift;
#else
reg = rec->ch ? CM_REG_CH1_FRAME1 : CM_REG_CH0_FRAME1;
ptr = snd_cmipci_read(cm, reg) - rec->offset;
Expand Down

0 comments on commit 50d50d1

Please sign in to comment.