Browse Source

[0.78.1] some transport enhancements

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@457 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
joq 22 years ago
parent
commit
ff87bea0b5
5 changed files with 40 additions and 30 deletions
  1. +1
    -2
      configure.in
  2. +2
    -0
      example-clients/transport.c
  3. +3
    -2
      jack/transport.h
  4. +27
    -23
      jackd/transengine.c
  5. +7
    -3
      libjack/transclient.c

+ 1
- 2
configure.in View File

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

JACK_MICRO_VERSION=1

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


+ 2
- 0
example-clients/transport.c View File

@@ -104,6 +104,8 @@ void timebase(jack_transport_state_t state, jack_nframes_t nframes,

void jack_shutdown(void *arg)
{
rl_cleanup_after_signal();
fprintf(stderr, "JACK shut down, exiting ...\n");
exit(1);
}



+ 3
- 2
jack/transport.h View File

@@ -262,8 +262,9 @@ int jack_transport_locate (jack_client_t *client,
* current cycle and the state returned is valid for the entire cycle.
*
* @param client the JACK client structure.
* @param pos current position structure, @a pos->valid describes
* which fields contain valid data.
* @param pos NULL; or pointer to structure for returning current
* transport position, @a pos->valid will describe which fields
* contain valid data.
*
* @return Current transport state.
*/


+ 27
- 23
jackd/transengine.c View File

@@ -92,8 +92,9 @@ jack_sync_poll_stop (jack_engine_t *engine)
//JOQ: check invariant for debugging...
assert (poll_count == engine->control->sync_remain);
VERBOSE (engine,
"sync poll halted with %ld clients and %llu usecs remaining\n",
engine->control->sync_remain, engine->control->sync_time_left);
"sync poll halted with %ld clients and %8.6f secs remaining\n",
engine->control->sync_remain,
(double) (engine->control->sync_time_left / 1000000.0));
engine->control->sync_remain = 0;
engine->control->sync_time_left = 0;
}
@@ -121,8 +122,8 @@ jack_sync_poll_start (jack_engine_t *engine)
engine->control->sync_remain = engine->control->sync_clients;
engine->control->sync_time_left = engine->control->sync_timeout;
VERBOSE (engine, "transport Starting, sync poll of %ld clients "
"for %llu usecs\n", engine->control->sync_remain,
engine->control->sync_time_left);
"for %8.6f secs\n", engine->control->sync_remain,
(double) (engine->control->sync_time_left / 1000000.0));
}

/* check for sync timeout */
@@ -146,6 +147,7 @@ jack_sync_timeout (jack_engine_t *engine)
return TRUE;
}


/**************** subroutines used by engine.c ****************/

/* driver callback */
@@ -344,27 +346,18 @@ jack_transport_cycle_end (jack_engine_t *engine)
ectl->current_time.frame + ectl->buffer_size;
}

/* Handle any new transport command from the last cycle. */
cmd = ectl->transport_cmd;
if (cmd != ectl->previous_cmd) {
ectl->previous_cmd = cmd;
VERBOSE (engine, "transport command: %s\n",
(cmd == TransportCommandStart? "START": "STOP"));
} else
cmd = TransportCommandNone;

/* See if a position request arrived during the last cycle.
* The request_time could change during the guarded copy. If
* so, we'll handle it now, but mistake it for a new request
* in the following cycle. That may cause an extra sync poll
* cycle, but should work. */
/* See if an asynchronous position request arrived during the
* last cycle. The request_time could change during the
* guarded copy. If so, we'll handle it now, but mistake it
* for a new request in the following cycle. That may cause
* an extra sync poll cycle, but should work. */
if (ectl->request_time.unique_1 != ectl->prev_request) {
ectl->prev_request = ectl->request_time.unique_1;
jack_transport_copy_position(&ectl->request_time,
&ectl->pending_time);
ectl->new_pos = 1;
VERBOSE (engine, "new transport postition: %lu, id=0x%llx\n",
VERBOSE (engine, "new transport position: %lu, id=0x%llx\n",
ectl->pending_time.frame, ectl->pending_time.unique_1);
ectl->new_pos = 1;
} else
ectl->new_pos = 0;

@@ -379,11 +372,21 @@ jack_transport_cycle_end (jack_engine_t *engine)
if ((ectl->sync_remain == 0) ||
(jack_sync_timeout(engine))) {
ectl->transport_state = JackTransportRolling;
VERBOSE (engine, "transport Rolling, %lld usec"
" left for poll\n", ectl->sync_time_left);
VERBOSE (engine, "transport Rolling, %8.6f sec"
" left for poll\n",
(double) (ectl->sync_time_left / 1000000.0));
}
}

/* Handle any new transport command from the last cycle. */
cmd = ectl->transport_cmd;
if (cmd != ectl->previous_cmd) {
ectl->previous_cmd = cmd;
VERBOSE (engine, "transport command: %s\n",
(cmd == TransportCommandStart? "START": "STOP"));
} else
cmd = TransportCommandNone;

/* state transition switch */
switch (ectl->transport_state) {

@@ -450,6 +453,7 @@ jack_transport_set_sync_timeout (jack_engine_t *engine,
jack_time_t usecs)
{
engine->control->sync_timeout = usecs;
VERBOSE (engine, "new sync timeout: %llu usecs\n", usecs);
VERBOSE (engine, "new sync timeout: %8.6f secs\n",
(double) (usecs / 1000000.0));
return 0;
}

+ 7
- 3
libjack/transclient.c View File

@@ -335,8 +335,11 @@ jack_transport_query (jack_client_t *client, jack_position_t *pos)
{
jack_control_t *ectl = client->engine;

/* the guarded copy makes this function work in any thread */
jack_transport_copy_position (&ectl->current_time, pos);
if (pos)
/* the guarded copy makes this function work in any
* thread */
jack_transport_copy_position (&ectl->current_time, pos);

return ectl->transport_state;
}

@@ -444,7 +447,8 @@ jack_set_transport_info (jack_client_t *client,
(info->transport_state != ectl->transport_state)) {
if (info->transport_state == JackTransportStopped)
ectl->transport_cmd = TransportCommandStop;
else if (info->transport_state == JackTransportRolling)
else if ((info->transport_state == JackTransportRolling) &&
(ectl->transport_state != JackTransportStarting))
ectl->transport_cmd = TransportCommandStart;
/* silently ignore anything else */
}


Loading…
Cancel
Save