Lua Scripting (lua.mo)

Started by dmilligan, March 29, 2015, 04:44:07 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

grnbrg

:sigh:  Hopefully this is actually a bug this time, and not something that seems pretty obvious in hindsight.


-- 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

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

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

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?


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

grnbrg

"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:


-- 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

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

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

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

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

@a1ex

Thanks for the fix and the education.  :)

Cheers

Garry

JohanJ

Thanks for the new builds. Any reason why 100D is not listed (anymore)? Tx
60D.111 / 100D.101 / M2.103

a1ex

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

@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

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

@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

BTW: what does that red half wheel mean?

a1ex

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


garry23

@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

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


vifino

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

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.




edit: so far received tests from:
- 600D (irvcobb); status: passed (minor bug found in image_prefix)
- 70D (lojzik, esas); status: autofocus not working (needs investigation), sticky half-shutter not present (minor)
- 650D (walter, esas); autofocus issues; please re-run api_test.lua
- 100D (scherbakoff.dima)
- 6D (Audionut) - bug in image_prefix
- 50D (aprofiti) - mostly OK, screen flickers a lot
- (waiting for others)

scherbakoff.dima

Quote from: a1ex on December 16, 2017, 01:36:42 AM
- 1100D and 5D2 are back (likely a build system issue; not sure if fixed; might come back later on other models)

100D is missing currently,may be it's affected by build system issue too? If you fix it, can you upload build for 100D of lua-fix, please?

Thanks in advance :)

a1ex

Solved, also for 70D. Any others still missing?

(todo: highlight them on the builds page - it currently just lists all the successfully built zips, but doesn't know to detect missing ones)