Re: Some AudioUnits crash WhackedTV sample code
Re: Some AudioUnits crash WhackedTV sample code
- Subject: Re: Some AudioUnits crash WhackedTV sample code
- From: William Stewart <email@hidden>
- Date: Tue, 21 Mar 2006 18:52:19 -0800
John, Robert,
Ok after a couple of false starts, I've now diagnosed the problem -
the F8 AU helped me to reproduce this very easily.
The GenericView has a wonderful feature (!), where it examines the
AU, and if the AU publishes alot of parameters, it is able to
assemble its UI in a separate thread, then the init method returns.
So, if the next call is to "show expert params" - this has the exact
same crash and affect as you would see below (ie. if you called this
method on an instance of the GenericView that hadn't been initialised
properly).
Of course, as its a threading problem, its a little non-
deterministic, and AUs that don't reach the threshold wouldn't
trigger this problem.
I've a bug already (<rdar://problem/4481332> AUGenericView crashes
loading an AudioUnit) that I can use to track this (obviously, we
shouldn't be crashing here!) - in the meantime I'd suggest taking
this line of code out of the whacked TV sample code. The view will
give you a UI widget in any case to show expert params if they are
there, so functionally, you don't really lose anything.
Thanks for your comments and reports
Bill
On 20/03/2006, at 7:16 PM, William Stewart wrote:
On 20/03/2006, at 7:07 PM, john wrote:
Hi Bill,
On the other hand, I have always used the correct code you have
below and I get a crash on the call the setShowsExpertParameters
with the F8 audiounit.
I would love a radar - http://bugreporter.apple.com
Thanks!
Bill
-- John
Robert,
I've reproduced the crash by making the following change in AULab:
Originally it is like this:
AUGenericView *viewToShow = [[[AUGenericView alloc]
initWithAudioUnit:mCurrentAU] autorelease];
Now, I change it to this:
AUGenericView *viewToShow = [[AUGenericView alloc] autorelease];
[viewToShow setShowsExpertParameters: YES];
[viewToShow initWithAudioUnit:mCurrentAU];
And I get a crash - with ANY AU - yours, Apple's, etc. The reason
being, that I am calling a method on the object BEFORE I have
called the init... method - so the setShows... method is
expecting state to be initialised that isn't until the init
method is called.
I think the Cocoa convention is such that init methods should be
called before any other instance method. We can probably make the
generic view more robust here, but I don't think that is the
primary culprit.
If I change the code to do this:
AUGenericView *viewToShow = [[[AUGenericView alloc]
initWithAudioUnit:mCurrentAU] autorelease];
[viewToShow setShowsExpertParameters: YES];
Then everything is also fine...
If you make that change in the whacked TV code - then it should
also be fine. I'll send the bug over to the QT team.
Thanks
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
______________________________________________________________________
____
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
______________________________________________________________________
____
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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