[Jack-Devel] Adjustable port alias limit

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Jack-Devel] Adjustable port alias limit

Sunset Tech
Greetings! I attempted to see if there was any work or discussion on this, but brought up nothing, I hope I am not duplicating some effort/thought here.
I recently developed a small script allowing me to assign ports to groups, using aliases, so that I may autoconnect these groups to ardour buses. However, I quickly discovered there is a limit of two aliases per port, which is admittedly workable, but not pleasantly so. perhaps there is a better method of achieving this functionality? but I wanted to continue using jack-matchmaker.
So I've patched a local copy of jack2 to allocate an array for aliases per port, and allow its size to be specified via the compile time flag --aliases-per-port. However, the implementation is not the best, I needed to introduce a seperate version of jack_port_get_aliases, suffixed with _b, which can be used in conjunction a new function, jack_port_max_aliases, to safely retrieve aliases beyond the first two. applications using the old jack_port_get_aliases will still be shown only the first two aliases in the list. however the matching functions will match against all aliases.
Additionally there is what looks like serialization&matching code in JackDriver, which i have not yet attempted to patch.
I've also patched copys of jack-matchmaker and luajack to make use of this.
I dont imagine such functionality would be accepted into jack in its current state? it seems there is sort of a bind here regarding external api design. I would love to contribute this to jack, so i'm emailing to see what the possibility of that is, and if anyone has any ideas about how to go about it. I am willing to patch jack1 as well for it, the relevant code looks near identical. I would also like to dynamically manage the array size or string memory allocation, perhaps within the limit, as statically allocating even port_num*(alias_limit=8)*name_size to store mostly unused aliases seems rather heavy, but it looked like everything regarding ports is statically allocated for a reason?

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Adjustable port alias limit

Ralf Mardorf
FWIW apart from jack audio, there are also jack and ALSA midi available.
AFAIK when for example using two TerraTec EWX 24/96 PCI cards as MIDI
interfaces, there is no way at all to restore MIDI connections
automatically. The only way is to do all MIDI IO connections with those
cards manually. Even changing the name of at least one card, does only
affect audio, the MIDI names of identical PCI cards are always the same.

--
pacman -Q linux{,-rt{-securityink,-cornflower,,-pussytoes}}|cut -d\  -f2
4.20.5.arch1-1
4.19.15_rt12-0
4.19.13_rt10-0
4.19.10_rt8-0
4.18.16_rt9-1
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Adjustable port alias limit

Chris Caudle
In reply to this post by Sunset Tech
On Mon, January 28, 2019 9:54 am, Sunset Tech wrote:
> Greetings! I attempted to see if there was any work or discussion on this,
> but brought up nothing, I hope I am not duplicating some effort/thought
> here.

One thing you should check is that there is an API defined for metadata in
JACK, but only jackd 1 has implemented that so far, it is still on the
to-do list for jackd 2 (along with incorporating the zita-a2j bridge code
like jackd 1, maybe something else as well I have forgotten).
I am not sure if the metadata API can be used for what you need, but
before starting something completely unrelated make sure to check the
jackd 1 implementation to see if the new API queued for inclusion in jackd
2 but not yet implemented might work.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Adjustable port alias limit

Chris Caudle
On Mon, January 28, 2019 10:42 am, Chris Caudle wrote:
> One thing you should check is that there is an API defined for metadata in
> JACK, but only jackd 1 has implemented that so far

Sorry, a little bit of bad form to reply to my own post instead of just
including this in the first message, but I did not think to look up the
URL before I hit send.  In case you have not found these links already:

This is the definition of the metadata API:
http://jackaudio.org/api/group__Metadata.html

The top level links to the API documentation:
http://jackaudio.org/api/index.html

Possibly the session API may be of use as well, I am not really familiar
with session tools.  It seems like possibly they could do what you want,
but there was a lot of churn for a while, and it seemed like there was
never a consensus which developed fully around multi-application session
store and restore.
Have you investigated something like ladish to see if it can restore the
connections like you want?  Or maybe I have misunderstood your end goal.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Adjustable port alias limit

Rui Nuno Capela
On 1/28/19 4:52 PM, Chris Caudle wrote:
> On Mon, January 28, 2019 10:42 am, Chris Caudle wrote:
>> One thing you should check is that there is an API defined for metadata in
>> JACK, but only jackd 1 has implemented that so far
>

Metadata API is already implemented on JACK2, but only on current git
head though (posed to be v1.9.13 perhaps)...

cheers
--
rncbc aka. Rui Nuno Capela
[hidden email]
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Adjustable port alias limit

Sunset Tech
In reply to this post by Chris Caudle
Apologies all, and Chris, new to responding to mailing lists, accidentally responded directly to Chris
Here follows the thread so far:

I thought about the metadata system, which i thought i had read had recently been included in 2? but i wouldnt be able to rely on jack-matchmakers port regex matching to automatically connect these group aliased ports to appropriately named ardour buses, necessitating me to write my own auto connect daemon with its own matching logic, possibly involving assigning meta data to ardours ports as well. I felt adjusting the alias functionality to remove the, surprising to me atleast, two alias limit, was the easier route that i could perhaps then contribute to the project.
If it turns out this patch is unincludable, or metadata or is simply ultimately the better way to achieve this, I'll be happy to maintain this patch locally until I can get around to writing or finding the tooling I would need. or if there is something already existing that I have missed

On Jan 28, 2019 12:19 PM, Chris Caudle wrote:
>On Mon, January 28, 2019 10:57 am, Sunset Tech wrote:
>> I thought about the metadata system, which i thought i had read had
>> recently been included in 2?

>You are correct, I have not been tracking jack development for a while, I
>did not notice that metadata was added a few months ago.

>> but i wouldnt be able to rely on jack-matchmakers port
>> regex matching to automatically connect these group
>> aliased ports to appropriately named ardour buses

>What kind of things are you wanting to automatically connect to ardour
>busses?  I'm having to bounce between a couple of things this morning,
>maybe a concrete example would help understand what you are trying to do.

It is primarily ports that are not always available or may disappear at any time. VCV Rack and netjack workers primarily. which i would like to group into mono, stereo, surround etc pairs. I have these things autoconnecting to ardour buses which are distributed to tracks, so that I dont need to remember to reconnect them to every track.
The workflow I have now is something like, name an ardour bus, run the group command over the desired ports, and issue a reload to jack-matchmaker(as it doesnt monitor port aliasing).
Admittedly, the limit does not much get in the way of this, its not likely I will desire to add a port to more than one group, but i would certainly like the ability, perhaps for creating weird stereo images out of vcv, but the limit, considering it is global for both port owners and non, feels tight, and could cause surprises/cognitive overhead for me when say, switching between grouping schemes

Additionally Chris mentioned the session api, and ladish, in a follow up message to their own, which I forgot to address.
Perhaps a session system could do what I need/better address my needs, I'll admit it's something I need to look into better, it hadnt occurred to me at the point where I felt the need to patch jack to enable more aliases, but I figure now that i've done the work, why not see if the jack team desires it.

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Adjustable port alias limit

Ralf Mardorf
In reply to this post by Ralf Mardorf
On Mon, 28 Jan 2019 12:01:56 -0500, Sunset Tech wrote:

>On Mon, Jan 28, 2019, 11:15 AM Ralf Mardorf wrote:
>>FWIW apart from jack audio, there are also jack and ALSA midi
>>available. AFAIK when for example using two TerraTec EWX 24/96 PCI
>>cards as MIDI interfaces, there is no way at all to restore MIDI
>>connections automatically. The only way is to do all MIDI IO
>>connections with those cards manually. Even changing the name of at
>>least one card, does only affect audio, the MIDI names of identical
>>PCI cards are always the same.
>I'll admit i am not sure what your general thought here is? depending
>on the method used to restore connections, with the script I wrote one
>of these devices could be oneshot assigned group aliases for its midi
>ports, and then connections restored from there

How does your script find out to what card it assigned the aliases?
Have you ever used two or more identical PCI cards as MIDI interface?
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Adjustable port alias limit

Sunset Tech
On Mon, Jan 28, 2019, 7:52 PM Ralf Mardorf <[hidden email] wrote:
>How does your script find out to what card it assigned the aliases?
it takes some info for the group and a pattern string to match against ports, you'd need to determine manually which ports belong to which device and supply them. from there one of the devices ports would possess predictable and unique names to restore connections against. the script and patch were written with grouping audio in mind, but it could be used to somewhat solve this I suppose
>Have you ever used two or more identical PCI cards as MIDI interface?
I've not.

On Mon, Jan 28, 2019, 7:52 PM Ralf Mardorf <[hidden email] wrote:
On Mon, 28 Jan 2019 12:01:56 -0500, Sunset Tech wrote:
>On Mon, Jan 28, 2019, 11:15 AM Ralf Mardorf wrote:
>>FWIW apart from jack audio, there are also jack and ALSA midi
>>available. AFAIK when for example using two TerraTec EWX 24/96 PCI
>>cards as MIDI interfaces, there is no way at all to restore MIDI
>>connections automatically. The only way is to do all MIDI IO
>>connections with those cards manually. Even changing the name of at
>>least one card, does only affect audio, the MIDI names of identical
>>PCI cards are always the same.
>I'll admit i am not sure what your general thought here is? depending
>on the method used to restore connections, with the script I wrote one
>of these devices could be oneshot assigned group aliases for its midi
>ports, and then connections restored from there

How does your script find out to what card it assigned the aliases?
Have you ever used two or more identical PCI cards as MIDI interface?
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Adjustable port alias limit

Sunset Tech
Actually I'm realizing now, that the port names are identical in this situation? in which case the script would end up assigning ports from both devices to a single group, probably with unpredictable ordering, so ends up not being a solution. only solution here would be for the midi drivers to not assign identical names to devices, possibly by finding some manner of unique ID to append. I dont think this patch is relevant to this problem.

On Mon, Jan 28, 2019, 8:30 PM Sunset Tech <[hidden email] wrote:
On Mon, Jan 28, 2019, 7:52 PM Ralf Mardorf <[hidden email] wrote:
>How does your script find out to what card it assigned the aliases?
it takes some info for the group and a pattern string to match against ports, you'd need to determine manually which ports belong to which device and supply them. from there one of the devices ports would possess predictable and unique names to restore connections against. the script and patch were written with grouping audio in mind, but it could be used to somewhat solve this I suppose
>Have you ever used two or more identical PCI cards as MIDI interface?
I've not.

On Mon, Jan 28, 2019, 7:52 PM Ralf Mardorf <[hidden email] wrote:
On Mon, 28 Jan 2019 12:01:56 -0500, Sunset Tech wrote:
>On Mon, Jan 28, 2019, 11:15 AM Ralf Mardorf wrote:
>>FWIW apart from jack audio, there are also jack and ALSA midi
>>available. AFAIK when for example using two TerraTec EWX 24/96 PCI
>>cards as MIDI interfaces, there is no way at all to restore MIDI
>>connections automatically. The only way is to do all MIDI IO
>>connections with those cards manually. Even changing the name of at
>>least one card, does only affect audio, the MIDI names of identical
>>PCI cards are always the same.
>I'll admit i am not sure what your general thought here is? depending
>on the method used to restore connections, with the script I wrote one
>of these devices could be oneshot assigned group aliases for its midi
>ports, and then connections restored from there

How does your script find out to what card it assigned the aliases?
Have you ever used two or more identical PCI cards as MIDI interface?
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org