For a project with very big synthDefs, I have to set very high values for the option numWireBufs of the server. Otherwise, I get an error mentioning I have to increase this value.
And I would like to know which is the maximum value I can set for numWireBufs (on both OSX and Linux) ?
Because I have remarked that setting very high numWireBufs values is OK on OSX, but generates GREY count errors on Linux.
I do not have a linux computer right now, but which is the max value for numWireBufs on Linux I can have without generating GREY count errors ?
What is the action you’re taking, right before the grey count errors? Because there are a lot of moving parts in your scenario, so it’s hard to guess based on “I did something (unspecified) and got this message.”
Grey count errors are a part of sclang (related to garbage collection), not the audio server, so the wirebuf count should be completely unrelated.
If your SynthDef is complex/large enough that you’re having to set an extremely high wirebuf count, it’s possible that you’re uncovering a memory-related bug on Linux - this could result in a grey count error. If you have one mega-SynthDef you might consider trying to break it up into multiple smaller SynthDefs you can chain together - this could side-step any potential problems resulting from the SynthDef being too large.
Also, fwiw: I often use very complex SynthDefs, to the point that I can only run one or two copies at a time before maxing out my CPU. My numWireBufs is still only set to 4092… orders of magnitude smaller than what you’ve suggested. If you’re needing a count as high as 8192*12000, it might be that you’ve got a bug in your SynthDef that’s generating a lot more complexity than you intend to. You might try using assertChannels in your SynthDef to ensure that you actually have the channel counts that you expect. (extAssertShape.sc · GitHub)
sig = SinOsc.ar([100, 200, 300]);
sig.assertChannels(3); // expect an array
sig = [sig, sig];
sig.assertChannels(2, 3); // expect an array of array's
sig = SinOsc.ar([100, 200, 300, 400]);
sig.assertChannels(3); // this errors because sig is 4 channels now
SynthDef’s topological sort is designed to minimize wirebuf usage (that is, it prefers narrow over wide graphs). This may increase usage of CPU cache over RAM, improving processing speed. It performs best on the very common case of parallel chains of UGens, mixed down at the end.
Buuuut… I just found a case where multichannel expansion → mixdown produces a wide graph: (a * b).sum can result in a chain of MulAdd units, and it puts all of the a units upfront (requiring one wire buffer per channel).
@scztt The reason why I wrongly linked high values of numWireBufs with grey count errors is because I noticed setting high values on Linux (above 1024) would generate automatically grey count errors with my program, whereas on Mac I can rarely have this issue.
That is why I set a limit for Linux on this line of the project.