reyalp
did you check get_flash_ready() ?
Yes.
function rs_shoot(opts)
local rec,vid = get_mode()
if not rec then
return false,'not in rec mode'
end
if type(init_remotecap) ~= 'function' then
return false, 'remotecap not supported'
end
if bitand(get_remotecap_support(),opts.fformat) ~= opts.fformat then
return false, 'unsupported format'
end
if not init_remotecap(opts.fformat,opts.lstart,opts.lcount) then
return false, 'init failed'
end
press('shoot_half')
local shtimeout = get_tick_count()
local gfrtime = 0
repeat
sleep(10)
if get_flash_ready() and (gfrtime==0) then
gfrtime=get_tick_count()-shtimeout
end
until ( get_shooting() and ( get_flash_ready() or (get_flash_mode()==2) ) ) or ( (get_tick_count()-shtimeout)>5000 )
shtimeout=get_tick_count()-shtimeout
reset_shoot_ok()
press('shoot_full')
local gsrtime = get_tick_count()
repeat
sleep(10)
until ( get_shoot_ok() ) or ( (get_tick_count()-gsrtime)>5000 )
gsrtime=get_tick_count()-gsrtime
release('shoot_full')
return true, 'get_shooting: ' .. shtimeout .. 'ms , gfr: ' .. gfrtime .. 'ms, gsr: ' .. gsrtime .. 'ms'
end
Above version (I haven't removed the debug related lines) works, tried on the
A410 and
A460 this time.
The below one however frequently fails with flash (A460 is worse).
function rs_shoot(opts)
local rec,vid = get_mode()
if not rec then
return false,'not in rec mode'
end
if type(init_remotecap) ~= 'function' then
return false, 'remotecap not supported'
end
if bitand(get_remotecap_support(),opts.fformat) ~= opts.fformat then
return false, 'unsupported format'
end
if not init_remotecap(opts.fformat,opts.lstart,opts.lcount) then
return false, 'init failed'
end
press('shoot_half')
local shtimeout = get_tick_count()
local gfrtime = 0
repeat
sleep(10)
if get_flash_ready() and (gfrtime==0) then
gfrtime=get_tick_count()-shtimeout
end
until ( get_shooting() and ( get_flash_ready() or (get_flash_mode()==2) ) ) or ( (get_tick_count()-shtimeout)>5000 )
shtimeout=get_tick_count()-shtimeout
local gsrtime = get_tick_count()
click('shoot_full')
return true, 'get_shooting: ' .. shtimeout .. 'ms , gfr: ' .. gfrtime .. 'ms, gsr: ' .. gsrtime .. 'ms'
end
Of course I'm not trying to say that my "solution" is ideal
, especially not when the exposure time is seconds long.
According to the logs, get_shooting() and get_flash ready() seem to become true at the same time.[hr]edit: I'm using capt_seq_hook_set_nr(), not the raw hook, I just forgot about that...