Up until recently, I had not been able to really test the usefulness of the LADI Session Handler (“Ladish” for short) as the Gentoo packages seemed to both require and conflict with the Lash software. However, recently, I’ve found how to untangle the mess, and am now able to run this program through its paces, and from what I can tell, it may well be my new default Jack control tool.
NOTE: This program is still pretty skeletal; you will need to know the command line names for the applications to add them to the sessions, and some trial and error will be required to save them with the correct session standard. Keep in mind that once the initial work has been completed, the software becomes easy to use.
Also, this program uses the same canvas as the Program “Patchage.” It is highly recommended that you read the article “Making Jack Connections with Patchage” for more information on using the connection canvas in this program; they both work the exact same way… with the exception that this program does not handle the green Alsa MIDI controls.
Originally, Jack could not save sessions. Every time you started Jack, you had to manually launch each program, and then go through the process of connecting everything together, one connection at a time. This could be tedious work, and generally didn’t end too well if something went wrong.
The first attempt at overall Jack session management was the LASH Audio Session Handler. The idea is that compatible programs would include controls that allows the overall session to control each programs’ session, so when you saved the overall session, each program would save its part independently, and when you loaded the overall session, each program would then load its previously-saved session, making everything synchronized.
There was little documentation, and Lash depended on other programs supporting it directly in order to include them in the session management. This obviously didn’t work too well, as many jack programs were simple tools that did not have or need session support, but would have been useful in a session.
Ladish, although similarly-named, is a reimplementation of the LASH concept, that takes into account that all programs aren’t going to be directly compatible with it, so it manages applications on several levels. What the levels are about is how likely a program is to accept signals to prompt it to shut down, save its session, or load a previous session from the studio directory.
Everything is compatible with level 0, as all it does is start and stop apps, and makes the Jack connections. This is the basic level, but it does not allow for saving individual packages’ sessions in the overall session directory.
Level 1 includes the ability to prompt an application to save its session if it receives a “SIGUSR1” UNIX signal, but it won’t have the ability to tell the program where to save.
Note: If you have version 0.3 of the LADI Session Handler, this is as far as you go; the following levels (LASH and Jack Session Handler) are available as of the 1.0 version of the handler.
Level 2 comes in two versions: LASH and Jack Session. Applications compatible with level 2 can be told to load or save projects, and from where they need to be loaded or saved.
This is as far as Ladish goes at the moment. I have found documentation on the Ladish website hinting toward a “Level 3,” which is for applications that are explicitly designed to work with Ladish. Needless to say, they’ll start, load, save, and close on Ladish’s command.
The first component is the main UI, called “Gladish.” If you’ve read my article on Patchage, this program should look VERY familiar:
Use of the connection window (called a “canvas” by the program) is pretty much identical to the usage for Patchage, although this will not show the green ALSA MIDI connectors. For more information for connecting and moving the boxes around, feel free to peruse the above article.
On the left is the studio manifest. In this list, you will see the studio and applications assigned to it in a 1-level outline. If you’ve created rooms, they will also show up with their contained applications.
Underneath the manifest is the buffer display. It will show the level of the Jack audio buffer. Overtop the buffer display is the dropouts reading; this will tell you how many xruns occurred over the course of the studio’s run. To clear this value, as well as the max DSP load value, identified below, use the option “Clear XRuns and Max DSP Load” in the “Tools” menu, or just the brush icon in the toolbar if it’s visible.
Underneath the buffer display is the studio details. This will show the name of the studio, a dot indicating Jack status (green means active, gray means inactive, orange means that xruns were detected, and red with a yellow exclamation point means that the session crashed), another display of the dropout value, and the current and maximum DSP load (The Digital Signal Processor is a sound card’s CPU; this is what does the work of converting sound to audio data; the higher this number, the more likely an XRun will happen).
The toolbar at the top is no surprise The brush will clear the XRuns and maximum DSP level; something to do before each recording in order to establish an accurate count of dropped samples during recording. The other four items adjusts the zoom level of the connections window; Plus zooms in, minus zooms out, 1:1 returns the window to its normal zoom level, and the square causes the window to maneuver and zoom in or out to fit everything in one view.
Gladish has several menus.
The first menu is the studio menu. This menu will allow you to create and manage several overall sessions with Gladish, also known in this context as “Studios.” A studio can contain rooms, applications, hardware, and connections.
To create a new studio (overall session), you select the first option, “New Studio.” Keep in mind that the studio is temporary; unless you save the studio after making changes, all your work will be lost. When you create a new studio, a dialog box will appear asking for the name for your new studio. Enter the name, click “OK,” and your studio is ready to begin. If you already have a studio, then you can just mouse over to “Load Studio,” and select your desired studio from the submenu.
Now, when you create a studio, it is configured and ready, but it is not active. In this state, you can add rooms and applications, but they will both be dormant; the applications will be listed, but they won’t run until the session is started.
To do this, you need to select “Start Studio.” This will start Jack, launch all the applications in the studio, and then create all the previously-made connections between them, rendering the studio ready to begin work without all the tedious mucking about with connections and application launching. When you’re done, you can stop the studio with the “Stop Studio” option.
“Rename Studio” allows you to change the studio’s name, if you decided the one you originally chose is not what you ultimately want. This can be useful if you want to repurpose an existing studio, or if you realize a wider application of the selected programs are available.
“Save Studio” and “Save Studio As…” options will allow you to save all changes you’ve made to the studio to this point. This is important with a new studio, as this will ensure all the studio changes you’ve made will be persistent. The latter will also allow you to create a studio backup, in the case you want to make experimental changes, and want to have a failsafe to return to. In order to save a studio, you need to make sure it is actually running; you can’t save a studio that’s not running.
Unloading the studio will (if it’s still started) shut down the studio, and then close the whole session. The black field will disappear, and the following very useful message will be in its place:
If you decide you don’t need a specific studio anymore (say, you’re no longer making that podcast, or you’ve completely changed your songwriting workflow), you can mouse over to the “Delete Studio” option, and then choose the studio you want to delete from the submenu.
Finally, “Quit” will allow you to close out of Gladish altogether.
The studio can allow a primary workflow; it will load the same set of applications each time you want to perform a project in the studio. If the workflow is perfectly stable, if no additional tasks need to be performed from time to time, then you’re set.
Sometimes, however, it becomes useful to have a space set aside in the signal chain where you can plug additional applications and/or plugins in when needed; such as adding a special effect to a normal voice recording, or perhaps using an interchangeable set of programs that generate musical tones, such as synths or samplers.
A Room is a self-contained space in the signal chain that can contain its own applications and connections, completely isolated from the larger workflow. This is a pretty hefty group of words, but in effect, it’s very simple. It is like a gladish-within-a-gladish.
On the outside, in the larger gladish canvas, the room looks like this (the inputs and outputs are somewhat configurable; I used the basic version):
As you can see, there are Left, Right, and MIDI inputs. You can also see Left, Right, Monitor Left, Monitor Right, and MIDI outputs. These are where the room can input and output sound. On the inside, these very same connections are visible as if they were endpoints:
The options in the “Room” menu simply allow you to create and destroy rooms.
Gladish is pretty much useless without a session, and rooms are equally as useless without projects, the room’s equivalent of a session. A room can only have one project active at a time; loading a different project will first remove the current project.
To create a new project, you need to select “Create Project…” A box will come up asking for the path and the name of the project. By clicking on the folder button, you can select the directory to save the project in. Simply browse to where you want to store the projects, create a subfolder, browse into it, and then click “OK.” Give the project a name, and then you’re done.
The Project Properties option is unique here, as it can allow you to assign a description of the project and create notes for the project.
The “Clear Room” item is available when a project is not started, which will clear all existing connections in the room. I am assuming this is designed for a time when rooms no longer need projects in order for applications to be loaded.
One important thing to note: Projects are not saved with the session. If you close the session, all projects are lost. Additionally, while saving a session with a project active, I’ve found that Jack and Ladish servers seem to crash, so remember to unload all projects before stopping or unloading the studio.
Finally, if any of the applications are meant to save files, they will save those files in the project folder. This means that when creating a studio, any items saved by a studio-running application will be lost, while those items saved within a project area will all be saved together in the same folder. Nifty, huh?
The downside to this is that, still being relatively new, Gladish doesn’t support the ability to drag a launcher into the program, or to automatically detect what applications are started and allow you to assign them to a session. To add an application, you need to know what the application’s command line is. The upside to this is that you only need to do so once; once it’s in the session; the session will handle it from then on.
To add an application to Gladish, select the “New Application” selection from the Application menu, and a dialog box will appear:
The first text box is the command line; you need to type in the application command, as well as all desired options to allow it to open the correct project file of its own. Of course, if you just want to use a fresh program each time the session starts, then you can just use the command by itself.
The Name box is the name that the application’s connections box will appear as on the canvas. For example, while the command line for my copy of Ardour is cd /home/reteo/Documents/Sound/Projects/Ardour; ardour2 “Simple Recording”, the name field simply has Ardour, so that the connections box looks like this:
The final four options determine the session handler level for the application, as described in the introduction. If you attempt to assign a level to an application that does not support it, the application will crash when you attempt to save it.
Sometimes when you first create the application, only the first two bubbles will be selectable. However, once it’s started and then stopped, you can change the properties of the program to select any of the levels at will.
Once all the desired applications have been added to the project, the manifest should show the session, all its programs, and each room with its own project’s programs, as so:
In this case, “Recording Studio” is the studio, “Temporary” is the room, and “Cleanup” (the one in parentheses) is the project. (“[LASH] Cleanup” is the session standard and name of a Jack-Rack application that I lack enough imagination to name differently).
Notice at the beginning of the application names, you see entries in square brackets. These are the session handler standards used by each. Note that most use the LASH standard, while Rakarrack uses L0. This means that Rakarrack is separately handled, and Gladish will only manage starting, shutting down, and connecting the inputs and outputs. The others can have things like requests to save their individual project files. I’m sure there’s more, but I don’t really have the details on the standards down to say any more at this time.
One more thing to note: You cannot add an application to a room without a project; the application entry will be grayed out until you either load or create a project for the room.
When you have a studio open, it is carefully set up so that it seems you have rooms and projects running, and where you have differently-named application boxes to set up connections with. Choosing JACK will add a new “room” to the list, called Raw JACK. This will show you the whole anarchic mess that is Jack running underneath Gladish.
The “jmcore” boxes are what makes rooms work; each jmcore item is a bridge between one of the input and output items on the room box in the session, and one of the input and output items inside the room. None of them are connected at this moment, because I don’t have the temporary room connected. Here’s an example of the room being connected:
Finally, the arrange button which automatically arranges everything on the canvas so that it is more or less neat and compact:
The first is the “Clear XRuns and Max DSP Load.” This will, as mentioned previously, clear the tracked number of XRuns and the Max DSP on the bottom of the window, and, if the dot is orange, make it green again. This is useful if you are about to perform another take of a session, and you want to know if the new take has any dropped frames.
The second option is the Gladish settings. There are not a lot, but the settings available are useful in tweaking the few Gladish behaviors are available.
“Send Notifications” simply means that Gladish will send notifications that will appear in little black boxes in the corner of your screen when something happens, such as when a studio is started, or when something crashes. This is very useful in explaining problems, so I keep it enabled.
The “Shell to use” determines which shell is used to display those applications that are shell-based (described above). It defaults to xterm, but I like the gnome-shell, and so that is what I use.
“JS delay” is specifically for the yoshimi-0.060.10 jack session implementation; apparently, the implementation is broken at the moment, so this option is designed as a workaround of sorts. It defaults to zero, although to be safe, I set it to 5 instead, just in case I come across such an issue.
Finally, the JACK configuration tool. This is the program used to configure Jack to do its work. By default, it shows ladiconf, although qjackctrl (the other main jack control application) can also be used. Since we will be covering it shortly, we’ll be leaving this on ladiconf.
Back to the tools menu.
“Configure JACK” will launch the application identified in the settings; in this case, this will launch the ladiconf utility. We will cover this later, as it is not a specific part of the Gladish application.
The next three items are important if something happens to cause one of the primary servers (jackdbus, ladishd, and a2jmidid) to crash. If you see a message stating that one of the servers crashed, then you use the appropriate “restart” item to start it working again.
Latency allows you to adjust JACK buffer on the fly; this way, if you are encountering too many Xruns, you can increase the latency, but if you’re hearing a significant delay, you can reduce the latency. You will notice a new item appear in the status bar at the bottom of the window:
The “48 kHz” was already there, an indication of the sample rate of Jack, but next to it, you’ll see a latency reading. This means that right now, Jack has a buffer of 1.3 milliseconds (64 samples). This is important when recording, because this means audio is completely realtime.
If I’m doing sound processing, then I can increase the latency to give the CPU more time to apply all the effect processing to the audio signal before Xruns happen. Since I won’t be recording at this point, delay isn’t going to matter nearly as much. However, if you’re recording, you’re going to start noticing a slight delay once you go past 3ms, it will become significant at 10, and reaches the distraction point at around 20ms. For my setup, this is at 128, 512, and 1024 samples, respectively, but remember, the sample rate determines how much delay will apply to 128, 512, or 1024 samples.
Finally, we have the Help menu. In it is an “About” box that contains the version information for the LADI Session Handler.
At this point, we can say “adieu” to the Gladish application and move on to the next item of importance, the LADI Tray application.
LADI Tray Application
The next item on the LADI Session Handler system is the tray application. This program will provide one or two extra items that are not available from Gladish. Now, certain versions of this include a command to launch gladish itself, although the version I have doesn’t seem to have that feature.
Logs is a useful option when it comes to debugging, as it will open a window with three tabs, one containing a log of Jack messages, one containing a log of Lash messages, and one containing a log of A2J messages (more on a2j later).
Reset Xruns is pretty much the tray version of “Clear XRuns and Max DSP Load.” It will clear ladish (and gladish) of any tracked XRuns or max DSP load, so you can start with a fresh count.
“Stop Jack Server” and “Reactivate Jack” are server control commands; these will allow you to reset Jack itself if something is going screwy. Of course, you will also need to restart the studio, since it was dependent on Jack. You’ll probably want to let the studio handle the Jack connections, unless something has gone wrong, and the studio is locked up. Then, killing Jack from here (or a command line) can break the lock and allow you to restart your session. Reactivate Jack, on the other hand, is useful if something happens to cause Jack to crash.
The A2J Bridge is referred to as the “Alsa to Jack bridge,” but the Ladish version is not related to the Alsa-Jack Bridges I describe in the articles “Bridging the Gap” and “Jack-Alsa Bridge Kit.” In this case, the bridge is MIDI-related, meaning that A2J will act as a bridge between the Alsa MIDI devices and the Jack MIDI connections. This is very important, because, as you’ll recall, Gladish does not support Alsa MIDI, something Patchage showed in green.
The “Start A2J bridge” command will create all the Jack-Compatible MIDI controls for the different programs in the gladish canvas, all marked in red. So far, I’m not seeing it connecting my actual MIDI hardware, although I’m assuming that’s a bug. Since I don’t use MIDI much, and can still use Patchage to connect MIDI, that’s not much of a problem. Reactivate A2J is, like the Jack version, something that will allow you to restart a crashed server.
The next three options are specifically for LASH programs. The first will send the signal to all LASH-compatible programs to save their sessions, the second will then allow you to close all LASH-compatible programs. The third option, like the others, will allow you to restart a crashed LASH session server.
The final option will close the LADI Tray application.
JACK Configuration Tool
Select Jack Driver
The first is the Jack driver selection; this determines what this version of Jack will use for its audio driver. A good default for now would be “Alsa” for an internal or USB audio device, or “firewire” or “freebob” if you are using a firewire interface. Or, if you don’t want to use external hardware, then you can use either the “loopback” or “dummy” drivers.
If you are using a networked Jack setup (recording on one system and processing on another), you could use net or netone (depending on whether you’re using Jack1 or Jack2).
Jack Engine Parameters
These are the general Jack server options; if you’ve followed my Jack Control Setup article, this should be mostly the same things.
The driver is just a repeat of the above box; change one, the other will change as well. I’m not sure about the reason for the redundancy, but there you go; same as the “Select Jack Driver” option.
The server name seems to be related to NetJack; if there are multiple jack servers running, it helps to give each a different name. I’m not sure how NetJack is used, so I’ll leave this one at “default,” as is recommended.
Realtime should be set, for reasons we have already covered in the Jack Control Setup and System Preparations articles. Once again, if you don’t want XRuns, you do want realtime mode. And unless you’re just using Jack to listen to audio, and are not recording or processing, then you don’t want XRuns.
Realtime Priority should be set to at least 10 under the rtprio value set in the limits.conf file (see the System Preparations article). If you do not set it this way, then you run the occasional risk of the Jack software, and pretty soon the whole system, locking up (Major props to AutoStatic for bringing that to my attention, although I wish I didn’t have to use Google translate to read your site… :P).
Temporary assumes that, if all (non-session) applications exit, then you’re done with Jack, and it automatically closes down. Probably not a bad idea if you’re using Jack as a normal sound server, but probably not the best thing to do for more advanced use. It’s a choice.
Verbose mode is for the logs accessed by the Ladi Tray application. If set, you will see a LOT more debugging information, useful when trying to track down an issue with Jack.
Sometimes Jack applications take a few moments to respond to Jack requests. If this is the case, setting the client timeout value can help prevent Jack from kicking the Application out.
The clock source is useful if you have more than one type of timer in your system. In this case, however, the options presented does not mesh with the options you can select, so I’ll recommend it stays at its default value at the moment.
If you don’t intend to use Jack for a large number of connections, you can reduce the maximum number of ports to save memory, or increase the number for really heavy processing. By default, Jack allows a total of 2048 ports to be created among all its applications.
For the “replace-registry” option, this seems to be related to shared memory. I’m afraid this is a little over my head, so unless you know what you’re doing (and if so, I’d appreciate an explanation), I’ll probably recommend you stick with the default.
Sync is about a second period of latency, which is added when sync is disabled. This can increase stability at the expense of latency, but considering the already low latency, this is not a bad thing, so I keep sync disabled.
These settings can change depending on the driver selected above. I will present Alsa here, as that’s the driver supported by PCI and USB devices, and since I don’t have anything with Firewire to use for screenshots (sorry).
As you can see, all the options here are the same ones you saw in the Jack Control Setup article, so feel free to set these similarly. I just use the defaults for most of them, except for the device and performance settings.
Basic Studio Session
Now that we have covered all of the important elements of the Ladish user interface, let’s cover the basic process of setting up a studio session. What we will do is create a new studio, add a room to that studio, and then add all applications to a project in that room. This way, any saved recordings will be stored in the project folder.
Assuming you’ve correctly set up the Jack settings, we can begin.
We’ll just set up simple recording project. We will include a Jack-Rack application in order to supply voice filtering plugins as needed, and use the excellent Jack TimeMachine application as a recorder. We will also make a link from the filter back to the speakers so we can use software monitoring.
First, we start Gladish.
The session is now started, and you can see “Hardware Capture” and “Hardware Playback.” These are the ports to the audio interface; for me, the capture device has two ports, one for a mic and one for a guitar. The two playback ports are for the left and right signals.
Now, I’ll go ahead and position them as needed…
All the recording will take place inside the “Recording” room; the left and right are just to be sent to the speakers for monitoring. This is important if you want to hear the results of the filtering as you’re speaking.
Now, we will click on the “Recording” room in the manifest, and we’ll see the connections inside the room.
To get the directory, I used the “Browse” folder icon on the window, and then navigated to my root “Ladi” folder containing all the project subfolders. Then, I clicked “Create Folder” and created the “Basic Recording” folder, and navigated inside, like this:
Once inside the folder, I just clicked “OK,” Gave the project its name (I chose to name it after the folder) and the project is now prepared. Remember this folder location; if you want to access anything saved by the files in the project, this folder is where their files will be saved.
Now that the project is set, let’s add some applications, namely Jack Rack (LADSPA Host) and TimeMachine (Recording Application). To save time, these are both LASH-compatible programs, so select level 2 (LASH).
Now, it would have been find to just do left and right, but it would seem to be cleaner to set another group to “Monitor Left” and “Monitor Right,” in case the room became part of a larger overall project.
Either way, at this point, you can now save the project using “Project” and “Save Project.” When you’re done, you can unload this project, and possibly use this exact same configuration later in another room, or even in an entirely different studio. You could zip up the folder, and transfer it to another system with Ladish, and it will immediately recognize the steps and set up the project as if it were native… so long as the applications are available on the other system.
So, now we’ve seen an excellent alternative to the QT Jack Control application; one that can handle several levels of session management simultaneously, including applications not designed for session management! I hope you found this tutorial instructive.
Have fun, and make something good!