Calling Java code from an audio or Midi callback
Calling Java code from an audio or Midi callback
- Subject: Calling Java code from an audio or Midi callback
- From: Stephane Letz <email@hidden>
- Date: Mon, 15 Apr 2002 10:59:55 +0200
Hi,
I just discovered that the CoreAudio audio or Midi callback can be used in
Java and was wondering how this was implemented. It seems that the Java
code runs directly inside the real-time thread.
We need to do the same thing (calling back Java code inside a realtime IO
proc). I tried to make a "suspensive" native call from the Java side that
is "resumed" from the IO callback using a condition variable (
pthread_cond_wait and pthread_cond_signal API)
The calling Java thread is also made real-time using thread_policy_set.
Thus I have 2 real-time threads running, and if works quite well.
I was wondering if the need for the second real-time thread could be
avoided, by calling back the Java code directly inside the Core Midi IO
proc.
- is is safe to callback the JVM?
- if yes any ideas of how this can be done?
Thanks for any advice.
Stephane Letz
Grame: Centre National de creation musicale
9, Rue du Garet
69001 Lyon
Tel: 04-72-07-37-00
Fax: 04-72-07-37-01
Web: www.grame.fr
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.