Log in or register to post comments

long statup time in custom project

May 4, 2012 - 5:42am #1

Hello qcar team,

first of all: thanks for sharing this great framework. I'm more than impressed with the performance and stability compared to other solutions I've tried.

This is my setup:
XCode 4.3.2.
OSX 10.7.3
iPad 2 without mobile network
qcar 1.5.8 native toolkit as it appears in the ImageTargets Sample App
iOS 5.1.

I've compiled and tested the ImageTargets demo app on my app, which works fine. Startup time (meaning the time until there's actual video content displayed on the screen) is around 1-2 seconds which is great.

I've now done some modifications to the ImageTargets app essentially stripping out all functions I don't need. Startup time stayed at around 1-2 seconds.

After that I copied the project files as well as the libQCAR.a with its header files to an already existing project I need to integrate the tracking into. In this new project the startup time now suddenly goes up to 10 seconds. This is the trace from the console (the NSLogs commands of the sample app have stayed pretty much untouched):

2012-05-04 14:24:20.056 cma[16379:5307] INFO/AR(16379) 2012-05-04 14:24:20: QCAR SDK version 1.5.8
2012-05-04 14:24:20.434 cma[16379:707] ARParentVC: appeared
2012-05-04 14:24:20.435 cma[16379:707] ARVC: viewDidAppear
2012-05-04 14:24:30.137 cma[16379:707] APPSTATUS_INIT_TRACKER
2012-05-04 14:24:30.147 cma[16379:707] Successfully initialized ImageTracker.

You can see a 10 second gap between the arvc appearing and the QCARUtiles reporting that the tracker has been initialized. After tracking has started, all si fine.

The only thing I can imagine going wrong here, might be some compiler settings. The only obvious difference between the sample app and my new project is, that I'm using automated reference counting on the new project. I've tried switching that off, but it does not make a difference.

Are there possibly any more hidden settings I need to find and adjust? Or do you have any other ideas why the starting up takes such a long time?

Any help is much apreciated!

David

Re: long statup time in custom project

May 7, 2012 - 9:55am #4

Just wanted to check back and say that it works now. I have not clue whatsoever I might've changed. I was working on a completely different part of the app, switched back to the master branch to check something and then it worked.. Possibly just another episode of the good old XCode fun. Thanks for responding anyway!

Re: long statup time in custom project

May 5, 2012 - 9:57am #3

Hello Kim,

thanks for your fast reply. I'm actually using the QCARUtils provided in the sample project, so the init is run on the background thread. Also the interface still works during the initialization, which is a sign that is is actually being run on the background thread.

I have found this call to be the one taking 10 seconds:
QCAR::init();

Also in this loop:

NSInteger initSuccess = 0;
do {
initSuccess = QCAR::init();
NSLog(@"%i", initSuccess);
} while (0 initSuccess);

I have found, that it actually stops at QCAR::init() and only exits the function and returns 100 once. I thought the loop would run numerous times and count from 0 to 100 depending on how fast qcar initializes it self. There must be some part in the init where it hangs.

Concerning debuggers: Afaik I have the lldb debugger running on both projects. At least the ImageTargets project has the exact same settings it is distributed with and I think it has lldb enabled, correct me if I'm wrong.

Do you have any more ideas?

Thanks again

David

Re: long statup time in custom project

May 4, 2012 - 1:38pm #2

Do you happen to be running with a debugger attached in the new project (and weren't before)? This can increase load times.

Also, note that in the samples initQCAR and loadTracker are run on a background thread (see QCARutils.mm). Have you done something similar for your project?

- Kim

Log in or register to post comments