Closed jreus closed 3 years ago
I guess the general approach with Sc on Bela should be: everything should work like normal Sc, BUT when running Sc from the IDE, there may be some assumptions that are not verified here, because the server is not booted automatically by the IDE. Could you post your full code? Where do you run it ? In the SC IDE or as a stand-alone program on Bela?
I guess the general approach with Sc on Bela should be: everything should work like normal Sc, BUT when running Sc from the IDE, there may be some assumptions that are not verified here, because the server is not booted automatically by the IDE. Could you post your full code? Where do you run it ? In the SC IDE or as a stand-alone program on Bela?
I'm encountering the same issue both when the buffers are loaded "on-board" the Bela, as well as via remote control in the IDE. The full program (running completely as a sketch on the Bela) is...
s = Server.default;
s.options.numAnalogInChannels = 8; // Analog channels active. can only be 2, 4 or 8
s.options.numAnalogOutChannels = 8;
s.options.numDigitalChannels = 16;
s.options.dacLevel = 0;
s.options.blockSize = 32;
s.options.numInputBusChannels = 2;
s.options.numOutputBusChannels = 10;
s.waitForBoot {
a = List.new;
1027.do {|idx|
var buf = Buffer.new(s);
a.add(buf);
idx.postln;
}
};
As the error trace is from the language, I suspect the issue is here in Server.sc (in my slightly older version of SC):
newBufferAllocators {
var bufferOffset;
var offset = this.calcOffset;
var n = options.maxLogins ? 1;
var numBuffers = options.numBuffers div: n;
bufferOffset = numBuffers * offset + options.reservedNumBuffers;
bufferAllocator =
ContiguousBlockAllocator.new(numBuffers, bufferOffset);
}
The number of available buffers is divided by the number of possible logins. What is your s.options.maxLogins?
we use various different values in our examples
Bela/examples/SuperCollider//7-remote-control/remote.scd:s.options.maxLogins = 4; // should match the settings on the Bela
Bela/examples/SuperCollider//7-remote-control/_main.scd:s.options.maxLogins = 4;
Bela/examples/SuperCollider//6-pattern-control/_main.scd:s.options.maxLogins = 8; // set max number of clients
Bela/examples/SuperCollider//2-digital-in/_main.scd:s.options.maxLogins = 16; // set max number of clients
Bela/examples/SuperCollider//1-digital-out/_main.scd:s.options.maxLogins = 16; // set max number of clients
Bela/examples/SuperCollider//4-analog-out/_main.scd:s.options.maxLogins = 16; // set max number of clients
Bela/examples/SuperCollider//5-sample-scrub/_main.scd:s.options.maxLogins = 4; // set max number of clients
Bela/examples/SuperCollider//3-analog-in/_main.scd:s.options.maxLogins = 16; // set max number of clients
Bela/examples/SuperCollider//0-hello-sc/_main.scd:s.options.maxLogins = 4;
I have tried it as well and I can confirm that the issue looks intended and is about s.options.maxLogins
.
With this setting, OP's example can count correctly to 255:
s.options.numBuffers = 256 * s.options.maxLogins;
I've tried also with 1024 buffers/login and it doesn't show any hard limit, counting correctly until 1023.
This seems to require no further intervention from us. Closing it.
Environment
Steps to reproduce (for bugs)
Hello. There seems to be an issue with being unable to increase the number of available audio buffers in SuperCollider on the Bela. Normally this would be done by setting a number of buffers in ServerOptions.numBuffers before booting the server, like so:
On the Bela this number seems to be totally ignored. What's worse, the default number of available buffers is only 128 on the Bela! This is significantly less than the usual 1024 that is the default on most SuperCollider builds. However when I print the results of
s.options.numBuffers
it does report 1024.The hard limit is shown by running the following code, which counts to 127 and then throws an error.
Which gives the error
ERROR: No more buffer numbers -- free some buffers before allocating more.
(full stack trace below)Any ideas on how to get more buffers? Or is this limit a conscious decision hard-coded somewhere?
Error message (for bugs)