Re: [PD-dev] why must one never send a message from a perform routine ?

2023-08-23 Thread Christof Ressi
I actually get fewer xruns in callback mode, This sounds highly unlikely. Maybe your "delay" setting is too low? Or Pd is not actually running with realtime priority? I also bump the sound-generation process up to realtime priority. Pd itself already tries to raise the thread priority; if

Re: [PD-dev] why must one never send a message from a perform routine ?

2023-08-23 Thread Day Rush
For what it's worth, I actually get fewer xruns in callback mode, but I am running computation-heavy externals for much of my sound design so YMMV. I also bump the sound-generation process up to realtime priority. On Wed, 23 Aug 2023 at 15:39, Joseph Larralde wrote: > Wow, thanks again

Re: [PD-dev] why must one never send a message from a perform routine ?

2023-08-23 Thread Christof Ressi
Ah, I thought you were talking about the "polling mode vs callback mode" thing. Yes, the API docs should mention in which context a function may or may not be called. For example, functions that can be safely called in perform routines may be annotated with something like "\qualifier

Re: [PD-dev] why must one never send a message from a perform routine ?

2023-08-23 Thread Dan Wilcox
Well, I don't mean documentation all internal mechanisms but, in this case, it might have been helpful to at least note *which* functions should or shouldn't be called in which situations. For instance, I note which libpd functions *not* call when DSP is running. > On Aug 23, 2023, at 5:30

Re: [PD-dev] why must one never send a message from a perform routine ?

2023-08-23 Thread Christof Ressi
so it would pay to fill out the header. Yeah, all API functions in "m_pd.h" should really have minimal documentation (preferrably doxygen). However, I'm not sure that "m_pd.h" is the place for documenting the inner workings of Pd... I think the official manual would be a more natural place,

Re: [PD-dev] why must one never send a message from a perform routine ?

2023-08-23 Thread Dan Wilcox
Joseph: Do not be embarrassed. Understanding the engine is relatively opaque IMO and info is scattered in different places. Christof: IMO these kinds of important details should really by in m_pd.h. The API is pretty stable at this point, so it would pay to fill out the header. This was my

Re: [PD-dev] why must one never send a message from a perform routine ?

2023-08-23 Thread Christof Ressi
Glad that I could help! Very little of this is really documented (accurately). Personally, I figured this out by reading the source code. Ideally, we should improve the official documentation in http://msp.ucsd.edu/Pd_documentation/x3.htm#s1.0. Some things are outdated, misleading or just

Re: [PD-dev] why must one never send a message from a perform routine ?

2023-08-23 Thread Joseph Larralde
Wow, thanks again Christof, this greatly improves my understanding of Pd's engine. Indeed, I never use callback mode because everytime I did in the past I got some xruns, but had no clue about what was happening behind the scene. I feel a bit ashamed, I'm pretty sure I could have figured this