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

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5492
Re: Lua Scripting (lua.mo)
« Reply #425 on: June 08, 2018, 10:39:37 PM »
Just finished a "darkframe creator"  lua script. Running the script will start recording 3 second mlv files starting with 12-bit lossless and then change iso from 100-6400. It starts in mv1080p then moves on to 5xZoom mode, then movie crop mode. Not included Crop rec yet. All will be recorden in 24fps and they can then be used in Switch or batch_mlv or Mlv App, mlv_dump for further automation averaging. 10bit files are excluded. Results often worse with 10bit files.
All my lua files belongs here:
https://bitbucket.org/Dannephoto/lua_magic/
and can be downloaded directly here:
https://bitbucket.org/Dannephoto/lua_magic/downloads/lua_magic.dmg


Code: [Select]
-- darkframe creator

--[[
Will create 3 second MLV files with following settings:
* iso 100-6400 iso
* FPS override set to 24
* mv1080p (1920x1080) 12-bit lossless, 14bit-lossless, 12-bit, 14bit
* 5xZoom (highest setting) 12-bit lossless(For 5D3 also 14bit lossless and 12-bit)
* Movie crop mode (whatever set to when starting) 12-bit lossless(For 5D3 also 14bit lossless and 12-bit)
* For further darkframe automation on mac check "Switch" https://www.magiclantern.fm/forum/index.php?topic=15108.0
* On windows check "batch_mlv" https://www.magiclantern.fm/forum/index.php?topic=10526.msg188558#msg188558
* Note that processing will take a while so why not have a coffe while waiting...
* don´t forget to film with your lens cap on
--]]

-- warn if in mv720p
if menu.get("FPS override", "Actual FPS", "") >= "49" and menu.get("FPS override", "Actual FPS", "") <= "61" then
   menu.set("Overlay", "Global Draw", "OFF")
   display.notify_box("Set cam to mv1080p and run script again")
   msleep(1000)
   display.notify_box("Set cam to mv1080p and run script again")
   msleep(1000)
   return
end

-- warn if not movie mode
  lv.zoom = 1
  console.hide()
  menu.close()
while camera.mode ~= MODE.MOVIE do
  display.notify_box("enable MOVIE mode")
  msleep(1000)
end

-- some pointers before starting
  display.notify_box("Put your lens cap on when filming")
  msleep(2000)
  display.notify_box("Put your lens cap on when filming")
  msleep(2000)
  display.notify_box("This will take about five minutes to finish")
  msleep(2000)
  display.notify_box("This will take about five minutes to finish")
  msleep(2000)

-- Overlay
  menu.set("Overlay", "Global Draw", "OFF")

-- global start off setting
if menu.get("Movie", "Movie crop mode", "") == "ON" then
  menu.select("Movie", "Movie crop mode")
  menu.open()     -- open ML menu
  key.press(KEY.SET)
  menu.close()
end
  camera.iso.value=100
  camera.shutter.value = 1/50
  menu.set("RAW video", "Data format", "12-bit lossless")
  menu.set("Sound recording", "Enable sound", "OFF")

-- Movie settings
  menu.set("Movie", "HDR video", "OFF")
  menu.set("Movie", "RAW video", "ON")
  menu.set("RAW video", "Resolution", 1920)
  menu.set("RAW video", "Preview", "Auto")

-- workaround. May need an extra pass(if higher fps than actual)
while menu.get("FPS override", "Actual FPS", "") <= "23" or menu.get("FPS override", "Actual FPS", "") >= "25" or menu.get("Movie", "FPS override", "") == "OFF" do
  lv.zoom = 1
  menu.set("Movie", "FPS override", "OFF")
  msleep(1000)

  if menu.get("FPS override", "Actual FPS", "") >= "23" and menu.get("FPS override", "Actual FPS", "") <= "24" then
    menu.set("FPS override", "Desired FPS", "24 (from 24)")
    camera.shutter.value = 1/50
  elseif menu.get("FPS override", "Actual FPS", "") >= "25" and menu.get("FPS override", "Actual FPS", "") <= "26" then
    menu.set("FPS override", "Desired FPS", "24 (from 25)")
    camera.shutter.value = 1/50
  elseif menu.get("FPS override", "Actual FPS", "") >= "29" and menu.get("FPS override", "Actual FPS", "") <= "30" then
    menu.set("FPS override", "Desired FPS", "24 (from 30)")
    camera.shutter.value = 1/50
  elseif menu.get("FPS override", "Actual FPS", "") >= "49" and menu.get("FPS override", "Actual FPS", "") <= "51" then
    menu.set("FPS override", "Desired FPS", "24 (from 50)")
    camera.shutter.value = 1/60
  elseif menu.get("FPS override", "Actual FPS", "") >= "59" and menu.get("FPS override", "Actual FPS", "") <= "60" then
    menu.set("FPS override", "Desired FPS", "24 (from 60)")
    camera.shutter.value = 1/60
  end

-- now turn FPS override to on
  menu.select("Movie", "FPS override")
  menu.open()     -- open ML menu
  key.press(KEY.SET)
  menu.close()
end

-- ISO
  i = 100
-------------------------------------- 
-- mv1080p (1920x1080) 24 FPS override
--------------------------------------
   display.notify_box("12-bit lossless mv1080p")
while menu.get("RAW video", "Data format", "") ~= "14-bit" do
   camera.iso.value=(i)
   key.press(KEY.REC)
   msleep(4000)
   movie.stop()
   msleep(3000)
  if menu.get("ISO", "Equivalent ISO", "") ~= "6400" then
    i = i * 2
  else
    i = 100
    if
      menu.get("RAW video", "Data format", "") == "12-bit lossless" then
      display.notify_box("14-bit lossless mv1080p")
      menu.set("RAW video", "Data format", "14-bit lossless")
    elseif
      menu.get("RAW video", "Data format", "") == "14-bit lossless" then
      display.notify_box("12-bit mv1080p")
      menu.set("RAW video", "Data format", "12-bit")
    elseif
      menu.get("RAW video", "Data format", "") == "12-bit" then
      display.notify_box("14-bit mv1080p")
      menu.set("RAW video", "Data format", "14-bit")
    end
  end
end

-- last darkframe round 14-bit
  i = 100
  camera.iso.value=100
while menu.get("ISO", "Equivalent ISO", "") ~= "6400" do
  key.press(KEY.REC)
  msleep(4000)
  movie.stop()
  msleep(3000)
  i = i * 2
  camera.iso.value=(i)
  msleep(1000)
end

-- last 6400 iso
if menu.get("ISO", "Equivalent ISO", "") == "6400" then
  key.press(KEY.REC)
  msleep(4000)
  movie.stop()
  msleep(3000)
end
----------------------------------------- 
-- 5xZoom highest setting 24 FPS override
-----------------------------------------
  i = 100
  lv.zoom = 5
  camera.iso.value=100
  camera.shutter.value = 1/50
  menu.set("RAW video", "Data format", "12-bit lossless")
  menu.set("RAW video", "Resolution", 2880)
  display.notify_box("12-bit lossless 5xzoom")

while menu.get("RAW video", "Data format", "") ~= "12-bit" do
   camera.iso.value=(i)
   key.press(KEY.REC)
   msleep(4000)
   movie.stop()
   msleep(3000)
  if menu.get("ISO", "Equivalent ISO", "") ~= "6400" then
    i = i * 2
  else
    i = 100
    if menu.get("RAW video", "Data format", "") == "12-bit lossless" and camera.model_short == "5D3" then
      display.notify_box("14-bit lossless 5xzoom")
      menu.set("RAW video", "Data format", "14-bit lossless")
    elseif
      menu.get("RAW video", "Data format", "") == "14-bit lossless" and camera.model_short == "5D3" then
      display.notify_box("12-bit 5xzoom")
      menu.set("RAW video", "Data format", "12-bit")
    elseif camera.model_short ~= "5D3" then
      menu.set("RAW video", "Data format", "12-bit")
    end
  end
end

-- last darkframe round 12-bit
if camera.model_short == "5D3" then
  i = 100
  camera.iso.value=100
  while menu.get("ISO", "Equivalent ISO", "") ~= "6400" do
    key.press(KEY.REC)
    msleep(4000)
    movie.stop()
    msleep(3000)
    i = i * 2
    camera.iso.value=(i)
    msleep(1000)
  end

-- last 6400 iso
  if menu.get("ISO", "Equivalent ISO", "") == "6400" then
    key.press(KEY.REC)
    msleep(4000)
    movie.stop()
    msleep(3000)
  end
end
----------------------------------
-- Movie crop mode 24 FPS override
----------------------------------
  lv.zoom = 1
  i = 100
  camera.iso.value=100
  camera.shutter.value = 1/50
  menu.set("RAW video", "Data format", "12-bit lossless")
if menu.get("Movie", "Movie crop mode", "") == "OFF" then
  menu.select("Movie", "Movie crop mode")
  menu.open()     -- open ML menu
  key.press(KEY.SET)
  menu.close()
  display.notify_box("12-bit lossless Movie crop mode")

while menu.get("RAW video", "Data format", "") ~= "12-bit" do
   camera.iso.value=(i)
   key.press(KEY.REC)
   msleep(4000)
   movie.stop()
   msleep(3000)
  if menu.get("ISO", "Equivalent ISO", "") ~= "6400" then
    i = i * 2
  else
    if menu.get("RAW video", "Data format", "") == "12-bit lossless" and camera.model_short == "5D3" then
      display.notify_box("14-bit lossless Movie crop mode")
      menu.set("RAW video", "Data format", "14-bit lossless")
    elseif
      menu.get("RAW video", "Data format", "") == "14-bit lossless" and camera.model_short == "5D3" then
      display.notify_box("12-bit Movie crop mode")
      menu.set("RAW video", "Data format", "12-bit")
    elseif camera.model_short ~= "5D3" then
      menu.set("RAW video", "Data format", "12-bit")
    end
  end
end

-- last darkframe round 12-bit
if camera.model_short == "5D3" then
  i = 100
  camera.iso.value=100
  while menu.get("ISO", "Equivalent ISO", "") ~= "6400" do
    key.press(KEY.REC)
    msleep(4000)
    movie.stop()
    msleep(3000)
    i = i * 2
    camera.iso.value=(i)
    msleep(1000)
  end

-- last 6400 iso
  if menu.get("ISO", "Equivalent ISO", "") == "6400" then
    key.press(KEY.REC)
    msleep(4000)
    movie.stop()
    msleep(3000)
  end
end

 if menu.get("Movie", "Movie crop mode", "") == "ON" then
   menu.select("Movie", "Movie crop mode")
   menu.open()     -- open ML menu
   key.press(KEY.SET)
   menu.close()
 end
end

-- Starting point
  camera.iso.value=100
  camera.shutter.value = 1/50
  menu.set("RAW video", "Data format", "12-bit lossless")

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: Lua Scripting (lua.mo)
« Reply #426 on: September 20, 2018, 04:09:40 PM »
Finally managed to clean up and test yet another round of fixes.

- api_test.lua passes on 5D2 and 500D (this one was hard, took me a week of intensive work, then had to take a break and focus on something else)
- lens.focus and other focus tools should refuse to work if continuous AF (photo mode) or movie servo AF (movie mode) is enabled in Canon menu
- menu.set: fixed issues reported by Danne (FPS override and some other "tricky" menus)
- dryos.sd_card, dryos.cf_card, fixed dryos.card.free_space, removed card.cluster_size
- moved dryos.dcim_dir to dryos.shooting_card.dcim_dir
- api_test.lua: the error messages should now appear in the log file; more obvious popups when user action is needed
- other: #2901, menu flicker, some more minor fixes.

Let's retry the API tests, hopefully they will pass this time.

P.S. I've got everything I need to emulate touchscreen functionality in QEMU on 700D, so I'm going to revisit lua_touch as well.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1736
Re: Lua Scripting (lua.mo)
« Reply #427 on: September 20, 2018, 04:33:58 PM »
@a1ex

On business travel at the moment, but will test on EOSM and 5D3 when I get back home.

Thanks for continuing to push the Lua capability.

Cheers

Garry

aprofiti

  • Contributor
  • Member
  • *****
  • Posts: 173
Re: Lua Scripting (lua.mo)
« Reply #428 on: September 20, 2018, 06:10:45 PM »
Looks good on 50D apart the movie stop command apparently not working.

I switched to movie mode by entering lv and enabling movie record (simple, not raw) in ML menu, then recording started automatically and wasn't stopping (waited less tan a minute, it should stop after sleep(1)), so i stopped manually by pressing set and exited LV, then assert were triggered.

I'll retry later
Edit: noting to do.. now it freezes

Here is the log:
Code: [Select]

===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-9-20 16:56:10
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 75
    apex = 2.375
    ms = 193
    value = 0.192776
  aperture = table:
    raw = 0
    apex = 0
    value = 0
    min = table:
      raw = 0
      apex = 0
      value = 0
    max = table:
      raw = 0
      apex = 0
      value = 0
  iso = table:
    raw = 104
    apex = 9.
    value = 1600
  ec = table:
    raw = 0
    value = 0
  flash = true
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 5500
  mode = 3
  metering_mode = 3
  drive_mode = 0
  model = "Canon EOS 50D"
  model_short = "50D"
  firmware = "1.0.9"
  temperature = 158
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  wait = function: 0xa00a50
  shoot = function: 0xa01b24
  reboot = function: 0xa01af8
  bulb = function: 0xa01d58
  burst = function: 0xa01dd8
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  write = function: 0x9ff478
  clear = function: 0x9ff3c4
  hide = function: 0x9ff3d4
  show = function: 0x9ff3e4
lv = table:
  enabled = false
  paused = false
  running = false
  zoom = 1
  overlays = false
  info = function: 0xa02304
  start = function: 0xa01f60
  stop = function: 0xa01f70
  resume = function: 0xa025f8
  wait = function: 0xa029c8
  pause = function: 0xa02608
lens = table:
  name = ""
  focal_length = 0
  focus_distance = 14080
  hyperfocal = 0
  dof_near = 0
  dof_far = 0
  af = false
  af_mode = 771
  autofocus = function: 0xa034ac
  focus = function: 0xa03674
display = table:
  idle = nil
  height = 480
  width = 720
  on = function: 0xa03f00
  pixel = function: 0xa05154
  notify_box = function: 0xa03fb4
  rect = function: 0xa04b28
  screenshot = function: 0xa03e1c
  line = function: 0xa04e8c
  draw = function: 0xa0409c
  off = function: 0xa03ef0
  load = function: 0xa041e4
  circle = function: 0xa04858
  clear = function: 0xa03e0c
  print = function: 0xa05320
key = table:
  last = 20
  wait = function: 0xa05830
  press = function: 0xa05af8
menu = table:
  visible = false
  new = function: 0xa07f20
  select = function: 0xa07010
  get = function: 0xa072c4
  close = function: 0xa05e58
  block = function: 0xa06060
  open = function: 0xa05e70
  set = function: 0xa070e4
movie = table:
  recording = false
  stop = function: 0xa03a74
  start = function: 0xa03b08
dryos = table:
  clock = 10
  ms_clock = 10306
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0xa09214
    children = function: 0xa090cc
    files = function: 0xa08fb0
    parent = table:
      exists = true
      create = function: 0xa09214
      children = function: 0xa090cc
      files = function: 0xa08fb0
      parent = table:
        exists = true
        create = function: 0xa09214
        children = function: 0xa090cc
        files = function: 0xa08fb0
        parent = nil
        path = "A:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xa09214
      children = function: 0xa090cc
      files = function: 0xa08fb0
      parent = table:
        exists = true
        create = function: 0xa09214
        children = function: 0xa090cc
        files = function: 0xa08fb0
        parent = table:
          exists = true
          create = function: 0xa09214
          children = function: 0xa090cc
          files = function: 0xa08fb0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/101CANON/"
    file_number = 1790
    folder_number = 101
    free_space = 6608
    image_path = function: 0xa093f0
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  shooting_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xa09214
      children = function: 0xa090cc
      files = function: 0xa08fb0
      parent = table:
        exists = true
        create = function: 0xa09214
        children = function: 0xa090cc
        files = function: 0xa08fb0
        parent = table:
          exists = true
          create = function: 0xa09214
          children = function: 0xa090cc
          files = function: 0xa08fb0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/101CANON/"
    file_number = 1790
    folder_number = 101
    free_space = 6608
    image_path = function: 0xa093f0
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  cf_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xa09214
      children = function: 0xa090cc
      files = function: 0xa08fb0
      parent = table:
        exists = true
        create = function: 0xa09214
        children = function: 0xa090cc
        files = function: 0xa08fb0
        parent = table:
          exists = true
          create = function: 0xa09214
          children = function: 0xa090cc
          files = function: 0xa08fb0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/101CANON/"
    file_number = 1790
    folder_number = 101
    free_space = 6608
    image_path = function: 0xa093f0
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  sd_card = nil
  date = table:
    day = 20
    yday = 1
    month = 9
    wday = 2
    hour = 16
    min = 56
    isdst = false
    year = 2018
    sec = 11
  remove = function: 0xa08aa4
  call = function: 0xa087cc
  rename = function: 0xa089d0
  directory = function: 0xa08b10
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0xa09e30
battery = table:
function not available on this camera
stack traceback:
[C]: in ?
[C]: in for iterator 'for iterator'
ML/SCRIPTS/LIB/logger.lua:125: in function 'logger.serialize'
ML/SCRIPTS/API_TEST.LUA:45: in function <ML/SCRIPTS/API_TEST.LUA:44>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:44: in function 'globals.print_table'
ML/SCRIPTS/API_TEST.LUA:90: in function 'globals.generic_tests'
ML/SCRIPTS/API_TEST.LUA:1471: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunktask = table:
  yield = function: 0xa0a498
  create = function: 0xa0a618
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
CF card (A:/) present
- free space: 6608 MiB
- next image: A:/DCIM/101CANON/IMG_1791.CR2
- DCIM dir. : A:/DCIM/101CANON/
File I/O tests completed.

Testing Canon GUI functions...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter PLAY mode...
Exit PLAY mode...
Stop LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Stop LiveView...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Stop LiveView...
Start LiveView...
Stop LiveView...
Start LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Stop LiveView...
Start LiveView...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Canon GUI tests completed.

Testing ML menu API...
Menu tests completed.

Testing picture taking functions...
Snap simulation test...
Single picture...
A:/DCIM/101CANON/IMG_1791.CR2: 21376548
A:/DCIM/101CANON/IMG_1791.JPG not found.
Two burst pictures...
Ideally, the camera should be in some continuous shooting mode (not checked).
A:/DCIM/101CANON/ABC_1792.CR2: 21336894
A:/DCIM/101CANON/ABC_1792.JPG not found.
A:/DCIM/101CANON/ABC_1793.CR2: 21336837
A:/DCIM/101CANON/ABC_1793.JPG not found.
Bracketed pictures...
A:/DCIM/101CANON/IMG_1794.CR2: 18407421
A:/DCIM/101CANON/IMG_1794.JPG not found.
A:/DCIM/101CANON/IMG_1795.CR2: 21310153
A:/DCIM/101CANON/IMG_1795.JPG not found.
A:/DCIM/101CANON/IMG_1796.CR2: 20568828
A:/DCIM/101CANON/IMG_1796.JPG not found.
Bulb picture...
Elapsed time: 11737
A:/DCIM/101CANON/IMG_1797.CR2: 11930947
A:/DCIM/101CANON/IMG_1797.JPG not found.
Picture taking tests completed.

Testing multitasking...
Only one task allowed to interrupt...
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Multitasking tests completed.

Testing half-shutter...
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
Half-shutter test OK.

Testing module 'lv'...
Starting LiveView...
Overlays: ML
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: ML
Setting zoom to x1...
Setting zoom to x5...
Setting zoom to x10...
Setting zoom to x5...
Setting zoom to x1...
Setting zoom to x10...
Setting zoom to x1...
Pausing LiveView...
Resuming LiveView...
Stopping LiveView...
LiveView tests completed.


Testing lens focus functionality...
This test requires an electronic lens.
Testing exposure settings...
Camera    : Canon EOS 50D (50D) 1.0.9
Lens      :
Shoot mode: 3
Shutter   : Ç5 (raw 75, 0.192776s, 193ms, apex 2.375)
Aperture  : Å0.0 (raw 0, f/0, apex 0)
Av range  : Å0.0..Å0.0 (raw 0..0, f/0..f/0, apex 0..0)
ISO       : Ä1600 (raw 104, 1600, apex 9.)
EC        : 0.0 (raw 0, 0 EV)
Flash EC  : 0.0 (raw 0, 0 EV)
Setting shutter to random values...
Setting ISO to random values...
This lens does not have variable aperture (skipping test).
Please switch to Av mode.
Setting EC to random values...
Setting Flash EC to random values...
Exposure tests completed.


Testing movie recording...
Please switch to Movie mode.

ML/SCRIPTS/API_TEST.LUA:1447: assertion failed!
stack traceback:
[C]: in function 'globals.assert'
ML/SCRIPTS/API_TEST.LUA:1447: in function 'globals.test_movie'
ML/SCRIPTS/API_TEST.LUA:1484: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunk

Using previous build it will fail at line 552 under test_keys() function. New build prints a warning in log about half shutter button

P.S: A1ex, Do you have more commits to push on lua_fix? Can you have a look why selftest "Small-block malloc test" will not works if I merge this on manual_lens?

Edit2: I noticed that lens wasn't screwed, so Af test wasn't enabled. Redone test and first AF test was ok, then it get in a loop trying to focus over infinity and and printing "lens is stuck?"
Code: [Select]

===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-9-20 18:38:37
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 75
    apex = 2.375
    ms = 193
    value = 0.192776
  aperture = table:
    raw = 40
    apex = 4.
    value = 4.
    min = table:
      raw = 32
      apex = 3.
      value = 2.8
    max = table:
      raw = 88
      apex = 10.
      value = 32
  iso = table:
    raw = 104
    apex = 9.
    value = 1600
  ec = table:
    raw = 0
    value = 0
  flash = true
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 5500
  mode = 3
  metering_mode = 3
  drive_mode = 0
  model = "Canon EOS 50D"
  model_short = "50D"
  firmware = "1.0.9"
  temperature = 158
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  burst = function: 0x9f37e8
  wait = function: 0x9f2460
  reboot = function: 0x9f3508
  bulb = function: 0x9f3768
  shoot = function: 0x9f3534
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  hide = function: 0x9f0de4
  write = function: 0x9f0e88
  clear = function: 0x9f0dd4
  show = function: 0x9f0df4
lv = table:
  enabled = false
  paused = false
  running = false
  zoom = 1
  overlays = false
  start = function: 0x9f3970
  pause = function: 0x9f4018
  stop = function: 0x9f3980
  info = function: 0x9f3d14
  wait = function: 0x9f43d8
  resume = function: 0x9f4008
lens = table:
  name = "17-50mm"
  focal_length = 17
  focus_distance = 0
  hyperfocal = 3836
  dof_near = 1358705152
  dof_far = 1000000
  af = true
  af_mode = 0
  focus = function: 0x9f5084
  autofocus = function: 0x9f4ebc
display = table:
  idle = nil
  height = 480
  width = 720
  pixel = function: 0x9f6b64
  circle = function: 0x9f6268
  line = function: 0x9f689c
  load = function: 0x9f5bf4
  print = function: 0x9f6d30
  rect = function: 0x9f6538
  notify_box = function: 0x9f59c4
  draw = function: 0x9f5aac
  off = function: 0x9f5900
  on = function: 0x9f5910
  clear = function: 0x9f581c
  screenshot = function: 0x9f582c
key = table:
  last = 20
  press = function: 0x9f7508
  wait = function: 0x9f7240
menu = table:
  visible = false
  set = function: 0x9f8af4
  open = function: 0x9f7880
  close = function: 0x9f7868
  get = function: 0x9f8cd4
  select = function: 0x9f8a20
  new = function: 0x9f9930
  block = function: 0x9f7a70
movie = table:
  recording = false
  start = function: 0x9f5518
  stop = function: 0x9f5484
dryos = table:
  clock = 12
  ms_clock = 12899
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0x9fac24
    children = function: 0x9faadc
    files = function: 0x9fa9c0
    parent = table:
      exists = true
      create = function: 0x9fac24
      children = function: 0x9faadc
      files = function: 0x9fa9c0
      parent = table:
        exists = true
        create = function: 0x9fac24
        children = function: 0x9faadc
        files = function: 0x9fa9c0
        parent = nil
        path = "A:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0x9fac24
      children = function: 0x9faadc
      files = function: 0x9fa9c0
      parent = table:
        exists = true
        create = function: 0x9fac24
        children = function: 0x9faadc
        files = function: 0x9fa9c0
        parent = table:
          exists = true
          create = function: 0x9fac24
          children = function: 0x9faadc
          files = function: 0x9fa9c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/102CANON/"
    file_number = 1812
    folder_number = 102
    free_space = 5412
    image_path = function: 0x9fae00
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  shooting_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0x9fac24
      children = function: 0x9faadc
      files = function: 0x9fa9c0
      parent = table:
        exists = true
        create = function: 0x9fac24
        children = function: 0x9faadc
        files = function: 0x9fa9c0
        parent = table:
          exists = true
          create = function: 0x9fac24
          children = function: 0x9faadc
          files = function: 0x9fa9c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/102CANON/"
    file_number = 1812
    folder_number = 102
    free_space = 5412
    image_path = function: 0x9fae00
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  cf_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0x9fac24
      children = function: 0x9faadc
      files = function: 0x9fa9c0
      parent = table:
        exists = true
        create = function: 0x9fac24
        children = function: 0x9faadc
        files = function: 0x9fa9c0
        parent = table:
          exists = true
          create = function: 0x9fac24
          children = function: 0x9faadc
          files = function: 0x9fa9c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/102CANON/"
    file_number = 1812
    folder_number = 102
    free_space = 5412
    image_path = function: 0x9fae00
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  sd_card = nil
  date = table:
    day = 20
    hour = 18
    month = 9
    yday = 1
    wday = 2
    sec = 38
    isdst = false
    min = 38
    year = 2018
  rename = function: 0x9fa3e0
  call = function: 0x9fa1dc
  remove = function: 0x9fa4b4
  directory = function: 0x9fa520
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0x9fb840
battery = table:
function not available on this camera
stack traceback:
[C]: in ?
[C]: in for iterator 'for iterator'
ML/SCRIPTS/LIB/logger.lua:125: in function 'logger.serialize'
ML/SCRIPTS/API_TEST.LUA:45: in function <ML/SCRIPTS/API_TEST.LUA:44>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:44: in function 'print_table'
ML/SCRIPTS/API_TEST.LUA:90: in function 'generic_tests'
ML/SCRIPTS/API_TEST.LUA:1471: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunktask = table:
  create = function: 0x9fc028
  yield = function: 0x9fbea8
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
CF card (A:/) present
- free space: 5412 MiB
- next image: A:/DCIM/102CANON/IMG_1813.CR2
- DCIM dir. : A:/DCIM/102CANON/
File I/O tests completed.

Testing Canon GUI functions...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Resume LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Canon GUI tests completed.

Testing ML menu API...
Menu tests completed.

Testing picture taking functions...
Snap simulation test...
Single picture...
A:/DCIM/102CANON/IMG_1813.CR2: 18622312
A:/DCIM/102CANON/IMG_1813.JPG not found.
Two burst pictures...
Ideally, the camera should be in some continuous shooting mode (not checked).
A:/DCIM/102CANON/ABC_1814.CR2: 18612035
A:/DCIM/102CANON/ABC_1814.JPG not found.
A:/DCIM/102CANON/ABC_1815.CR2: 18636418
A:/DCIM/102CANON/ABC_1815.JPG not found.
Bracketed pictures...
A:/DCIM/102CANON/IMG_1816.CR2: 17129986
A:/DCIM/102CANON/IMG_1816.JPG not found.
A:/DCIM/102CANON/IMG_1817.CR2: 18624202
A:/DCIM/102CANON/IMG_1817.JPG not found.
A:/DCIM/102CANON/IMG_1818.CR2: 21540350
A:/DCIM/102CANON/IMG_1818.JPG not found.
Bulb picture...
Elapsed time: 11848
A:/DCIM/102CANON/IMG_1819.CR2: 15562635
A:/DCIM/102CANON/IMG_1819.JPG not found.
Picture taking tests completed.

Testing multitasking...
Only one task allowed to interrupt...
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Multitasking tests completed.

Testing half-shutter...
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
Half-shutter test OK.

Testing module 'lv'...
Starting LiveView...
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: ML
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: ML
Setting zoom to x1...
Setting zoom to x5...
Setting zoom to x10...
Setting zoom to x5...
Setting zoom to x1...
Setting zoom to x10...
Setting zoom to x1...
Pausing LiveView...
Resuming LiveView...
Stopping LiveView...
LiveView tests completed.


Testing lens focus functionality...
Autofocus outside LiveView...
Focus distance: 0
Autofocus in LiveView...
Is there something to focus on?
29...Please trigger autofocus (half-shutter / AF-ON / * ).
59...58...57...56...55...54...53...52...51...50...49...48...Autofocus triggered.
Autofocus completed.
Focus distance: 0
Focusing backward...
Focus distance: 0
Focus motor position: 13242
Focusing forward with step size 3, wait=true...
...
ML/SCRIPTS/API_TEST.LUA:1362: lens.focus() requires autofocus enabled.
stack traceback:
[C]: in function 'lens.focus'
ML/SCRIPTS/API_TEST.LUA:1362: in function 'test_lens_focus'
ML/SCRIPTS/API_TEST.LUA:1482: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunk

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: Lua Scripting (lua.mo)
« Reply #429 on: September 20, 2018, 08:21:02 PM »
Will look into malloc issues, but now I need to take a break, sorry.

AF test: maybe worth trying some other lens? Follow focus working? Maybe it breaks after AF test? (you could try commenting out the calls to lens.autofocus).

Movie recording test: you could run just that (remove other tests from the script) and see if there's any message on the screen. Maybe add some printf's in movie_end (shoot.c) and see where it fails. It presses SET and checks some pre- and post-conditions.

David_Hugh

  • Freshman
  • **
  • Posts: 73
Re: Lua Scripting (lua.mo)
« Reply #430 on: September 20, 2018, 11:36:06 PM »
Here's the log for 70D! Looks pretty similar to what was posted before...

Code: [Select]
ML/SCRIPTS/API_TEST.LUA - 2018-9-20 22:41:54
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 115
    apex = 7.375
    ms = 6
    value = 0.006024
  aperture = table:
    raw = 21
    apex = 1.625
    value = 1.7
    min = table:
      raw = 21
      apex = 1.625
      value = 1.7
    max = table:
      raw = 72
      apex = 8.
      value = 16
  iso = table:
    raw = 80
    apex = 6.
    value = 200
  ec = table:
    raw = 0
    value = 0
  flash = true
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 2500
  mode = 3
  metering_mode = 3
  drive_mode = 0
  model = "Canon EOS 70D"
  model_short = "70D"
  firmware = "1.1.2"
  temperature = 155
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  shoot = function: 0xc0a3a4
  bulb = function: 0xc0a5d8
  wait = function: 0xc092d0
  burst = function: 0xc0a658
  reboot = function: 0xc0a378
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  hide = function: 0xc07c54
  show = function: 0xc07c64
  clear = function: 0xc07c44
  write = function: 0xc07cf8
lv = table:
  enabled = false
  paused = false
  running = false
  zoom = 1
  overlays = false
  stop = function: 0xc0a7f0
  info = function: 0xc0ab84
  pause = function: 0xc0ae88
  start = function: 0xc0a7e0
  wait = function: 0xc0b248
  resume = function: 0xc0ae78
lens = table:
  name = "18-35mm"
  focal_length = 23
  focus_distance = 540
  hyperfocal = 16423
  dof_near = 525
  dof_far = 555
  af = true
  af_mode = 0
  focus = function: 0xc0bef4
  autofocus = function: 0xc0bd2c
display = table:
  idle = nil
  height = 480
  width = 720
  line = function: 0xc0d70c
  clear = function: 0xc0c68c
  pixel = function: 0xc0d9d4
  print = function: 0xc0dba0
  off = function: 0xc0c770
  notify_box = function: 0xc0c834
  load = function: 0xc0ca64
  rect = function: 0xc0d3a8
  draw = function: 0xc0c91c
  circle = function: 0xc0d0d8
  on = function: 0xc0c780
  screenshot = function: 0xc0c69c
key = table:
  last = 10
  wait = function: 0xc0e0b0
  press = function: 0xc0e378
menu = table:
  visible = false
  get = function: 0xc0fb44
  open = function: 0xc0e6f0
  new = function: 0xc107a0
  block = function: 0xc0e8e0
  set = function: 0xc0f964
  select = function: 0xc0f890
  close = function: 0xc0e6d8
movie = table:
  recording = false
  stop = function: 0xc0c2f4
  start = function: 0xc0c388
dryos = table:
  clock = 49
  ms_clock = 49459
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0xc11a94
    children = function: 0xc1194c
    files = function: 0xc11830
    parent = table:
      exists = true
      create = function: 0xc11a94
      children = function: 0xc1194c
      files = function: 0xc11830
      parent = table:
        exists = true
        create = function: 0xc11a94
        children = function: 0xc1194c
        files = function: 0xc11830
        parent = nil
        path = "B:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xc11a94
      children = function: 0xc1194c
      files = function: 0xc11830
      parent = table:
        exists = true
        create = function: 0xc11a94
        children = function: 0xc1194c
        files = function: 0xc11830
        parent = table:
          exists = true
          create = function: 0xc11a94
          children = function: 0xc1194c
          files = function: 0xc11830
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 6459
    folder_number = 100
    free_space = 30385
    image_path = function: 0xc11c70
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  shooting_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xc11a94
      children = function: 0xc1194c
      files = function: 0xc11830
      parent = table:
        exists = true
        create = function: 0xc11a94
        children = function: 0xc1194c
        files = function: 0xc11830
        parent = table:
          exists = true
          create = function: 0xc11a94
          children = function: 0xc1194c
          files = function: 0xc11830
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 6459
    folder_number = 100
    free_space = 30385
    image_path = function: 0xc11c70
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  cf_card = nil
  sd_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xc11a94
      children = function: 0xc1194c
      files = function: 0xc11830
      parent = table:
        exists = true
        create = function: 0xc11a94
        children = function: 0xc1194c
        files = function: 0xc11830
        parent = table:
          exists = true
          create = function: 0xc11a94
          children = function: 0xc1194c
          files = function: 0xc11830
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 6459
    folder_number = 100
    free_space = 30385
    image_path = function: 0xc11c70
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  date = table:
    isdst = false
    hour = 22
    month = 9
    year = 2018
    min = 41
    wday = 5
    yday = 263
    day = 20
    sec = 54
  call = function: 0xc1104c
  rename = function: 0xc11250
  directory = function: 0xc11390
  remove = function: 0xc11324
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0xc126b0
battery = table:
  level = 99
  id = 0
  performance = 3
  time = nil
  drain_rate = 33
task = table:
  create = function: 0xc12e98
  yield = function: 0xc12d18
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
SD card (B:/) present
- free space: 30385 MiB
- next image: B:/DCIM/100CANON/IMG_6460.JPG
- DCIM dir. : B:/DCIM/100CANON/
File I/O tests completed.

Testing Canon GUI functions...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Start LiveView...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Resume LiveView...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Canon GUI tests completed.

Testing ML menu API...

ML/SCRIPTS/API_TEST.LUA:390: assertion failed!
stack traceback:
[C]: in function 'assert'
ML/SCRIPTS/API_TEST.LUA:390: in function 'test_menu'
ML/SCRIPTS/API_TEST.LUA:1476: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunk

aprofiti

  • Contributor
  • Member
  • *****
  • Posts: 173
Re: Lua Scripting (lua.mo)
« Reply #431 on: September 21, 2018, 12:25:10 AM »
AF test: maybe worth trying some other lens? Follow focus working? Maybe it breaks after AF test? (you could try commenting out the calls to lens.autofocus).
I suspect that is more likely the lens not supported... It's a Tamron lens that doesn't report focus distance in Focus tab and also no Follow focus after pressing PLAY button...

Unfortunately I don't have another AF lens to try, just another couple of manuals lenses...
However just the steps increment AF test seems to fail

Movie recording test: you could run just that (remove other tests from the script) and see if there's any message on the screen. Maybe add some printf's in movie_end (shoot.c) and see where it fails. It presses SET and checks some pre- and post-conditions.
Already backtracked code previously because I was suspecting for SET button not pressed as I noticed some times ago that half shutter doesn't work with non raw movie recording in 50D, don't know if it the same for other camera.

I tried to put some debugging messages and seems problem is that fake_simble_button() doesn't works due to Locked UI:



Tried with and without REC Key set to HalfShutter

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3707
Re: Lua Scripting (lua.mo)
« Reply #432 on: September 21, 2018, 01:43:08 AM »
7D test looks good:

Code: [Select]
===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-9-20 15:32:35
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 101
    apex = 5.625
    ms = 20
    value = 0.020263
  aperture = table:
    raw = 48
    apex = 5.
    value = 5.6
    min = table:
      raw = 37
      apex = 3.625
      value = 3.5
    max = table:
      raw = 80
      apex = 9.
      value = 22.6
  iso = table:
    raw = 104
    apex = 9.
    value = 1600
  ec = table:
    raw = 0
    value = 0
  flash = true
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 5500
  mode = 3
  metering_mode = 3
  drive_mode = 0
  model = "Canon EOS 7D"
  model_short = "7D"
  firmware = "2.0.3"
  temperature = 146
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  shoot = function: 0xb6bf34
  bulb = function: 0xb6c168
  reboot = function: 0xb6bf08
  wait = function: 0xb6ae60
  burst = function: 0xb6c1e8
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  hide = function: 0xb697e4
  write = function: 0xb69888
  clear = function: 0xb697d4
  show = function: 0xb697f4
lv = table:
  enabled = false
  paused = false
  running = false
  zoom = 1
  overlays = false
  info = function: 0xb6c714
  stop = function: 0xb6c380
  wait = function: 0xb6cdd8
  resume = function: 0xb6ca08
  start = function: 0xb6c370
  pause = function: 0xb6ca18
lens = table:
  name = "EF28-105mm f/3.5-4.5 USM"
  focal_length = 28
  focus_distance = 880
  hyperfocal = 7424
  dof_near = 797
  dof_far = 983
  af = true
  af_mode = 0
  focus = function: 0xb6da84
  autofocus = function: 0xb6d8bc
display = table:
  idle = nil
  height = 480
  width = 720
  rect = function: 0xb6ef38
  on = function: 0xb6e310
  print = function: 0xb6f730
  circle = function: 0xb6ec68
  line = function: 0xb6f29c
  notify_box = function: 0xb6e3c4
  screenshot = function: 0xb6e22c
  off = function: 0xb6e300
  load = function: 0xb6e5f4
  draw = function: 0xb6e4ac
  clear = function: 0xb6e21c
  pixel = function: 0xb6f564
key = table:
  last = 20
  press = function: 0xb6ff08
  wait = function: 0xb6fc40
menu = table:
  visible = false
  set = function: 0xb714f4
  select = function: 0xb71420
  close = function: 0xb70268
  get = function: 0xb716d4
  open = function: 0xb70280
  new = function: 0xb72330
  block = function: 0xb70470
movie = table:
  recording = false
  start = function: 0xb6df18
  stop = function: 0xb6de84
dryos = table:
  clock = 19
  ms_clock = 19435
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0xb73624
    children = function: 0xb734dc
    files = function: 0xb733c0
    parent = table:
      exists = true
      create = function: 0xb73624
      children = function: 0xb734dc
      files = function: 0xb733c0
      parent = table:
        exists = true
        create = function: 0xb73624
        children = function: 0xb734dc
        files = function: 0xb733c0
        parent = nil
        path = "A:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xb73624
      children = function: 0xb734dc
      files = function: 0xb733c0
      parent = table:
        exists = true
        create = function: 0xb73624
        children = function: 0xb734dc
        files = function: 0xb733c0
        parent = table:
          exists = true
          create = function: 0xb73624
          children = function: 0xb734dc
          files = function: 0xb733c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/100EOS7D/"
    file_number = 17
    folder_number = 100
    free_space = 30482
    image_path = function: 0xb73800
    type = "CF"
    _card_ptr = userdata
    path = "A:/"
  shooting_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xb73624
      children = function: 0xb734dc
      files = function: 0xb733c0
      parent = table:
        exists = true
        create = function: 0xb73624
        children = function: 0xb734dc
        files = function: 0xb733c0
        parent = table:
          exists = true
          create = function: 0xb73624
          children = function: 0xb734dc
          files = function: 0xb733c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/100EOS7D/"
    file_number = 17
    folder_number = 100
    free_space = 30482
    image_path = function: 0xb73800
    type = "CF"
    _card_ptr = userdata
    path = "A:/"
  cf_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xb73624
      children = function: 0xb734dc
      files = function: 0xb733c0
      parent = table:
        exists = true
        create = function: 0xb73624
        children = function: 0xb734dc
        files = function: 0xb733c0
        parent = table:
          exists = true
          create = function: 0xb73624
          children = function: 0xb734dc
          files = function: 0xb733c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/100EOS7D/"
    file_number = 17
    folder_number = 100
    free_space = 30482
    image_path = function: 0xb73800
    type = "CF"
    _card_ptr = userdata
    path = "A:/"
  sd_card = nil
  date = table:
    wday = 5
    hour = 15
    day = 20
    min = 32
    month = 9
    sec = 35
    isdst = false
    yday = 263
    year = 2018
  directory = function: 0xb72f20
  call = function: 0xb72bdc
  rename = function: 0xb72de0
  remove = function: 0xb72eb4
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0xb74240
battery = table:
  level = 59
  id = 0
  performance = 3
  time = nil
  drain_rate = 33
task = table:
  create = function: 0xb74a28
  yield = function: 0xb748a8
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
CF card (A:/) present
- free space: 30482 MiB
- next image: A:/DCIM/100EOS7D/IMG_0018.CR2
- DCIM dir. : A:/DCIM/100EOS7D/
File I/O tests completed.

Testing Canon GUI functions...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Start LiveView...
Stop LiveView...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Start LiveView...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Canon GUI tests completed.

Testing ML menu API...
Menu tests completed.

Testing picture taking functions...
Snap simulation test...
Single picture...
A:/DCIM/100EOS7D/IMG_0018.CR2: 26615415
A:/DCIM/100EOS7D/IMG_0018.JPG not found.
Two burst pictures...
Ideally, the camera should be in some continuous shooting mode (not checked).
A:/DCIM/100EOS7D/ABC_0019.CR2: 31920840
A:/DCIM/100EOS7D/ABC_0019.JPG not found.
A:/DCIM/100EOS7D/ABC_0020.CR2: 30492116
A:/DCIM/100EOS7D/ABC_0020.JPG not found.
Bracketed pictures...
A:/DCIM/100EOS7D/IMG_0021.CR2: 25987980
A:/DCIM/100EOS7D/IMG_0021.JPG not found.
A:/DCIM/100EOS7D/IMG_0022.CR2: 30908496
A:/DCIM/100EOS7D/IMG_0022.JPG not found.
A:/DCIM/100EOS7D/IMG_0023.CR2: 16403388
A:/DCIM/100EOS7D/IMG_0023.JPG not found.
Bulb picture...
Elapsed time: 12700
A:/DCIM/100EOS7D/IMG_0024.CR2: 14301987
A:/DCIM/100EOS7D/IMG_0024.JPG not found.
Picture taking tests completed.

Testing multitasking...
Only one task allowed to interrupt...
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Multitasking tests completed.

Testing half-shutter...
Half-shutter test OK.

Testing module 'lv'...
Starting LiveView...
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: ML
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: ML
Setting zoom to x1...
Setting zoom to x5...
Setting zoom to x10...
Setting zoom to x5...
Setting zoom to x1...
Setting zoom to x10...
Setting zoom to x1...
Pausing LiveView...
Resuming LiveView...
Stopping LiveView...
LiveView tests completed.


Testing lens focus functionality...
Autofocus outside LiveView...
Focus distance: 1100
Autofocus in LiveView...
Please trigger autofocus (half-shutter / AF-ON / * ).
59...58...57...56...55...54...Autofocus triggered.
Autofocus completed.
Focus distance: 655350
Focusing backward...
Focus distance: 655350
Focus motor position: 9
Focusing forward with step size 3, wait=true...
........
Focus distance: 470
Focus motor position: -1895
Focusing backward with step size 3, wait=true...
...........
Focus distance: 655350
Focus motor position: 7
Focus range: 8 steps forward, 11 steps backward.
Motor steps: 1904 forward, 1902 backward, 2 lost.
Focusing forward with step size 3, wait=false...
................
Focus distance: 470
Focus motor position: -1895
Focusing backward with step size 3, wait=false...
.................
Focus distance: 655350
Focus motor position: 0
Focus range: 16 steps forward, 17 steps backward.
Motor steps: 1902 forward, 1895 backward, 7 lost.
Focusing forward with step size 2, wait=true...
.............................................
Focus distance: 470
Focus motor position: -1896
Focusing backward with step size 2, wait=true...
............................................
Focus distance: 655350
Focus motor position: 0
Focus range: 45 steps forward, 44 steps backward.
Motor steps: 1896 forward, 1896 backward, 0 lost.
Focusing forward with step size 2, wait=false...
...........................................................................................
Focus distance: 470
Focus motor position: -1895
Focusing backward with step size 2, wait=false...
.................................................................................................
Focus distance: 655350
Focus motor position: 3
Focus range: 91 steps forward, 97 steps backward.
Motor steps: 1895 forward, 1898 backward, 3 lost.

Focus test completed.

Testing exposure settings...
Camera    : Canon EOS 7D (7D) 2.0.3
Lens      : EF28-105mm f/3.5-4.5 USM
Shoot mode: 3
Shutter   : Ç5 (raw 75, 0.192776s, 193ms, apex 2.375)
Aperture  : Å5.6 (raw 48, f/5.6, apex 5.)
Av range  : Å3.5..Å22 (raw 37..80, f/3.5..f/22.6, apex 3.625..9.)
ISO       : Ä1600 (raw 104, 1600, apex 9.)
EC        : 0.0 (raw 0, 0 EV)
Flash EC  : 0.0 (raw 0, 0 EV)
Setting shutter to random values...
Setting ISO to random values...
Setting aperture to random values...
Error: aperture delta 0.275001 EV (expected < 0.1875, Å9.9, method=2)
Please switch to Av mode.
Setting EC to random values...
Setting Flash EC to random values...
Exposure tests completed.


Testing movie recording...
Please switch to Movie mode.
Movie recording tests completed.

Done!
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3707
Re: Lua Scripting (lua.mo)
« Reply #433 on: September 21, 2018, 01:46:21 AM »
EOSM test, not so good:

Code: [Select]
===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-9-20 16:51:36
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 104
    apex = 6.
    ms = 16
    value = 0.015625
  aperture = table:
    raw = 37
    apex = 3.625
    value = 3.5
    min = table:
      raw = 24
      apex = 2.
      value = 2.
    max = table:
      raw = 80
      apex = 9.
      value = 22.6
  iso = table:
    raw = 72
    apex = 5.
    value = 100
  ec = table:
    raw = 0
    value = 0
  flash = "auto"
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 6500
  mode = 3
  metering_mode = 3
  drive_mode = 0
  model = "Canon EOS M"
  model_short = "EOSM"
  firmware = "2.0.2"
  temperature = 228
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  burst = function: 0xb34cf8
  shoot = function: 0xb34a44
  reboot = function: 0xb34a18
  bulb = function: 0xb34c78
  wait = function: 0xb33970
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  clear = function: 0xb322e4
  write = function: 0xb32398
  hide = function: 0xb322f4
  show = function: 0xb32304
lv = table:
  enabled = true
  paused = false
  running = true
  zoom = 1
  overlays = 2
  pause = function: 0xb35528
  info = function: 0xb35224
  resume = function: 0xb35518
  start = function: 0xb34e80
  stop = function: 0xb34e90
  wait = function: 0xb358e8
lens = table:
  name = "EF-M22mm f/2 STM"
  focal_length = 22
  focus_distance = 655350
  hyperfocal = 7322
  dof_near = 7242
  dof_far = 1000000
  af = true
  af_mode = 0
  focus = function: 0xb36594
  autofocus = function: 0xb363cc
display = table:
  idle = nil
  height = 480
  width = 720
  clear = function: 0xb36d2c
  screenshot = function: 0xb36d3c
  load = function: 0xb37104
  print = function: 0xb38240
  draw = function: 0xb36fbc
  pixel = function: 0xb38074
  on = function: 0xb36e20
  circle = function: 0xb37778
  off = function: 0xb36e10
  line = function: 0xb37dac
  rect = function: 0xb37a48
  notify_box = function: 0xb36ed4
key = table:
  last = 10
  press = function: 0xb38a18
  wait = function: 0xb38750
menu = table:
  visible = false
  get = function: 0xb3a1e4
  select = function: 0xb39f30
  block = function: 0xb38f80
  set = function: 0xb3a004
  open = function: 0xb38d90
  close = function: 0xb38d78
  new = function: 0xb3ae40
movie = table:
  recording = false
  stop = function: 0xb36994
  start = function: 0xb36a28
dryos = table:
  clock = 9
  ms_clock = 9705
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0xb3c134
    children = function: 0xb3bfec
    files = function: 0xb3bed0
    parent = table:
      exists = true
      create = function: 0xb3c134
      children = function: 0xb3bfec
      files = function: 0xb3bed0
      parent = table:
        exists = true
        create = function: 0xb3c134
        children = function: 0xb3bfec
        files = function: 0xb3bed0
        parent = nil
        path = "B:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xb3c134
      children = function: 0xb3bfec
      files = function: 0xb3bed0
      parent = table:
        exists = true
        create = function: 0xb3c134
        children = function: 0xb3bfec
        files = function: 0xb3bed0
        parent = table:
          exists = true
          create = function: 0xb3c134
          children = function: 0xb3bfec
          files = function: 0xb3bed0
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 7446
    folder_number = 100
    free_space = 30382
    image_path = function: 0xb3c310
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  shooting_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xb3c134
      children = function: 0xb3bfec
      files = function: 0xb3bed0
      parent = table:
        exists = true
        create = function: 0xb3c134
        children = function: 0xb3bfec
        files = function: 0xb3bed0
        parent = table:
          exists = true
          create = function: 0xb3c134
          children = function: 0xb3bfec
          files = function: 0xb3bed0
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 7446
    folder_number = 100
    free_space = 30382
    image_path = function: 0xb3c310
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  cf_card = nil
  sd_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xb3c134
      children = function: 0xb3bfec
      files = function: 0xb3bed0
      parent = table:
        exists = true
        create = function: 0xb3c134
        children = function: 0xb3bfec
        files = function: 0xb3bed0
        parent = table:
          exists = true
          create = function: 0xb3c134
          children = function: 0xb3bfec
          files = function: 0xb3bed0
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 7446
    folder_number = 100
    free_space = 30382
    image_path = function: 0xb3c310
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  date = table:
    day = 20
    min = 51
    hour = 16
    wday = 5
    month = 9
    isdst = false
    yday = 263
    sec = 37
    year = 2018
  call = function: 0xb3b6ec
  directory = function: 0xb3ba30
  remove = function: 0xb3b9c4
  rename = function: 0xb3b8f0
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0xb3cd50
battery = table:
function not available on this camera
stack traceback:
[C]: in ?
[C]: in for iterator 'for iterator'
ML/SCRIPTS/LIB/logger.lua:125: in function 'logger.serialize'
ML/SCRIPTS/API_TEST.LUA:45: in function <ML/SCRIPTS/API_TEST.LUA:44>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:44: in function 'globals.print_table'
ML/SCRIPTS/API_TEST.LUA:90: in function 'globals.generic_tests'
ML/SCRIPTS/API_TEST.LUA:1471: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunktask = table:
  yield = function: 0xb3d3b8
  create = function: 0xb3d538
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
SD card (B:/) present
- free space: 30382 MiB
- next image: B:/DCIM/100CANON/IMG_7447.CR2
- DCIM dir. : B:/DCIM/100CANON/
File I/O tests completed.

Testing Canon GUI functions...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...

ML/SCRIPTS/API_TEST.LUA:293: assertion failed!
stack traceback:
[C]: in function 'globals.assert'
ML/SCRIPTS/API_TEST.LUA:293: in function 'globals.test_camera_gui'
ML/SCRIPTS/API_TEST.LUA:1475: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunk
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3707
Re: Lua Scripting (lua.mo)
« Reply #434 on: September 21, 2018, 03:08:25 AM »
700D is good too. I take it that the 5D3 has been thoroughly tested.

Code: [Select]
===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-9-21 02:12:57
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 125
    apex = 8.625
    ms = 3
    value = 0.002533
  aperture = table:
    raw = 40
    apex = 4.
    value = 4.
    min = table:
      raw = 37
      apex = 3.625
      value = 3.5
    max = table:
      raw = 80
      apex = 9.
      value = 22.6
  iso = table:
    raw = 120
    apex = 11.000001
    value = 6400
  ec = table:
    raw = 0
    value = 0
  flash = true
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 4500
  mode = 3
  metering_mode = 3
  drive_mode = 0
  model = "Canon EOS REBEL T5i"
  model_short = "700D"
  firmware = "1.1.5"
  temperature = 150
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  wait = function: 0xb16f00
  reboot = function: 0xb17fa8
  bulb = function: 0xb18208
  burst = function: 0xb18288
  shoot = function: 0xb17fd4
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  write = function: 0xb15928
  clear = function: 0xb15874
  hide = function: 0xb15884
  show = function: 0xb15894
lv = table:
  enabled = false
  paused = false
  running = false
  zoom = 1
  overlays = false
  start = function: 0xb18410
  resume = function: 0xb18aa8
  info = function: 0xb187b4
  stop = function: 0xb18420
  wait = function: 0xb18e78
  pause = function: 0xb18ab8
lens = table:
  name = "EF28-105mm f/3.5-4.5 USM"
  focal_length = 28
  focus_distance = 655350
  hyperfocal = 10371
  dof_near = 10211
  dof_far = 1000000
  af = true
  af_mode = 0
  autofocus = function: 0xb1995c
  focus = function: 0xb19b24
display = table:
  idle = nil
  height = 480
  width = 720
  notify_box = function: 0xb1a464
  clear = function: 0xb1a2bc
  screenshot = function: 0xb1a2cc
  draw = function: 0xb1a54c
  rect = function: 0xb1afd8
  circle = function: 0xb1ad08
  load = function: 0xb1a694
  on = function: 0xb1a3b0
  line = function: 0xb1b33c
  off = function: 0xb1a3a0
  pixel = function: 0xb1b604
  print = function: 0xb1b7d0
key = table:
  last = 10
  wait = function: 0xb1bce0
  press = function: 0xb1bfa8
menu = table:
  visible = false
  set = function: 0xb1d594
  block = function: 0xb1c510
  open = function: 0xb1c320
  get = function: 0xb1d774
  new = function: 0xb1e3d0
  select = function: 0xb1d4c0
  close = function: 0xb1c308
movie = table:
  recording = false
  start = function: 0xb19fb8
  stop = function: 0xb19f24
dryos = table:
  clock = 9
  ms_clock = 9968
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0xb1f6c4
    children = function: 0xb1f57c
    files = function: 0xb1f460
    parent = table:
      exists = true
      create = function: 0xb1f6c4
      children = function: 0xb1f57c
      files = function: 0xb1f460
      parent = table:
        exists = true
        create = function: 0xb1f6c4
        children = function: 0xb1f57c
        files = function: 0xb1f460
        parent = nil
        path = "B:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xb1f6c4
      children = function: 0xb1f57c
      files = function: 0xb1f460
      parent = table:
        exists = true
        create = function: 0xb1f6c4
        children = function: 0xb1f57c
        files = function: 0xb1f460
        parent = table:
          exists = true
          create = function: 0xb1f6c4
          children = function: 0xb1f57c
          files = function: 0xb1f460
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 4816
    folder_number = 100
    free_space = 30383
    image_path = function: 0xb1f8a0
    type = "SD"
    _card_ptr = userdata
    path = "B:/"
  shooting_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xb1f6c4
      children = function: 0xb1f57c
      files = function: 0xb1f460
      parent = table:
        exists = true
        create = function: 0xb1f6c4
        children = function: 0xb1f57c
        files = function: 0xb1f460
        parent = table:
          exists = true
          create = function: 0xb1f6c4
          children = function: 0xb1f57c
          files = function: 0xb1f460
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 4816
    folder_number = 100
    free_space = 30383
    image_path = function: 0xb1f8a0
    type = "SD"
    _card_ptr = userdata
    path = "B:/"
  cf_card = nil
  sd_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xb1f6c4
      children = function: 0xb1f57c
      files = function: 0xb1f460
      parent = table:
        exists = true
        create = function: 0xb1f6c4
        children = function: 0xb1f57c
        files = function: 0xb1f460
        parent = table:
          exists = true
          create = function: 0xb1f6c4
          children = function: 0xb1f57c
          files = function: 0xb1f460
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 4816
    folder_number = 100
    free_space = 30383
    image_path = function: 0xb1f8a0
    type = "SD"
    _card_ptr = userdata
    path = "B:/"
  date = table:
    sec = 58
    isdst = false
    year = 2018
    hour = 2
    yday = 264
    min = 12
    day = 21
    month = 9
    wday = 6
  call = function: 0xb1ec7c
  remove = function: 0xb1ef54
  directory = function: 0xb1efc0
  rename = function: 0xb1ee80
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0xb202e0
battery = table:
function not available on this camera
stack traceback:
[C]: in ?
[C]: in for iterator 'for iterator'
ML/SCRIPTS/LIB/logger.lua:125: in function 'logger.serialize'
ML/SCRIPTS/API_TEST.LUA:45: in function <ML/SCRIPTS/API_TEST.LUA:44>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:44: in function 'print_table'
ML/SCRIPTS/API_TEST.LUA:90: in function 'generic_tests'
ML/SCRIPTS/API_TEST.LUA:1471: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunktask = table:
  yield = function: 0xb20948
  create = function: 0xb20ac8
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
SD card (B:/) present
- free space: 30383 MiB
- next image: B:/DCIM/100CANON/IMG_4817.CR2
- DCIM dir. : B:/DCIM/100CANON/
File I/O tests completed.

Testing Canon GUI functions...
Start LiveView...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Enter PLAY mode...
Exit PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Stop LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Start LiveView...
Pause LiveView...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Stop LiveView...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Start LiveView...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Stop LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter MENU mode...
Canon GUI tests completed.

Testing ML menu API...
Menu tests completed.

Testing picture taking functions...
Snap simulation test...
Single picture...
B:/DCIM/100CANON/IMG_4817.CR2: 27375458
B:/DCIM/100CANON/IMG_4817.JPG not found.
Two burst pictures...
Ideally, the camera should be in some continuous shooting mode (not checked).
B:/DCIM/100CANON/ABC_4818.CR2: 27368745
B:/DCIM/100CANON/ABC_4818.JPG not found.
B:/DCIM/100CANON/ABC_4819.CR2: 27367243
B:/DCIM/100CANON/ABC_4819.JPG not found.
Bracketed pictures...
B:/DCIM/100CANON/IMG_4820.CR2: 25458672
B:/DCIM/100CANON/IMG_4820.JPG not found.
B:/DCIM/100CANON/IMG_4821.CR2: 27376957
B:/DCIM/100CANON/IMG_4821.JPG not found.
B:/DCIM/100CANON/IMG_4822.CR2: 15054972
B:/DCIM/100CANON/IMG_4822.JPG not found.
Bulb picture...
Elapsed time: 11706
B:/DCIM/100CANON/IMG_4823.CR2: 14105453
B:/DCIM/100CANON/IMG_4823.JPG not found.
Picture taking tests completed.

Testing multitasking...
Only one task allowed to interrupt...
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Multitasking tests completed.

Testing half-shutter...
Half-shutter test OK.

Testing module 'lv'...
Starting LiveView...
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: ML
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: ML
Setting zoom to x1...
Setting zoom to x5...
Setting zoom to x10...
Setting zoom to x5...
Setting zoom to x1...
Setting zoom to x10...
Setting zoom to x1...
Pausing LiveView...
Resuming LiveView...
Stopping LiveView...
LiveView tests completed.


Testing lens focus functionality...
Autofocus outside LiveView...
Focus distance: 6820
Autofocus in LiveView...
Please trigger autofocus (half-shutter / AF-ON / * ).
59...58...57...56...55...54...53...52...51...50...49...48...47...46...45...44...43...42...41...40...39...38...Autofocus triggered.
Autofocus completed.
Focus distance: 880
Focusing backward...
Focus distance: 655350
Focus motor position: 0
Focusing forward with step size 3, wait=true...
.........
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 3, wait=true...
.......
Focus distance: 655350
Focus motor position: 0
Focus range: 9 steps forward, 7 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 3, wait=false...
..................................
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 3, wait=false...
...............
Focus distance: 655350
Focus motor position: 0
Focus range: 34 steps forward, 15 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 2, wait=true...
.............................................
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 2, wait=true...
............................................
Focus distance: 655350
Focus motor position: 0
Focus range: 45 steps forward, 44 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 2, wait=false...
...
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 2, wait=false...
.................................................................................
Focus distance: 655350
Focus motor position: 0
Focus range: 115 steps forward, 81 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.

Focus test completed.

Testing exposure settings...
Camera    : Canon EOS REBEL T5i (700D) 1.1.5
Lens      : EF28-105mm f/3.5-4.5 USM
Shoot mode: 3
Shutter   : Ç5 (raw 75, 0.192776s, 193ms, apex 2.375)
Aperture  : Å4.0 (raw 40, f/4., apex 4.)
Av range  : Å3.8..Å24 (raw 39..82, f/3.8..f/24.6, apex 3.875..9.25)
ISO       : Ä1600 (raw 104, 1600, apex 9.)
EC        : 0.0 (raw 0, 0 EV)
Flash EC  : 0.0 (raw 0, 0 EV)
Setting shutter to random values...
Setting ISO to random values...
Setting aperture to random values...
Please switch to Av mode.
Setting EC to random values...
Setting Flash EC to random values...
Exposure tests completed.


Testing movie recording...
Please switch to Movie mode.
Movie recording tests completed.

Done!
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: Lua Scripting (lua.mo)
« Reply #435 on: September 21, 2018, 07:15:42 AM »
I tried to put some debugging messages and seems problem is that fake_simble_button() doesn't works due to Locked UI:

That must be from those half-shutter tricks, so we'll probably need to disengage these somehow.

That fake_simple_button considering UI locks must be a bit overkill; I should double-check that. At least, the shutter bit should not affect things, so we may leave it out (gui-common.c, try 0xFFFE instead of 0xFFFF). I believe that's enough to pass the test (but then, I've expected the Lua tests tweaking for 5D2 would take half an hour or so, and it took an entire week...)

Quote
ML/SCRIPTS/API_TEST.LUA:293:

Likely returned from PLAY mode to LiveView. Any sort of Canon dialog pops up that would prevent ML from considering that GUI mode as "idle"? Maybe that shooting mode indicator with huge fonts? Can it be disabled from Canon menu?

On 500D, there was one indicator telling you to autofocus with the back button, rather than half-shutter. The 500D cannot focus with half-shutter in LiveView. That dialog was pretty annoying after a while, and there was a feature request to remove it (just don't remember where), so... I've disabled that dialog.

Quote
ML/SCRIPTS/API_TEST.LUA:390: assertion failed!

Right, FPS override missing (and enabling it in its current state would probably fail the test anyway).

The 70D may also fail at lens.autofocus(). If you comment out these tests from api_test.lua, do the others pass?

aprofiti

  • Contributor
  • Member
  • *****
  • Posts: 173
Re: Lua Scripting (lua.mo)
« Reply #436 on: September 21, 2018, 12:57:02 PM »
That must be from those half-shutter tricks, so we'll probably need to disengage these somehow.

That fake_simple_button considering UI locks must be a bit overkill; I should double-check that. At least, the shutter bit should not affect things, so we may leave it out (gui-common.c, try 0xFFFE instead of 0xFFFF).

Now it stop the movie :) Still trigger an Assertion at line 1454 but that's movie review which is not available on 50D.

If I enter LV manually, I get in console "UILock: 00000000 -> 41000000 -> 00000000"
when recoding start it prints "UILock: 8300017f -> 41000001 -> 8300017f (!!!)"

May be useful to know? Maybe is not halfshutter?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: Lua Scripting (lua.mo)
« Reply #437 on: September 21, 2018, 01:18:20 PM »
Now it stop the movie :) Still trigger an Assertion at line 1454 but that's movie review which is not available on 50D.

Confirmed in QEMU - the 50D does not even attempt to play the movie. So... the only thing we can do is to add an exception.

Or figure out how to implement movie playback, but that's a bit more difficult.

Quote
If I enter LV manually, I get in console "UILock: 00000000 -> 41000000 -> 00000000"
when recoding start it prints "UILock: 8300017f -> 41000001 -> 8300017f (!!!)"

Confirmed on 5D2; the UI lock change for blocking half-shutter is not yet confirmed when prop_request_change returns, since that's requested from another property handler. Appears to be a false alarm.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: Lua Scripting (lua.mo)
« Reply #438 on: December 23, 2018, 11:33:19 PM »
Holidays are here, so I could finally look into this again. It's both refreshing that I could sit down for a couple of days to troubleshoot some long-standing issues, and frustrating that I could not achieve more than "just" a few bug fixes.

Most important changes:
- 5D2/50D: fixed memory allocation issues with many small blocks from shoot_malloc (reported by aprofiti)
- 600D/1100D: fixed Q menu navigation (it was totally broken and nobody complained)
- fixed lua.directory.children to allow recursive directory listing (sample code in api_test.lua)
- expecting api_test.lua to succeed on 50D and 70D, but only tested in QEMU
- log file moved into ML/LOGS

Is it ready for mainline? You tell me. Please run the usual tests and report back.

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)

Happy Holidays!

... or maybe Merry Christmas? not there yet :)

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1736
Re: Lua Scripting (lua.mo)
« Reply #439 on: December 24, 2018, 08:20:12 AM »
@a1ex

Only minor suggestion is that, if you can, can you add the fix to the depth of field code, i.e. https://bitbucket.org/hudson/magic-lantern/issues/2912/focusc-needs-updating-with-one-line-of

Not a prime issue, as I can easily correct in Lua.

BTW why do you use two infinities in the Lua module?  That is the focus position and dof report infinity as different numbers. Once again, not an issue, just curious.

Cheers

Garry

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: Lua Scripting (lua.mo)
« Reply #440 on: December 24, 2018, 08:51:28 AM »
Sure, will check. I was also hoping to add a QEMU test for DOF calculations (i.e. for each focus distance possibly reported by the lens, write down the computed values and compare them to some reference calculator).

Two infinities:
- focus distance: reported by Canon in cm as 16-bit values; their choice was 65535 = infinity. Lua reports it in mm, so without a special code path to handle this, it ends up as 655350 mm.
- DOF code: arbitrary choice made by Trammell many years ago (before I joined); nobody questioned it yet.

Lua seems to use math.huge for infinity, but for some reason, it's not printed correctly (possibly related to this issue).

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1736
Re: Lua Scripting (lua.mo)
« Reply #441 on: December 24, 2018, 10:01:39 AM »
@a1ex

Many thanks for the insight.

As I say, not an issue, as I can handle ‘differences’ in my scripts.

BTW DoF equations are simplifications, based on assuming a simple lens equation. Many good reads out there, eg http://www.janrik.net/DOFpostings/PM1/DOFInvestigations1.htm and https://www.panohelp.com/thinlensformula.html

Cheers

Garry

JohanJ

  • Freshman
  • **
  • Posts: 88
Re: Lua Scripting (lua.mo)
« Reply #442 on: January 01, 2019, 09:09:41 PM »
Test result for 60D using build lua_fix.2018Dec23.60D111

running API_TEST.LUA ended with ERR70 crash when the script was processing movie tests. Crashed in movie mode in funktion movie.stopp. I had to pull the battery.

Logfiles:
LUATEST.LOG
CRASH00.LOG
LOG000.LOG


Stubs test in selftest.mo: 1 failed
Logfile STUBTEST.LOG

Memory benchmarks in bench.mo
 BENCH1.JPG
 
All files can be downloaded from here:

One observation during field tests:
shortcut keys for focus patterns do not work anymore.

EDIT: Shortcut keys for focus patterns work as defined as long as back screen is off (neither Canon info screen nor leveling meter should be active). I guess that is as designed, so ignore the previous observation.

60D.111 / 100D.101 / M2.103

JohanJ

  • Freshman
  • **
  • Posts: 88
Re: Lua Scripting (lua.mo)
« Reply #443 on: January 02, 2019, 06:45:57 PM »
Test results for 100D using build lua_fix.2018Dec23.100D101

  • API_TEST.LUA went through w/o any problems. Logfiles: LUATEST.LOG
  • Stubs test in selftest.mo: 14 failed. Logfile STUBTEST.LOG
  • Memory benchmarks in bench.mo:  BENCH1_100D.JPG

All files can be downloaded from here

One strange artefact identified using long-press Q/SET button: the ML overlay symbol for long-press Q/set remains visible after Q button was released. You can see this orange little ring as a sticky symbol even when scrolling through Canon menus or even in Play mode when reviewing a picture. One has to (short) press SET again to let the symbol disappear. Two screenshots available in the download folder.
60D.111 / 100D.101 / M2.103

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3707
Re: Lua Scripting (lua.mo)
« Reply #444 on: January 25, 2019, 05:19:19 PM »
...the ML overlay symbol for long-press Q/set remains visible after Q button was released...

Let's bring some more attention to that. Here are your screenshots:





I looked through the issues in Bitbucket and couldn't find anything about this. I'd suggest filing a bug report. Sorry I can't help more at the moment.

Your stub test log does show something that I can help with.

Code: [Select]
[INFO] Camera model: Canon EOS 100D 1.0.1 (0x80000346 100D)
...
[Pass] HALFSHUTTER_PRESSED => 0x1
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
...
=========================================================
Test complete, 11688 passed, 14 failed.
.

I'll bet you ran this test in movie mode, right? Try starting the test in photo mode. The test will prompt you when to switch to movie mode.

This isn't obvious and I couldn't find anything posted about it but I've been going crazy lately trying to get a perfect test run on the EOSM and it turns out that it is because those tests fail while the camera is in LiveView and being a mirrorless, the EOSM is always in LiveView mode.

Ran the tests on the 700D, I annotated the test to find where it was failing on the EOSM/EOSM2:

Movie Mode
Code: [Select]
...
[INFO] Camera model: Canon EOS REBEL T5i 1.1.5 (0x80000326 700D)
...
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[FAIL] wait_focus_status(1000, 3) => 0x0
[FAIL] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
...
=========================================================
Test complete, 11772 passed, 20 failed.
.

Start test in photo mode then switch to movie mode when prompted:
Code: [Select]
...
[INFO] Camera model: Canon EOS REBEL T5i 1.1.5 (0x80000326 700D)
...
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[Pass] wait_focus_status(1000, 3) => 0x1
[Pass] lv_focus_status => 0x3
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[Pass] wait_focus_status(1000, 3) => 0x1
[Pass] lv_focus_status => 0x3
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[Pass] wait_focus_status(1000, 3) => 0x1
[Pass] lv_focus_status => 0x3
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[Pass] wait_focus_status(1000, 3) => 0x1
[Pass] lv_focus_status => 0x3
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[INFO] ****** EOSM/M2 usually fails here but sometimes passes ******
[Pass] wait_focus_status(1000, 3) => 0x1
[Pass] lv_focus_status => 0x3
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] wait_focus_status(1000, 3) => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x1
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x1
[Pass] get_focus_confirmation() => 0x0
[Pass] HALFSHUTTER_PRESSED => 0x0
[Pass] lv_focus_status => 0x1
...
=========================================================
Test complete, 11782 passed, 0 failed.
.

Hum--interesting that the test that triggers the fail runs 5 times in photo mode and 10 times in movie mode and reports two tests per iteration.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1542
  • Code monkey
Re: Lua Scripting (lua.mo)
« Reply #445 on: February 25, 2019, 07:39:04 PM »
- 600D/1100D: fixed Q menu navigation (it was totally broken and nobody complained)

Is it ready for mainline? You tell me. Please run the usual tests and report back.

Long time away, happy to see you all again....

Made the tests on my 600D and here results:
- lua tests      passed all
- stub tests    passed all


attached zip file with all the resulting .log and .ppm


----------------------------------------
EDIT
----------------------------------------

in unified I've tried to load all the modules after enabling flexinfo for 600D and got err70 when going in LV from photo mode. After some try found out that was the lua module the cause and that was the error log:

Code: [Select]
ASSERT: pPSLuckyTbl
at ClrHistAlgor.c:81, task CLR_CALC
lv:0 mode:3

CLR_CALC stack: 135c00 [137050-133050]
0xUNKNOWN  @ ff07e414:137048
0xUNKNOWN  @ ff1fbb10:137020
0xFF1FB56C @ ff037048:137008
0xUNKNOWN  @ ff1fb59c:136ff8
0xUNKNOWN  @ ff1fb624:136fd8
0xFF31362C @ ff12ab64:136fa8
0xFF3EEEFC @ ff31398c:136f20
0xFF0142FC @ ff3eef8c:135c38
0x00C80478 @ c809c8:135c00

Magic Lantern version : Nightly.2019Feb26.600D102
Mercurial changeset   : 7a3b5fa3f4c6+ (unified)
Built on 2019-02-26 01:27:33 UTC by scrax@MacBook-Pro-di-scrax.local.
Free Memory  : 192K + 520K

as already reported the lua_fix branch is not affected so to me this is a sign that the fix works
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: Lua Scripting (lua.mo)
« Reply #446 on: March 20, 2019, 10:40:33 AM »
EOSM test, not so good

Solved. Got one of these to test Danne's updates, and couldn't believe how broken ML is on this camera. I mean, not even the "Hello World" script was working...

Now it's a little better, but still, don't expect miracles. Pretty much "all" I wanted from this update was to pass the Lua API tests. There's plenty of other stuff to fix, that either I didn't address, or I've fixed locally but needs more testing. Many of the issues are likely easy, just time-consuming, others are a little harder. I'll see what I can do.

Also, the waveform crash identified by @garry23, and the persistent long-press icon on 100D, should be fixed.

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 6737
Re: Lua Scripting (lua.mo)
« Reply #447 on: March 20, 2019, 12:21:27 PM »
Run some non-scientific shots with 650D. ISOless (2) error with Dual-ISO not gone completely but changed manners. Before I had to reset ML settings to get rid of it and now I have a hard time to provoke it: error occured only *once* and was not persistent after restart! Lua.mo not loaded.T:

EDIT: Found a way to provoke error ... sort of. Just turn cam on and off. Somewhere between 2-5 out of 10 times ISOless error shows up. Was not able to see it 2 times in a row, yet. Can live with that.
Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5492
Re: Lua Scripting (lua.mo)
« Reply #448 on: March 20, 2019, 02:24:57 PM »
Solved. Got one of these to test Danne's updates, and couldn't believe how broken ML is on this camera. I mean, not even the "Hello World" script was working...
Yeah, this camera do need a lot of fixing but very good to learn and play with as the issues are mostly "almost already working" state. Great to see lua fixes. Super tool.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3707
Re: Lua Scripting (lua.mo)
« Reply #449 on: March 20, 2019, 07:54:22 PM »
Got one of these to test Danne's updates, and couldn't believe how broken ML is on this camera.

Yay! The EOSM is going to get some more love. Hope you got an EF-M IS lens for your EOSM.  ;)

Pretty much "all" I wanted from this update was to pass the Lua API tests.

Of course I had to try it out. It did get through all of the tests but it was an interesting journey getting there so I thought I'd document it.

First try:
Code: [Select]
Testing picture taking functions...
Snap simulation test...
Single picture...
B:/DCIM/100CANON/IMG_7537.CR2: 18609788
B:/DCIM/100CANON/IMG_7537.JPG not found.
Two burst pictures...
Ideally, the camera should be in some continuous shooting mode (not checked).

ML/SCRIPTS/API_TEST.LUA:1094: assertion failed!
stack traceback:
[C]: in function 'globals.assert'
ML/SCRIPTS/API_TEST.LUA:1094: in function 'globals.test_camera_take_pics'
ML/SCRIPTS/API_TEST.LUA:1574: in function <ML/SCRIPTS/API_TEST.LUA:1564>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1564: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1603: in main chunk

Hum, been playing around with different settings so better clear out all my Canon settings, format the card, turn on only the essential settings and try it again. Let's see, what are the essential settings I use? Switch from jpeg to raw stills, continuous shooting mode, fire shutter without lens, turn on back button focus and put it in manual mode.

Take two:
Code: [Select]
Testing lens focus functionality...
Autofocus outside LiveView...
Focus distance: 1540
Autofocus in LiveView...
Please trigger autofocus (half-shutter / AF-ON / * ).
59...58...57...56...55...54...53...52...51...50...49...48...47...46...45...44...43...42...41...40...39...38...37...36...35...34...33...32...31...30...29...28...27...26...25...24...23...22...21...20...19...18...17...16...15...14...13...12...11...10...9...8...7...6...5...4...3...2...1...0...
ML/SCRIPTS/API_TEST.LUA:1428: Autofocus not triggered.

Darn it, wasn't paying attention and missed the user prompt to trigger autofocus.

Take three:
Code: [Select]
ML/SCRIPTS/API_TEST.LUA:1441: lens.focus() requires continuous AF disabled.
stack traceback:
[C]: in function 'lens.focus'
ML/SCRIPTS/API_TEST.LUA:1441: in function 'globals.test_lens_focus'
ML/SCRIPTS/API_TEST.LUA:1579: in function <ML/SCRIPTS/API_TEST.LUA:1564>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1564: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1603: in main chunk

Oops, forgot that resetting to Canon defaults puts the camera in continuous autofocus mode. Turned that off.

Take four:


Uh, what's happening? I had an EF-M lens mounted and the lua test has always had problems with these lenses even though these were designed specifically for the M series of cameras. As you can see it is stuck in an endless loop and the lens isn't budging. Turned off the camera before the battery died and found this in the log.

Code: [Select]
Focus distance: 7600
Focusing backward...

ML/SCRIPTS/API_TEST.LUA:1441: lens.focus() only works in LiveView.
stack traceback:
[C]: in function 'lens.focus'
ML/SCRIPTS/API_TEST.LUA:1441: in function 'test_lens_focus'
ML/SCRIPTS/API_TEST.LUA:1579: in function <ML/SCRIPTS/API_TEST.LUA:1564>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:1564: in function 'api_tests'
ML/SCRIPTS/API_TEST.LUA:1603: in main chunk

Switched to an EF lens with the EF to EF-M adapter and finally got through the tests. I did forget to set movie mode to manual but it looks like it got through the movie tests anyway.

Code: [Select]
===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2019-3-20 12:11:39
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 75
    apex = 2.375
    ms = 193
    value = 0.192776
  aperture = table:
    raw = 48
    apex = 5.
    value = 5.6
    min = table:
      raw = 22
      apex = 1.75
      value = 1.8
    max = table:
      raw = 80
      apex = 9.
      value = 22.6
  iso = table:
    raw = 72
    apex = 5.
    value = 100
  ec = table:
    raw = 0
    value = 0
  flash = true
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 5200
  mode = 3
  metering_mode = 3
  drive_mode = 1
  model = "Canon EOS M"
  model_short = "EOSM"
  firmware = "2.0.2"
  temperature = 236
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  shoot = function: 0xc32124
  bulb = function: 0xc32358
  reboot = function: 0xc320f8
  wait = function: 0xc31050
  burst = function: 0xc323d8
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  clear = function: 0xc2f9c4
  write = function: 0xc2fa78
  hide = function: 0xc2f9d4
  show = function: 0xc2f9e4
lv = table:
  enabled = true
  paused = false
  running = true
  zoom = 1
  overlays = 2
  resume = function: 0xc32bf8
  info = function: 0xc32904
  stop = function: 0xc32570
  wait = function: 0xc32fc8
  pause = function: 0xc32c08
  start = function: 0xc32560
lens = table:
  name = "EF50mm f/1.8 STM"
  focal_length = 50
  focus_distance = 1990
  hyperfocal = 23596
  dof_near = 1849
  dof_far = 2155
  af = true
  af_mode = 0
  focus = function: 0xc33c74
  autofocus = function: 0xc33aac
display = table:
  idle = nil
  height = 480
  width = 720
  print = function: 0xc35920
  notify_box = function: 0xc345b4
  screenshot = function: 0xc3441c
  pixel = function: 0xc35754
  off = function: 0xc344f0
  rect = function: 0xc35128
  load = function: 0xc347e4
  circle = function: 0xc34e58
  line = function: 0xc3548c
  on = function: 0xc34500
  clear = function: 0xc3440c
  draw = function: 0xc3469c
key = table:
  last = 10
  wait = function: 0xc35e30
  press = function: 0xc360f8
menu = table:
  visible = false
  open = function: 0xc36470
  new = function: 0xc38520
  get = function: 0xc378c4
  block = function: 0xc36660
  select = function: 0xc37610
  set = function: 0xc376e4
  close = function: 0xc36458
movie = table:
  recording = false
  start = function: 0xc34108
  stop = function: 0xc34074
dryos = table:
  clock = 12
  ms_clock = 12218
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0xc39844
    children = function: 0xc396cc
    files = function: 0xc395b0
    parent = table:
      exists = true
      create = function: 0xc39844
      children = function: 0xc396cc
      files = function: 0xc395b0
      parent = table:
        exists = true
        create = function: 0xc39844
        children = function: 0xc396cc
        files = function: 0xc395b0
        parent = nil
        path = "B:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xc39844
      children = function: 0xc396cc
      files = function: 0xc395b0
      parent = table:
        exists = true
        create = function: 0xc39844
        children = function: 0xc396cc
        files = function: 0xc395b0
        parent = table:
          exists = true
          create = function: 0xc39844
          children = function: 0xc396cc
          files = function: 0xc395b0
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 7567
    folder_number = 100
    free_space = 15180
    image_path = function: 0xc39a20
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  shooting_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xc39844
      children = function: 0xc396cc
      files = function: 0xc395b0
      parent = table:
        exists = true
        create = function: 0xc39844
        children = function: 0xc396cc
        files = function: 0xc395b0
        parent = table:
          exists = true
          create = function: 0xc39844
          children = function: 0xc396cc
          files = function: 0xc395b0
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 7567
    folder_number = 100
    free_space = 15180
    image_path = function: 0xc39a20
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  cf_card = nil
  sd_card = table:
    drive_letter = "B"
    dcim_dir = table:
      exists = true
      create = function: 0xc39844
      children = function: 0xc396cc
      files = function: 0xc395b0
      parent = table:
        exists = true
        create = function: 0xc39844
        children = function: 0xc396cc
        files = function: 0xc395b0
        parent = table:
          exists = true
          create = function: 0xc39844
          children = function: 0xc396cc
          files = function: 0xc395b0
          parent = nil
          path = "B:/"
        path = "B:/DCIM/"
      path = "B:/DCIM/100CANON/"
    file_number = 7567
    folder_number = 100
    free_space = 15180
    image_path = function: 0xc39a20
    type = "SD"
    path = "B:/"
    _card_ptr = userdata
  date = table:
    month = 3
    sec = 41
    isdst = false
    hour = 12
    min = 11
    yday = 79
    wday = 4
    day = 20
    year = 2019
  rename = function: 0xc38fd0
  remove = function: 0xc390a4
  directory = function: 0xc39110
  call = function: 0xc38dcc
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0xc3a460
battery = table:
function not available on this camera
stack traceback:
[C]: in ?
[C]: in for iterator 'for iterator'
ML/SCRIPTS/LIB/logger.lua:125: in function 'logger.serialize'
ML/SCRIPTS/API_TEST.LUA:45: in function <ML/SCRIPTS/API_TEST.LUA:44>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:44: in function 'globals.print_table'
ML/SCRIPTS/API_TEST.LUA:90: in function 'globals.generic_tests'
ML/SCRIPTS/API_TEST.LUA:1568: in function <ML/SCRIPTS/API_TEST.LUA:1564>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1564: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1603: in main chunktask = table:
  yield = function: 0xc3aac8
  create = function: 0xc3ac48
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
SD card (B:/) present
- free space: 15180 MiB
- next image: B:/DCIM/100CANON/IMG_7568.CR2
- DCIM dir. : B:/DCIM/100CANON/
- B:/DCIM/
  - B:/DCIM/100CANON/
  - B:/DCIM/EOSMISC/
- B:/MISC/
- B:/ML/
  - B:/ML/FONTS/
    - B:/ML/FONTS/ARGNOR23.RBF
    - B:/ML/FONTS/ARGNOR32.RBF
    - B:/ML/FONTS/TERM20.RBF
    - B:/ML/FONTS/ARGHLF22.RBF
    - B:/ML/FONTS/TERM12.RBF
    - B:/ML/FONTS/ARGNOR28.RBF
  - B:/ML/MODULES/
    - B:/ML/MODULES/SILENT.MO
    - B:/ML/MODULES/DUAL_ISO.MO
    - B:/ML/MODULES/LUA.MO
    - B:/ML/MODULES/ARKANOID.MO
    - B:/ML/MODULES/MLV_PLAY.MO
    - B:/ML/MODULES/FILE_MAN.MO
    - B:/ML/MODULES/EOSM_202.SYM
    - B:/ML/MODULES/AUTOEXPO.MO
    - B:/ML/MODULES/MLV_LITE.MO
    - B:/ML/MODULES/DEFLICK.MO
    - B:/ML/MODULES/SELFTEST.MO
    - B:/ML/MODULES/BENCH.MO
    - B:/ML/MODULES/PIC_VIEW.MO
    - B:/ML/MODULES/EDMAC.MO
    - B:/ML/MODULES/IMG_NAME.MO
    - B:/ML/MODULES/MLV_SND.MO
    - B:/ML/MODULES/MLV_REC.MO
    - B:/ML/MODULES/ETTR.MO
    - B:/ML/MODULES/ADV_INT.MO
    - B:/ML/MODULES/LOADING.LCK
  - B:/ML/SETTINGS/
    - B:/ML/SETTINGS/LUA.EN
    - B:/ML/SETTINGS/MAGIC.CFG
    - B:/ML/SETTINGS/MENUS.CFG
  - B:/ML/SCRIPTS/
    - B:/ML/SCRIPTS/LIB/
      - B:/ML/SCRIPTS/LIB/LOGGER.LUA
      - B:/ML/SCRIPTS/LIB/KEYS.LUA
      - B:/ML/SCRIPTS/LIB/CONFIG.LUA
      - B:/ML/SCRIPTS/LIB/STRICT.LUA
    - B:/ML/SCRIPTS/CALC.LUA
    - B:/ML/SCRIPTS/SCRNSHOT.LUA
    - B:/ML/SCRIPTS/RECDELAY.LUA
    - B:/ML/SCRIPTS/EDITOR.LUA
    - B:/ML/SCRIPTS/PONG.LUA
    - B:/ML/SCRIPTS/MENUTEST.LUA
    - B:/ML/SCRIPTS/HELLO.LUA
    - B:/ML/SCRIPTS/SOKOBAN.LUA
    - B:/ML/SCRIPTS/COPY2M.LUA
    - B:/ML/SCRIPTS/UNLOAD.LUA
    - B:/ML/SCRIPTS/API_TEST.LUA
  - B:/ML/DATA/
    - B:/ML/DATA/FF8P.LUT
    - B:/ML/DATA/FF8R.LUT
    - B:/ML/DATA/APSC8R.LUT
    - B:/ML/DATA/APSC8P.LUT
  - B:/ML/CROPMKS/
    - B:/ML/CROPMKS/CINESCO2.BMP
    - B:/ML/CROPMKS/CRSSMTR2.BMP
    - B:/ML/CROPMKS/PHIVIDEO.BMP
    - B:/ML/CROPMKS/PHIPHOTO.BMP
    - B:/ML/CROPMKS/PASSPORT.BMP
  - B:/ML/LOGS/
    - B:/ML/LOGS/ROM1.BIN
    - B:/ML/LOGS/ROM0.BIN
    - B:/ML/LOGS/LUATEST.LOG
  - B:/ML/DOCS
  - B:/ML/README
- B:/AUTOEXEC.BIN
- B:/ML-SETUP.FIR
File I/O tests completed.

Testing Canon GUI functions...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Stop LiveView...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Resume LiveView...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Resume LiveView...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter PLAY mode...
Exit PLAY mode...
Canon GUI tests completed.

Testing ML menu API...
Menu tests completed.

Testing picture taking functions...
Snap simulation test...
Single picture...
B:/DCIM/100CANON/IMG_7568.CR2: 15934665
B:/DCIM/100CANON/IMG_7568.JPG not found.
Two burst pictures...
Ideally, the camera should be in some continuous shooting mode (not checked).
B:/DCIM/100CANON/ABC_7569.CR2: 15862970
B:/DCIM/100CANON/ABC_7569.JPG not found.
B:/DCIM/100CANON/ABC_7570.CR2: 15893316
B:/DCIM/100CANON/ABC_7570.JPG not found.
Bracketed pictures...
B:/DCIM/100CANON/IMG_7571.CR2: 29530223
B:/DCIM/100CANON/IMG_7571.JPG not found.
B:/DCIM/100CANON/IMG_7572.CR2: 15777412
B:/DCIM/100CANON/IMG_7572.JPG not found.
B:/DCIM/100CANON/IMG_7573.CR2: 14038449
B:/DCIM/100CANON/IMG_7573.JPG not found.
Bulb picture...
Elapsed time: 12235
B:/DCIM/100CANON/IMG_7574.CR2: 14095226
B:/DCIM/100CANON/IMG_7574.JPG not found.
Picture taking tests completed.

Testing multitasking...
Only one task allowed to interrupt...
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Multitasking tests completed.

Testing half-shutter...
Half-shutter test OK.

Testing module 'lv'...
LiveView is running; stopping...
Starting LiveView...
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: ML
Overlays: ML
Overlays:
- Zebras: LumaFast, over 99%
- Focus Peak: OFF
- Magic Zoom: OFF
- Cropmarks: OFF
- Spotmeter: Percent, AFbox
- False color: OFF
- Histogram: RAW RGB, Log
- Waveform: OFF
- Vectorscope: OFF
Turning everything off:
- Zebras: LumaFast, over 99% -> OFF
- Spotmeter: Percent, AFbox -> OFF
- Histogram: RAW RGB, Log -> OFF
Turning on one by one:
- Zebras: ON/OFF (LumaFast, over 99%)
- Focus Peak: ON/OFF (ON,0.5,local)
- Magic Zoom: ON/OFF (F+HS, Med, TL, 2:1)
- Cropmarks: ON/OFF (CINESCO2.BMP)
- Spotmeter: ON/OFF (Percent, AFbox)
- False color: ON/OFF (Marshall)
- Histogram: ON/OFF (RAW RGB, Log)
- Waveform: ON/OFF (Small)
- Vectorscope: ON/OFF (ON)
Turning everything on:
- Zebras: ON
- Focus Peak: ON
- Magic Zoom: ON
- Cropmarks: ON
- Spotmeter: ON
- False color: ON
- Histogram: ON
- Waveform: ON
- Vectorscope: ON
Restoring previous state:
- Zebras: LumaFast, over 99%
- Focus Peak: OFF
- Magic Zoom: OFF
- Cropmarks: OFF
- Spotmeter: Percent, AFbox
- False color: OFF
- Histogram: RAW RGB, Log
- Waveform: OFF
- Vectorscope: OFF
Overlays working :)
Overlays: disabled
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: ML
Setting zoom to x1...
Setting zoom to x5...
Setting zoom to x10...
Setting zoom to x5...
Setting zoom to x1...
Setting zoom to x10...
Setting zoom to x1...
Pausing LiveView...
Resuming LiveView...
Stopping LiveView...
LiveView tests completed.


Testing lens focus functionality...
Autofocus outside LiveView...
Focus distance: 340
Autofocus in LiveView...
Please trigger autofocus (half-shutter / AF-ON / * ).
59...58...57...Autofocus triggered.
Autofocus completed.
Focus distance: 8610
Focusing backward...
Focus distance: 655350
Focus motor position: 268
Focusing forward with step size 3, wait=true...
.........................
Focus distance: 340
Focus motor position: 3073
Focusing backward with step size 3, wait=true...
............................
Focus distance: 655350
Focus motor position: 268
Focus range: 25 steps forward, 28 steps backward.
Motor steps: 2805 forward, 2805 backward, 0 lost.
Focusing forward with step size 3, wait=false...
.......................................................
Focus distance: 530
Focus motor position: 2054
Focusing backward with step size 3, wait=false...
..............................................
Focus distance: 530
Focus motor position: 2054
Focus range: 55 steps forward, 46 steps backward.
Motor steps: 1786 forward, 0 backward, 1786 lost.
Focusing forward with step size 2, wait=true...
...
Focus distance: 530
Focus motor position: 2054
Focusing backward with step size 2, wait=true...
...
Focus distance: 530
Focus motor position: 2054
Focus range: 164 steps forward, 164 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 2, wait=false...
...
Focus distance: 530
Focus motor position: 2054
Focusing backward with step size 2, wait=false...
...
Focus distance: 530
Focus motor position: 2054
Focus range: 170 steps forward, 171 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.

Focus test completed.

Testing exposure settings...
Camera    : Canon EOS M (EOSM) 2.0.2
Lens      : EF50mm f/1.8 STM
Shoot mode: 3
Shutter   : Ç5 (raw 75, 0.192776s, 193ms, apex 2.375)
Aperture  : Å5.6 (raw 48, f/5.6, apex 5.)
Av range  : Å1.8..Å22 (raw 22..80, f/1.8..f/22.6, apex 1.75..9.)
ISO       : Ä1600 (raw 104, 1600, apex 9.)
EC        : 0.0 (raw 0, 0 EV)
Flash EC  : 0.0 (raw 0, 0 EV)
Setting shutter to random values...
Setting ISO to random values...
Setting aperture to random values...
Error: aperture delta 0.26 EV (expected < 0.1875, Å1.8, method=2)
Please switch to Av mode.
Setting EC to random values...
Setting Flash EC to random values...
Exposure tests completed.


Testing movie recording...
Please switch to Movie mode.
Movie recording tests completed.

Done!

Note that there is an error towards the end of the log. Not sure what it means.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102