Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jul 2004 17:44:46 -0500 (CDT)
From:      "Conrad J. Sabatier" <conrads@cox.net>
To:        Don Lewis <truckman@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Questionable code in sys/dev/sound/pcm/channel.c
Message-ID:  <XFMail.20040726174446.conrads@cox.net>
In-Reply-To: <200407262233.i6QMXghe058450@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <conrads@cox.net> -- "In Unix veritas"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20040726174446.conrads>