Sound driver "plays" silence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Sound driver "plays" silence

Andrew Gaylard
 
In my message, archived here
http://lists.squeakfoundation.org/pipermail/vm-dev/2007-October/001595.html
I mentioned that it seems that once a sound has played,
the image keeps sending silence to the sound device.

This keeps the CPU quite busy, as seen both by the OS
(load average) and the interpreter (slower benchmarks).

I've had a little more time to dig into this, and it
seems this is expected behaviour: it is toggled by the
"soundStopWhenDone" preference, and read in
SoundPlayer>>playLoop.  It seems that this is
off by default (i.e. sound never really stops, once
started). Switching it to "on" solved my problem.

So now I'm curious.  Why was it built this way?
And why do released images have this preference off?

For most modern hardware, this isn't an issue, but for
slower hardware (e.g. mine), or for power-lean systems
(e.g. the OLPC) I think it could be.

Andrew
Reply | Threaded
Open this post in threaded view
|

Re: Sound driver "plays" silence

Andreas.Raab
 
Andrew Gaylard wrote:
> So now I'm curious.  Why was it built this way?
> And why do released images have this preference off?

Purely historical coincidence. Things used to work more smoothly on Mac
  OS 7-9 if we kept sending silence instead of turning the whole
soundsystem on and off. I added the preference since on Windows ('95 and
'98) access to the sound device is exclusive so having had Squeak play a
sound once would make it inaccessible for other apps.

I don't think any of these concerns are valid any longer.

Cheers,
   - Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Sound driver "plays" silence

Yoshiki Ohshima-2
In reply to this post by Andrew Gaylard
 
  Thank you, Andrew,

> For most modern hardware, this isn't an issue, but for
> slower hardware (e.g. mine), or for power-lean systems
> (e.g. the OLPC) I think it could be.

  The soundStopWhenDone preference is set to on in the OLPC Etoys
image, FYI.  When the user switches away from Etoys, we also shutdown
the sound system.

-- Yoshiki