kylemcdonald / ofxEdsdk

Interfacing with Canon cameras from openFrameworks for OSX. An alternative to ofxCanon and CanonCameraWrapper.
Other
112 stars 51 forks source link

Support for OSX v2.12? #8

Closed bakercp closed 10 years ago

bakercp commented 11 years ago

Hey there, I just got EDSDK 2.12 installed and it recognizes that a camera is attached but then hangs indefinitely. I tried the sample programs included with the sdk and they worked nicely. Before I dig too far, do you have any tips on what to check first?

kylemcdonald commented 11 years ago

i haven't tested 2.12 yet, but i know @laserpilot has been doing some experimentation. i also have heard that some of the other addons don't hang w 2.12, so something in my setup routine probably needs to be updated.

roymacdonald commented 11 years ago

Hi Kyle, I've been trying to make this work with edsdk v2.12, as I need to use a canon t3i. Unfortunately canon is not providing download links to the previous versions which support the t3i. I only have an older version that doesn't support it. Yet, there seems to be a problem in the edsOpenSession() method. It gets stuck there. After trying lots of things by trying to replicate the behaviour in the sdk sample I found out that the problem might be thread related. If you go to ofxEdsdk.cpp in Camera::setup(int deviceId) { change startThread(true, false); to startThread(false, false); The app runs, the camera session is openned, you get the liveView working and you are able to take photos but the app is just leaking. :(
log message: ofxEdsdkExampleDebug[24907:490f] *** __NSAutoreleaseNoPool(): Object 0x3631130 of class NSCFNumber autoreleased with no pool in place - just leaking

Also if you set startThread(true, false); to startThread(true, true); It appears that the thread is waiting for an external mutex to be unlocked.

I'll try to figure out what's the problem. If you have any clue please let me know. Best!

BTW, do you have a copy of edsdk v2.10 or 2.11 that you can share with me.

laserpilot commented 11 years ago

Roy, I just sent you an email with a link to those EDSDK's if you want to have a look. I think someone working without ofxEDSDK was having a similar issue, so their sdk may still be buggy...

roymacdonald commented 11 years ago

@laserpilot Just received your email. thanks! Yeah, after googling for a while I found that other people were having trouble as well with the sdk. It appears that canon introduced a bug in 2.11. and has not got rid of it.

bakercp commented 11 years ago

Hey @laserpilot would you mind sharing the older SDK w/ me as well? Thanks.

badgeek commented 11 years ago

hi @laserpilot would you mind to send me the link of the old sdk ? thanks

roymacdonald commented 11 years ago

Hey guys, So if fixed the thing and have it running on both win and mac with edsdk v2.12 Check it here: https://github.com/roymacdonald/ofxEdsdk/tree/fix-2.12

Essentially there are three issues: all of these are part of ofxEdsdk::Camera 1.- ofxEdsdk::Camera::update() needs to happen only if the camera is connected (there was some problem with the lock going on before being conected). 2.- Everything tends to hang if Eds::StartLiveview(camera); is called after Eds::OpenSession(camera); in the threaded function. I'm not really sure what's going on but it seems to work. 3.There seems to be a leaking object inside the edsdk lib. (well actually it is there as a leak inspection revealed), because there's no autorelease pool. I added some #ifdef so to create an autorelease pool.

@kylemcdonald should I PR?

kylemcdonald commented 11 years ago

yes, please PR and i review the changes easier

roymacdonald commented 11 years ago

Hey guys, Kyle just merged my PR. It works with edsdk v2.12 on both mac and win. Please check it and let me know if there is any problem with it. Usage remains the same. Best!

kylemcdonald commented 10 years ago

because 2.14 is supported i'm closing this issue.