<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Actually, I just remember that I fixed a very similar issue with
      the ASIO backend. However, it was a bit more nasty, because Pd
      would simply crash if the "Delay" value was too low :-) My
      solution was too simply cap the value at the hardware blocksize:</p>
    <p><a class="moz-txt-link-freetext" href="https://github.com/pure-data/pure-data/blob/3ae0388c2ba354e2b5d818c1422b7484c4a491bf/src/s_audio.c#L357">https://github.com/pure-data/pure-data/blob/3ae0388c2ba354e2b5d818c1422b7484c4a491bf/src/s_audio.c#L357</a></p>
    <p>---<br>
    </p>
    <p>The problem with the Jack backend is that it caps at *Pd's*
      blocksize (64 samples) - which is often lower than the Jack
      buffersize. Consequently, the Jack callback might never have a
      chance to fill the ring buffer.</p>
    <p>I think the solution is simple:</p>
    <p>In <i>jack_open_audio()</i> replace<br>
    </p>
    <pre>if (advance_samples < DEFDACBLKSIZE)
    advance_samples = DEFDACBLKSIZE;</pre>
    <p>with<br>
    </p>
    <pre>if (advance_samples < jack_blocksize)
    advance_samples = jack_blocksize;</pre>
    <p>@Roman: can you give this a try?<br>
    </p>
    <p>Christof<br>
    </p>
    <div class="moz-cite-prefix">On 22.03.2022 15:39, Roman Haefeli
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:c39e6c365c216d4d5eeac9a854b8eea90ac31179.camel@gmail.com">
      <pre class="moz-quote-pre" wrap="">On Tue, 2022-03-22 at 15:23 +0100, IOhannes m zmoelnig wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">On 3/22/22 15:06, Roman Haefeli wrote:
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">On Tue, 2022-03-22 at 14:56 +0100, Christof Ressi wrote:
</pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <pre class="moz-quote-pre" wrap="">Anyway, I can open an issue to describe that in my case DSP
only
works with callbacks on.
</pre>
            </blockquote>
            <pre class="moz-quote-pre" wrap="">  Yes, please! The Jack backend is supposed to work regardless of
the
"callback" setting.
</pre>
          </blockquote>
          <pre class="moz-quote-pre" wrap="">
But not regardless of the "delay (ms)" setting. If it is too low,
Pd
won't process audio. I don't know if there is a way to know
beforehand
what 'too low' is. It isn't necessarily a bug in Pd, I'd say.
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
it's probably a bug in Pd if the DSP and the GUI both freeze.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Indeed, if the buffer is set too small, then Pd GUI freezes! 

>From my anecdotal testing, it looks like the critical value is
predictable. As Christof said, the buffer cannot be smaller than JACK's
blocksize. 

For instance with JACK @ 256 samples @ 44.1kHz (5.8ms):
  - Pd works with 6ms
  - Pd freezes with 5ms

I guess the dialog could be designed in a way to set a lower boundary
that is dependent on the detected JACK blocksize. I don't know,
however, if Pd is able to detect the blocksize before DSP is turned on.

Roman 
 
</pre>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
<a class="moz-txt-link-abbreviated" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-list">https://lists.puredata.info/listinfo/pd-list</a>
</pre>
    </blockquote>
  </body>
</html>