From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: CS4281 fixes (2nd try) (fwd) Date: Tue, 20 Aug 2002 19:21:59 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: multipart/mixed; boundary="Multipart_Tue_Aug_20_19:21:59_2002-1" Return-path: Received: from Cantor.suse.de (ns.suse.de [213.95.15.193]) by alsa.alsa-project.org (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA12991 for ; Tue, 20 Aug 2002 19:22:06 +0200 In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Kai Vehmanen Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org --Multipart_Tue_Aug_20_19:21:59_2002-1 Content-Type: text/plain; charset=US-ASCII 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 --Multipart_Tue_Aug_20_19:21:59_2002-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="cs4281-gcc-fix.dif" Content-Transfer-Encoding: 7bit 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; --Multipart_Tue_Aug_20_19:21:59_2002-1-- ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390