[squeak-dev] Sound mixing makes nasty noises

Herbert K├Ânig herbertkoenig at gmx.net
Tue Dec 29 11:38:51 UTC 2020

Am 28.12.2020 um 22:48 schrieb tim Rowledge:
>> On 2020-12-28, at 10:36 AM, Herbert <herbertkoenig at gmx.net> wrote:
>> Inside Squeak I saw a lot of clipping as expected, outside I saw
>> wrapping whenever it clipped inside.
> That would be an interesting thing to prove conclusively. It's not unimagineable that there could be a bug in a unix sound library.
I'd suspect the Squeak primitive that hands the buffers to the OS before
looking into OS code.

Would it be conclusive to record the outside for a minute or so, read
that file and count wrapping
(sample(n) = +fullscale and sample(n+1) = -fullscale) or (sample(n) =
-fullscale and sample(n+1) = +fullscale)
and do the same for all SoundBuffers we get hold of inside Squeak during
the recording? (repeatedly checking SoundBuffer allInstances)

> Maybe if we make a crafted sound buffer with a clean waveform that we know never gets clipped but does hit the maxval/minval and play it directly with no mixing related calls (because the mixer code does volume scaling etc and internal clipping) we might see what comes out of pulseaudio and indeed alsa.
AbstractSound or the like has a class var Sine with that but I feel
that's directed at finding a bug in the OS and discards the possibility
of Squeak messing it up. And the organ sounds used are predictable
enough re clipping but I hope the individual envelopes add some
randomness to cover more cases.



More information about the Squeak-dev mailing list