Comments (4)
This affects the .poll method
from supercollider.
Funny fact:
running scsynth
, scprintf()
will work fine.
Running sclang
, the scprintf()
of the spawned process will not work fine.
Even more: if you start sclang
and then kill -2 \
pgrep scsynth`(or
kill -2the pid of the audio thread), it will dump all the
scprintfmessages you printed earlier and were not actually printed . However, if you ctrl-c
sclang` it will die immediately without dumping those messages. Still, the PRU will stop correctly (which somehow means that the signal handler (see #11) is getting called, but the messages are not dumped.).
As suggested by @apmcpherson, this can totally be an issue of buffering of the stdout
of scsynth
when started by sclang
. However, I tried to make sclang
start scsynth
with stdbuf -i 0 -o 0 -e 0 scsynth
(which should prevent buffering of stdout/in/err
) instead of exec scsynth
and this does not yield any improvement. example patch:
diff --git a/SCClassLibrary/Platform/linux/LinuxPlatform.sc b/SCClassLibrary/Platform/linux/LinuxPlatform.sc
index 19566f1..c2724ad 100644
--- a/SCClassLibrary/Platform/linux/LinuxPlatform.sc
+++ b/SCClassLibrary/Platform/linux/LinuxPlatform.sc
@@ -10,7 +10,7 @@ LinuxPlatform : UnixPlatform {
helpDir = this.systemAppSupportDir++"/Help";
// Server setup
- Server.program = "exec scsynth";
+ Server.program = "stdbuf -o0 -i0 -e0 scsynth";
// Score setup
Score.program = Server.program;
note that if I run exec stdbuf -o0 -i0 -e0 scsynth
it just fails (scsynth
process becomes defunct).
from supercollider.
so I have a fix for this, but then if I use poll()
in SC, the console gets flooded with messages. @sensestage do you know how poll() is implemented (e.g.: in something like:
var rate = AnalogIn.ar(0).exprange(0.3, 20);
rate.poll(100);
) ? Where is this poll()
implemented?
This is the patch which flushes the rt_printf
buffers from a separate thread and outlines the issue above:
diff --git a/server/scsynth/SC_Bela.cpp b/server/scsynth/SC_Bela.cpp
index 8e34305..ee91360 100644
--- a/server/scsynth/SC_Bela.cpp
+++ b/server/scsynth/SC_Bela.cpp
@@ -327,6 +327,7 @@ void SC_BelaDriver::staticMAudioSyncSignal(void*){
// ... but mode switches are still happening here, in a lower priority thread.
// FIXME: this triggers a mode switch in Xenomai.
staticMAudioSync->Signal();
+ rt_print_flush_buffers();
rt_task_suspend(rt_task_self());
}
from supercollider.
Right, my fix is fine. The "flooding" I experienced above is related to another issue.
Merge PR #60 to fix this.
from supercollider.
Related Issues (20)
- Allow for compiling custom UGens in a Bela SC project
- Analog outs as audio are not working
- scsynth should send back CPU usage to SC IDE HOT 2
- Bela UGens do not interact nicely with `play` HOT 4
- Re-write common/SC_SyncCondition.h so that it uses Xenomai primitives
- integrate neon math functions into scsynth HOT 1
- Cache compiled class library for faster startup HOT 2
- remove warnings for out of range analogOut channels HOT 5
- Nicely handle different channel counts for I/O. HOT 3
- numAudioBusChannels on Bela scsynth lower than remote sclang HOT 23
- DigitalOut ugens have problems HOT 5
- Anything we can merge to upstream? HOT 8
- Zero documentation for DigitalIn / AnalogIn HOT 3
- (Bela IDE) add project specific library configfile for sclang startup
- Let's merge Bela support into SC! HOT 9
- number of available audio buffers seems to be locked at 128 on Bela HOT 6
- UGens which detect invalid settings at constructor should still call SETCALC() HOT 4
- Scope occasionally causes segfault HOT 5
- Bela-specific mods to the server class file HOT 11
- Dseq, Dser and Demand - unexpected behaviour on bela HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supercollider.