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

When scsynth is terminated, the PRU keeps running #11

Closed giuliomoro closed 7 years ago

giuliomoro commented 8 years ago

This probably means that the PRU cleanup is not performed

sensestage commented 8 years ago

maybe related to #9 ?

sensestage commented 7 years ago

I think it is definately related to #9.

giuliomoro commented 7 years ago

So this happens only when you SIGINT scsynth. It does not happen when using s.quit;, as far as I can tell.

This happens because - afaict - there is no signal handler installed, os none of the cleanup functions gets called. Ideally you would want to install a signal handler in main() in scsynth_main.cpp that makes some magic to properly stop the server. Therefore I'd say this is unrelated from #9

For instance, would it be possible to emulate a the equivalent s.quit sent from sclang ? That's probably the cleanest way of dying.

e.g.:

// at the top of `scsynth_main.cpp`:

#ifdef BELA
// Handle Ctrl-C by requesting that the audio rendering stop

void interrupt_handler(int signal)
{
    // do magic to gracefully stop the server 
}
#endif

// and then later in main() ...

#ifdef BELA
    // Set up interrupt handler to catch Control-C and SIGTERM
    signal(SIGINT, interrupt_handler);
    signal(SIGTERM, interrupt_handler);
#endif
giuliomoro commented 7 years ago

@apmcpherson