Browse Source

[0.78.3] ignore old-style timebase masters

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@460 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
joq 22 years ago
parent
commit
7783f087bc
8 changed files with 48 additions and 38 deletions
  1. +1
    -1
      configure.in
  2. +18
    -13
      doc/transport.dox
  3. +1
    -1
      jack/internal.h
  4. +6
    -8
      jack/jack.h
  5. +3
    -10
      jack/transport.h
  6. +0
    -1
      jackd/engine.c
  7. +2
    -2
      jackd/transengine.c
  8. +17
    -2
      libjack/transclient.c

+ 1
- 1
configure.in View File

@@ -14,7 +14,7 @@ dnl changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=78
JACK_MICRO_VERSION=2
JACK_MICRO_VERSION=3

dnl ---
dnl HOWTO: updating the jack protocal version


+ 18
- 13
doc/transport.dox View File

@@ -41,7 +41,7 @@ are in <jack/transport.h>
- We want a way for clients with heavyweight state to sync up when
the user presses "play", before the transport starts rolling.

- We need to provide for ongoing binary compatibility as the
- We want to provide for ongoing binary compatibility as the
transport design evolves.


@@ -52,7 +52,8 @@ The former transport master role has been divided into two layers:
- @ref timebase - counting beats, frames, etc. on every cycle.
- @ref transportcontrol - start, stop and reposition the playback.

Existing clients continue to work in compatibility mode.
Existing transport clients continue to work in compatibility mode.
But, old-style timebase masters will no longer control the transport.


@subsection timebase Timebase Master
@@ -171,7 +172,6 @@ will enter the ::JackTransportStarting state and begin invoking their


@image html fsm.png "Transport State Transition Diagram"
@image latex fsm.png "Transport State Transition Diagram"


@subsection transportclients Transport Clients
@@ -191,27 +191,35 @@ cycle and the state returned is valid for the entire cycle.

@subsection compatibility Compatibility

We want to support the existing functions in compatibility mode as
deprecated interfaces for a while. The main reasons are:
During the transition period we will support the old-style interfaces
in compatibility mode as deprecated interfaces. This compatibility is
not 100%, there are limitations.

The main reasons for doing this are:

- facilitate testing with clients that already have transport
support
- provide a clean migration path, so application developers are
not discouraged from supporting the transport interface
- inter-operate with ardour 0.9 beta.

So, these interfaces continue to be supported (but deprecated):
These deprecated interfaces continue to work:

@code
typedef struct jack_transport_info_t;

void jack_set_transport_info (jack_client_t *client,
jack_transport_info_t *tinfo);
void jack_get_transport_info (jack_client_t *client,
jack_transport_info_t *tinfo);
int jack_engine_takeover_timebase (jack_client_t *);
@endcode

Unfortunately, the old-style timebase master interface cannot coexist
cleanly with such new features as jack_transport_locate() and
slow-sync clients. So, these interfaces are only present as stubs:

@code
void jack_set_transport_info (jack_client_t *client,
jack_transport_info_t *tinfo);
int jack_engine_takeover_timebase (jack_client_t *);
@endcode

For compatibility with future changes, it would be good to avoid
structures entirely. Nevertheless, the jack_position_t structure
@@ -238,7 +246,4 @@ will probably not be included in JACK release 1.0.
are addressed there's no reason to retain those two SMPTE fields in
the jack_position_t structure.
- looping -- unless we get feedback that this is really required
- internal timebase master or slow-sync clients
- probably a good idea
- haven't studied it
*/

+ 1
- 1
jack/internal.h View File

@@ -103,6 +103,7 @@ typedef struct {
jack_position_t pending_time; /* position for next cycle */
jack_position_t request_time; /* latest requested position */
jack_unique_t prev_request; /* previous request unique ID */
volatile int seq_number; /* unique ID sequence number */
int new_pos; /* new position this cycle */
unsigned long sync_clients; /* number of is_slowsync clients */
unsigned long sync_remain; /* number of them with sync_poll */
@@ -119,7 +120,6 @@ typedef struct {
float cpu_load;
unsigned long port_max;
int engine_ok;
jack_engine_t *engine;
unsigned long n_port_types;
jack_port_type_info_t port_types[JACK_MAX_PORT_TYPES];
jack_port_shared_t ports[0];


+ 6
- 8
jack/jack.h View File

@@ -536,16 +536,14 @@ jack_port_t *jack_port_by_name (jack_client_t *, const char *portname);
jack_port_t *jack_port_by_id (const jack_client_t *client, jack_port_id_t id);

/**
* If a client is told (by the user) to become the timebase for the
* entire system, it calls this function. If it returns zero, then the
* client has the responsibility to call jack_set_transport_info() at
* the end of its process callback.
* Old-style interface to become the timebase for the entire JACK
* subsystem.
*
* @deprecated This function is only for compatibility with earlier
* transport implementations. Instead, see <jack/transport.h> and use
* jack_set_timebase_callback().
* @deprecated This function still exists for compatibility with the
* earlier transport interface, but it does nothing. Instead, see
* <jack/transport.h> and use jack_set_timebase_callback().
*
* @return 0 on success, otherwise a non-zero error code
* @return ENOSYS, function not implemented.
*/
int jack_engine_takeover_timebase (jack_client_t *);



+ 3
- 10
jack/transport.h View File

@@ -387,16 +387,9 @@ void jack_get_transport_info (jack_client_t *client,
/**
* Set the transport info structure (deprecated).
*
* @param client the JACK client structure.
* @param tinfo used to return a new transport info structure used
* for the next process cycle. The "valid" field must say which
* fields contain valid data.
*
* @deprecated This is for compatibility with the earlier transport
* interface. Define a ::JackTimebaseCallback, instead.
*
* @pre Caller must be the current timebase master. Must be called
* from the process thread.
* @deprecated This function still exists for compatibility with the
* earlier transport interface, but it does nothing. Instead, define
* a ::JackTimebaseCallback.
*/
void jack_set_transport_info (jack_client_t *client,
jack_transport_info_t *tinfo);


+ 0
- 1
jackd/engine.c View File

@@ -1740,7 +1740,6 @@ jack_engine_new (int realtime, int rtpriority, int verbose, int client_timeout)
jack_register_shm (engine->control_shm_name, addr, shmid);
engine->control = (jack_control_t *) addr;
engine->control->engine = engine;

/* setup port type information from builtins. buffer space is allocated
whenever we call jack_set_buffer_size()


+ 2
- 2
jackd/transengine.c View File

@@ -234,6 +234,7 @@ jack_transport_init (jack_engine_t *engine)
memset (&ectl->pending_time, 0, sizeof(ectl->pending_time));
memset (&ectl->request_time, 0, sizeof(ectl->request_time));
ectl->prev_request = 0;
ectl->seq_number = 1; /* can't start at 0 */
ectl->new_pos = 0;
ectl->sync_remain = 0;
ectl->sync_clients = 0;
@@ -305,8 +306,7 @@ jack_transport_client_set_sync (jack_engine_t *engine,
int ret;
jack_client_internal_t *client;

// JOQ: I am assuming the process cycle is serialized with
// respect to this lock...
/* The process cycle runs with this lock. */
jack_lock_graph (engine);

client = jack_client_internal_by_id (engine, client_id);


+ 17
- 2
libjack/transclient.c View File

@@ -373,9 +373,14 @@ jack_transport_stop (jack_client_t *client)

/************* Compatibility with old transport API. *************/

#define OLD_TIMEBASE_BROKEN

int
jack_engine_takeover_timebase (jack_client_t *client)
{
#ifdef OLD_TIMEBASE_BROKEN
return ENOSYS;
#else
jack_request_t req;

req.type = SetTimeBaseClient;
@@ -383,6 +388,7 @@ jack_engine_takeover_timebase (jack_client_t *client)
req.x.timebase.conditional = 0;

return jack_client_deliver_request (client, &req);
#endif /* OLD_TIMEBASE_BROKEN */
}

void
@@ -416,12 +422,20 @@ jack_get_transport_info (jack_client_t *client,
}
}

static int first_error = 1;

void
jack_set_transport_info (jack_client_t *client,
jack_transport_info_t *info)
{
static int first_error = 1;

#ifdef OLD_TIMEBASE_BROKEN

if (first_error)
jack_error ("jack_set_transport_info() no longer supported.");
first_error = 0;

#else

jack_control_t *ectl = client->engine;

if (!client->control->is_timebase) { /* not timebase master? */
@@ -470,6 +484,7 @@ jack_set_transport_info (jack_client_t *client,
ectl->pending_time.ticks_per_beat = info->ticks_per_beat;
ectl->pending_time.beats_per_minute = info->beats_per_minute;
}
#endif /* OLD_TIMEBASE_BROKEN */
}

#endif /* OLD_TRANSPORT */

Loading…
Cancel
Save