Focus bracketing scripts sometimes stops at "shoot" command - page 6 - Script Writing - CHDK Forum

Focus bracketing scripts sometimes stops at "shoot" command

  • 76 Replies
  • 25901 Views
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #50 on: 04 / January / 2013, 08:52:33 »
Advertisements
Quote
Also, if you can try the Lua test script with flash (no set_focus), and see if that hangs, that would help too.  Another idea is to put the camera in manual focus mode before starting the script.

The Lua test script with flash (no set_focus),also hangs.
I have to put the camera in manual focus mode, if not, it crashes.

I have, so far, not seen two consecutive failures (with all the versions, and scripts).

I also think the "bug" is related to some kind of "waiting for a condition that never happens" or wasn´t noticed. The more busy the camera is, more likely the bug is triggered.

Impressions from the original script and CHDK version:
- set_focus but no flash, I think it hanged once (with TV ~2s)
- If I "rem" the set_focus command, and only uses flash, it hangs more often.
- Combined set_focus and flash => causes even more hangs.

Even though my focus bracketing now works very well, I will happily test on, if you have more suggestions around this "bug" ...

*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #51 on: 04 / January / 2013, 11:50:58 »
Even though my focus bracketing now works very well, I will happily test on, if you have more suggestions around this "bug" ...
Thanks! I think we can solve this, and have something even better than before if we keep trying.

The way the modified shoot() works now, and doesn't hang, is by returning to the script without hanging, or shooting. This depends on the script calling shoot() again. So if it misses the last shot, for example, you're out of luck.

The solution is for shoot() to try again before returning, rather than counting on the script to try again.

The best solution would be to try again without letting the shutter button all the way up, so you don't need to re-meter and re-focus. The sequence is:

release(shoot_full_only)
--delay
press(shoot_full_only)

If that doesn't work, we can just repeat the whole shoot() process again. Anyway, I'll do a build using the first method, and post it for you to test.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline lapser

  • *****
  • 1093
New Version to Test
« Reply #52 on: 04 / January / 2013, 16:00:17 »
Here's the new version that implements the method described in my last post. It modifies shoot() so it always shoots, and hopefully never hangs. It works on my camera, with or without flash, and without missing shots, so hopefully it will work for you too. If not, I have one more thing I can try.

This version of shoot() first checks to see if the shutter is half_pressed already. If so, it will leave it half pressed after it shoots. This allows more rapid shooting using the exposure and focus setting of the first shot. The attached Lua script tests and times both methods.

shoot1.lua first tests the normal shoot() method, which meters and focuses each shot. It prints the time between shots, which is about 1900 msec on my camera. Press and hold <set> to go to the next test.

Then shoot1.lua presses "half_shoot" and repeats the same loop. On my camera, the time between shots drops to about 800 msec. This is pretty close to the maximum rate of around 600 msec for my camera in continuous mode. Press and hold <menu> to exit.

So if it works on your camera, we might have a winner.
====
In this version, I added a counter increment right before the shutter opens. After incrementing the counter, I set the sign bit on, so it will test <0 while the shutter is open. When the raw data is ready and the shot histogram is finished, I clear the sign bit (and increment again for cameras without the shutter open hook), so the counter is now >=0.

If you start with the shutter up, shoot() first presses half_shoot and waits for get_shooting(), as before. Then it waits until the counter is >=0. That is, it waits for the shutter to close from the last shot. At this point, it saves the shot counter in a local variable, since it now won't change until the next shutter open.  Then, it starts pressing and releasing shoot_full_only at a rate of 5 times per second, until the shot counter changes, signifying the shot has started. Then it releases shoot_full_only. If the shutter was up, it returns. Otherwise it lets the shutter up and waits for get_shooting() to go back to 0 (false).

That's the theory. You're the proof. Thanks again.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #53 on: 05 / January / 2013, 09:28:50 »
@lapser

First tested the speed with shoot1.lua.
- With flash, went from ~3200ms to ~2600ms
- Without flash, ~1600ms to ~520ms, thats really fast ...

Bad news: Both your and mine script still hangs ...


*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #54 on: 05 / January / 2013, 11:19:32 »
- With flash, went from ~3200ms to ~2600ms
- Without flash, ~1600ms to ~520ms, thats really fast ...
I assume you're talking about the second half of shoot1.lua, with shoot_half pressed? Were you in continuous mode? Will you try it in single shot?
Yes, fast is the idea.
Quote
Bad news: Both your and mine script still hangs ...
How often do they hang? Do they ever hang on the first shot? Did shoot1.lua hang in both parts, i.e. before and after you press <set>? Did it hang without flash? Which part?

The current test version clicks shoot_full_only until the shot starts, which works in half_shoot. When it hangs, it looks like the camera needs a complete re-shoot(), letting up the shutter all the way instead of half way. That's what happens with Phl's fix, so if it doesn't work that way, it will be bad news. But I love solving problems, so bad news is good news to me.

I'll add the complete re-shoot() option and post a new test build soon. Again, thanks for the help.
« Last Edit: 05 / January / 2013, 11:23:00 by lapser »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #55 on: 05 / January / 2013, 11:45:07 »
Quote
I assume you're talking about the second half of shoot1.lua, with shoot_half pressed? Were you in continuous mode? Will you try it in single shot?
Yes it was the second half of the script, and in "single shot".
If I run the script in high-speed continuous mode ~440ms
(According to manual: standard continuous mode ~1,5 shots per second and high-speed mode ~2,4 shots per second)

I have had the original version hang on the first shot.
shoot1.lua hang at the 5:th shot (first part) with flash in this test.
Normally it hangs once for every ~20-50 shots (with flash). I have never been able to let the script finish without a hang during my tests (200-300 shots in a loop, with flash) .
« Last Edit: 05 / January / 2013, 11:55:15 by skrylten »

*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #56 on: 05 / January / 2013, 12:45:27 »
Thanks. Does shoot1.lua ever hang without flash?
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #57 on: 05 / January / 2013, 13:06:50 »
I have not seen it hang, but I think I have only seen it once with the original version and my script, so it is very rare without the flash ( if it happens at all).


*

Offline lapser

  • *****
  • 1093
Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #58 on: 05 / January / 2013, 14:13:57 »
OK, here's the new version that re-shoots repeatedly if the shot fails. It should the same be as Phil's method, except it never returns without actually shooting the shot, so you don't need a return value, or any extra logic in the script. If the shot is never successful, you'll here it clicking and not shooting over and over.

Let me know how it does with flash and your script. I'm not totally sure it will hold the same focus on the 2nd attempt after a 1st shot failure. You could print get_focus after the shoot and make sure it's always what you expect. But first, you have to make it through shoot without hanging. Good luck.

[EDIT] Will you also check it with shoot1.lua? The first part should work without hanging, and the 2nd part will probably hang, (but there's a slight chance it won't).

Here's another test, without CHDK running, that will help.  Press the shutter button (with your finger) and hold it until it flashes. Then release half way and press and hold it again. See if it takes another shot. Then, do the same thing but let the shutter button all the way up when the camera flashes, and press all the way down immediately.

On my camera, it always keeps shooting this way, so if yours doesn't, it might explain why this happens.
« Last Edit: 05 / January / 2013, 14:21:15 by lapser »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Focus bracketing scripts sometimes stops at "shoot" command
« Reply #59 on: 06 / January / 2013, 07:34:09 »
@lapser

- My script with flash, 200 shots no hangs, correct focus
- shoot1.lua, 50 shots each part, no hangs, a bit slow but might be the flash recharging after 200+ consecutive shots

The "insistent" wins, well done lapser !  :D

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal