From owner-freebsd-current@FreeBSD.ORG Mon Jul 26 22:44:49 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B88016A4CE; Mon, 26 Jul 2004 22:44:49 +0000 (GMT) Received: from lakermmtao11.cox.net (lakermmtao11.cox.net [68.230.240.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id B779543D46; Mon, 26 Jul 2004 22:44:48 +0000 (GMT) (envelope-from conrads@cox.net) Received: from dolphin.local.net ([68.11.71.51]) by lakermmtao11.cox.net (InterMail vM.6.01.03.02.01 201-2131-111-104-103-20040709) with ESMTP <20040726224447.BMKA11198.lakermmtao11.cox.net@dolphin.local.net>; Mon, 26 Jul 2004 18:44:47 -0400 Received: from dolphin.local.net (localhost.local.net [127.0.0.1]) by dolphin.local.net (8.12.11/8.12.11) with ESMTP id i6QMikvw002300; Mon, 26 Jul 2004 17:44:46 -0500 (CDT) (envelope-from conrads@dolphin.local.net) Received: (from conrads@localhost) by dolphin.local.net (8.12.11/8.12.11/Submit) id i6QMikO1002299; Mon, 26 Jul 2004 17:44:46 -0500 (CDT) (envelope-from conrads) Message-ID: X-Mailer: XFMail 1.5.5 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200407262233.i6QMXghe058450@gw.catspoiler.org> Date: Mon, 26 Jul 2004 17:44:46 -0500 (CDT) Organization: A Rag-Tag Band of Drug-Crazed Hippies From: "Conrad J. Sabatier" To: Don Lewis cc: freebsd-current@freebsd.org Subject: Re: Questionable code in sys/dev/sound/pcm/channel.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: conrads@cox.net List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jul 2004 22:44:49 -0000 On 26-Jul-2004 Don Lewis wrote: > > I just looked at the code some more. With timeout hardwired to 1, > count can never go negative. The code initializes count to hz, and > then decrements it whenever chn_sleep() returns EWOULDBLOCK, and > re-initializes count to hz if chn_sleep() returns zero. With timeout > hardwired to 1, count should only be able to decrement to zero if > chn_sleep() returns EWOULDBLOCK hz times in a row, which means that > nothing could be stuffed into the buffer for one second, which seems > like a long time ... > > I suspect that with your change the write() call is returning a 0 and > the player software is doing a retry that succeeds (or this might be > audible as a skip). Hmmm. Well, one thing's for certain: you've obviously managed to discern more about what's going on in this code than me! :-) It would be nice to hear from our sound maintainers on this issue. They've been rather...quiet lately. :-) -- Conrad J. Sabatier -- "In Unix veritas"