[BUG] unix squeak sound playing freeze

Lex Spoon lex at cc.gatech.edu
Fri Sep 7 20:52:44 UTC 2001


On Fri, Sep 07, 2001 at 05:42:06AM -0600, Matthew McNaughton wrote:
> Diagnosis:
> 
> In src/unix/sqUnixSound.c, HAVE_OSS will not be defined, so the dummy
> low-level sound driver routines from lines 468 to 516 will be compiled.
> These pretend to the upper levels that sound hardware is in fact
> available, and discard whatever sounds are passed down. It will also
> pretend in snd_AvailableSpace() that there is always room for more sound
> data.
> 
> This becomes important in the image, in SoundPlayer>>playLoop. If there is
> always space, then playLoop will sit in an infinite loop, continuously
> writing zeroes to the sound device. On real sound hardware, the sound
> driver's output buffer will fill up eventually and snd_AvailableSpace()
> will return 0, so that the block [ReadyForBuffer wait] in playLoop will
> eventually be executed.
> 
[...]
> SoundPlayer should not be writing zeroes constantly. Is there some reason
> it does this? Are there hardware platforms that will play static if you
> don't keep them crammed full of zeroes?
> 


Good detective work!  A really simple solution, which you'll find in
all the sqUnixSound.c files on my patches page, is to fail the
start-playing primitive.  Nowadays, Squeak can already perfectly-well
handle the absence of a sound device at the image level, and so
simulating a NULL device isn't needed.  This fix is accomplished
simply by making snd_Start() call success(false).


-Lex




More information about the Squeak-dev mailing list