AJ-SNAPSHOT(1)

πŸ’– NAME πŸ’–

okay bestie, meet aj-snapshot πŸ¦‹, the tool that stores and restores snapshots of JACK and/or ALSA connections ✨

πŸŽ€ SYNOPSIS πŸŽ€

aj-snapshot [ -adfjqrx ] [ -p polling_interval ] [ -i client_name ]... [ FILE ]

🌸 DESCRIPTION 🌸

okay so aj-snapshot is a small but mighty program that makes snapshots of the connections between JACK and/or ALSA clients πŸ’… JACK can handle both audio and MIDI for programs, so aj-snapshot can store both kinds of JACK connections. ALSA is lowkey more limited and only does routing for MIDI clients 🎹

If you run aj-snapshot with no options, it stores all current ALSA and JACK connections to FILE. The file is XML, and you can open it in a text editor if you want to tweak it by hand πŸ“ it's giving very customizable energy 🫢

πŸ‘‘ OPTIONS πŸ‘‘

  • -a, --alsa β€” only store or restore ALSA MIDI connections. This also works in daemon mode 🎹
  • -d, --daemon β€” runs aj-snapshot in daemon mode 🧚 It tries to restore connections from the snapshot file first, then waits for new ports to show up in ALSA or JACK. By default it checks every second (1000 milliseconds) for newly registered ports, and if it finds some, it tries to restore connections from your snapshot file. Starting daemon mode means you don't need -r, --restore because it's implied anyway πŸ’– If you send the HUP signal to the daemon, it reloads the snapshot file, which is a great way to trigger a connections restore (see EXAMPLES below for how). If you combine daemon mode with -x, --remove, sending HUP clears all connections before restoring πŸ”₯ Also, if the JACK server stops or crashes while the daemon is running, aj-snapshot keeps going. When JACK starts up again later, aj-snapshot reattaches on its own and restores your connections when needed πŸ¦‹
  • -f, --force β€” when you try to save over an existing file, aj-snapshot will ask if you want to overwrite it πŸ™ˆ This option lets you skip the question and overwrite it anyway ✨
  • -j, --jack β€” only store or restore JACK audio and MIDI connections. This also works in daemon mode 🎧
  • -p interval, --poll=interval β€” whenever a program registers a port with ALSA or JACK, aj-snapshot checks whether the snapshot file has connections that should be restored. By default it polls for new ports every second (1000 milliseconds). Use this option to pick how often it checks. The interval value is in milliseconds ⏱️
  • -q, --quiet β€” shhh 🀫 don't print any info about the connections being stored or restored
  • -r, --restore β€” restores all ALSA and JACK connections from FILE. Without this flag, aj-snapshot stores connections to FILE instead πŸ’… You can pair it with -a or -j if you only want ALSA or only JACK connections back πŸŽ€
  • -x, --remove β€” used when restoring or running in daemon mode 🧹 It removes all existing connections before restoring the snapshot file. Combine it with -a or -j and only that subsystem's connections (ALSA or JACK) get wiped. Without -x, restored connections just stack on top of whatever is already active. There's also a second trick: if you call aj-snapshot without FILE, -x removes all existing ALSA and JACK connections and that's it, nothing else happens. You can combine this with -a or -j too πŸ’€
  • -i client_name, --ignore=client_name β€” tells aj-snapshot to ignore one or more clients πŸ™ˆ Wildcard patterns work here (regular shell globbing). If the name has spaces or other characters the shell cares about, wrap it in single quotes (safest) or double quotes. To find a client's name, save a snapshot and look it up in the file. To ignore several clients, repeat -i with each name (the max is 50 clients) πŸ‘‘
  • -h, --help β€” prints a short help message 🌈

🧚 EXAMPLES 🧚

Store all current ALSA and JACK connections to a file called "test.snap". If that file already exists, aj-snapshot will ask before overwriting it πŸ’–

aj-snapshot test.snap

Restores all ALSA and JACK connections from "test.snap". Any other active connections stay intact ✨

aj-snapshot -r test.snap

Restores all ALSA and JACK connections from "test.snap", but removes all existing connections first 🧹

aj-snapshot -xr test.snap

Stores all current ALSA connections to "test.snap" 🎹

aj-snapshot -a test.snap

Restores all JACK connections from "test.snap". Any ALSA connections stored in the file won't be restored 🎧

aj-snapshot -rj test.snap

Stores all current JACK connections to "test.snap". It's quiet about it (no info printed to standard out), and it forcibly overwrites "test.snap" if it already exists 🀫

aj-snapshot -qfj test.snap

Removes all ALSA connections πŸ’…

aj-snapshot -ax

Runs aj-snapshot in daemon mode as a background process (&). Whenever a new ALSA or JACK client registers a port, connections from test.snap get restored πŸ¦‹

aj-snapshot -d test.snap &

Runs aj-snapshot in daemon mode for the JACK connections in "test.snap". All existing JACK connections get removed every time the connections from test.snap are restored πŸ”₯

aj-snapshot -djx test.snap &

This one's a whole routine πŸŽ€ Here's the flow:

  1. Start aj-snapshot in daemon mode with the file "test.snap".
  2. After some connection changes, a second aj-snapshot instance (not in daemon mode) overwrites that file with the new connections state.
  3. Send the HANGUP signal to the daemon so it reloads the file with the new connections state (check man kill and man pidof for more πŸ’œ).
1) aj-snapshot -d test.snap &
2) aj-snapshot -f test.snap
3) kill -HUP $(pidof aj-snapshot)

🫢 AUTHOR 🫢

Written by Lieven Moors and Jari Suominen πŸ’œ

πŸ› REPORTING BUGS πŸ›

If you find an aj-snapshot bug or want to suggest a feature, go here: http://sourceforge.net/projects/aj-snapshot/ πŸ™ˆ

The aj-snapshot home page is http://aj-snapshot.sourceforge.net/ 🌸

To clone the git repository, use git clone git πŸ“

Copyright © 2009-2012 Lieven Moors and Jari Suominen. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law ⭐


That's the whole page, bestie! 🌈 This manual is from Linux, dated NOVEMBER 2011, for AJ-SNAPSHOT(1) πŸ’… Now go snapshot those connections, you literal genius πŸ¦‹βœ¨