Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnecting ports that have been disconnected #19

Open
netboy3 opened this issue Apr 4, 2021 · 2 comments
Open

Reconnecting ports that have been disconnected #19

netboy3 opened this issue Apr 4, 2021 · 2 comments

Comments

@netboy3
Copy link

netboy3 commented Apr 4, 2021

Thank you for writing this utility. It is very useful. The use-case I have an issue with is as follows. Suppose I have source "A" that is supposed to be connected to sink "B" by a rule in jack-matchmaker. once source "A" registers, reg_callback() will be called and in turn call _refresh() to connect it. Now suppose I used a graph GUI tool such as Carla to connect "A" to sink "C" and disconnect it from sink "B". Now if any additional port (such as source port "D") will register with jack, matchmaker will again execute _refresh() and will re-connect "A" to "B". my point is that reconnecting should only occur for and when a port on the rules list registers, and not be globally refreshed and re-connected when any registration occurs.

@SpotlightKid
Copy link
Owner

my point is that reconnecting should only occur for and when a port on the rules list registers, and not be globally refreshed and re-connected when any registration occurs.

That seems like a reasonable expectation at first, but you also have to take ports into account, which already are registered a) when jack_matchmaker starts up or b) when the pattern file is re-read and patterns are added/replaced.

For a) it's probably sensible to treat all existing ports as new, as jack_matchmaker behaves now. Though there might be circumstances where you don't want that.

For b) it isn't so clear, I think. Should all patterns take effect immediately on reloading the pattern file? Or only new patterns? jack_matchmaker currently doesn't track which patters are new, it loads all patterns as if they were new ones. And should new connections be made involving only existing ports or only, if a newly registered port is involved. A regular expression pattern may match possible connections for both cases at once.

I see lots of potential for confusing behavior.

@netboy3
Copy link
Author

netboy3 commented Apr 6, 2021

Thanks for the timely response. I suppose it really depends on the definition of what this utility is supposed to do. If one reads the README 1st sentence "Auto-connect JACK ports as they appear and when they match", one can assume that the graph would only change when a port appears (registers) and not when other ports appear and/or when the utility starts. Obviously this is open to interpretation and subjective, but if you look at jack-plumbing, for example, it will only change the graph if a port on the match list appears (true to the definition). it will not change anything if other registration events happen, even if a port on the match list is not connected properly. if one still wants to "re-align" the graph to the match list, one can run jack-plumbing as a one-shot (with the -d option) even while the daemon is running, and it will scan the ports and connect/disconnect whatever needs to based on the match list, so you basically get both worlds. Again, i'm not trying to undermine your project, it just seems to not be accurate to its titled definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants