[Jack-Devel] Cannot callback the server in notification thread!

Robin Gareus robin at gareus.org
Sat Aug 10 01:17:52 CEST 2019


On 8/9/19 4:20 AM, Ethan Funk wrote:
> In an application I am writing, I am getting an error message out
> stderr (see email subject), and a connection failure return result,
> when I try to use jack_connect() from inside a
> jack_set_port_registration_callback function, using Jack2. 

sadly, jack thread semantics are not very well documented, but the
subject says it all. You can't send a request from a callback.

> My goal is
> to have the application remember and re-connect to a disconnected port
> if/when it "comes back."  Am I going to need to create a mostly
> sleeping thread just for port re-connections attempts, or is there
> something obvious I am missing?

Nope, you're not missing anything. That's what qjackctl's Patchbay does
for auto-connections, and jack.plumbing in deamon mode, etc..

Check out http://rohandrape.net/?t=rju&e=md/jack-plumbing.md it's
packaged part of "jack-tools" on most GNU/Linux distros and probably the
smallest codebase for the task at hand.

ciao,
robin



More information about the Jackaudio mailing list