[MacRuby-devel] [MacRuby] #733: Proc as callback function for CoreAudio(AudioDeviceCreateIOProcID) isn't called

MacRuby ruby-noreply at macosforge.org
Sat Jun 5 08:44:05 PDT 2010


#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:                       
-----------------------------------+----------------------------------------

Comment(by nagachika00@…):

 Replying to [comment:3 martinlagardette@…]:
 > I'm not sure I understand exactly what you're asking, so let me know if
 I'm not correctly answering:
 I'm sorry for my ambiguous question. I understand the limitation of
 current MacRuby about function pointer returned from C/Obj-C functions.
 But in this case, I think the limitation is not matter because returned
 function pointer (procID) is not called by application, but just passed to
 AudioDeviceStart(). I wonder if the definition of AudioDeviceIOProcID is
 mistake in design of API. It is just an 'ID', not really function pointer
 (it is never called).

 I guess the cause of problem is...
  1. The callback function is called from CoreAudio's internal new thread.
     The thread may be not ready for exception or some other preparation
 for execute MacRuby method (I'm not sure any preparations are needed).
  2. The trampoline function's lifetime maybe limited until return of call
 C/Obj-C function which Proc object is passed. If trampoline function is
 sweeped after call of AudioDeviceCreateIOProcID(), AudioDeviceStart()
 cannot call it.

 I'm afraid I have a terrible misunderstanding...

 > You can load custom bridge support files,
 Thank you! I'll try it :)

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/733#comment:4>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list