[BUG] unix squeak sound playing freeze

Matthew McNaughton mcnaught at cs.ualberta.ca
Fri Sep 7 22:38:55 UTC 2001


On Fri, 7 Sep 2001, Lex Spoon wrote:

> On Fri, Sep 07, 2001 at 05:42:06AM -0600, Matthew McNaughton wrote:
> > 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).

This is one of the first workarounds I found, but I don't like it.
Allowing SoundPlayer to constantly write zeroes has a number of problems:

- Even when sound hardware is available, SoundPlayer consumes CPU
unnecessarily. I don't really notice it on my 1.1Ghz athlon, but the
people discussing using Squeak on a PDA might.

- When a sound is played, there can be a delay while the sound hardware
finishes playing all those zeroes, if the driver is unable to mix new
sounds into stuff that is already playing.

Would it be a waste of time for me to improve SoundPlayer? If it worked
well, would it be likely to make its way into the image? Who would I send
the change set to?

-- 
Matthew McNaughton <mcnaught at cs.ualberta.ca>





More information about the Squeak-dev mailing list