From owner-freebsd-current@FreeBSD.ORG Tue Jul 27 15:20:43 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 C759E16A4CE; Tue, 27 Jul 2004 15:20:43 +0000 (GMT) Received: from hak.cnd.mcgill.ca (hak.cnd.mcgill.ca [132.216.11.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C0A543D6D; Tue, 27 Jul 2004 15:20:43 +0000 (GMT) (envelope-from mat@hak.cnd.mcgill.ca) Received: from hak.cnd.mcgill.ca (localhost [127.0.0.1]) by hak.cnd.mcgill.ca (8.12.9/8.12.8) with ESMTP id i6RFOTKJ003040; Tue, 27 Jul 2004 11:24:29 -0400 (EDT) (envelope-from mat@hak.cnd.mcgill.ca) Received: (from mat@localhost) by hak.cnd.mcgill.ca (8.12.9/8.12.8/Submit) id i6RFOTwv003039; Tue, 27 Jul 2004 11:24:29 -0400 (EDT) Date: Tue, 27 Jul 2004 11:24:29 -0400 From: Mathew Kanner To: "Conrad J. Sabatier" Message-ID: <20040727152429.GB92352@cnd.mcgill.ca> References: <200407262233.i6QMXghe058450@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Organization: I speak for myself, operating in Montreal, CANADA X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.62 X-Spam-Checker-Version: SpamAssassin 2.62 (2004-01-11) on hak.cnd.mcgill.ca cc: 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 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2004 15:20:43 -0000 On Jul 26, Conrad J. Sabatier wrote: > > 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. :-) Who are the sound maintainers ? :) My internet is supposed to be re-connected on Friday so I will start to be more active then. However, my knowledge of internals of PCM is somewhat limited. --Mat -- sig machine broken