session management and *disconnecting* jack items?

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

Post Reply
wolftune
Established Member
Posts: 1323
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Contact:

session management and *disconnecting* jack items?

Post by wolftune »

My default setup has jack connecting to the pulse bridge. I can get sessions with jackpatch to create new connections, but is there a way to have a session automatically *disconnect* something (in this case the direct jack to pulse-out, since I'm putting other stuff between them)?

Ideally, I could have the default connections automatically return when I close the session.

Perhaps the way to do this would be with some scripts?
Aaron Wolf
Music teacher, scholar
http://wolftune.com
nilshi
Established Member
Posts: 375
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: session management and *disconnecting* jack items?

Post by nilshi »

Not in any of the standard NSM tools.

A script would be the right solution here. Disconnecting is easy:
put a shell script into your session dir, make it executable, use "jack_disconnect" (from JACK) in there. Use the script with nsm-proxy.

Auto-Disconnect needs some kind of external watch mechanism. Not sure yet.

Having a client that can trigger on certain NSM events ("session is loaded", "session closed" etc.) is technically easy to do and an item that is on the "nice to have" TODO list for a very long time now. I am sorry I never got around to create that. If I do it with python this is 2 or 3 days of work. A post like this certainly bumps the priority.
wolftune
Established Member
Posts: 1323
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Contact:

Re: session management and *disconnecting* jack items?

Post by wolftune »

Thanks for clarifying!

The idea of triggering something on load and close of sessions seems quite potentially useful. I'm imagining I could have a session run a script that sets all sorts of parameters (such as buffer size and device settings and so on), and it would be ideal to reset those when the session is over.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
wolftune
Established Member
Posts: 1323
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Contact:

Re: session management and *disconnecting* jack items?

Post by wolftune »

I suppose the alternative should work: include the NSM session stuff in a script itself (although, annoyingly, that would require a new script for each session, but for some cases, it would be fine).

So, I make a script that does the disconnect and loads the session. I make another script that closes the session and reconnects. Then, instead of getting the session through some NSM front-end, I just run the script to get the session and the other script to leave the session.

Does that make sense?
Aaron Wolf
Music teacher, scholar
http://wolftune.com
nilshi
Established Member
Posts: 375
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: session management and *disconnecting* jack items?

Post by nilshi »

Outside control by script is surely a good solution. And it is available right now.

Staring the session per script can be done with

Code: Select all

nsmd --load-session <name>
where name is the short name of the session (not a file path), essentially the directory name.
Btw. combined with

Code: Select all

--session-root <path>
this can be used to load a session directly anywhere on disk.
Post Reply