Re: [rfc] i810_audio: offset LVI from CIV to avoid stalled start

From: Herbert Xu
Date: Mon Jan 17 2005 - 18:45:02 EST


On Mon, Jan 17, 2005 at 04:44:22PM -0500, John W. Linville wrote:
>
> Enemy Territory is available for free (as in beer) download from
> www.enemy-territory.com. Sound plays almost immediately once the
> game is started.
>
> Is this sufficient?

Sure, I don't mind trying it out :)

In the mean time, does this patch fix your problem as well?

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
===== sound/oss/i810_audio.c 1.76 vs edited =====
--- 1.76/sound/oss/i810_audio.c 2005-01-08 16:44:18 +11:00
+++ edited/sound/oss/i810_audio.c 2005-01-18 10:20:42 +11:00
@@ -1196,18 +1196,21 @@
if (count < fragsize)
return;

+ /* MASKP2(swptr, fragsize) - 1 is the tail of our transfer */
+ x = MODULOP2(MASKP2(dmabuf->swptr, fragsize) - 1, dmabuf->dmasize);
+ x >>= dmabuf->fragshift;
+
if (!dmabuf->enable && dmabuf->ready) {
if (!(dmabuf->trigger & trigger))
return;

+ I810_IOWRITEB(x, state->card, port + OFF_LVI);
start(state);
while (!(I810_IOREADB(state->card, port + OFF_CR) & ((1<<4) | (1<<2))))
;
+ return;
}

- /* MASKP2(swptr, fragsize) - 1 is the tail of our transfer */
- x = MODULOP2(MASKP2(dmabuf->swptr, fragsize) - 1, dmabuf->dmasize);
- x >>= dmabuf->fragshift;
I810_IOWRITEB(x, state->card, port + OFF_LVI);
}