Crudebyte Logo
JACKiOS  1.9.10.3
The non-callback API

Detailed Description

The functions in this group are intended to be used for more advanced purposes. Typical use cases are JACK client applications which implement their audio rendering engine to support SMP to i.e. utilize the resources of a multi core CPU device in a more powerful way. Even though recent implementations of the JACK server (jackdmp, JACK2) explicitly support SMP during execution of their graph branches, each client is by default executed in only one thread (within the process of the respective client application).

So it can make sense in certain cases to implement a JACK client application in a more extended way for SMP purposes, i.e. in cases of a complex DAW application which is supposed to bear most of the CPU work load of the entire JACK system. In the latter case, the parallelization of JACK graphs hits a logical constraint and might not be able to utilize the CPU resources of a SMP system optimal in full extent.

In such a case the JACK client app might create additional audio thread(s) and use the functions below to synchronize them for each JACK process period, since those separate audio thread(s) would not be part of the usual JACK process callback context.

See Also
thread.h

Functions

jack_nframes_t jack_thread_wait (jack_client_t *client, int status) JACK_OPTIONAL_WEAK_EXPORT
jack_nframes_t jack_cycle_wait (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT
void jack_cycle_signal (jack_client_t *client, int status) JACK_OPTIONAL_WEAK_EXPORT
int jack_set_process_thread (jack_client_t *client, JackThreadCallback thread_callback, void *arg) JACK_OPTIONAL_WEAK_EXPORT

Function Documentation

jack_nframes_t jack_thread_wait ( jack_client_t client,
int  status 
)

THIS FUNCTION IS DEPRECATED AND SHOULD NOT BE USED IN NEW JACK CLIENTS.

Deprecated:
Please use jack_cycle_wait() and jack_cycle_signal() functions.
jack_nframes_t jack_cycle_wait ( jack_client_t client)

Wait until this JACK client should process data.

Parameters
client- pointer to a JACK client structure
Returns
the number of frames of data to process
void jack_cycle_signal ( jack_client_t client,
int  status 
)

Signal next clients in the graph.

Parameters
client- pointer to a JACK client structure
status- if non-zero, calling thread should exit
int jack_set_process_thread ( jack_client_t client,
JackThreadCallback  thread_callback,
void *  arg 
)

Tell the Jack server to call thread_callback in the RT thread. Typical use are in conjunction with jack_cycle_wait and jack_cycle_signal functions. The code in the supplied function must be suitable for real-time execution. That means that it cannot call functions that might block for a long time. This includes malloc, free, printf, pthread_mutex_lock, sleep, wait, poll, select, pthread_join, pthread_cond_wait, etc, etc.

NOTE: this function cannot be called while the client is activated (after jack_activate has been called.)

Returns
0 on success, otherwise a non-zero error code.
DE • EN
Copyright © MMXIII Crudebyte. All rights reserved.

twitter