#733: Proc as callback function for CoreAudio(AudioDeviceCreateIOProcID) isn't called -----------------------------------+---------------------------------------- Reporter: nagachika00@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- I'm trying to output arbitrary waveform data to audio device with CoreAudio Framework, and confront a callback function problem. I attach sample scripts. At first, I have to apply a small dirty patch to MacRuby to avoid {{{"unrecognized runtime type `?'"}}} exception. The function AudioDeviceStart/Stop take an argument has type `"^?"`, but MacRuby doesn't allow that type. I attach the patch too. In my sample, register Proc as callback function with AudioDeviceCreateIOProcID() seems success. Then call AudioDeviceStart() to start playback, but the Proc object seems never called. The sample script intends play silent waveform, so make no sound is OK, but log message to stdout with Kernel#p method isn't available. The callback function in CoreAudio is called from CoreAudio internal thread. Is that the cause of the problem? {{{ $ macruby -I. coreaudio_sample.rb Default Output Device ID = 268 #<Pointer:0x2002565a0> start sleep macruby(19434,0x103cc7000) malloc: *** auto malloc[19434]: error: GC operation on unregistered thread. Thread registered implicitly. Break on auto_zone_thread_registration_error() to debug. stop }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/733> MacRuby <http://macruby.org/>