All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Kai Vehmanen <kai.vehmanen@wakkanet.fi>
Cc: alsa-devel@alsa-project.org
Subject: Re: CS4281 fixes (2nd try) (fwd)
Date: Tue, 20 Aug 2002 19:21:59 +0200	[thread overview]
Message-ID: <s5hy9b1tphk.wl@alsa2.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0208201421520.20196-100000@aino.wakkanet.fi>

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

At Tue, 20 Aug 2002 14:39:13 +0300 (EEST),
Kai Vehmanen wrote:
> 
> >> And another cs4281 mystery: with 0.9.0rc1 the record wakeup is constantly
> >> late. Even though I've set avail_min to x frames, upon wake-up there's
> >> continuously more than y*x frames available (ie. not just a few samples).
> > this issue is not investigated yet.  i'll get a card and take a look
> > later, too.
> 
> Hmm, the very latest CVS-tree seems to work differently (rc1 -> rc3). Now
> that post-rc3 snd-cs4281 works with my laptops, I'll try to reproduce the
> problem.
 
ok.

> BTW; The cs4281 compilation problem I reported earlier is definitely
>      a compiler issue. On two different laptops (x20&x21 thinkpads),
>      compiling with the RH72 gcc 2.96 produces a snd-cs4281.o that fails 
>      to recognize the soundchip. By adding one "(volatile*)" (that shouldn't 
>      have any effect), driver works on all laptops. This happens with
>      current CVS and all 0.9.x release candidates. So beware 
>      of that gcc version.

the attached patch works for you?


Takashi

[-- Attachment #2: cs4281-gcc-fix.dif --]
[-- Type: application/octet-stream, Size: 1798 bytes --]

Index: alsa-kernel/pci/cs4281.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/cs4281.c,v
retrieving revision 1.26
diff -u -r1.26 cs4281.c
--- alsa-kernel/pci/cs4281.c	20 Aug 2002 09:05:36 -0000	1.26
+++ alsa-kernel/pci/cs4281.c	20 Aug 2002 17:18:30 -0000
@@ -629,6 +629,7 @@
 	cs4281_t *chip = snd_magic_cast(cs4281_t, ac97->private_data, return -ENXIO);
 	int count;
 	unsigned short result;
+	int ac97_num = ((volatile ac97_t *)ac97)->num; // FIXME: some gcc handles wrongly the pointer...
 
 	/*
 	 *  1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
@@ -639,7 +640,7 @@
 	 *  6. Read ACSTS = Status Register = 464h, check VSTS bit
 	 */
 
-	snd_cs4281_peekBA0(chip, ac97->num ? BA0_ACSDA2 : BA0_ACSDA);
+	snd_cs4281_peekBA0(chip, ac97_num ? BA0_ACSDA2 : BA0_ACSDA);
 
 	/*
 	 *  Setup the AC97 control registers on the CS461x to send the
@@ -658,7 +659,7 @@
 	snd_cs4281_pokeBA0(chip, BA0_ACCDA, 0);
 	snd_cs4281_pokeBA0(chip, BA0_ACCTL, BA0_ACCTL_DCV | BA0_ACCTL_CRW |
 					    BA0_ACCTL_VFRM | BA0_ACCTL_ESYN |
-			   (ac97->num ? BA0_ACCTL_TC : 0));
+			   (ac97_num ? BA0_ACCTL_TC : 0));
 
 
 	/*
@@ -691,7 +692,7 @@
 		 *  ACSTS = Status Register = 464h
 		 *  VSTS - Valid Status
 		 */
-		if (snd_cs4281_peekBA0(chip, ac97->num ? BA0_ACSTS2 : BA0_ACSTS) & BA0_ACSTS_VSTS)
+		if (snd_cs4281_peekBA0(chip, ac97_num ? BA0_ACSTS2 : BA0_ACSTS) & BA0_ACSTS_VSTS)
 			goto __ok2;
 		udelay(10);
 	}
@@ -705,7 +706,7 @@
 	 *  Read the data returned from the AC97 register.
 	 *  ACSDA = Status Data Register = 474h
 	 */
-	result = snd_cs4281_peekBA0(chip, ac97->num ? BA0_ACSDA2 : BA0_ACSDA);
+	result = snd_cs4281_peekBA0(chip, ac97_num ? BA0_ACSDA2 : BA0_ACSDA);
 
       __end:
 	return result;

  parent reply	other threads:[~2002-08-20 17:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-19 16:50 CS4281 fixes (2nd try) (fwd) Kai Vehmanen
2002-08-20  9:44 ` Takashi Iwai
2002-08-20 11:39   ` Kai Vehmanen
2002-08-20 12:43     ` CS4281 fixes (2nd try) Kai Vehmanen
2002-08-20 17:21     ` Takashi Iwai [this message]
2002-08-22 10:21 ` tomasz motylewski
     [not found] <4EFAB02CD1631648856752B7E482C9A312CA45@esebe003.ntc.nokia.com>
2002-08-21 12:01 ` CS4281 fixes (2nd try) (fwd) Kai Vehmanen

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=s5hy9b1tphk.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.vehmanen@wakkanet.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.