Dolly Zoom - page 3 - Creative Uses of CHDK - CHDK Forum

Dolly Zoom

  • 21 Replies
  • 8236 Views
Re: Dolly Zoom
« Reply #20 on: 26 / July / 2020, 21:26:22 »
Advertisements
@Caefix
It would be nice to avoid these crashes in CHDK, but putting delays between half shoot and changing zoom seems to be a viable workaround.
Seems to work OK just waiting for the image to show up on the SD:
Code: [Select]
exp = get_exp_count()
press("shoot_half")
repeat
        sleep(50)
until get_shooting() == true
click("shoot_full")
release("shoot_half")

while (get_exp_count() == exp) do
        sleep(50)
        print("wait...")
end

set_zoom(znext)

Found a similar crash, going the other direction:  zoom-then-shoot.  This script:

Code: [Select]
--[[
@title zoom 14 crash
@chdk_version 1.5.0
]]

set_zoom(14)
print("14")
press("shoot_half")
print("after shoot_half")
release("shoot_half")

...works fine the first time, but if you manually move the zoom back to 0 and run it again, it crashes.


*

Offline reyalp

  • ******
  • 14125
Re: Dolly Zoom
« Reply #21 on: 27 / July / 2020, 00:21:57 »
Seems to work OK just waiting for the image to show up on the SD:
Code: [Select]
exp = get_exp_count()
press("shoot_half")
repeat
        sleep(50)
until get_shooting() == true
click("shoot_full")
release("shoot_half")

while (get_exp_count() == exp) do
        sleep(50)
        print("wait...")
end

set_zoom(znext)
FWIW, shoot_full includes shoot_half, so it will be implicitly released after click('shoot_full'). If you wanted to go back to half press, you should use click('shoot_full_only')

To wait for the end of shot, I normally use
Code: [Select]
repeat sleep(10) until not get_shooting()
This should be later than the exposure count change. shoot() should also block until all this and more is done. However, this didn't seem to be enough in some of my testing. It's possibly using sleep(50) usually gives the extra, but camera and setting specific variations are also likely.

Quote
Found a similar crash, going the other direction:  zoom-then-shoot.  This script:

...works fine the first time, but if you manually move the zoom back to 0 and run it again, it crashes.
I also get the AFScanDriver.c assert (from CaptSeqTask) if I zoom and then immediately press shoot_half. A sleep(100) avoids it. set_zoom should block for the actual time the zoom is moving, so you shouldn't need to account for that.

In normal coding, throwing random delays at crashes is usually considered bad practice, but the way CHDK is hacked into the stock firmware makes it a pretty normal thing for us.
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal