Re: FCPX: Alert dialog and FPS issues
Re: FCPX: Alert dialog and FPS issues
- Subject: Re: FCPX: Alert dialog and FPS issues
- From: Paul Miller <email@hidden>
- Date: Fri, 20 Jan 2012 13:18:20 -0600
On 1/20/2012 12:51 PM, Darrin Cardani wrote:
Is this for a registration dialog or something? (I ask because I know
you guys don't do much custom UI stuff.) If so, would launching a
separate app be an acceptable solution until we get this fixed?
Won't launching a separate app (and waiting on it) cause similar
dead-locks? I ask because I'm having similar looking dead-locks when
attempting to set parameter values after returning from my app.
Darrin
On Jan 20, 2012, at 10:31 AM, Peter Litwinowicz wrote:
Any suggestion on what to do if we do need a modal dialog box? Not
sure how to run that without "servicing the run loop".
Pete
From: Paul Schneider <email@hidden <mailto:email@hidden>>
Date: Thu, 19 Jan 2012 14:59:21 -0800
To: Garrick Meeker <email@hidden
<mailto:email@hidden>>
Cc: <email@hidden <mailto:email@hidden>>
Subject: Re: FCPX: Alert dialog and FPS issues
Thanks, Garrick.
From the stack, it looks like the problem is that running a modal
dialog causes us to process events inside -parameterChanged. This
leads us to service timers that apparently we weren't expecting to run
until "later".
Attaching a sheet and avoiding servicing the run loop inside
-parameterChanged seems like a good workaround until we can address
the issue.
On Jan 19, 2012, at 2:53 PM, Garrick Meeker wrote:
I tried a couple variations with FxWindowAPI. I'll skip the window
creation code but running it like this still hangs:
[NSApp runModalForWindow: win];
as does this:
[win center];
[win makeKeyAndOrderFront: win];
_shouldKeepRunning = true;
NSRunLoop *theRL = [NSRunLoop currentRunLoop];
//while (_shouldKeepRunning && [theRL runMode:NSModalPanelRunLoopMode
beforeDate:[NSDate distantFuture]]);
while (_shouldKeepRunning && [theRL runMode:NSDefaultRunLoopMode
beforeDate:[NSDate distantFuture]]);
(I wasn't sure if I needed to add something for modal to work, but I
would expect the default mode to work.)
However, I realized that a work around is to just display this like a
sheet (that is, use the current run loop implicitly).
At the end of our plugin, check if a message is pending. If so:
Create the window:
NSWindow *win = [windowAPI createWindowWithContentRect:NSMakeRect(0,
0, 446, 244)];
NSButton *button = [[[NSButton alloc] initWithFrame:NSMakeRect(331,
12, 95, 32)] autorelease];
NSTextField *text = [[[NSTextField alloc] initWithFrame:
NSMakeRect(24, 156, 402, 67)] autorelease];
// etc...
Display:
_dialog = win;
[win center];
[win makeKeyAndOrderFront: win];
Exit from our plugin.
When OK is clicked:
[windowAPI destroyWindow: _dialog];
_dialog = NULL;
This might be harder if you have existing UI code, so someone else
might care about having this fixed. However, this method using
FxWindowAPI makes our message dialog have the same look and feel.
On Jan 18, 2012, at 10:30 AM, Darrin Cardani wrote:
OK, thanks everyone for the additional information. We'll look into it.
One option, which I haven't tried, may be to use the FxWindowAPI and
run the current run loop in NSModalPanelRunLoopMode.
Darrin
On Jan 17, 2012, at 4:08 PM, Garrick Meeker wrote:
I just ran into this too. Is the call to
NSRunInformationalAlertPanel okay or do we need to use FxWindowAPI?
I'm not sure how to use that modally.
#0 0x00007fff8706cdc2 in semaphore_wait_signal_trap ()
#1 0x00007fff8707240d in pthread_mutex_lock ()
#2 0x00000001007ad455 in -[FFEffect channelFolder] ()
#3 0x00000001007aab70 in -[FFEffect enabled] ()
#4 0x0000000100dae511 in -[FFColorFolderLabelController update] ()
#5 0x00007fff84ef8123 in -[NSArray makeObjectsPerformSelector:] ()
#6 0x000000010284a98f in -[OZViewControllerGroup update] ()
#7 0x000000010285a159 in -[OZLabeledParamController update] ()
#8 0x00007fff84ef8123 in -[NSArray makeObjectsPerformSelector:] ()
#9 0x000000010284a98f in -[OZViewControllerGroup update] ()
#10 0x00007fff84ef8123 in -[NSArray makeObjectsPerformSelector:] ()
#11 0x000000010284a98f in -[OZViewControllerGroup update] ()
#12 0x0000000100972eef in -[FFInspectorModuleChannels
_updateChannels] ()
#13 0x00007fff8868f45f in __NSThreadPerformPerform ()
#14 0x00007fff84ed53d1 in __CFRunLoopDoSources0 ()
#15 0x00007fff84ed35c9 in __CFRunLoopRun ()
#16 0x00007fff84ed2d8f in CFRunLoopRunSpecific ()
#17 0x00007fff8a40e7ee in RunCurrentEventLoopInMode ()
#18 0x00007fff8a40e551 in ReceiveNextEventCommon ()
#19 0x00007fff8a40e4ac in BlockUntilNextEventMatchingListInMode ()
#20 0x00007fff897e3eb2 in _DPSNextEvent ()
#21 0x00007fff897e3801 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#22 0x00007fff89a1edc3 in -[NSApplication _realDoModalLoop:peek:] ()
#23 0x00007fff89a1c951 in -[NSApplication runModalForWindow:] ()
#24 0x00007fff89a3a0ec in _NXDoLocalRunAlertPanel ()
#25 0x00007fff89a3a769 in NSRunInformationalAlertPanel ()
...
#29 0x000000012d1679f6 in -[...FxFilter parameterChanged:]
(self=0x11e50b430, _cmd=0x7fff87a88394, parmId=100)
#30 0x0000000117a12440 in -[OZFxPlugParameterHandler
sendNotifications:] ()
#31 0x0000000117c5fbb4 in OZFxPlugSharedBase::notify ()
#32 0x00000001177efb5a in
OZNotificationManager::processNotifications ()
#33 0x0000000117346f4d in -[MEViewCtlrDelegateWrapper
controller:didChangeChannel:] ()
#34 0x0000000102848f79 in -[OZViewController didChangeChannel] ()
#35 0x00000001028760d8 in -[OZChanBoolController setChannelValue:] ()
#36 0x00007fff89938eda in -[NSApplication sendAction:to:from:] ()
#37 0x00000001002f77ed in -[NSProApplication sendAction:to:from:] ()
#38 0x00000001008c49f8 in -[FFApplication sendAction:to:from:] ()
#39 0x00007fff89938e39 in -[NSControl sendAction:to:] ()
#40 0x00007fff899c484b in -[NSCell
trackMouse:inRect:ofView:untilMouseUp:] ()
#41 0x00007fff899f537a in -[NSButtonCell
trackMouse:inRect:ofView:untilMouseUp:] ()
#42 0x00000001003395cd in -[NSProButtonCell
trackMouse:inRect:ofView:untilMouseUp:] ()
#43 0x00007fff899c32f5 in -[NSControl mouseDown:] ()
#44 0x00007fff898dd3a7 in -[NSWindow sendEvent:] ()
#45 0x000000010031d987 in -[NSProWindow sendEvent:] ()
#46 0x00007fff89812afa in -[NSApplication sendEvent:] ()
#47 0x00000001002f8f48 in -[NSProApplication sendEvent:] ()
#48 0x00000001008c4273 in -[FFApplication sendEvent:] ()
#49 0x00007fff897a96de in -[NSApplication run] ()
#50 0x00000001002fa04b in NSProApplicationMain ()
#51 0x0000000100001478 in start ()
On Jan 17, 2012, at 1:38 PM, Darrin Cardani wrote:
Actually, Paul just pointed out that -parameterChanged: should
only be called on the main thread. Can you stop in the debugger
and see if it's happening on a non-UI thread? If so, that's a bug.
If not, we'll need to figure out what's causing the hang.
Thanks,
Darrin
On Jan 17, 2012, at 9:04 AM, Darrin Cardani wrote:
Ganga,
In the first case, you're probably getting a -parameterChanged:
call on a thread other than the main thread in FCPX. If that's
the case, you'll need to run your alert panel on the main thread,
perhaps using [-NSObject performSelector:onMainThread:].
The timingAPI issue is a known bug that should be fixed in a
future release.
By the way, I saw your other questions. I'll try to get an answer
for you this week. I've been on vacation for the last 3 weeks, so
sorry for the slow response.
Darrin
On Jan 3, 2012, at 6:05 AM, ganga wrote:
Hi all,
I'm working on FxPlug filter for FCPX. I noticed that, FCPX
hangs most of the times if I call NSRunAlertPanel from
parameterChanged method (some times it worked perfectly). Same
code works in Motion 5 all the time. Does anyone know about this
issue?
I also noticed that timingAPI returns fps of motion template
instead of current FCPX project. I am using
timelineFpsNumeratorForEffect and
timelineFpsDenominatorForEffect APIs. Is there any other way to
get fps associated with FCPX project?
Regards
Gangaraju
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden
<mailto:email@hidden>)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden <mailto:email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden
<mailto:email@hidden>)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden <mailto:email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden
<mailto:email@hidden>)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
<mailto:email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden
<mailto:email@hidden>)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden <mailto:email@hidden>
_______________________________________________ Do not post admin
requests to the list. They will be ignored. Pro-apps-dev mailing list
(email@hidden <mailto:email@hidden>)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden <mailto:email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden
<mailto:email@hidden>)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden