<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 7, 2017 at 4:09 PM, Hanspeter Portner <span dir="ltr"><<a href="mailto:dev@open-music-kontrollers.ch" target="_blank">dev@open-music-kontrollers.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 07.04.2017 06:38, Stefan Riha wrote:<br>
> Hi, trying to bottom-post:<br>
><br>
> On Tue, Mar 14, 2017 at 10:08 PM, Stefan Westerfeld <<a href="mailto:stefan@space.twc.de">stefan@space.twc.de</a><br>
</span><span class="gmail-">> <mailto:<a href="mailto:stefan@space.twc.de">stefan@space.twc.de</a>>> wrote:<br>
><br>
>        Hi!<br>
><br>
>     On Fri, Mar 10, 2017 at 07:19:24PM +0100, David Robillard wrote:<br>
>     > On Wed, 2017-03-08 at 20:23 +0100, Robin Gareus wrote:<br>
>     > > On 03/08/2017 08:04 PM, David Robillard wrote:<br>
>     > > I'd love to see an efficient IPC mechanism that works x-platform on<br>
>     > > all<br>
>     > > the platforms that LV2 works on.<br>
>     ><br>
>     > Nobody ever got fired for using TCP sockets.<br>
><br>
>     Yes, right. One could use a pipe() if the platform supports that and<br>
>     fall<br>
>     back to identical-API sockets.<br>
>     ><br>
>     > "Efficient", well, yeah.  No.  This is a fallback (or single-plugin<br>
>     > host) mechanism, not something ideal.  That said, it can easily be good<br>
>     > enough.  Hell, people do this for actual plugins and kinda sorta get<br>
>     > away with it, most UIs are waaaaaaaaaaaaayyyyyyyy less demanding.<br>
><br>
>     We don't need hard-RT for UI anyway, so this should be fine.<br>
><br>
><br>
> I'm a programming beginner and also interested in learning about TCP.<br>
><br>
> I thought it's too slow/expensive for audio. But maybe it's nice for<br>
> testing plugins, e.g. if a host doesn't provide a generic gui, or if the<br>
> "generic logic" produces cumbersome results. Since it was brought up in<br>
> this thread, I was wondering if anybody could outline in more detail how<br>
> to do this properly?<br>
<br>
</span>The conversation is about using some IPC mechanisms (pipe/TCP) for<br>
communication from host to plugin UIs running in a separate process<br>
space. It would be the hosts job to do that for you. The plugin author<br>
wouldn't need to implement that.<br></blockquote><div><br></div><div>I had no clue, thanks for clarifying!</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> I should say that I understand about 20% of what is being discussed<br>
> here, so I appreciate references to tutorials or introductions<br>
> (particularly using networking protocols).<br>
><br>
> I tried to get something working with as little effort as possible,<br>
> probably very naively:<br>
><br>
> At UI instantiation I launch a TCP listener in a new thread (A) that<br>
> listens on an OS-assigned port. When the connection is established, the<br>
> stream is split into a "receiver" and a "sender". The "receiver", which<br>
> in my case receives from a Web browser, is blocking, and so must be put<br>
> into another thread (B), along with the LV2 write_function and the<br>
> controller. The port_event() function is connected to the "sender" with<br>
> a so-called "channel". Side note: A "channel" is a Rust thing that<br>
> provides asynchronous communication between threads, surely there is<br>
> something equivalent in C, but I don't know how to call it.<br>
<br>
</span>Surely there is a non-blocking version of the receiver? You'd put that<br>
into an ui:idleInterface which will be called continuously with a fixed<br>
update rate by the host.<br></blockquote><div><br></div><div>Indeed, I read about that, they added it recently to the library I use. I'll try that.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> So in other words, there are two new threads for a single plugin<br>
> instance, which is probably very bad. True?<br>
><br>
> Is a better way to do it, to let the ui be a client only, and connect to<br>
> a standalone server? That wouldn't reduce the overall load, but the<br>
> server could live on a different CPU core or even CPU?<br>
<br>
</span>Well, I don't know what you actually try to solve here... Do you want to<br>
run your UI in the browser? Then you may be interested in this:<br>
<br>
<a href="https://github.com/moddevices/modgui-embed" rel="noreferrer" target="_blank">https://github.com/moddevices/<wbr>modgui-embed</a></blockquote><div><br></div><div>Yes, that was the idea! Thanks for the link.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<span class="gmail-"><br>
> When I brought up websockets in a previous thread (almost a year ago)<br>
> Hanspeter pointed me to his Moony plugin. However, I could not find<br>
> stuff related to websockets, tcp or the like.<br>
<br>
</span>It must still be there in the git logs somewhere. I've migrated the UI<br>
to a GL implementation since, as I don't want to deal with browser<br>
incompatibilities, an UI in the browser gives a bad user experience and<br>
the ui:showInterface is not (reliably) implemented across LV2 hosts.<br>
<br>
Implementing your UI in GL and drawing it to the platform's native<br>
surface will give you the least pain, IMHO.<br></blockquote><div><br></div><div>Browser incompatibilities of course defeat the purpose of having a web gui, I can see that. Ok I'll keep GL in mind.</div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail-HOEnZb"><div class="gmail-h5">______________________________<wbr>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.lv2plug.in">Devel@lists.lv2plug.in</a><br>
<a href="http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in" rel="noreferrer" target="_blank">http://lists.lv2plug.in/<wbr>listinfo.cgi/devel-lv2plug.in</a><br>
</div></div></blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks a lot for your help!!<br></div></div>