Saturday, July 21, 2012

M9Tether 2.2c released

A very minor release with two small memory bugfixes.

The program still suffered from freezes on my Windows 7 64-bit, and after extensive attempts to find the cause, or to even confirm this was just a problem on 64-bit, I had hardly made any progress with this problem.

Technically it isn't a freeze by the way. What happens is that the PTP event system fails. It's unclear if that originates in the camera or in the middle layer on the PC. The signal 'photo ready' isn't sent anymore (or at least not received).

But then, if you change say the ISO setting on the camera (which also causes an event to fire), all the previous events come in one go.

It's not so much a freeze, more of a pile up, like they're quite literally stuck, waiting to be released.

Then after running some additional debugging tools, I did find two lines of code that might have been responsible. I say 'might', because the bug didn't show up always before the fix. It's one of those things... You could snap away ten times and then the eleventh time events would get stuck. And those numbers differed constantly. So testing if the bug is really gone is almost impossible. You can only confirm it's still there (when it happens again), but not really confirm it isn't there anymore (it might happen on your next shot). This is one of the most annoying type of bugs a programmer can run into. And seeing how I'm dealing here with an unstable PTP implementation on the camera, USB drivers, Windows PTP drivers, and then my own code, all working together in an asynchronous event driven system, it's almost impossible to find out what's causing this, without first spending hours on sniffing out the low level communication between camera and PC (which then is only helpful if you can actually quickly reproduce the bug).

But after this fix, and snapping away for a long time, I wasn't able to reproduce the freezes, so I have good hope.

You can download this release here.

No comments:

Post a Comment