[email protected] wrote:
> hmm, i need more time to understand the different between both stats. so in
> moment i can
> not evaluate this. but the jack api proposes this functions, for things need
> more time.
>
> read comment for the jack_set_process_thread function.
The non-callback API isn't a way for us to remove ourselves from being called
back. JACK is an interrupt-driven (or "callback") API. I.e. we pass a
callback
function to the JACK library... and then we have no control over when and where
it is called. As a consequence, we process a discrete chunk of data every time
we are called.
some_init_function() {
register_callback_with_lib( my_callback );
}
int my_callback(args) {
// process the data
}
In contrast, programmers are used to working with stream I/O. ALSA and OSS
have
an API that is more of a stream-like API. This means that we have some program
that polls for data:
while( have_some_data_from_lib() ) {
// process the data
}
The JACK non-callback API provides a way to write JACK programs that looks like
the old stream-like API's.
So, using the non-callback API is roughly equivalent to using the callback API.
Whenever we're in the "// process the data" block... we have the same rules
about being realtime safe. For us to do this with Hydrogen would be a big
change.
It sounds like you *want* is simply to say to JACK, "don't call the callback."
This is done like this:
jack_deactive(m_client);
jack_set_process_callback(0, 0);
jack_activate(m_client);
However, it might be easier to implement this (and it works for all audio
drivers):
bool too_busy_to_process = false;
void load_drumkit(void) {
too_busy_to_process = true;
// load the drum kit
too_busy_to_process = false;
}
int audioEngine_process(int, void*) {
if( too_busy_to_process )
return;
// ...
}
Peace,
Gabriel
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel