* [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
@ 2005-01-20 20:22 John W. Linville
2005-01-20 20:27 ` Herbert Xu
2005-01-20 21:07 ` John W. Linville
0 siblings, 2 replies; 12+ messages in thread
From: John W. Linville @ 2005-01-20 20:22 UTC (permalink / raw)
To: linux-kernel; +Cc: tv, herbert, jgarzik, marcelo.tosatti
Offset LVI past CIV when starting DAC/ADC in order to prevent
stalled start.
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Thomas Voegtle <tv@lio96.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
This fixes a "no sound" problem with Wolfenstein Enemy Territory and
(apparently) other games using the Quake3 engine. It probably affects
some other OSS applications as well.
This recreates some code that had been removed from the i810_audio
driver around 5/2004.
drivers/sound/i810_audio.c | 10 ++++++++++
1 files changed, 10 insertions(+)
--- i810_audio-2.4/drivers/sound/i810_audio.c.orig 2005-01-20 14:41:43.914734688 -0500
+++ i810_audio-2.4/drivers/sound/i810_audio.c 2005-01-20 14:41:43.916734414 -0500
@@ -1062,10 +1062,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 (!(inb(port + OFF_CR) & ((1<<4) | (1<<2))))
;
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-20 20:22 [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start John W. Linville
@ 2005-01-20 20:27 ` Herbert Xu
2005-01-20 21:07 ` John W. Linville
1 sibling, 0 replies; 12+ messages in thread
From: Herbert Xu @ 2005-01-20 20:27 UTC (permalink / raw)
To: linux-kernel, tv, jgarzik, marcelo.tosatti
On Thu, Jan 20, 2005 at 03:22:59PM -0500, John W. Linville wrote:
>
> + /* 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);
> +
BTW, I think you want to fix up the last sentence in the comment.
It doesn't seem to correspond to what the code is doing.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-20 20:22 [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start John W. Linville
2005-01-20 20:27 ` Herbert Xu
@ 2005-01-20 21:07 ` John W. Linville
2005-01-20 21:23 ` John W. Linville
1 sibling, 1 reply; 12+ messages in thread
From: John W. Linville @ 2005-01-20 21:07 UTC (permalink / raw)
To: linux-kernel, tv, herbert, jgarzik, marcelo.tosatti
Please ignore this patch...it was made assuming that a previous patch
had been applied -- that seems not to have been the case...
I will reform and repost...
John
On Thu, Jan 20, 2005 at 03:22:59PM -0500, John W. Linville wrote:
> Offset LVI past CIV when starting DAC/ADC in order to prevent
> stalled start.
>
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
> Acked-by: Thomas Voegtle <tv@lio96.de>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
> This fixes a "no sound" problem with Wolfenstein Enemy Territory and
> (apparently) other games using the Quake3 engine. It probably affects
> some other OSS applications as well.
>
> This recreates some code that had been removed from the i810_audio
> driver around 5/2004.
>
> drivers/sound/i810_audio.c | 10 ++++++++++
> 1 files changed, 10 insertions(+)
>
> --- i810_audio-2.4/drivers/sound/i810_audio.c.orig 2005-01-20 14:41:43.914734688 -0500
> +++ i810_audio-2.4/drivers/sound/i810_audio.c 2005-01-20 14:41:43.916734414 -0500
> @@ -1062,10 +1062,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 (!(inb(port + OFF_CR) & ((1<<4) | (1<<2))))
> ;
> --
> John W. Linville
> linville@tuxdriver.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread* [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-20 21:07 ` John W. Linville
@ 2005-01-20 21:23 ` John W. Linville
2005-01-20 22:01 ` John W. Linville
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: John W. Linville @ 2005-01-20 21:23 UTC (permalink / raw)
To: linux-kernel, tv, herbert, jgarzik, marcelo.tosatti
Offset LVI past CIV when starting DAC/ADC in order to prevent
stalled start.
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Thomas Voegtle <tv@lio96.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
(Use this one...it doesn't depend on a non-existent patch...)
This fixes a "no sound" problem with Wolfenstein Enemy Territory and
(apparently) other games using the Quake3 engine. It probably affects
some other OSS applications as well.
This recreates some code that had been removed from the i810_audio
driver around 5/2004.
drivers/sound/i810_audio.c | 10 ++++++++++
1 files changed, 10 insertions(+)
--- i810_audio-2.4/drivers/sound/i810_audio.c.orig 2005-01-20 14:41:43.914734688 -0500
+++ i810_audio-2.4/drivers/sound/i810_audio.c 2005-01-20 16:20:07.360411333 -0500
@@ -1062,10 +1062,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 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(port, 1);
+
start(state);
while (!(inb(port + OFF_CR) & ((1<<4) | (1<<2))))
;
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-20 21:23 ` John W. Linville
@ 2005-01-20 22:01 ` John W. Linville
2005-01-20 22:07 ` Herbert Xu
2005-01-23 14:54 ` John W. Linville
2005-08-03 18:18 ` [patch 2.4.32-pre1] " John W. Linville
2 siblings, 1 reply; 12+ messages in thread
From: John W. Linville @ 2005-01-20 22:01 UTC (permalink / raw)
To: linux-kernel, herbert
On Thu, Jan 20, 2005 at 04:23:46PM -0500, John W. Linville wrote:
> + /* 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 increment the CIV value to the next sg segment
> + * to be played so that when we call start, things will operate
> + * properly
> + */
Herbert,
Is this (slightly altered) comment more to your liking? If so,
I'll post an additive patch for the 2.6 version...
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-20 22:01 ` John W. Linville
@ 2005-01-20 22:07 ` Herbert Xu
2005-01-22 3:02 ` Herbert Xu
0 siblings, 1 reply; 12+ messages in thread
From: Herbert Xu @ 2005-01-20 22:07 UTC (permalink / raw)
To: linux-kernel
On Thu, Jan 20, 2005 at 05:01:21PM -0500, John W. Linville wrote:
> On Thu, Jan 20, 2005 at 04:23:46PM -0500, John W. Linville wrote:
>
> > + /* 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 increment the CIV value to the next sg segment
> > + * to be played so that when we call start, things will operate
> > + * properly
> > + */
>
> Is this (slightly altered) comment more to your liking? If so,
> I'll post an additive patch for the 2.6 version...
IMHO the last sentence is still wrong. We're not touching the value
of CIV at all. We're setting LVI to CIV + 1...
OTOH, perhaps we should actually try implementing what the comment
suggests?
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-20 22:07 ` Herbert Xu
@ 2005-01-22 3:02 ` Herbert Xu
2005-01-23 14:48 ` John W. Linville
0 siblings, 1 reply; 12+ messages in thread
From: Herbert Xu @ 2005-01-22 3:02 UTC (permalink / raw)
To: linux-kernel; +Cc: John W. Linville
On Fri, Jan 21, 2005 at 09:07:13AM +1100, herbert wrote:
> On Thu, Jan 20, 2005 at 05:01:21PM -0500, John W. Linville wrote:
> > On Thu, Jan 20, 2005 at 04:23:46PM -0500, John W. Linville wrote:
> >
> > > + /* 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 increment the CIV value to the next sg segment
> > > + * to be played so that when we call start, things will operate
> > > + * properly
> > > + */
> >
> > Is this (slightly altered) comment more to your liking? If so,
> > I'll post an additive patch for the 2.6 version...
>
> IMHO the last sentence is still wrong. We're not touching the value
> of CIV at all. We're setting LVI to CIV + 1...
>
> OTOH, perhaps we should actually try implementing what the comment
> suggests?
OK I dug into the archives and found that the reason we need to do
it this way is because you can't set the value of CIV directly. So
how about s/CIV/LVI/ in the last sentence?
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-22 3:02 ` Herbert Xu
@ 2005-01-23 14:48 ` John W. Linville
0 siblings, 0 replies; 12+ messages in thread
From: John W. Linville @ 2005-01-23 14:48 UTC (permalink / raw)
To: Herbert Xu; +Cc: linux-kernel
On Sat, Jan 22, 2005 at 02:02:58PM +1100, Herbert Xu wrote:
> On Fri, Jan 21, 2005 at 09:07:13AM +1100, herbert wrote:
> > On Thu, Jan 20, 2005 at 05:01:21PM -0500, John W. Linville wrote:
> > > On Thu, Jan 20, 2005 at 04:23:46PM -0500, John W. Linville wrote:
> > > > + * the next sg segment, it won't even get a start. So, instead, when
> > > > + * we are stopped, we increment the CIV value to the next sg segment
> > > > + * to be played so that when we call start, things will operate
> > > > + * properly
> > > > + */
> OK I dug into the archives and found that the reason we need to do
> it this way is because you can't set the value of CIV directly. So
> how about s/CIV/LVI/ in the last sentence?
Herbert,
Agreed...I will post a patch to that effect shortly...
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-20 21:23 ` John W. Linville
2005-01-20 22:01 ` John W. Linville
@ 2005-01-23 14:54 ` John W. Linville
2005-08-03 18:18 ` [patch 2.4.32-pre1] " John W. Linville
2 siblings, 0 replies; 12+ messages in thread
From: John W. Linville @ 2005-01-23 14:54 UTC (permalink / raw)
To: linux-kernel, tv, herbert, jgarzik, marcelo.tosatti
On Thu, Jan 20, 2005 at 04:23:46PM -0500, John W. Linville wrote:
> Offset LVI past CIV when starting DAC/ADC in order to prevent
> stalled start.
Please hold-off on applying this patch...I'm going to repost this
patch with a related patch shortly.
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* [patch 2.4.32-pre1] i810_audio: offset LVI from CIV to avoid stalled start
2005-01-20 21:23 ` John W. Linville
2005-01-20 22:01 ` John W. Linville
2005-01-23 14:54 ` John W. Linville
@ 2005-08-03 18:18 ` John W. Linville
2005-08-03 18:35 ` John W. Linville
2005-08-03 18:36 ` [patch 2.4.32-pre1 (corrected)] " John W. Linville
2 siblings, 2 replies; 12+ messages in thread
From: John W. Linville @ 2005-08-03 18:18 UTC (permalink / raw)
To: linux-kernel, tv, herbert, jgarzik, marcelo.tosatti
Offset LVI past CIV when starting DAC/ADC in order to prevent
stalled start.
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Thomas Voegtle <tv@lio96.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
This fixes a "no sound" problem with Wolfenstein Enemy Territory and
(apparently) other games using the Quake3 engine. It probably affects
some other OSS applications as well.
This recreates some code that had been removed from the i810_audio
driver around 5/2004. The euqivalent patch has been in the 2.6 stream
since about 2.6.11.
drivers/sound/i810_audio.c | 13 +++++++++++++
1 files changed, 13 insertions(+)
diff --git a/drivers/sound/i810_audio.c b/drivers/sound/i810_audio.c
--- a/drivers/sound/i810_audio.c
+++ b/drivers/sound/i810_audio.c
@@ -1062,10 +1062,23 @@ static void __i810_update_lvi(struct i81
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 LVI value to the next sg segment to be played so that when
+ * we call start, things will operate properly. Since the CIV can't
+ * be written to directly for this purpose, we set the LVI to CIV + 1
+ * temporarily. Once the engine has started we set the LVI to its
+ * final value.
+ */
if (!dmabuf->enable && dmabuf->ready) {
if (!(dmabuf->trigger & trigger))
return;
+ CIV_TO_LVI(port, 1);
+
start(state);
while (!(inb(port + OFF_CR) & ((1<<4) | (1<<2))))
;
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [patch 2.4.32-pre1] i810_audio: offset LVI from CIV to avoid stalled start
2005-08-03 18:18 ` [patch 2.4.32-pre1] " John W. Linville
@ 2005-08-03 18:35 ` John W. Linville
2005-08-03 18:36 ` [patch 2.4.32-pre1 (corrected)] " John W. Linville
1 sibling, 0 replies; 12+ messages in thread
From: John W. Linville @ 2005-08-03 18:35 UTC (permalink / raw)
To: linux-kernel, tv, herbert, jgarzik, marcelo.tosatti
On Wed, Aug 03, 2005 at 02:18:16PM -0400, John W. Linville wrote:
> + * we are stopped, we set both the LVI value and also we increment
> + * the LVI value to the next sg segment to be played so that when
> + * we call start, things will operate properly. Since the CIV can't
Scratch that...bad comment...will repost...
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* [patch 2.4.32-pre1 (corrected)] i810_audio: offset LVI from CIV to avoid stalled start
2005-08-03 18:18 ` [patch 2.4.32-pre1] " John W. Linville
2005-08-03 18:35 ` John W. Linville
@ 2005-08-03 18:36 ` John W. Linville
1 sibling, 0 replies; 12+ messages in thread
From: John W. Linville @ 2005-08-03 18:36 UTC (permalink / raw)
To: linux-kernel, tv, herbert, jgarzik, marcelo.tosatti
Offset LVI past CIV when starting DAC/ADC in order to prevent
stalled start.
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Thomas Voegtle <tv@lio96.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
This fixes a "no sound" problem with Wolfenstein Enemy Territory and
(apparently) other games using the Quake3 engine. It probably affects
some other OSS applications as well.
This recreates some code that had been removed from the i810_audio
driver around 5/2004. The euqivalent patch has been in the 2.6 stream
since about 2.6.11.
drivers/sound/i810_audio.c | 13 +++++++++++++
1 files changed, 13 insertions(+)
diff --git a/drivers/sound/i810_audio.c b/drivers/sound/i810_audio.c
--- a/drivers/sound/i810_audio.c
+++ b/drivers/sound/i810_audio.c
@@ -1062,10 +1062,23 @@ static void __i810_update_lvi(struct i81
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. Since the CIV can't
+ * be written to directly for this purpose, we set the LVI to CIV + 1
+ * temporarily. Once the engine has started we set the LVI to its
+ * final value.
+ */
if (!dmabuf->enable && dmabuf->ready) {
if (!(dmabuf->trigger & trigger))
return;
+ CIV_TO_LVI(port, 1);
+
start(state);
while (!(inb(port + OFF_CR) & ((1<<4) | (1<<2))))
;
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2005-08-03 18:41 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-20 20:22 [patch 2.4.29] i810_audio: offset LVI from CIV to avoid stalled start John W. Linville
2005-01-20 20:27 ` Herbert Xu
2005-01-20 21:07 ` John W. Linville
2005-01-20 21:23 ` John W. Linville
2005-01-20 22:01 ` John W. Linville
2005-01-20 22:07 ` Herbert Xu
2005-01-22 3:02 ` Herbert Xu
2005-01-23 14:48 ` John W. Linville
2005-01-23 14:54 ` John W. Linville
2005-08-03 18:18 ` [patch 2.4.32-pre1] " John W. Linville
2005-08-03 18:35 ` John W. Linville
2005-08-03 18:36 ` [patch 2.4.32-pre1 (corrected)] " John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox