Giter Site home page Giter Site logo

spotlightkid / jack-matchmaker Goto Github PK

View Code? Open in Web Editor NEW
71.0 7.0 6.0 150 KB

Auto-connect new JACK ports matching the patterns given on the command line.

License: GNU General Public License v2.0

Python 95.29% Shell 4.71%
jackaudio connections connection-manager

jack-matchmaker's People

Contributors

bluemax avatar peterfab9845 avatar spotlightkid avatar terencode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jack-matchmaker's Issues

Only makes a connection if none already exists

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!

Clarify in documentation that patterns are always treated as regular expressions

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$'

Discover, remember and apply connections

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.

Unable to connect to JACK when starting more than one instance

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.

Auto reconnect when Jack server is restarted

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.

Add disconnect pattern functionality

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.

Reconnecting ports that have been disconnected

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.

Segfault

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

Add documentation for systemd setup

  • How to install systemd service
  • How to configure as user service
  • Environment file settings
  • Pattern file
  • How to configure as system service (untested, so not supported yet)

install issue on Raspbain Buster

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

Unable to create systemd service using provided instructions

System: Arch/Manjaro-5.17.1-3
Jack-matchmaker version: 0.10.0-1 (from AUR)

Output of provided commands:
image

(same issue when running as sudo)

Issue persists if directory is 'corrected' to /etc/

Issue also persists when files are manually created:
image

Detect it only 1 channel

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.