> I know various questions keep coming up about this feature. Is it needed and, if so, is it needed on all platforms. For example, if it doesn't apply to macOS maybe we can hide the checkbox.
Generally, the callback scheduler does its job (advancing the scheduler, notifying the GUI, receiving MIDI, etc.) directly in the audio callback function, which I wouldn't recommend in the case of Pd because many operations are not realtime safe. *)
The polling scheduler, on the other hand, does all its work in a seperate thread and communicates with the audio callback via a lockfree FIFO (aka FAKEBLOCKING). Note that the latency/delay parameter only applies to the polling scheduler (it basically adds some extra space to the ring buffer to compensate for fluctuations in CPU load).
There are some parts in the callback scheduler code which I don't really understand, e.g. why sched_tick() is also called in m_callbackscheduler() although it is already called in sched_audio_callbackfn()...
Also, it's quite easy to hang Pd or get weird audio glitches... Actually, I don't think anyone is actually using it as it doesn't seem to offer any benefits. Maybe it's time to rip it out completely...
Christof
*) SuperCollider also runs its synthesis engine directly in the audio callback, but this is only works so well because they make sure that all operations are realtime safe, i.e. no system calls, no IO operations, no memory allocations with malloc/free, etc.
Gesendet: Freitag, 02. August 2019 um 23:12 Uhr
Von: "Dan Wilcox" <danomatika@gmail.com>
An: "Miller Puckette" <msp@ucsd.edu>
Cc: pd-dev <pd-dev@lists.iem.at>
Betreff: Re: [PD-dev] Pd hangs on exit on macOS
Ok. I figured it out. I thought I was going crazy and, since I many different builds of Pd for testing various things, I was also getting a bit lost as to what I might have changed and when.
At some point, I had enabled the "Use callbacks" checkbox in the Audio dialog. Using Forget all settings, then restarting Pd and enabling that checkbox will make Pd hang. Try it out Alex...
I know various questions keep coming up about this feature. Is it needed and, if so, is it needed on all platforms. For example, if it doesn't apply to macOS maybe we can hide the checkbox.
I tested with the following builds from Miller's site: 0.49-1, 0.49-1-i386, 0.49-0test5, 0.48-2, 0.48-1, 0.48-0. (0.47 and previous do not run as the GUI can't find Tk 8.4).
*All* hang my on system after doing the following:
1. open Pd app
2. turn on DSP
3. open audio test patch
4. turn off DSP
GUI goes unresponsive and pd core process pegs CPU. I then have to use "killall pd" on the command line.
not a problem for me doing exactly what you listed
Pd-extended does not hang and is able to restart audio after toggling DSP.
This is a strange issue as I don't remember when it started happening. I feel like Pd was running fine when I first updated to macOS 10.14, so I wonder if it's some sort of issuer with my system only. This is also not a problem on my macOS 10.13 machine at work.
You can also open the Activity Monitor app and search for "pd." If the process has hung, it may also display "Not Responding" next to it.
Well, like I said, I've been using Pd 0.49-1 without anything funny happening, no hanging whatsoever. At least without noticing it, and it all looks fine by checking activity monitor.
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at
https://lists.puredata.info/listinfo/pd-dev