CVTools plugin won't load in screensaver on 10.6.7

Peter's picture

Hi Kineme Community,

I stumbled accross the VCTools plugin and fell in love with it but unfortunately when I copy the example compositions from the CVTools into my screensaver directory, the CVTools plugin won't load.

Including the .qtx into an XCode sceensaver project reveals the following in the NSLogs during startup:

6/5/11 3:28:03 AM   System Preferences[853]   *** <QCNodeManager | namespace = "com.apple.QuartzComposer" | 349 nodes>: Could not load bundle at path "/Library/Graphics/Quartz Composer Patches/CVTools.plugin" (Error Domain=NSCocoaErrorDomain Code=3586 UserInfo=0x200858dc0 "The bundle “CVTools” couldn’t be loaded because it isn’t compatible with the current application." (dlopen_preflight(/Library/Graphics/Quartz Composer Patches/CVTools.plugin/Contents/MacOS/CVTools): no suitable image found.  Did find:
   /Library/Graphics/Quartz Composer Patches/CVTools.plugin/Contents/MacOS/CVTools: GC capability mismatch))

Maybe I am completely wrong but I think the VCTools plugin has been compiled without support for garbage collection and Snow Leopard doesn't like that when running a screensaver. (Running the .qtx files on the desktop works without issues...)

Is it possible to get the VCTools compiled with support for garbage collection based on the new OpenVC sources? If the source code for this plugin is available, I would love to give it a try too.

Any comments, help, tricks & special moves to get this to work is much appreciated.

Thanks for you help!

Peter's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Ideas anyone?

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Couple of points... the files are "qtz", and the plugin is CVTools, not VCTools (guessing these are typos.)

It probably won't load in the Screensaver thing because of something called "Safe Mode", which precludes plugins not marked as being "safe" from loading in environments that require it (like, probably, the Screensaver Prefs thing.)

So, CVTools could be marked as being "safe" in the plugin project (probably not a good idea), or you could install the kinemecore.plugin patch and mark it as safe for various apps in your install, by using it's special prefs.

Peter's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Thanks for your comment. (…and sorry for the typos.)

Unfortunately, I am not able to select the DesktopScreenEffectsPref.prefPane as application under the "Unsave Mode" section. I didn't test to run other Kineme plugins as screensaver so far, will do that shortly.

I do get the same error by just copying the example CVTools composition into my screensaver folder:

6/6/11 7:34:21 PM System Preferences[1061] *** : Could not load bundle at path "/Library/Graphics/Quartz Composer Patches/CVTools.plugin" (Error Domain=NSCocoaErrorDomain Code=3586 UserInfo=0x200e60b00 "The bundle “CVTools” couldn’t be loaded because it isn’t compatible with the current application." (dlopen_preflight(/Library/Graphics/Quartz Composer Patches/CVTools.plugin/Contents/MacOS/CVTools): no suitable image found. Did find: /Library/Graphics/Quartz Composer Patches/CVTools.plugin/Contents/MacOS/CVTools: GC capability mismatch))

I know that previous versions of OpenCV didn't support garbage collection, so I assume that the CVTools.plugin didn't get build to support that. Maybe even the latest version don't support GC as well, however if I use the latest OpenCV 2 sources to build an app in XCode with GC support on then I don't run into any issues.

Any more ideas on what to try?

Thanks again for all your help! -Peter

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

It should come up as "ScreenSaverEngine", not DesktopScreenEffectsPref.prefPane.

It looks like if you do this, and open up System Preferences in 32 bit mode, it works.

errr, what plugins/patches for QC actually do use garbage collection?

Peter's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Thanks for looking into this but unfortunately I do end up with the same error...

I marked all the plugins as safe for the SystemPreferences and Screensaver engine, saved the composition and checked the box to run SystemPreferences in 32bit, restarted, still no luck.

The video will show, just the face detection part won't load (same NSLog errors).

Anything that I missed?

Thanks again.

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Nope, I'm just wrong; it renders fine in the SystemPreferences preview, just not when the actual ScreenSaver is triggered.

For clarification, this is what I mean:

I'm taking the CVTools Point Flow example, and hooking up an lfo where the mouse click would be connected. I turn the lfo to square wave so that it automatically refreshes the chain.

By turning System Prefs to 32 bit, and also enabling Safe Mode for GL Tools and CV Tools, the composition loads ok in the System Preferences app preview window, but not when I trigger actual ScreenSaver engine. So, yeah, maybe you're correct about garbage collection stuff, but it seems really crappy if that's the case. I wonder why the ScreenSaver engine opts in for that...

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Well...

I went into the ScreenSaver.framework. Inside of that is the actual ScreenSaverEngine.app. Triggering that to 32-bit... makes no difference, which is really obnoxious. Furthermore, when one actually hits "test" in system preferences, stuff DOES work.

Sorry, not helping any with this, just reporting some more quirks. It's obnoxious for stuff like that to break and not have any workarounds. It's not like hamstringing the way that works is advantageous to anyone... a head scratcher for sure.

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Hmm, kinemecore safe-mode thingy isn't actually working at all.

6/6/11 9:55:28 PM ScreenSaverEngine[1670] *** Message from : Cannot create connection from ["outputValue" @ "LFO_1"] to ["inputUseInputPointsSignal" @ "OpenCVCalcOpticalFlowPyrLK_1"]

CVTools isn't loading (most likely) according to Console; everything that connects to those patches is failing to connect.... I even checked file path to make sure I had the correct versions of ScreenSaverEngine and SystemPrefs. yep.

I guess a build of CVTools marked as safe may (or may not?) reveal whether or not garbage collection is an actual issue or not... I would expect the patches to restore regardless of garbage collection being an issue though. I still suspect it's a safe mode problem.

Peter's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

I ran a simple test myself to proof my theory.

I created a small official QC plugin (which is considered safe by the OS, right?) the plugin outputs a string that you feed in (input string = output string), default value is "Hello World!".

One version is build with support for GC and the other one without.

Both are working fine when using in Quartz composer only.

Now using the one without GC and running a test composition as screensaver.

It shows "Hello World!" but I used the input string "Do you see me? GC is supported" -> The plugin, doesn't work.

Doing the same but using the plugin with GC support presents me "Do you see me? GC is supported" -> Works!

I will attach the files to this post. -Peter

PreviewAttachmentSize
TestMeQTZ.zip2 KB
PluginWithGCSupport.zip4.86 KB
PluginNoGCSupport.zip4.85 KB

Peter's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

I forgot to attach the XCode project...

PreviewAttachmentSize
QCPluginTestSource.zip23.2 KB

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

I don't think it's garbage collection that's the issue. This isn't a QCPlugin, and the same rules don't quite apply (though I admit, I haven't looked at your plugin/zip test, or tested what QCPlugin does... only what a QCPatch does - what you're actually trying to load).

I've tested this; I can create a qtz with a clear and GL Point. This restores and plays fine in the System Prefs or the Screensaver engine. I don't believe GL Tools uses garbage collection. The GL Point is marked as safe though, in the actual code of the plugin, as opposed to having to rely on the kinemecore option.

So, the problem is probably with kinemecore's safe mode over-ride stuff not working anymore for some reason (?). It looks like maybe if CVTools's patches were marked as safe, in the project itself, it may work. As an outlier, there may also be something problematic with the CVTools (and Particle Tools, and K3D) special ports. They don't load into the patch list, and thusly can't get a safe mode over-ride. This may be causing stuff not to load in those environments, even though many of the patches are theoretically being marked as safe. Without more testing, I'm uncertain.

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

After some more testing:

-Kinemecore's safe mode workaround stuff is not seeming to work as it used to. Perhaps this can be fixed at some point. On my system, it doesn't seem to allow a patch not marked as safe to load as safe.

-I'm 99.9999% certain that CVTools's patches could be manually updated to work in safe mode. The result would load as a Screensaver, with compositions working the way you would expect.

I think that you should definitely consider putting in a feature request, or consider commissioning this if you need a quick turnaround, at info@kineme.net

cwright's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

gtoledo3 wrote:
I don't think it's garbage collection that's the issue. This isn't a QCPlugin, and the same rules don't quite apply

you are wrong. GC is ABSOLUTELY REQUIRED to be enabled/supported to even load the binary into the process' address space as linked, executable code. CVTools is not compiled (by kineme) with GC enabled, ergo it CANNOT be loaded by GC-requiring applications (Screen Saver Engine and ... System Preferences I guess?).

if the code isn't loaded (due to a GC failure) then it doesn't matter at all whether the patch is marked safe or not because it isn't loaded, and thus cannot be asked about safety.

This is true of the supported API as well, though there are fewer places where GC and the supported API coincide.

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

In 32 bit mode, System Preferences/ScreenSaverEngine will absolutely load it if the patches are explicitly marked as safe.

In 64 bit mode, you are absolutely correct.

If the patches aren't marked as safe, they won't load in 64 bit mode either. I see that if garbage collection issue prevent the loading that kinemecore could possibly be failing... sooo, yeah, I'm getting why it's a garbage collection thing as well.

gtoledo3's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Yep, gc enabled, no safe mode stuff manual in CVTools, kinemecore's safemode works fine. cwright is impeccably correct, and I was sidetracked. At the end of the day, gc needs to be enabled to work in screensaver, and safe mode does not, being able to be controlled successfully with k-core once gc is working.

Peter's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Thanks everyone for looking into this! I really appreciate your help.

-Peter

jstrecker's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Thanks for the suggestion. We've just released a new version of CVTools (0.3) that will let you create screensavers.

Peter's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Thank you so much for looking into this and for all your help. Unfortunately, I am still not able to use the CVTools in a screensaver environment. I am still getting the very same error message in the NSLogs.

Is there something that I miss, did someone got it to work? If so, how?

Thanks again. -Peter

jstrecker's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Please try downloading it again. There was a problem with the plugin file, but now it should be fixed. I'm attaching a screensaver composition that worked for me (basically the test that @gtoledo3 described).

PreviewAttachmentSize
cvtools-point-flow screensaver.qtz3.9 KB

Peter's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Thanks again for all your help, it works! :) Out of curiosity, what was wrong with the plugin file?

-Peter

jstrecker's picture
Re: CVTools plugin won't load in screensaver on 10.6.7

Oh, just a silly mistake on my part. The Xcode project had multiple build configurations. I added GC support on only one, and it was not the one used when building the released plugin.