linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anwar <anwar@austin.rr.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] i810_audio.c in 2.4.0-prerelease (fixes RealPlayer for one)
Date: Mon, 01 Jan 2001 13:55:40 -0600	[thread overview]
Message-ID: <3A50E0BC.ADD9BEDB@austin.rr.com> (raw)

The patch from Tjeerd Mulder that is already in 2.4.0-prerelease fixes a 
lot of issues with i810_audio, but it still does not seem to enable
variable rates 
(non 48K rates).  I am not sure if VRA works for everybody else with the
current
code, but I needed the patch below for VRA to work on my Dell Optiplex
GX110.

So the patch below specifically enables VRA during rate 
change requests (based on code from Jim Studt, posted to LKML on Dec
29).  This
is needed for things like Real Player to work , because the first thing
RealPlayer 
does is to set the DAC rate to 44100Hz.

Also, the patch already in 2.4.0.-prerelease introduced a bug in the
driver that we 
get a divide-by-zero error if we just do "fd=open("/dev/dsp", O_WRONLY)
; close (fd);".  
This is also fixed below (the last hunk).

--- linux/drivers/sound/i810_audio.c.old        Sat Dec 30 13:23:14 2000
+++ linux/drivers/sound/i810_audio.c    Mon Jan  1 13:24:36 2001
@@ -383,6 +383,7 @@
 {
        struct dmabuf *dmabuf = &state->dmabuf;
        u32 dacp;
+       u16 extended_status;
        struct ac97_codec *codec=state->card->ac97_codec[0];

        if(!(state->card->ac97_features&0x0001))
@@ -410,6 +411,10 @@

        if(rate != i810_ac97_get(codec, AC97_PCM_FRONT_DAC_RATE))
        {
+               /* Reset variable rate mode */
+               extended_status = i810_ac97_get(codec,
AC97_EXTENDED_STATUS);
                i810_ac97_set(codec, AC97_POWER_CONTROL, dacp|0x0200);
@@ -433,6 +438,7 @@
 {
        struct dmabuf *dmabuf = &state->dmabuf;
        u32 dacp;
+       u16 extended_status;
        struct ac97_codec *codec=state->card->ac97_codec[0];
 
        if(!(state->card->ac97_features&0x0001))
@@ -460,6 +466,10 @@
 
        if(rate != i810_ac97_get(codec, AC97_PCM_LR_DAC_RATE))
        {
+               /* Reset variable rate mode */
+               extended_status = i810_ac97_get(codec,
AC97_EXTENDED_STATUS);
+               if (!(extended_status&1))
+                       i810_ac97_set(codec, AC97_EXTENDED_STATUS,
extended_status|1);
                /* Power down the ADC */
                dacp=i810_ac97_get(codec, AC97_POWER_CONTROL);
                i810_ac97_set(codec, AC97_POWER_CONTROL, dacp|0x0100);
@@ -770,7 +780,10 @@
        swptr = dmabuf->swptr;
        spin_unlock_irqrestore(&state->card->lock, flags);
 
-       len = swptr % (dmabuf->dmasize/SG_LEN);
+       if (dmabuf->dmasize)
+               len = swptr % (dmabuf->dmasize/SG_LEN);
+       else
+               len = 0;
 
        memset(dmabuf->rawbuf + swptr, silence, len);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

                 reply	other threads:[~2001-01-01 20:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3A50E0BC.ADD9BEDB@austin.rr.com \
    --to=anwar@austin.rr.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).