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

From: Thomas Voegtle
Date: Wed Jan 19 2005 - 04:12:09 EST


On Wed, 19 Jan 2005, Herbert Xu wrote:

> On Tue, Jan 18, 2005 at 01:07:47PM -0500, John W. Linville wrote:
> >
> > No, that does not fix it. :-( In fact, it doesn't seem to alter the
> > problem at all...
>
> OK. In that case I agree with your patch. The overruns that I
> attributed to it were probably caused by other bugs that's been
> fixed since.
>
> Cheers,
>


Here is the same patch against 2.6.11-rc1-bk6. Works for me.


--- linux-2.6.11-rc1-bk6/sound/oss/i810_audio.c.old 2005-01-19 09:47:20.438345600 +0100
+++ linux-2.6.11-rc1-bk6/sound/oss/i810_audio.c 2005-01-19 09:48:43.618700264 +0100
@@ -1196,10 +1196,20 @@
if (count < fragsize)
return;

+ /* if we are currently stopped, then our CIV is actually set to our
+ * *last* sg segment and we are ready to wrap to the next. However,
+ * if we set our LVI to the last sg segment, then it won't wrap to
+ * the next sg segment, it won't even get a start. So, instead, when
+ * we are stopped, we set both the LVI value and also we increment
+ * the CIV value to the next sg segment to be played so that when
+ * we call start, things will operate properly
+ */
if (!dmabuf->enable && dmabuf->ready) {
if (!(dmabuf->trigger & trigger))
return;

+ CIV_TO_LVI(state->card, port, 1);
+
start(state);
while (!(I810_IOREADB(state->card, port + OFF_CR) & ((1<<4) | (1<<2))))
;






--
Thomas Vögtle email: thomas@xxxxxxxxxxxxxxx
----- http://www.voegtle-clan.de/thomas ------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/