BelaPlatform / supercollider

an environment and programming language for real time audio synthesis and algorithmic composition
GNU General Public License v3.0
14 stars 8 forks source link

Server fails to start with `s.options.blockSize` != 16 #40

Closed giuliomoro closed 7 years ago

giuliomoro commented 7 years ago
s = Server.default;
s.options.numAnalogInChannels = 8;
s.options.numAnalogOutChannels = 8;
s.options.numDigitalChannels = 16;
s.options.blockSize = 32;
s.options.numInputBusChannels = 2;
s.options.numOutputBusChannels = 2;
s.options.postln;

s.waitForBoot({
});

if s.options.blockSize != 16 then the server cannot be started and it errors out terminate called without an active exception. Note that 16 is the default blocksize for Bela.

jpburstrom commented 7 years ago

This should work if you adjust s.options.hardwareBufferSize to equal s.options.blockSize.

sensestage commented 7 years ago

I think in standard SC you can make the blockSize smaller than the hardwareBufferSize, but not larger. This makes sense as you have to have samples ready for a hardware callback.

On Bela the hardwareBufferSize is usually 16, and I believe (off the top of my head) that that is hardcoded at the moment. So indeed, the blockSize should be 16 or smaller.

sensestage commented 7 years ago

So - this should be fixed in the documentation - and perhaps a check when setting the blockSize to something larger than the hardwareBufferSize.

LFSaw commented 7 years ago

actually, as mentioned in #33, I found that I have to set both block-size an hardware-buffer-size to be equal for scsynth to run properly. Sizes of 32 resp. 64 worked as well (and made buffer-underruns appear less).

sensestage commented 7 years ago

Now a warning is posted when the hardwareBufferSize is smaller than the blockSize. So I think it is a clear user error right now.

SC's blockSize can be smaller than the hardwareBufferSize.

sensestage commented 7 years ago

But, doesn't generate proper audio then...

sensestage commented 7 years ago

Fixed via: 017c59ced9841b313036113fc7f98ad742610d31

The blockSize takes precedence over the set hardwareBufferSize.