[squeak-dev] Many questions about sounds :-)

tim Rowledge tim at rowledge.org
Mon Jun 28 18:26:56 UTC 2021

> On 2021-06-28, at 4:12 AM, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
> Ah, that's interesting. :-) But why is "[] newProcess" blazing fast whereas the invocation in the SoundPlayer is so expensive? Is this somehow related to the resources (closure vector) that need to be shared in this case?

This almost nothing at all to do with the costs of starting a Squeak Process - which are quite close to 0 - and almost entirely the costs of starting the platform sound system, getting the samples into the platform sound system buffers, and said sound system actually getting around to making speakers wobble back and forth. Another layer of possible time-spending is the fairly complex code in SoundPlayer class>>#playLoop and its friends.

I'm not certain, but I also suspect that only Mac has actually functional quick-start code in the sound plugin.

It might be instructive to insert some time tagging to measure how long it takes from sending the sound buffer to the OS until the actual sound comes out. And indeed how long from asking Squeak to start playing until it gets to the OS buffer.

tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Old programmers never die; they just branch to a new address.

More information about the Squeak-dev mailing list