<html data-lt-installed="true">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body style="padding-bottom: 1px;">
    <p><br>
    </p>
    <p><br>
    </p>
    <p>Hello, fellow Jack developers.</p>
    <p>I am currently writing a jack client which is loaded from within
      the unity3d game engine. It's supposed to work like this: Every
      time, jack requests audio, unity3d generates it. This is done in
      order to bypass the unity3d audio renderer and use the audio in
      different applications instead.</p>
    <p>Technically, everything works fine so far. When the software is
      started, either from within the unity3d editor or directly as a
      compiled unity3d application, the client appears in QJackCtl and I
      can route the channels to wherever I want and even hear the audio.
      <br>
    </p>
    <p>BUT: the client randomly disables. At some point during runtime
      (both in the built version and directly from the editor) it
      happens, that the routing disconnects itself, and I am unable to
      reconnect it. When I try, I get the message "Cannot connect ports
      owned by inactive clients: "Unity" is not active".</p>
    <p>This behavior seems to be very unpredictable, sometimes it
      happens after just a second, sometimes it runs fine for over a
      minute or two. Sometimes it does not even happen (or I did not
      wait long enough).<br>
    </p>
    <p>I have experienced this behavior both writing my own framework or
      by using the JackSharp framework. The behavior also does not
      change when uninstalling pulseaudio (which was sort of a last
      guess on our end).</p>
    <p>The same behavior occurs when I use jack with a dummy driver. The
      connection is established and randomly breaks down again.
      (although obviously I can't hear the sound).</p>
    <p>Interestingly: when I use the framework as a standalone version,
      everything seems to work fine. Therefore, it kind of seems
      obvious, that it has to have to do something with Unity or the
      fact, that the framework is called from a different thread or
      something like that. However, Unity does not report any problems.<br>
    </p>
    <p>What I can see in the QJackCtl Log: The exact moment the problem
      occurs, the kPortRegistrationOff Method is called on all ports. It
      looks like the server disables all ports, then tries to deactivate
      the client and therefore destroying all the ports. It eventually
      proceeds to tell, that the client was destroyed successfully and
      that's it. <br>
    </p>
    <p>I have implemented all the callbacks that are available from the
      API (at least all that i think where usefull) but all I get is,
      that the framework receives the jack_on_info_shutdown method is
      called. This method is passed a const char argument which is
      supposed to hold the reason, but all it says is : "JACK server has
      been closed". Which it is not. It is still running.</p>
    <p>At this point, I am out of ideas of what to do to narrow down the
      problem. </p>
    <p>I have tested other applications (like Reaper) and they work
      fine. <br>
    </p>
    <p>I am using Ubuntu 20.04, both on low-latency or generic kernel
      > 5.14</p>
    <p>I use the latest version of jack2 (as of Dec 22)</p>
    <p>I know all this sounds very vague and overly complex, but I have
      no idea what else to look for or which information may be
      necessary to further investigate the problem. <br>
    </p>
    <p>Any help at all is highly appreciated.</p>
    <p>Thank you all very much</p>
    <p>Have a nice day</p>
    <p>Benny<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <lt-container></lt-container>
  </body>
</html>