Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proper jack_set_thread_init_callback behavior #496

Open
wmedrano opened this issue Sep 4, 2019 · 2 comments
Open

proper jack_set_thread_init_callback behavior #496

wmedrano opened this issue Sep 4, 2019 · 2 comments

Comments

@wmedrano
Copy link

wmedrano commented Sep 4, 2019

The documentation says:

Tell JACK to call thread_init_callback once just after the creation of the thread in which all other callbacks will be handled.

The code in the supplied function does not need to be suitable for real-time execution.

However, in jack and jack2 I've noticed that it gets called multiple times.

Simple program that has has callback called multiple times. https://pastebin.com/dVZqdGdh

Should the documentation be updated? I think saying creation of the thread implies that there is a single thread and the function will be called only once.

RustAudio/rust-jack#104

@HadrienG2
Copy link

Could it be because jack2, which uses multiple audio processing threads, actually spawns multiple audio threads per application? I just checked that the different invocations come from different OS threads...

If so, that is indeed just a matter of clarifying the documentation.

@emmef
Copy link

emmef commented Nov 20, 2019

Seeing the above, is my assumption correct that jack_set_thread_init_callback(...) only calls thread_init_callback for threads that also call process_callback as set by jack_set_process_callback(...)? In that case, the documentation could be clarified as:

Tell JACK to call thread_init_callback once just after the creation of a processing thread in which processing callbacks will be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants