Re: Questionable code in sys/dev/sound/pcm/channel.c

From: Conrad J. Sabatier <conrads_at_cox.net>
Date: Mon, 26 Jul 2004 17:44:46 -0500 (CDT)
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_at_cox.net> -- "In Unix veritas"
Received on Mon Jul 26 2004 - 20:44:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:03 UTC