spotlightkid / jack-matchmaker Goto Github PK
View Code? Open in Web Editor NEWAuto-connect new JACK ports matching the patterns given on the command line.
License: GNU General Public License v2.0
Auto-connect new JACK ports matching the patterns given on the command line.
License: GNU General Public License v2.0
jack-plumbing works this way - from their docs:
(connect "SuperCollider:out_(.*)" "system:playback_\1")
This connect rule ensures that whenever scsynth(1) is running any output ports it registers are connected to appropriate ALSA playback ports.
The connect rule only makes a connection if none already exist.
Cheers!
Write with ReST, convert with rst2man
(see jack-select example).
Add exmples to readme where this could be an issue and how to work around that. E.g.
jack-matchmaker foo:out_1 system:out_1
would connect all of of foo:out_1
, foo:out_11
, foo:out_12
etc. to all of system:out_1
, system:out_11
, system:out_12
etc.
To prevent that, anchor the regular expression to the string end by adding a `$':
jack-matchmaker 'foo:out_1$' 'system:out_1$'
Would it be possible to have a different ruleset that would match connections being made and store them so they can be applied again automatically?
I was thinking it could have lower prio than anything explicit from the current ruleset, but a wildcard regex would then mean you will no longer have to write down every thing you need to match, making the setup and testing phase of a new system much quicker.
Might be easier to only have a toggle for "remember connection" if the rules way seem redundant.
If this can be implemented it would probably be good to either store the connections in a human readable format or have a cli option to list and remove parts of the db/list.
It is not possible to run more than one instance of jack-matchmaker at the same time unless the -N
is used to set distinctive JACK client names. The second instance only connects the moment after the first one closes.
jack-matchmaker erroneously interprets a non-zero return value of jack_client_open
which has the JackNameNotUnique
bit set as an error and remains in the re-connect loop.
If the Jack server is restarted while matchmaker is running, stdout is flooded with "JackClientSocket::Read time out" messages. It could try to reconnect to the new Jack server.
It would be very useful if we could have the same behavior, but just for disconnecting port, so everything on JACK would be automated.
A flow would be like:
jack-matchmaker
listens to new connections / events -> disconnect pattern match -> disconnects the connection between the ports.
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.
We run jack-matchmaker as a systemd service. After some time it crashed with a segfault. Other jack clients are not affected.
I don't know how to debug this.
[11557.773032] jack-matchmaker[1155]: segfault at 4 ip 00007f4c0d44b2ce sp 00007f4c0d0f2c50 error 4 in libjack.so.0.1.0[7f4c0d427000+28000]
[11557.773039] Code: ba 03 00 00 00 31 ff be 0c 00 00 00 e8 7b d2 fd ff 48 89 85 08 01 00 00 48 85 c0 0f 84 bb 00 00 00 80 bd 10 01 00 00 00 75 0a <44> 0f b6 60 05 45 84 e4 75 48 41 bc 01 00 00 00 48 83 c4 08 44 89
[12995.735951] jack-matchmaker[3759]: segfault at 4 ip 00007f998a4a92ce sp 00007ffcf9cfb3a0 error 4 in libjack.so.0.1.0[7f998a485000+28000]
[12995.735955] Code: ba 03 00 00 00 31 ff be 0c 00 00 00 e8 7b d2 fd ff 48 89 85 08 01 00 00 48 85 c0 0f 84 bb 00 00 00 80 bd 10 01 00 00 00 75 0a <44> 0f b6 60 05 45 84 e4 75 48 41 bc 01 00 00 00 48 83 c4 08 44 89
Ubuntu 20.04.1 with 5.4.0-62-lowlatency kernel
jack-matchmaker -c | grep -v ^$ | sed '$!N;s/\n//' | sort | sed 's/ /\n /; G'
Add it to readme or whatever
Tired to install jack-matchmaker today on Raspberry Pi 4 with Buster installed. Getting some errors.
Any suggestions on how to troubleshoot this?
10.0.1.20 ~ $ pip install jack-matchmaker
...
Successfully installed jack-matchmaker-0.7.1
10.0.1.20 ~ $ jack-matchmaker --help
Traceback (most recent call last):
File "/home/we/.local/bin/jack-matchmaker", line 6, in <module>
from jackmatchmaker import main
File "/home/we/.local/lib/python2.7/site-packages/jackmatchmaker/__init__.py", line 245
num_aliases, *aliases = jacklib.port_get_aliases(port)
^
SyntaxError: invalid syntax
10.0.1.20 ~ $ jackd -V
jackdmp version 1.9.12 tmpdir /dev/shm protocol 8
If there is only one channel, can jack connect this one channel to the all(LR) channels of the system playback port? It's a good simple for a single app, but it's a lot more complicated if it's a Firefox browser.
Here is the actual port of Firefox, when there is only one tab and it is playing stereo there,
Firefox Developer Edition:AudioStream_0_out_0 (Tab 1, Youtube)
Firefox Developer Edition:AudioStream_0_out_1 (Tab 1, Youtube)
Google Translate TTS under only one tab,
Firefox Developer Edition:AudioStream_0_out_0 (Only the left channel sound on my speakers)
And, contains two tabs,
Firefox Developer Edition:AudioStream_0_out_0 (Tab 1, Youtube)
Firefox Developer Edition:AudioStream_0_out_1 (Tab 1, Youtube)
Firefox Developer Edition:AudioStream_1_out_0 (Tab 2, Google Translate)
See http://jackaudio.org/files/docs/html/group__Metadata.html.
AFAICS, Jack 2 only has support for properties the latest release 1.9.12.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.