Browse Source

[engine] in case of a continous stream of timeouts, we suspend the execution of the processing graph.

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@4429 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.121.0
torben 14 years ago
parent
commit
e726e6a746
3 changed files with 12 additions and 1 deletions
  1. +1
    -0
      jack/engine.h
  2. +7
    -0
      jackd/clientengine.c
  3. +4
    -1
      jackd/engine.c

+ 1
- 0
jack/engine.h View File

@@ -138,6 +138,7 @@ struct _jack_engine {
pid_t wait_pid;
int nozombies;
volatile int problems;
volatile int continuous_stream;
volatile int new_clients_allowed;

/* these lists are protected by `client_lock' */


+ 7
- 0
jackd/clientengine.c View File

@@ -286,6 +286,13 @@ jack_check_clients (jack_engine_t* engine, int with_timeout_check)
client->control->timed_out++;
client->error++;
VERBOSE (engine, "client %s has timed out", client->control->name);
} else {
/*
* the client recovered. if this is a single occurence, thats probably fine.
* however, we increase the continuous_stream flag.
*/

engine->continuous_stream += 1;
}
}
}


+ 4
- 1
jackd/engine.c View File

@@ -1842,6 +1842,7 @@ jack_engine_new (int realtime, int rtpriority, int do_mlock, int do_unlock,
engine->driver_exit = jack_engine_driver_exit;
engine->transport_cycle_start = jack_transport_cycle_start;
engine->client_timeout_msecs = client_timeout;
engine->continuous_stream = 0;
engine->problems = 0;

engine->next_client_id = 1; /* 0 is a NULL client ID */
@@ -2419,7 +2420,7 @@ jack_run_one_cycle (jack_engine_t *engine, jack_nframes_t nframes,
return 0;
}

if (engine->problems) {
if (engine->problems || (engine->continuous_stream > 10)) {
VERBOSE (engine, "problem-driven null cycle problems=%d", engine->problems);
jack_unlock_problems (engine);
jack_unlock_graph (engine);
@@ -2444,6 +2445,7 @@ jack_run_one_cycle (jack_engine_t *engine, jack_nframes_t nframes,
DEBUG("run process\n");

if (jack_engine_process (engine, nframes) != 0) {
engine->continuous_stream = 0;
DEBUG ("engine process cycle failed");
jack_check_client_status (engine);
}
@@ -3505,6 +3507,7 @@ jack_sort_graph (jack_engine_t *engine)
jack_compute_all_port_total_latencies (engine);
jack_rechain_graph (engine);
jack_compute_new_latency (engine);
engine->continuous_stream = 0;
VERBOSE (engine, "-- jack_sort_graph");
}



Loading…
Cancel
Save