Hi folks,
I’m working on a project integrating SC and Ableton (on OSX.12 ARM M1) connected via IAC (+ CV out to other outboard devices via CVTools). I’m experiencing intermittent yet very significant timing issues, especially when moving from one application to the next and where any network activity takes place. Though i’m baffled that a contemporary computing system still exhibits such issues (wasn’t this why we stuck with Atari?) it does seem that either the IAC bus or SC are low priority here.
Is there a means to force Supercollider to prioritize time-sensitive actions?
Thanks.
Jose
April 5, 2023, 1:45pm
#2
Hi @zentrumsounds ,
There is a known SC server priority issue with M1 processors due to the new MacOs QoS implementation. Waiting that this problem will be solved, you need to modify the source code of SC server and recompile SC by yourself. After that SC works like a charm on M1-M2
See this topic :
opened 01:43PM - 16 Jan 23 UTC
bug
os: macOS
## Environment
* SuperCollider version: 3.12.2, 3.13.0-rc-1 arm64 and x64
* … Operating system: macOS Monterey 12.6.1 and Ventura
## Steps to reproduce
```supercollider
SynthDef(\imp, { OffsetOut.ar(0, Impulse.ar(0)); FreeSelf.kr(Impulse.kr(0)); }).add;
(
t = Task({
10000.do({ arg i;
Synth(\imp);
0.05.wait;
});
});
)
t.start;
t.stop;
```
## Expected vs. actual behavior
I have done different tests sending messages from scland and from another OSC client (Antescofo) to scsynth and I find scheduling problems (rhythmic irregularity or interruptions).
If I launch the Task process (example above Steps to reproduce) on a Mac M1 the rhythm generated by scland in scsynth has irregularities and is not completely stable. For example if MacOS starts to make an indexation (Spotligth), if I connect to the internet or switch from one application to another (command+tab), there are interruptions. It seems that every time the system does a background operation, there are interruptions sending or receiving OSC messages.
I have done several tests on 2 MacBook Pro M1 with Monterey (12.6.1) and a MacBook Air M1 with Ventura.
This problem does not happen on a MacBook Pro with Intel processor running SC 3.12.2.
I've tried with the x64 version on Rosetta and native ARM64 and the problem is the same...
Apparently there is a priority problem, but using the 'renice' command in the terminal and increasing the priority of scsynth and sclang process there seems to be a very small improvement, but it doesn't solve the problem.
Any idea how to solve this problem? To make it work like on an Intel processor without interruptions ?
Thanks,
José
Best,
José
1 Like
Thanks Jose!
That’s it exactly…though I’m not quite clear what the fix involves.
Is it “simply” a case of removing (commenting out) the lines in question at 109-116? I’ve only used the SC download and not yet recompiled SC myself. Not sure I’m 100% comfortable doing this but the timing errors are going to cause issues in a performance i have in a few weeks if i can’t resolve this.
static void resyncThreadFunc() {
# ifdef NOVA_TT_PRIORITY_RT
std::pair<int, int> priorities = nova::thread_priority_interval_rt();
nova::thread_set_priority_rt((priorities.first + priorities.second) / 2);
# else
std::pair<int, int> priorities = nova::thread_priority_interval();
nova::thread_set_priority(priorities.second);
# endif
347-354:
void SC_AudioDriver::RunThread() {
#ifdef NOVA_TT_PRIORITY_RT
std::pair<int, int> priorities = nova::thread_priority_interval_rt();
nova::thread_set_priority_rt((priorities.first + priorities.second) / 2);
#else
std::pair<int, int> priorities = nova::thread_priority_interval();
nova::thread_set_priority(priorities.second);
#endif
Remove the calls to nova::thread_set_priority
in the following places:
static void asioFunction() {
#ifdef NOVA_TT_PRIORITY_RT
std::pair<int, int> priorities = nova::thread_priority_interval_rt();
nova::thread_set_priority_rt((priorities.first + priorities.second) / 2);
#else
std::pair<int, int> priorities = nova::thread_priority_interval();
nova::thread_set_priority(priorities.second);
#endif
boost::asio::io_service::work work(ioService);
ioService.run();
}
static void resyncThreadFunc() {
# ifdef NOVA_TT_PRIORITY_RT
std::pair<int, int> priorities = nova::thread_priority_interval_rt();
nova::thread_set_priority_rt((priorities.first + priorities.second) / 2);
# else
std::pair<int, int> priorities = nova::thread_priority_interval();
nova::thread_set_priority(priorities.second);
# endif
void SC_AudioDriver::RunThread() {
#ifdef NOVA_TT_PRIORITY_RT
std::pair<int, int> priorities = nova::thread_priority_interval_rt();
nova::thread_set_priority_rt((priorities.first + priorities.second) / 2);
#else
std::pair<int, int> priorities = nova::thread_priority_interval();
nova::thread_set_priority(priorities.second);
#endif
1 Like
Jose
April 5, 2023, 2:43pm
#5
That’s it! Thanks again @Spacechild1
So just to clarify. This involves building SC from scratch using XCode? Or are these actions i can take on the downloaded 3.13.0 version?
Jose
April 5, 2023, 3:11pm
#7
Unfortunately you have to do it from scratch by compiling it yourself.
Follow the instructions here :
It is not absolutely necessary to use XCode, you can do it directly from the terminal using cmake.
Waiting for the problem to be solved definitively, maybe some developer can make a version for distribution on the Downloads | SuperCollider site??
1 Like