Re: [ecasound] Jack session support in Ecasound

From: Kai Vehmanen <kvehmanen@email-addr-hidden>
Date: Sat Jul 23 2011 - 13:49:14 EEST


On Tue, 12 Jul 2011, Joel Roth wrote:

> Jack session being the third session manager
> implemented for linux (after LASH and LADI)
> I would think it would reflect some deeper understanding
> of the issues involved.
> Will Ecasound have to implement this, or for Nama,
> could I do this directly?

it's indeed a bit tricky. The main issue is that in ecasound, it's the
library that does all the heavy lifting towards JACK (i.e. it registers to
JACK as a client). But the library does not know who or how it is used in
larger context, so if it gets a callback from JACK to save its state, it
cannot really do its own.

Even for ecasound (the command-line frontend), the natural place to
implement session support would be in the frontend code. But it has no
direct access to JACK client instance implemented in libecasound, so it
basicly has the same problem Nama and other apps.

I see two main implementation options:

1) Expose the session interface from libecasound. I.e. when JACK
    ask to save state, libecasound would pass this to the ECI
    clients as well.

2) Use a "delegate" design. Libecasound does not support
    session managing (it ignores requests to save state). Instead
    client app independently registers as a JACK client, and
    when getting a callback to save state, it basicly does
    a "cs-save-as foobar.ecs" and thus saves state for ecasound
    as well.

Now design wise (1) is the right thing to do, but in practise, I think (2)
is the practical solution, and how the initial support probably needs to
be done.

A proof-of-concept would be really useful as it's not entirely clear to me
how well other JACK components (e.g. pyjacksm) handle some clients doing
(2). But I don't see any technical showstoppers, so this is mostly "just
work" to implement.

> Can anyone explain in simple language how the
> interface works? Does it have to be written
> in C?

The app needs to register as a JACK client (using the C libjack API) and
then you'll get a callback saying that "save state to this directory", and
optional flag whether to just save, or save'n'quit. And that's basicly it.
In jack source tree, example-clients/simple_session_client.c provides a
simple example. And the app needs to able to restore state by passing a
certain commmand line (this should be easy given ecasound's ability to
save chainsetups).

Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide. Store less, Store more with what you own, Move data to
the right place. Try It Now!
Ecasound-list mailing list
Received on Sat Jul 23 16:15:02 2011

This archive was generated by hypermail 2.1.8 : Sat Jul 23 2011 - 16:15:02 EEST