Author Topic: Lua Scripting (lua.mo)  (Read 93949 times)

grnbrg

  • New to the forum
  • *
  • Posts: 9
Re: Lua Scripting (lua.mo)
« Reply #325 on: August 05, 2017, 11:59:06 PM »
:sigh:  Hopefully this is actually a bug this time, and not something that seems pretty obvious in hindsight.

Code: [Select]
-- 70D LV exposure test
-- If run in LV, high speed continuous mode, will trigger a burst of 3 frames.

menu.close()
console.show()

print("Click?")

key.wait()

camera.shutter.value = 1/500
camera.iso.value=100
camera.shoot(false)

key.wait()

This script should fire a single frame, and does in most combinations.

However, in Live View, with the drive mode set to high speed (7fps), this script fires the shutter 3 times.



Brian.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10558
  • 5D Mark Free
Re: Lua Scripting (lua.mo)
« Reply #326 on: August 06, 2017, 12:14:57 AM »
5D3 1.2.3, high speed continuous mode in LiveView: takes only one picture.

However, after trying a couple of times, I've managed to make the camera a bit unresponsive (script stuck somewhere after showing "Click?", most keys working for menu navigation, except SET and joystick press, which did not do anything). Will try to reproduce and fix this one.

Does this behavior have anything to do with key handling? (e.g. does it help if you just close the menu and use a fixed delay?)

Do other ML features that rely on picture taking (e.g. intervalometer) take multiple pictures at once in this mode?

(side note: there is a setting in ML to take a few pictures at once for e.g. motion detection, but it shouldn't apply here)

grnbrg

  • New to the forum
  • *
  • Posts: 9
Re: Lua Scripting (lua.mo)
« Reply #327 on: August 06, 2017, 01:00:08 AM »
Key handling doesn't appear to be relevant -- I came across this in the middle of another script, and pared it down to a testable example.

Just confirmed that the basic intervalometer fires 3 frame bursts where a single exposure is correct, and camera.burst(1) fires 3 frames.  Advanced bracketing seems to work fine.


Brian.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10558
  • 5D Mark Free
Re: Lua Scripting (lua.mo)
« Reply #328 on: August 06, 2017, 01:11:17 AM »
What about camera.burst(2) ?

"3 frame bursts where a single exposure is correct" -> you mean, only one of these 3 pictures has the exposure you expect, and the other two have different exposures?

Is it a regression over the regular builds? (you can try the 10/12-bit experimental build, or older builds from nikfreak)

If you can compile ML, does this also take 3 pictures?

Code: [Select]
/* don't click me, debug.c */
static void run_test()
{
    msleep(2000);
    call("Release");
}

grnbrg

  • New to the forum
  • *
  • Posts: 9
Re: Lua Scripting (lua.mo)
« Reply #329 on: August 09, 2017, 04:05:56 AM »
"3 frame bursts where a single exposure is correct" -> I expect a single shutter actuation and get three.

I have reproduced the issue with the June 24th and July 6th lua_fix builds -- Will test with the Oct 26, 2016 mainline beta tonight.

I reset the camera settings and ML settings to defaults, and while it did not fix the issue, I'm now (usually*) getting two exposures per camera.shoot(false) + LV + high speed continuous call.  Not really in a position to compile a binary.  Also, slow shutter speeds seem to work -- a 1 second shutter time didn't double or triple.  Will titrate this and report, if I can identify where the problem starts.

*.... usually?

I expanded the test script to shoot a series of -- 1/8000s, 1/4000s, 1/2000s and 1/1000s one after the other.  Usually, each call to camera.shoot(false) is producing two images, as though the function has been called twice.  But occasionally a run of the test script will produce 7 images, not 8.



Brian.

Edit:  Tested with the older mainline binary -- still getting double shutter activations.

When running the following test script:

Code: [Select]
-- 70D LV exposure test
-- If run in LV, high speed continuous mode, will trigger a burst of 3 frames.

menu.close()
console.show()

print("Click?")

key.wait()

camera.shutter.value = 1/25
camera.iso.value=100
camera.shoot(false)
camera.shutter.value = 1/10
camera.shoot(false)
camera.shutter.value = 1/5
camera.shoot(false)
camera.shutter.value = 1/4
camera.shoot(false)


key.wait()

the 1/25s call results in two images.  The subsequent three calls each reliably result in a single image.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10558
  • 5D Mark Free
Re: Lua Scripting (lua.mo)
« Reply #330 on: September 02, 2017, 11:03:48 PM »
Updates:
- menu.select now also works on submenus (api_test.lua for examples)
- bunch of fixes regarding dynamically built (sub)menus
- console now works alongside ML overlays (todo: clean up the menu)
- file_man still crashes :(

Builds will appear shortly.

tajino

  • New to the forum
  • *
  • Posts: 11
Re: Lua Scripting (lua.mo)
« Reply #331 on: September 10, 2017, 05:10:13 PM »
Would it be possible with the current ML lua API to get the current running intervalometer countdown time until the next shot is fired? I know we can get/set interval.time but how to know the time remaining until the next shot is fired.

What I'm trying to accomplish is to resume live view a few user defined seconds before the next interval.time is reached, to allow some time for auto ETTR to do its work. This only applies to shooting simple silent pic with LV power saving turn on. Currently when LV resumes for the next silent pic, there is not enough time for ETTR to work before the silent pic is taken.

Or there is a better way of doing this? Thanks.

thomasfli

  • Just arrived
  • *
  • Posts: 2
Re: Lua Scripting (lua.mo)
« Reply #332 on: October 16, 2017, 06:19:20 PM »
I do not know if this has been reported before, but I tried to use the 2017Sep11.600d102 version and the camera using that, the camera won't even turn on. As soon as the card is plugged in, the SD lamp starts blinking multiple times, pauses, and blinks in the same pattern again.

This definitely is related to this build, since when plugging in a card with a stable version of ML, everything works as it should.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10558
  • 5D Mark Free
Re: Lua Scripting (lua.mo)
« Reply #333 on: November 05, 2017, 08:01:33 PM »
Small updates:
- fixed 600D (tested in qemu)
- fixed led_blink
- lens.autofocusing, console.visible, lv.overlays, lv.vidmode (readonly)
- camera.gui.play/menu (rw), play_photo, play_movie, qr, idle (readonly)

Would lv.overlays fit better as camera.gui.lv_overlays instead? (it's related to GUI modes/states, but only applies to LiveView).

To keep the scripting API requests organized, I'd like to remind you there's a dedicated board for them. Feel free to use it.

If you have scripting API requests or suggestions posted elsewhere, please ask a moderator to move them (so we can find them easily when working on Lua).

garry23

  • Hero Member
  • *****
  • Posts: 1371
Re: Lua Scripting (lua.mo)
« Reply #334 on: November 05, 2017, 08:09:17 PM »
@a1ex

Thanks for the fix and the education.  :)

Cheers

Garry

JohanJ

  • Freshman
  • **
  • Posts: 52
Re: Lua Scripting (lua.mo)
« Reply #335 on: November 05, 2017, 10:51:52 PM »
Thanks for the new builds. Any reason why 100D is not listed (anymore)? Tx
60D.111 / 100D.101 / M2.103

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10558
  • 5D Mark Free
Re: Lua Scripting (lua.mo)
« Reply #336 on: December 03, 2017, 11:07:59 PM »
100D is on the way, just waiting for some recent backends.

Meanwhile, got an important fix on the stdio side (errors should no longer be truncated), a backwards-incompatible change in menu.get and also the scripts are now sorted by file name when loading.

garry23

  • Hero Member
  • *****
  • Posts: 1371
Re: Lua Scripting (lua.mo)
« Reply #337 on: December 04, 2017, 08:40:35 AM »
@a1ex

Just tried the latest Lua-fix branch and all appear OK: thanks.

Have noted one strangeness on the EOSM.

Previously I could clear the ML menu back to Canon with a half shutter press.

If I do that now, nothing happens and I get the red half wheel in the bottom right.

I have to explicitly do a double screen press.

I've changed nothing in the camera.

Cheers

Garry

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10558
  • 5D Mark Free
Re: Lua Scripting (lua.mo)
« Reply #338 on: December 04, 2017, 10:03:24 AM »
There was no change to menu backend or key handling. Does the issue go away if you just swap in the previous build? Does it happen with the default ML configuration? (no settings changed, no modules loaded). Does it happen with only Lua loaded, and no scripts running in background?

garry23

  • Hero Member
  • *****
  • Posts: 1371
Re: Lua Scripting (lua.mo)
« Reply #339 on: December 04, 2017, 10:13:45 AM »
@a1ex

Strange, as I said it was on both cameras.

I did a canon reset and problem has gone away.

Could have been a coincidence or my set up.

Let's see if any others report,

All running OK now.

Cheers

Garry

garry23

  • Hero Member
  • *****
  • Posts: 1371
Re: Lua Scripting (lua.mo)
« Reply #340 on: December 04, 2017, 10:36:07 AM »
BTW: what does that red half wheel mean?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10558
  • 5D Mark Free
Re: Lua Scripting (lua.mo)
« Reply #341 on: December 04, 2017, 11:32:16 AM »
It means you can't use the scrollwheel to navigate ML menus (the events would be interpreted as exposure controls by Canon firmware, and ML can't do much about that, as they are handled by another processor). On most cameras, that happens when browsing ML menu while recording. On 500D, that also happens in standby (in movie mode).

garry23

  • Hero Member
  • *****
  • Posts: 1371
Re: Lua Scripting (lua.mo)
« Reply #342 on: December 04, 2017, 11:41:41 AM »
@a1ex

Thanks  :)

garry23

  • Hero Member
  • *****
  • Posts: 1371
Re: Lua Scripting (lua.mo)
« Reply #343 on: December 04, 2017, 02:10:27 PM »
@a1ex

BTW on an EOSM with the 11-22mm lens, in the lens locked/transportation mode, you can still access  the ML menu and scroll/access the menu items.

In this configuration pressing the half shutter brings up the red scroll wheel symbol and, of course, doesn't allow you to use the half shutter to exit the ML menu.

Just info, not looking for action.

Cheers

Garry

Rubencho

  • Just arrived
  • *
  • Posts: 1
Re: Lua Scripting (lua.mo)
« Reply #344 on: December 05, 2017, 03:35:19 PM »
Hi,

Having a strange issue. I simply don't have the RAW recording nor the Crop mode option on my camera. I've installed the last Lua update from 3rd of December, for a 5DMIII with a 1.2.3 firmware. They don't appear in the Movie section. Any idea why is not there?

Thanks.

walter_schulz

  • Senior
  • ****
  • Posts: 378
Re: Lua Scripting (lua.mo)
« Reply #345 on: December 07, 2017, 01:54:35 PM »
Module tab

vifino

  • Just arrived
  • *
  • Posts: 1
Re: Lua Scripting (lua.mo)
« Reply #346 on: December 15, 2017, 11:24:47 PM »
Hi.

I've used one of the previous experimental builds on my 5D2, but now the new experimental build doesn't seem to have a 5D2 option any longer.
Could someone provide a current build or must I build it myself?

Thank you,
vifino.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10558
  • 5D Mark Free
Re: Lua Scripting (lua.mo)
« Reply #347 on: Yesterday at 01:36:42 AM »
Minor update:
- fixed issue #2821 (was affecting all camera models on this branch)
- fixed initialization of some rarely used fields when creating new menus from a script
- camera.gui.mode (current Canon dialog, low-level, get/set - wrapper for SetGUIRequestMode / CURRENT_GUI_MODE)
- fixed camera.gui functions on 60D, maybe also on other models (please test)
- 1100D and 5D2 are back (likely a build system issue; not sure if fixed; might come back later on other models)



Call for testers - as lately I've been hunting various bugs on this branch, and noticed some of the changes introduced model-specific issues (for example, api_test.lua was failing on 60D on one of the earliest tests).

For every single camera model available on the Experiments page (lua_fix build), please run:

- api_test.lua (upload the log)
- selftest.mo -> stubs tests (upload the log)
- bench.mo -> memory benchmarks (upload the screenshot)
- overall sanity check (for example, if you decide to take this build out and use it for a couple of hours, please report back)

Reason (don't like to repeat myself, but...): I'd like to merge this into mainline, but I'm unable to test all this stuff myself. Besides the updates to the Lua module, there were significant changes done to ML core, in order to make the Lua API behave in a somewhat sane way (and pass the scripting API tests). That means, these changes may affect every single ML functionality - not just Lua.

Sure, I have made these changes with good intentions (to fix things), but unfortunately each camera model has its own quirks, and this particular branch uncovered a lot of them. I keep discovering broken stuff (that's not broken in regular nightlies) almost every time I play with this branch. Therefore, I need your help to narrow down these issues and be able to merge lua_fix without breaking too much stuff at once.

You may ask - why I'm not running all this stuff in QEMU? The emulation is not exactly good enough to run api_test.lua, though it can already run simpler scripts, but I'm making progress polishing the emulation. There's even a quick start guide, although the functionality is quite limited right now.