<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 4, 2023, at 11:46 AM, Denis Połeć <<a href="mailto:denis.polec@gmail.com" class="">denis.polec@gmail.com</a>> wrote:</div><div class=""><br class=""><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="">As far as I can tell, everything is going smoothly with the callback settings. </div><div class="">However, I still haven't quite understood what it is for.</div></div></div></blockquote><br class=""></div><div>There was some discussion, maybe a year ago, about changing the name of this option and finding ways to make it clear what it does.</div><div><br class=""></div><div>Copy/paste from Christof's email replay to Romain, to which you were not in CC:</div><div><br class=""></div><div><blockquote type="cite" class=""><blockquote type="cite" class=""> Are there situations when using<br class="">callbacks  (on CoreAudio) bring any benefit?<br class=""></blockquote><br class="">With "callbacks" enabled, Pd runs directly on the audio thread. <br class="">Generally, this is not really recommended because Pd itself is not <br class="">realtime safe. Many operations block for an indeterminate amount of <br class="">time, e.g. any call to "malloc()", network IO, file system operations, <br class="">etc. The upside is that you can avoid some extra delay (see below).<br class=""><br class="">With Pd's ringbuffer scheduler (= "callbacks" disabled), you can freely <br class="">adjust the delay according to? your needs. (The "delay" parameter <br class="">basically sets the size of the ringbuffer.) The price you pay is some <br class="">extra delay (1x the hardware buffer size). To minimize this extra delay, <br class="">you would set the /hardware buffer size/ as low as possible (e.g. 64 <br class="">samples) since the audio callback does nothing but transfer a bunch of <br class="">samples. In this case, the extra latency would be as low as 64 samples, <br class="">so nothing to worry about too much.<br class=""><br class="">(The "callback" option can indeed make a noticable difference when using <br class="">Jack with larger block sizes. Ideally you would just use the smallest <br class="">Jack block size possible, but this might not work well for other Jack <br class="">clients...)<br class=""><br class="">As a side note: up until now, Pd's scheduler thread regularly goes to <br class="">sleep for a fixed duration, so it may wake up a bit too late. If the <br class="">delay setting is too low, this can lead to drop outs. With my <br class="">"scheduler_fix" branch, the scheduler thread waits on a semaphore and is <br class="">notified immediately when audio data is available. In my experience so <br class="">far, this allows for lower "delay" settings than before.<br class=""><br class="">Christof</blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">--------</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">Dan Wilcox</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><a href="http://twitter.com/danomatika" class="">@danomatika</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><a href="http://danomatika.com" class="">danomatika.com</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><a href="http://robotcowboy.com" class="">robotcowboy.com</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><br class="Apple-interchange-newline">
</div>
<br class=""></body></html>