Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248151
b: refs/heads/master
c: 0b7ce9e
h: refs/heads/master
i:
  248149: 9017b33
  248147: 45acbb3
  248143: d787019
v: v3
  • Loading branch information
Eliot Blennerhassett authored and Takashi Iwai committed Apr 5, 2011
1 parent 229f25a commit 71f4304
Show file tree
Hide file tree
Showing 2 changed files with 11 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: a6477134db119a22aa30911ff18e440b8db9df65
refs/heads/master: 0b7ce9e2bd2d9dbc8f4797b0cd5e0d138cb529e1
12 changes: 10 additions & 2 deletions trunk/sound/pci/asihpi/asihpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ struct snd_card_asihpi_pcm {
unsigned int pcm_buf_host_rw_ofs; /* Host R/W pos */
unsigned int pcm_buf_dma_ofs; /* DMA R/W offset in buffer */
unsigned int pcm_buf_elapsed_dma_ofs; /* DMA R/W offset in buffer */
unsigned int drained_count;
struct snd_pcm_substream *substream;
u32 h_stream;
struct hpi_format format;
Expand Down Expand Up @@ -592,6 +593,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream,
if (substream->stream != s->stream)
continue;

ds->drained_count = 0;
if ((s->stream == SNDRV_PCM_STREAM_PLAYBACK) &&
(card->support_mmap)) {
/* How do I know how much valid data is present
Expand Down Expand Up @@ -771,12 +773,18 @@ static void snd_card_asihpi_timer_function(unsigned long data)
(on_card_bytes < ds->pcm_buf_host_rw_ofs)) {
hpi_handle_error(hpi_stream_start(ds->h_stream));
snd_printdd("P%d start\n", s->number);
ds->drained_count = 0;
}
} else if (state == HPI_STATE_DRAINED) {
snd_printd(KERN_WARNING "P%d drained\n",
s->number);
/*snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN);
continue; */
ds->drained_count++;
if (ds->drained_count > 2) {
snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN);
continue;
}
} else {
ds->drained_count = 0;
}
} else
pcm_buf_dma_ofs = bytes_avail + ds->pcm_buf_host_rw_ofs;
Expand Down

0 comments on commit 71f4304

Please sign in to comment.