• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: bastardizing AUEventListenerNotify() no longer working?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bastardizing AUEventListenerNotify() no longer working?


  • Subject: Re: bastardizing AUEventListenerNotify() no longer working?
  • From: Stephen Davis <email@hidden>
  • Date: Thu, 31 Dec 2009 10:43:07 -0800


On Dec 30, 2009, at 11:03 PM, William Stewart wrote:


On Dec 31, 2009, at 7:42 AM, Stephen Davis wrote:

For a little test project I was abusing AUEventListenerNotify() to send property change notifications from my input render callback to the main thread but, as has been discussed previously, AUEventListenerNotify() no longer lets you send kAudioUnitEvent_PropertyChange notifications.

It doesn't? Can we get a bug report written, as I'm not aware that this has stopped working. The one issue that did come up was that providing NULL for the object parameter was failing (and I'm not sure that this every worked, as I seemed to remember having problems with this myself a while ago)

/*!
    @function   AUEventListenerNotify
    @abstract   Deliver an AudioUnitEvent to all listeners registered to receive it.
    @discussion This is only to be used for notifications about parameter changes (and gestures).
                It can not be used for notifying changes to property values as these are 
                internal to an audio unit and should not be issued outside of the audio unit itself.
    @param      inSendingListener
                    A parameter listener generating the change and which does not want to
                    receive a callback as a result of it. May be NULL.
    @param      inSendingObject
                    The object generating the change and which does not want to receive a
                    callback as a result of it. NULL is treated specially when inListener is
                    non-null; it signifies that none of the specified listener's objects will
                    receive notifications.
    @param      inEvent
                    The event to be delivered.
    @result     An OSStatus error code.
*/

:-)

AUEventListenerNotify() is failing with paramErr if mEventType = kAudioUnitEvent_PropertyChange.

I also wouldn't call this "abusing" :) - it is really the kind of use that the API was provided for...

Unfortunately, switching to the kAudioUnitEvent_ParameterValueChange version doesn't seem to work b/c faking the mAudioUnit parameter by casting a non-ComponentInstance pointer into it is failing in the call to AUEventListenerAddEventType() when setting up the listener.

yes - because the event listener is trying to get parameter information about the parameter you've provided

Figured that was the case.


Fair enough, I was abusing the API (test project!).  I was doing so because it is a convenient API to use for sending messages from the render thread callback to my main thread, on the assumption that the underlying mechanism was implemented in a "don't take locks on the RT thread if at all possible" way.

Yep - it is :)

stephen
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >bastardizing AUEventListenerNotify() no longer working? (From: Stephen Davis <email@hidden>)
 >Re: bastardizing AUEventListenerNotify() no longer working? (From: William Stewart <email@hidden>)

  • Prev by Date: Re: Re: iPhone input/output sampling rates
  • Next by Date: Preparing audio file data for an FFT
  • Previous by thread: Re: bastardizing AUEventListenerNotify() no longer working?
  • Next by thread: iPhone input/output sampling rates
  • Index(es):
    • Date
    • Thread