• 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: AUEventListenerNotify paramErr for PropertyChange events on Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AUEventListenerNotify paramErr for PropertyChange events on Leopard


  • Subject: Re: AUEventListenerNotify paramErr for PropertyChange events on Leopard
  • From: William Stewart <email@hidden>
  • Date: Thu, 6 Dec 2007 12:47:15 -0800

response below

On Dec 5, 2007, at 7:19 PM, William Stewart wrote:


On Dec 5, 2007, at 6:59 PM, Sophia Poirier [dfx] wrote:

On Dec 5, 2007, at 9:46 PM, William Stewart wrote:

You shouldn't need to make this call from within an AU - all you need to do there is call the AUBase::PropertyChanged method (which in turn will turn around and call of the registered property change listeners iwth the AU).

Oh hmmm, I thought it had to do with not blocking a render thread, that it was better to call AUEventListenerNotify() if you're sending the property change from within audio rendering. Am I incorrect about this and is PropertyChanged() in actually fine for that?

Its more on the listening end for properties. The property changed notify is executed on the thread you issue it on, but the real trouble can start when that callback is executed. So, for instance a view that is listening for property changes, should definitely be using the EventListener (otherwise those callbacks would execute on the render thread in this case).


When you instantiate a listener using the event listener (say your view), the event listener installs a property listener on the AU. When that property listener is called, it doesn't call the event listeners, but rather just registers that the property has changed, and sets the wheels in motion so that the actual event listeners will fire on their appropriate threads.

That said, we will look into this (as there's nothing here that looks obviously wrong to me

Thank you.

We normally don't expect the ListenerNotify to be called from property changes, so that could be why you are seeing a discrepancy here


Bill

On Dec 5, 2007, at 6:46 PM, William Stewart wrote:

Sohia

You shouldn't need to make this call from within an AU - all you need to do there is call the AUBase::PropertyChanged method (which in turn will turn around and call of the registered property change listeners iwth the AU). That said, we will look into this (as there's nothing here that looks obviously wrong to me)

Bill

On Dec 5, 2007, at 6:04 PM, Sophia Poirier [dfx] wrote:

I am experiencing a problem with AUEventListenerNotify() only in Leopard (10.5.1 specifically). It seems that, no matter how I try to do it, I am always getting paramErr returned from AUEventListenerNotify() when I try to do a kAudioUnitEvent_PropertyChange event. A basic example from an AUEffectBase-derived AU for me is looking something like this:

AudioUnitEvent auEvent = {0};
auEvent.mEventType = kAudioUnitEvent_PropertyChange;
auEvent.mArgument.mProperty.mAudioUnit = GetComponentInstance();
auEvent.mArgument.mProperty.mPropertyID = somePropertyID;
auEvent.mArgument.mProperty.mScope = kAudioUnitScope_Global;
auEvent.mArgument.mProperty.mElement = 0;
OSStatus status = AUEventListenerNotify(NULL, NULL, &auEvent);

I am getting -50 (paramErr) returned always. I started seeing this with custom property IDs, so I tried using some of the AU standard ones and saw the same results. I then tried experimenting with not making the first two arguments NULL (sometimes making both not NULL, sometimes just trying to do that with one of them), and still always paramErr. When I say experimented with those, I mean that I created an AUEventListenerRef object successfully and passed the resulting one and the same "refcon" object to the call to AUEventListenerNotify(), but still no success.

However, if I go and try doing almost identical code but with a kAudioUnitEvent_ParameterChange event type, then I get 0 (noErr) returned.

I'm trying my best but simply can't find anything that I might be doing wrong, so I'm wondering: Has anything changed in the Leopard implementation of AUEventListenerNotify() that might explain this? Am I possibly doing something incorrectly that Leopard is more stringent in handling? Or is there possibly a bug with this in Leopard?

thanks,
Sophia



The code is explicitly checking for a property change event and returning a parameter error. This will be because of the reasons I discuss above. I will add a comment to the header doc that explains this.

Thanks

Bill




_______________________________________________ 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: 
 >AUEventListenerNotify paramErr for PropertyChange events on Leopard (From: "Sophia Poirier [dfx]" <email@hidden>)
 >Re: AUEventListenerNotify paramErr for PropertyChange events on Leopard (From: William Stewart <email@hidden>)

  • Prev by Date: Re: Validity of ACC Convertor Bitrate Values from kAudioConverterAvailableEncodeBitRates
  • Next by Date: Re: Problems when changing sample rate on a aggregate device
  • Previous by thread: Re: AUEventListenerNotify paramErr for PropertyChange events on Leopard
  • Next by thread: Sending NoteOff Events to the Internal Synth
  • Index(es):
    • Date
    • Thread