linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: linux-kernel@vger.kernel.org
Cc: herbert@gondor.apana.org.au, jgarzik@pobox.com
Subject: [rfc] i810_audio: offset LVI from CIV to avoid stalled start
Date: Mon, 17 Jan 2005 13:37:08 -0500	[thread overview]
Message-ID: <20050117183708.GD4348@tuxdriver.com> (raw)

"Some" OSS applications have trouble with later versions of the
i810_audio driver.  Wolfenstein Enemy Territory from idSoftware is
one such application.

I did a little legwork in BK and tracked-down the exact change which
caused the break.  The changelog comments are dismissive to the
original code.  However, I find that recreating a patch equivalent
to what was removed restores sound to the game.

Anyone have any suggestions for a patch that a) works; and, b)
accounts for the concerns expressed in the changelog?

John

P.S. Here is the problematic patch: (DO NOT TRY TO APPLY THIS)

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/05/11 03:51:54-04:00 herbert@gondor.apana.org.au 
#   [sound i810] remove bogus CIV_TO_LVI
#   
#   This patch removes a pair of bogus LVI assignments.  The explanation in
#   the comment is wrong because the value of PCIB tells the hardware that
#   the DMA buffer can be processed even if LVI == CIV.
#   
#   Setting LVI to CIV + 1 causes overruns when with short writes
#   (something that vmware is very fond of).
# 
# drivers/sound/i810_audio.c
#   2004/05/11 03:51:52-04:00 herbert@gondor.apana.org.au +0 -10
#   [sound i810] remove bogus CIV_TO_LVI
#   
#   This patch removes a pair of bogus LVI assignments.  The explanation in
#   the comment is wrong because the value of PCIB tells the hardware that
#   the DMA buffer can be processed even if LVI == CIV.
#   
#   Setting LVI to CIV + 1 causes overruns when with short writes
#   (something that vmware is very fond of).
# 
diff -Nru a/drivers/sound/i810_audio.c b/drivers/sound/i810_audio.c
--- a/drivers/sound/i810_audio.c	2005-01-14 16:20:27 -05:00
+++ b/drivers/sound/i810_audio.c	2005-01-14 16:20:27 -05:00
@@ -1079,25 +1079,15 @@
 	else
 		port += dmabuf->write_channel->port;
 
-	/* 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_{dac,adc}, things will operate properly
-	 */
 	if (!dmabuf->enable && dmabuf->ready) {
 		if(rec && dmabuf->count < dmabuf->dmasize &&
 		   (dmabuf->trigger & PCM_ENABLE_INPUT))
 		{
-			CIV_TO_LVI(port, 1);
 			__start_adc(state);
 			while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ;
 		} else if (!rec && dmabuf->count &&
 			   (dmabuf->trigger & PCM_ENABLE_OUTPUT))
 		{
-			CIV_TO_LVI(port, 1);
 			__start_dac(state);
 			while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ;
 		}
-- 
John W. Linville
linville@tuxdriver.com

             reply	other threads:[~2005-01-17 18:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-17 18:37 John W. Linville [this message]
2005-01-17 18:46 ` [patch 2.4.29-rc1] i810_audio: offset LVI from CIV to avoid stalled start John W. Linville
2005-01-17 22:54   ` Thomas Voegtle
2005-01-17 20:39 ` [rfc] " Herbert Xu
2005-01-17 21:44   ` John W. Linville
2005-01-17 23:23     ` Herbert Xu
2005-01-18 18:07       ` John W. Linville
2005-01-18 22:42         ` Herbert Xu
2005-01-19  8:59           ` Thomas Voegtle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050117183708.GD4348@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).