From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [Alsa-user] Upgrade problems -addendum Date: Thu, 23 Jan 2003 11:03:00 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <200301221234.33054.tais.hansen@osd.dk> <200301221647.05780.tais.hansen@osd.dk> <200301230135.58325.tais.hansen@osd.dk> Mime-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: multipart/mixed; boundary="Multipart_Thu_Jan_23_11:03:00_2003-1" Return-path: In-Reply-To: <200301230135.58325.tais.hansen@osd.dk> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: "Tais M. Hansen" Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org --Multipart_Thu_Jan_23_11:03:00_2003-1 Content-Type: text/plain; charset=US-ASCII At Thu, 23 Jan 2003 01:35:53 +0100, Tais M. Hansen wrote: > > On Wednesday 22 January 2003 17:23, Takashi Iwai wrote: > > could you test the following two patches? > > with the first one, the driver will calculate the current pointer like > > VIA686 does. if this is ok, no messages will appear. > > The first patch makes artsd freeze the computer for about 10-20 seconds and > then aborts with a "cpu overload" message. ogg123 sometimes plays noise when > starting while speeding through the ogg-file, sometimes it plays normally. > Only ogg123 generated output in syslog which I've attached in > alsa-ogg123-syslog-p1.txt.gz. ok, that's not good... > > > the second one is to force to increase the index. you'll see debug > > messages, anyway, if POINTER_DEBUG is defined. > > First, removing first patch and applying the second patch. Ogg123 freezes when > started with no sound and a lot of errors. Ctrl-C is caught after about 10 > secs. Syslog output is attached in alsa-ogg123-syslog-p2.txt.gz. Artsd starts > but keep looping a short random piece of noise. No sound can be played/heard > when played. Killing artsd produces the output attached in > alsa-artsd-syslog-p2.txt.gz. hmm... > Applying both patches. Ogg123 and artsd behaves like when only the first patch > was applied. I let ogg123 run a little longer and noticed that sometimes > about half a second noise where played. Syslog errors from using ogg123 this > time is attached in alsa-ogg123-syslog-p1+p2.txt.gz. ah, applying both has no effect.. > Note: POINTER_DEBUG was defined and the initial patch you sent was applied > throughout the test. ok, the attached is the third trial. please appply it solely without the preivous patches. hope this works better... ciao, Takashi --Multipart_Thu_Jan_23_11:03:00_2003-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="via-pointer-test3.dif" Content-Transfer-Encoding: 7bit Index: alsa-kernel/pci/via82xx.c =================================================================== RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/via82xx.c,v retrieving revision 1.21 diff -u -r1.21 via82xx.c --- alsa-kernel/pci/via82xx.c 22 Jan 2003 14:21:05 -0000 1.21 +++ alsa-kernel/pci/via82xx.c 23 Jan 2003 09:40:01 -0000 @@ -232,6 +232,7 @@ struct snd_via_sg_table *idx_table; /* for recovery from the unexpected pointer */ unsigned int lastpos; + unsigned int lastidx; unsigned int bufsize; unsigned int bufsize2; }; @@ -485,6 +486,7 @@ outb(0x00, port + VIA_REG_OFFSET_TYPE); /* for via686 */ outl(0, port + VIA_REG_OFFSET_CURR_PTR); viadev->lastpos = 0; + viadev->lastidx = 0; } @@ -589,17 +591,26 @@ #endif /* count register returns full size when end of buffer is reached */ if (size != count) { - snd_printd(KERN_ERR "invalid via82xx_cur_ptr, using last valid pointer\n"); - res = viadev->lastpos; + /* assume the next index */ + idx = viadev->lastidx + 1; + if (idx >= viadev->tbl_entries) + idx = 0; + size = viadev->idx_table[idx].size; + res = viadev->idx_table[idx].offset + size - count; + if (res < viadev->lastpos && (res >= viadev->bufsize2 || viadev->lastpos < viadev->bufsize2)) { + snd_printd(KERN_ERR "invalid via82xx_cur_ptr, using last valid pointer\n"); + return viadev->lastpos; + } } else { res = viadev->idx_table[idx].offset + size; if (res < viadev->lastpos && (res >= viadev->bufsize2 || viadev->lastpos < viadev->bufsize2)) { snd_printd(KERN_ERR "invalid via82xx_cur_ptr (2), using last valid pointer\n"); - res = viadev->lastpos; + return viadev->lastpos; } } } viadev->lastpos = res; /* remember the last positiion */ + viadev->lastidx = idx; if (res >= viadev->bufsize) res -= viadev->bufsize; return res; @@ -648,7 +659,7 @@ return 0; spin_lock(&chip->reg_lock); count = inl(VIAREG(chip, OFFSET_CURR_COUNT) + viadev->reg_offset); - idx = count >> 24; + idx = (count >> 24) & viadev->tbl_entries; count &= 0xffffff; res = calc_linear_pos(viadev, idx, count); spin_unlock(&chip->reg_lock); --Multipart_Thu_Jan_23_11:03:00_2003-1-- ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com