Browse Source

Merge https://github.com/jackaudio/jack1 into alsa_midi_port_name_suffix

pull/36/head
rncbc 9 years ago
parent
commit
55fa3c6e92
6 changed files with 502 additions and 528 deletions
  1. +5
    -5
      .gitmodules
  2. +0
    -7
      include/engine.h
  3. +7
    -23
      include/internal.h
  4. +16
    -24
      jackd/clientengine.c
  5. +461
    -461
      jackd/engine.c
  6. +13
    -8
      libjack/port.c

+ 5
- 5
.gitmodules View File

@@ -1,9 +1,9 @@
[submodule "example-clients"]
path = example-clients
url = https://github.com/jackaudio/example-clients
[submodule "jack"]
path = jack
url = git://github.com/jackaudio/headers.git
url = https://github.com/jackaudio/headers
[submodule "tools"]
path = tools
url = git://github.com/jackaudio/tools.git
[submodule "example-clients"]
path = example-clients
url = git://github.com/jackaudio/example-clients.git
url = https://github.com/jackaudio/tools

+ 0
- 7
include/engine.h View File

@@ -144,13 +144,6 @@ struct _jack_engine {
JSList *clients_waiting;
JSList *reserved_client_names;

/* Double linked list of clients in running order */
jack_client_internal_t *execlist_head;
jack_client_internal_t *execlist_tail;
#define EXECLIST_ORDER 1 /* Re-order clients */
#define EXECLIST_CYCLE 2 /* Check cycles */
int execlist_request;

jack_port_internal_t *internal_ports;
jack_client_internal_t *timebase_client;
jack_port_buffer_info_t *silent_buffer;


+ 7
- 23
include/internal.h View File

@@ -452,18 +452,6 @@ struct _jack_request {
int32_t status;
} POST_PACKED_STRUCTURE;


/* Data used by the algorithm determining running order
* of clients.
*/
typedef struct _jack_feedcounts {
struct _jack_feedcounts *next;
struct _jack_client_internal *client;
int fwd_count;
int rev_count;
} jack_feedcounts_t;


/* Per-client structure allocated in the server's address space.
* It's here because its not part of the engine structure.
*/
@@ -476,18 +464,14 @@ typedef struct _jack_client_internal {
int event_fd;
int subgraph_start_fd;
int subgraph_wait_fd;

/* protected by engine->client_lock */
JSList *ports;

jack_feedcounts_t *feedlist;
struct _jack_client_internal *execlist_next;
struct _jack_client_internal *execlist_prev;
int depcount;
int depcheck;

JSList *ports; /* protected by engine->client_lock */
JSList *truefeeds; /* protected by engine->client_lock */
JSList *sortfeeds; /* protected by engine->client_lock */
int fedcount;
int tfedcount;
jack_shm_info_t control_shm;
unsigned long execution_order;
struct _jack_client_internal *next_client; /* not a linked list! */
dlhandle handle;
int (*initialize)(jack_client_t*, const char*); /* int. clients only */
void (*finish)(void *); /* internal clients only */
@@ -554,7 +538,7 @@ extern jack_port_t *jack_port_by_id_int(const jack_client_t *client,
jack_port_id_t id, int* free);

extern jack_port_t *jack_port_by_name_int(jack_client_t *client,
const char *port_name);
const char *port_name, int* free);
extern int jack_port_name_equals(jack_port_shared_t* port, const char* target);

/** Get the size (in bytes) of the data structure used to store


+ 16
- 24
jackd/clientengine.c View File

@@ -62,13 +62,13 @@ jack_client_disconnect_ports (jack_engine_t *engine,
}

jack_slist_free (client->ports);
jack_slist_free (client->truefeeds);
jack_slist_free (client->sortfeeds);
client->truefeeds = 0;
client->sortfeeds = 0;
client->ports = 0;
}


/* Modified for new client execution order algorithm.
* FA 08/2015
*/
int
jack_client_do_deactivate (jack_engine_t *engine,
jack_client_internal_t *client, int sort_graph)
@@ -88,7 +88,6 @@ jack_client_do_deactivate (jack_engine_t *engine,
}

if (sort_graph) {
engine->execlist_request = EXECLIST_ORDER | EXECLIST_CYCLE;
jack_sort_graph (engine);
}
return 0;
@@ -163,6 +162,7 @@ jack_zombify_client (jack_engine_t *engine, jack_client_internal_t *client)
client->control->name);

/* caller must hold the client_lock */

/* this stops jack_deliver_event() from contacing this client */

client->control->dead = TRUE;
@@ -337,9 +337,6 @@ jack_check_clients (jack_engine_t* engine, int with_timeout_check)
return errs;
}

/* Modified for new client execution order algorithm.
* FA 08/2015
*/
void
jack_remove_clients (jack_engine_t* engine, int* exit_freewheeling_when_done)
{
@@ -407,7 +404,6 @@ jack_remove_clients (jack_engine_t* engine, int* exit_freewheeling_when_done)
}

if (need_sort) {
engine->execlist_request = EXECLIST_ORDER | EXECLIST_CYCLE;
jack_sort_graph (engine);
}

@@ -568,9 +564,6 @@ jack_client_name_invalid (jack_engine_t *engine, char *name,

/* Set up the engine's client internal and control structures for both
* internal and external clients. */
/* Modified for new client execution order algorithm.
* FA 08/2015
*/
static jack_client_internal_t *
jack_setup_client_control (jack_engine_t *engine, int fd, ClientType type, const char *name, jack_uuid_t uuid)
{
@@ -582,11 +575,10 @@ jack_setup_client_control (jack_engine_t *engine, int fd, ClientType type, const
client->request_fd = fd;
client->event_fd = -1;
client->ports = 0;
client->feedlist = 0;
client->depcount = 0;
client->depcheck = 0;
client->execlist_next = 0;
client->truefeeds = 0;
client->sortfeeds = 0;
client->execution_order = UINT_MAX;
client->next_client = NULL;
client->handle = NULL;
client->finish = NULL;
client->error = 0;
@@ -772,15 +764,19 @@ setup_client (jack_engine_t *engine, ClientType type, char *name,
jack_engine_reset_rolling_usecs (engine);

if (jack_client_is_internal (client)) {


jack_unlock_graph (engine);

/* Call its initialization function. This function
* may make requests of its own, so we temporarily
* release and then reacquire the request_lock. */
if (client->control->type == ClientInternal) {

pthread_mutex_unlock (&engine->request_lock);
if (client->initialize (client->private_client,
object_data)) {

/* failed: clean up client data */
VERBOSE (engine,
"%s jack_initialize() failed!",
@@ -796,7 +792,8 @@ setup_client (jack_engine_t *engine, ClientType type, char *name,
pthread_mutex_lock (&engine->request_lock);
}

} else {
} else { /* external client */

jack_unlock_graph (engine);
}

@@ -867,7 +864,6 @@ jack_get_reserved_name (jack_engine_t *engine, jack_uuid_t uuid)
}
return 0;
}

int
jack_client_create (jack_engine_t *engine, int client_fd)
{
@@ -977,10 +973,6 @@ jack_client_create (jack_engine_t *engine, int client_fd)
return 0;
}


/* Modified for new client execution order algorithm.
* FA 08/2015
*/
int
jack_client_activate (jack_engine_t *engine, jack_uuid_t id)
{
@@ -1005,8 +997,8 @@ jack_client_activate (jack_engine_t *engine, jack_uuid_t id)
* this point.
*/

jack_get_fifo_fd (engine, ++engine->external_client_cnt);
engine->execlist_request = EXECLIST_ORDER;
jack_get_fifo_fd (engine,
++engine->external_client_cnt);
jack_sort_graph (engine);




+ 461
- 461
jackd/engine.c
File diff suppressed because it is too large
View File


+ 13
- 8
libjack/port.c View File

@@ -488,8 +488,16 @@ jack_port_by_id (jack_client_t *client, jack_port_id_t id)
}

jack_port_t *
jack_port_by_name_int (jack_client_t *client, const char *port_name)
jack_port_by_name_int (jack_client_t *client, const char *port_name, int* free)
{
JSList *node;
for (node = client->ports; node; node = jack_slist_next (node)) {
if (jack_port_name_equals(((jack_port_t *) node->data)->shared, port_name)) {
*free = FALSE;
return (jack_port_t *) node->data;
}
}

unsigned long i, limit;
jack_port_shared_t *port;

@@ -498,6 +506,7 @@ jack_port_by_name_int (jack_client_t *client, const char *port_name)

for (i = 0; i < limit; i++) {
if (port[i].in_use && jack_port_name_equals (&port[i], port_name)) {
*free = TRUE;
return jack_port_new (client, port[i].id,
client->engine);
}
@@ -511,6 +520,7 @@ jack_port_by_name (jack_client_t *client, const char *port_name)
{
JSList *node;
jack_port_t* port;
int need_free = FALSE;

for (node = client->ports_ext; node; node = jack_slist_next (node)) {
port = node->data;
@@ -522,8 +532,8 @@ jack_port_by_name (jack_client_t *client, const char *port_name)

/* Otherwise allocate a new port structure, keep it in the
* ports_ext list for later use. */
port = jack_port_by_name_int (client, port_name);
if (port != NULL) {
port = jack_port_by_name_int (client, port_name, &need_free);
if (port != NULL && need_free) {
client->ports_ext =
jack_slist_prepend (client->ports_ext, port);
}
@@ -972,8 +982,3 @@ jack_audio_port_mixdown (jack_port_t *port, jack_nframes_t nframes)
#endif /* USE_DYNSIMD */
}
}






Loading…
Cancel
Save