esskar / Canon.Eos.Framework

Currently, this project is not under development. Time is not my friend.
MIT License
66 stars 33 forks source link

Issue with stopping the live view #12

Open TechGeek opened 12 years ago

TechGeek commented 12 years ago

I am having problems with stopping the live view. I am using 1100D, latest framework and EDSDK 2.10. The CameraCockpit application will crash when I try to stop the live view.

Any idea?

esskar commented 12 years ago

Hi. Let me get back to this. My camera broke, so i had to get it fixed.

simonbuehler commented 12 years ago

here i just hangs in

protected void SetPropertyIntegerData(uint propertyId, long data) { this.ExecuteSetter(() => Util.Assert(Edsdk.EdsSetPropertyData(this.Handle, propertyId, 0, Marshal.SizeOf(typeof(uint)), (uint)data), string.Format("Failed to set property integer data: propertyId {0}, data {1}", propertyId, data), propertyId, data)); }

with propertyID = 1280 and data = 0

TechGeek commented 12 years ago

Yes. I have trace the code too. When stopping the live view, this.LiveViewDevice = 0;

Any solution?

Bill-Lea commented 12 years ago

I have not tried thios but my question is why is data defines as along one place and a uint in another?

TechGeek commented 12 years ago

I have changed the parameter type to uint but it still hangs...

protected void SetPropertyIntegerData(uint propertyId, uint data)

simonbuehler commented 12 years ago

i have the feeling its a threading issue, shouldn't be there something like a thread.join before and then set the device to null?

esskar commented 12 years ago

the uint to long conversion is not an issue. but uint is not CLS Compliant, thats why i tended to use long for the public API

Bill-Lea commented 12 years ago

I had a bit of trouble getting the latest version to compile but once it did compile I was unable to duplicate the crashing problem,. True, when you exit live view the last live view image is not erased but the camera will reenter live view and or take a picture with only the aoto-focus failure problem. I don't consider this to be a problem of the software so it seems all is working at least for me. I'm using a Canon EOS 7d and compiling using Visual Studio 11 beta. I didn't think to check what version of .Net i was using. Still It looks like its working OK in my configuration.

I have had a lot of trouble with types in the software for the Olympus E-500 so when ever I see different type I worry. I should have tried to duplicate the problem before suggesting a cure. Sorry for any confusion.

And sorry for this pseudo answer -- it works for me is certainly not what you want to hear. If you were wondering what my problem was - I had to coppy all the DLL's into various places and I had to recreate a excetion file as mentioned in one other issue. .

simonbuehler commented 12 years ago

i tried again to fix it but i see random hangs which for me means that there is a timing/racing/threading issue

one thread tries to DownloadEvf() via a background thread and the other tries to set SetPropertyIntegerData the device back to TFT i think those two threads must be synced so they don't block each other but i didn't find a way, any idea @esskar ?

crea-doo commented 12 years ago

I also tried to fix that and I've found a partial fix. The app now isn't crashing on stopping the live view but stopping the live view doesn't work everytime you try. I've forked the project under http://github.com/crea-doo/Canon.Eos.Framework/ - so try it out and maybe you'll find a better fix...

esskar commented 12 years ago

thanks. i do not have any Eos Camera at hand and i'am busy at work. I hope to get back to this soon.

simonbuehler commented 12 years ago

i compared other c# wrappers and found that DownloadEvf isn't threadsafe, so the correct way is to add a boolean like _cancelLiveviewRequested and breaking the download loop on this condition. Then one can set the liveviewdevice to none and everything is ok