Custom Bracket for Time Lapse

Started by yonespro, April 22, 2020, 10:36:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yonespro

Hi All,
First timer scripting and could really use some help.  I have t5i/700D, using lua_fix.2019Mar20.700D115

Thanks for any help or pointing to resources in advance.

My intention is to be able to script a custom exposure bracket that I can then trigger from my external intervalometer.

Here's a version of the script that doesn't have the expected result of running every time the intervalometer triggers but does cause the script to loop from an initial fullshutter trigger (I couldn't figure out how to get a while loop to work for this scenario):

lua

bracket_menu = menu.new
{
    name    = "Yones",
    choices = { "OFF", "ON" },
    value   = "OFF",
    help    = "8 exposure bracket",
}

function event.keypress(key)
    while key == KEY.FULLSHUTTER and bracket_menu.value == "ON" do
      camera.shutter.value = 1/4000
camera.shoot(64,false)

camera.shutter.value = 1/1000
camera.shoot(64,false)

camera.shutter.value = 1/250
camera.shoot(64,false)
 
camera.shutter.value = 1/60
camera.shoot(64,false)

camera.shutter.value = 1/15
camera.shoot(100,false)

camera.shutter.value = 1/4
camera.shoot(300,false)

  camera.shutter.value = 1.0
camera.shoot(1100,false)

camera.shutter.value = 4.0
camera.shoot(4200,false)

      camera.shutter.value = 1/4000

    end
end


After inconsistent amount of times running it crashes, here are the two crash reports:


ASSERT: err == SUCCESS
at GUI.c:679, PropMgr:ff0d6a04
lv:0 mode:3

PropMgr stack: 14ce18 [14cf68-14bf68]
0xUNKNOWN  @ bba0:14cf60
0xUNKNOWN  @ 16aac:14cf38
0x000167A4 @ ff11f0d4:14cf20
0xUNKNOWN  @ 167d4:14cf10
0xUNKNOWN  @ 1685c:14cef0
0xFF31B1DC @ ff31e034:14cec0
0xUNKNOWN  @ ff31b320:14ce98
0xFF0D69A0 @ ff1c6f8c:14ce70
0x00001900 @ ff0d6a00:14ce50
0x0007EF78 @ 7f280:14ce18

Magic Lantern version : lua_fix.2019Mar20.700D115
Mercurial changeset   : e98cf272a50b (lua_fix) tip
Built on 2019-03-20 09:35:13 UTC by jenkins@nightly.
Free Memory  : 135K + 2772K




and



ASSERT: err == SUCCESS
at GUI.c:679, GuiMainTask:ff0d6a04
lv:0 mode:3

GuiMainTask stack: 1a3750 [1a3998-1a1998]
0xUNKNOWN  @ fffffffd:1a390c
0x00B1B05C @ b19cec:1a38e4
0x00B1B790 @ b1b070:1a38d8
0x00B1B870 @ b1b7a4:1a38c8
0xUNKNOWN  @ b1b8e4:1a37f0
0x00B1ADE0 @ b1b784:1a37e8
0x00AEF094 @ b1ae6c:1a37c8
0x000C4FC4 @ aef0d0:1a37a8
0x00001900 @ ff0d6a00:1a3788
0x0007EF78 @ 7f280:1a3750

Magic Lantern version : lua_fix.2019Mar20.700D115
Mercurial changeset   : e98cf272a50b (lua_fix) tip
Built on 2019-03-20 09:35:13 UTC by jenkins@nightly.
Free Memory  : 137K + 2818K


Walter Schulz

Will try to reproduce with my 650D.
EDIT: Reproduceable with 650D, no other lua scripts loaded.

One question: You renamed/deleted all other lua scripts in scripts folder so no other script is loaded?

a1ex

Quote from: Walter Schulz on April 23, 2020, 09:40:26 AM
One question: You renamed/deleted all other lua scripts in scripts folder so no other script is loaded?

In lua_fix versions, no script is loaded by default. You need to explicitly enable autorun on each script you want to be loaded/executed at startup.

Quote from: yonespro on April 22, 2020, 10:36:42 PM
ASSERT: err == SUCCESS
at GUI.c:679, GuiMainTask:ff0d6a04

Short answer: the keypress event handler runs in GuiMainTask, and it has to return quickly. Photo capture also requires GUI events, so it can't be completed in a keypress handler; you need to offload it to some other task. The shoot_task hook is suitable for this purpose.

Long answers:
https://www.magiclantern.fm/forum/index.php?topic=16614.msg161978#msg161978
https://www.magiclantern.fm/forum/index.php?topic=21590.msg197093#msg197093
https://www.magiclantern.fm/forum/index.php?topic=24319.msg218556#msg218556
https://www.magiclantern.fm/forum/index.php?topic=4997.msg179155#msg179155
https://www.magiclantern.fm/forum/index.php?topic=14309.msg198217#msg198217

yonespro

a1ex, thanks for your response.

I've looked into your "Long Answers" and seems I need to study a lot. 

I will be looking into shoot_task and what a hook and task are.  I believe I understand the idea of having the complete capture process outside of the keypress triggered function.  The approach to coding this is beyond me at the moment.

I will continue to research and will post back with questions at some point.

Thanks again for pointing.

garry23

@yonespro

You may wish to look at my scripts that make use of what @a1ex said, for example this one https://gist.github.com/pigeonhill/2c799711e1a774b4ebe1ef09d2d95749

Or my others scripts at photography.grayheron.net

As @a1ex says, keep the keypress event handler lean, i.e. just tracking that a key press has occurred and handling it, and use the shoot_task to do 'other stuff', triggered/controlled by flags set in the keypress handler.