<div dir="ltr"><div>Speaking entirely personally, I think this design is just plain nuts. I know there are some JACK-ecosystem developers who disagree with me, but I think that using JACK clients for this purpose is just wrong and is pushing the design scope for JACK.<br><br></div>What you're doing is precisely what a plugin architecture was intended to address, and I really think you'd be better off implementing your own audio graph with plugins. Of course, that requires a version of zyn that can run as a plugin, which I think has been discussed but I don't think it was every implemented fully.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 9, 2015 at 2:01 AM, Johannes Lorenz <span dir="ltr"><<a href="mailto:johannes89@mailueberfall.de" target="_blank">johannes89@mailueberfall.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
> I try to understand your plan:<br>
><br>
> simple data flow example:<br>
><br>
> zynaddsubfx_1_output<br>
><br>
>           V<br>
> sequencer_client_1_input<br>
><br>
>           V<br>
> sequencer_input_ringbuffer<br>
><br>
>           V<br>
> (sequencer processing stuff)<br>
><br>
>           V<br>
> sequencer_output_ringbuffer<br>
><br>
>           V<br>
> sequencer_client_output<br>
><br>
>           V<br>
> system_client_input(hardware output)<br>
<br>
</span>Your picture is indeed correct. To add some more examples:<br>
<br>
  * Something like this is also possible<br>
<br>
        sequencer_input_ringbuffer_1     sequencer_input_ringbuffer_2<br>
                V                                V<br>
        plus (i.e. addition of sound-waves)<br>
                V<br>
        plus_effect_ringbuffer<br>
<br>
  * The part that you labeled "(sequencer processing stuff)" might be filled with:<br>
<br>
                V<br>
        peak_controller_effect        some lfo generator<br>
                V (lfo)                       V (lfo)<br>
        zynaddsubfx_2_volume_input    zynaddsubfx_2_filter_freq_input<br>
                V<br>
        (zynaddsubfx_2)<br>
                V<br>
        zynaddsubfx_2_output<br>
                V<br>
        sequencer_client_2_input<br>
                V<br>
<span class=""><br>
> Maybe also what you envision to happen in which thread or which<br>
> callback?<br>
<br>
</span>Let's take the second example. zynaddsubfx itself is in another process, so we don't need to run this at all. For feeding each ringbuffer from zyn, I planned to use a separate jack client. E.g., if process() of sequencer_client_1_input is being called, it simply copies "nframes" into sequencer_input_ringbuffer.<br>
<br>
Everything that now remains (e.g. lfo generator, peak_controller_effect, sending input to zynaddsubfx_2) is done by a process() callback of sequencer_client_output. I call this one the master jack client.<br>
<br>
About the problem:<br>
<br>
A point where I think spinlocks can't be avoided would be, e.g., reading from sequencer_output_ringbuffer. The sequencer's master jack client would need to do that in process(), but it can not guess when the ringbuffer reader from sequencer_client_2_input has even started to feed the ringbuffer.<br>
<span class=""><br>
> Do you want to do some signal processing in your sequencer or would it<br>
> be ok to delegate this to other jack clients? (may be easier)<br>
<br>
</span>Hopefully you got it from the explenations above: the master jack client would do this right now, as I planned. Other ideas will be fine, too. Though, I guess, for "some lfo generator", e.g., a separate jack client would be overkill, as this generator simply does, e.g., f(x) = sin(x).<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Jack-Devel mailing list<br>
<a href="mailto:Jack-Devel@lists.jackaudio.org">Jack-Devel@lists.jackaudio.org</a><br>
<a href="http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org" target="_blank">http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org</a><br>
</div></div></blockquote></div><br></div>