Crudebyte Logo
Creating & manipulating clients

Detailed Description

The JACK system is designed as client - server model. There is (usually) exactly one JACK server application, which is responsible for audio / MIDI routing between applications, synchronization and monitoring of their timings, handling of underlying hardware, and all other back end services you associate with the JACK system.

Every application in the JACK system communicates as client with the JACK server. So a JACK client is the fundamental entity that represents your application in the JACK system. Accordingly you first need to create a JACK client for your application with jack_client_open() to be able to use the JACK API for any useful purpose. Usually only one client per application is created. However you might also create more than one JACK client for your application at the same time, i.e. to split a very complex application in logical subdivisions (which in practice is rarely done though).

The functions in this group provide the most fundamental calls to manage JACK clients, like creating, destroying, renaming of clients.


jack_client_tjack_client_open (const char *client_name, jack_options_t options, jack_status_t *status,...) JACK_OPTIONAL_WEAK_EXPORT
jack_client_tjack_client_new (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
int jack_client_close (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
int jack_client_name_size (void) JACK_OPTIONAL_WEAK_EXPORT
char * jack_get_client_name (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
int jack_internal_client_new (const char *client_name, const char *load_name, const char *load_init) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
void jack_internal_client_close (const char *client_name) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
int jack_activate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
int jack_deactivate (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
int jack_get_client_pid (const char *name) JACK_OPTIONAL_WEAK_EXPORT
jack_native_thread_t jack_client_thread_id (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT

Function Documentation

jack_client_t* jack_client_open ( const char *  client_name,
jack_options_t  options,
jack_status_t status,

Open an external client session with a JACK server. This interface is more complex but more powerful than jack_client_new(). With it, clients may choose which of several servers to connect, and control whether and how to start the server automatically, if it was not already running. There is also an option for JACK to generate a unique client name, when necessary.

client_nameof at most jack_client_name_size() characters. The name scope is local to each server. Unless forbidden by the JackUseExactName option, the server will modify this name to create a unique variant, if needed.
optionsformed by OR-ing together JackOptions bits. Only the JackOpenOptions bits are allowed.
status(if non-NULL) an address for JACK to return information from the open operation. This status word is formed by OR-ing together the relevant JackStatus bits.

Optional parameters: depending on corresponding [options bits] additional parameters may follow status (in this order).

  • [JackServerName] (char *) server_name selects from among several possible concurrent server instances. Server names are unique to each user. If unspecified, use "default" unless $JACK_DEFAULT_SERVER is defined in the process environment.
Opaque client handle if successful. If this is NULL, the open operation failed, *status includes JackFailure and the caller is not a JACK client.
jack_client_t* jack_client_new ( const char *  client_name)


Please use jack_client_open().
int jack_client_close ( jack_client_t client)

Disconnects an external client from a JACK server.

0 on success, otherwise a non-zero error code
int jack_client_name_size ( void  )
the maximum number of characters in a JACK client name including the final NULL character. This value is a constant.
char* jack_get_client_name ( jack_client_t client)
pointer to actual client name. This is useful when JackUseExactName is not specified on open and JackNameNotUnique status was returned. In that case, the actual name will differ from the client_name requested.
int jack_internal_client_new ( const char *  client_name,
const char *  load_name,
const char *  load_init 

Load an internal client into the Jack server.

Internal clients run inside the JACK server process. They can use most of the same functions as external clients. Each internal client must declare jack_initialize() and jack_finish() entry points, called at load and unload times. See inprocess.c for an example of how to write an internal client.

Please use jack_internal_client_load().
client_nameof at most jack_client_name_size() characters.
load_nameof a shared object file containing the code for the new client.
load_initan arbitary string passed to the jack_initialize() routine of the new client (may be NULL).
0 if successful.
void jack_internal_client_close ( const char *  client_name)

Remove an internal client from a JACK server.

Please use jack_internal_client_unload().
int jack_activate ( jack_client_t client)

Tell the Jack server that the program is ready to start processing audio.

0 on success, otherwise a non-zero error code
int jack_deactivate ( jack_client_t client)

Tell the Jack server to remove this client from the process graph. Also, disconnect all ports belonging to it, since inactive clients have no port connections.

0 on success, otherwise a non-zero error code
int jack_get_client_pid ( const char *  name)
pid of client. If not available, 0 will be returned.
jack_native_thread_t jack_client_thread_id ( jack_client_t client)
the pthread ID of the thread running the JACK client side real-time code.
Copyright © MMXIII Crudebyte. All rights reserved.