--- alsa-driver-1.0.12rc2/alsa-kernel/sparc/dbri.c 2006-08-24 20:33:35.000000000 +0200 +++ linux-2.6.17a/sound/sparc/dbri.c 2006-08-24 20:21:40.000000000 +0200 @@ -628,7 +628,7 @@ to send them to the DBRI. */ -#define MAXLOOPS 10 +#define MAXLOOPS 20 /* * Wait for the current command string to execute */ @@ -2110,12 +2118,13 @@ static int snd_dbri_prepare(struct snd_p */ ret = setup_descs(dbri, DBRI_STREAMNO(substream), snd_pcm_lib_period_bytes(substream)); + info->offset = 0; runtime->stop_threshold = DBRI_TD_MAXCNT / runtime->channels; spin_unlock_irq(&dbri->lock); - dprintk(D_USR, "prepare audio output. %d bytes\n", info->size); + dprintk(D_USR, "prepare audio output. pipe %d, %d bytes\n", info->pipe, info->size); return ret; } @@ -2150,7 +2159,7 @@ static snd_pcm_uframes_t snd_dbri_pointe snd_pcm_uframes_t ret; ret = bytes_to_frames(substream->runtime, info->offset) - % (substream->runtime->buffer_size + 1); + % substream->runtime->buffer_size; dprintk(D_USR, "I/O pointer: %ld frames of %ld.\n", ret, substream->runtime->buffer_size); return ret;