Canon 1200D

Started by akkotyni, July 12, 2014, 02:48:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dterrahe

I reran the key test but now without pressing the shutter button (which previously I mistakenly thought I was asked to do). Passed fine now.


===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-4-29 08:04:15
===============================================================================

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

dterrahe

So it looks like the only remaining issue is with the lens focus test. I put on the 18-55 to see if that makes a difference. It just keeps running endlessly.

At the start it asks me to do a half-press; after that is there any further interaction required?

It seems to run fine, but is on a loop showing lines typically like:

Lens moving (0, 0)
Lens moving (11, 0)
etc


This goes on for at least 10 mins.

The log shows nothing interesting to me.

===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-4-29 08:10:45
===============================================================================

Testing lens focus functionality...
Focus distance: 760
Autofocus in LiveView...
Please trigger autofocus (half-shutter / AF-ON / * ).
19...18...17...16...15...14...13...12...Autofocus triggered.
Autofocus completed.
Focus distance: 760
Focusing backward...
Focus distance: 655350
Focus motor position: 620
Focusing forward with step size 3, wait=true...
.............
Focus distance: 250
Focus motor position: -1273
Focusing backward with step size 3, wait=true...
..........
Focus distance: 655350
Focus motor position: 650
Focus range: 13 steps forward, 10 steps backward.
Motor steps: 1893 forward, 1923 backward, 30 lost.
Focusing forward with step size 3, wait=false...
.....................................
Focus distance: 250
Focus motor position: -1263
Focusing backward with step size 3, wait=false...
.......................................
Focus distance: 655350
Focus motor position: 655
Focus range: 37 steps forward, 39 steps backward.
Motor steps: 1913 forward, 1918 backward, 5 lost.
Focusing forward with step size 2, wait=true...
.................................................................
Focus distance: 250
Focus motor position: -1303
Focusing backward with step size 2, wait=true...
..................................................................
Focus distance: 655350
Focus motor position: 658
Focus range: 65 steps forward, 66 steps backward.
Motor steps: 1958 forward, 1961 backward, 3 lost.
Focusing forward with step size 2, wait=false...
...
Focus distance: 250
Focus motor position: -1269
Focusing backward with step size 2, wait=false...
...
Focus distance: 655350
Focus motor position: 675
Focus range: 158 steps forward, 173 steps backward.
Motor steps: 1927 forward, 1944 backward, 17 lost.
Focusing forward with step size 1, wait=true...
...
Focus distance: 250
Focus motor position: 10888
Focusing backward with step size 1, wait=true...
...
Focus distance: 300
Focus motor position: 11582
Focus range: 14282 steps forward, 273 steps backward.
Motor steps: 10213 forward, 694 backward, 10907 lost.
Focusing forward with step size 1, wait=false...
...
Focus distance: 250
Focus motor position: 11192
Focusing backward with step size 1, wait=false...
...


In the above, the forum code has truncated the ..... lines; some are very long.

a1ex

The lens is supposed to focus back and forth during this test; doesn't happen? The logs suggest it actually worked, to some extent, but got stuck at step size 1. Maybe it has to do with the mechanical condition of the lens.

Walter Schulz

I haven't clocked it but focus test does take some time (depends on lens according to dfort). Comparing file date for LUA_TEST.LOG and time logged inside: 19 min. Looks like stuck at some point but it works.

May I suggest some changes to api_test.lua?
- Extensive beeps when asking for user interaction
- Timestamps for sub-tests.

dterrahe

Quote from: a1ex on April 29, 2018, 10:57:28 AM
The lens is supposed to focus back and forth during this test; doesn't happen? The logs suggest it actually worked, to some extent, but got stuck at step size 1. Maybe it has to do with the mechanical condition of the lens.

You are right; it is moving, even with the very last iteration of the loops where it gets stuck. It just never reaches the exit loop condition, whatever that is. It does the same thing with two different lenses, one of which is basically brand new so I hope it is not already broken :-)

I do not see the text "Lens moving", that appears on the screen while the test is running, anywhere in the lua script, so don't know where that's coming from. Is that within an API call that doesn't return until a "1" (accuracy?) is reached? All the Step 1s work except the last one. Strange?

a1ex

That comes from PROP_LV_FOCUS_DONE in lens.c; it's an event sent by the MPU (secondary processor that - in this case - executes the focus commands). The same MCU sends some flags telling whether the lens reached its limits, for example.

Previously, ML used to rely on these signals. Since I've noticed they are unreliable (see e.g. issue #2452), ML (in the lua_fix branch) also uses some heuristics to figure out whether the lens is still moving or not; however, I can imagine a situation where:
- the motor doesn't have enough force to push the focus limit microswitch (because of the tiny step commands)
- or maybe it just gets stuck in the middle (can happen with a DC motor when using tiny step commands, but unlikely with a stepper motor)
- however, the motor moves enough to change the encoder position (back and forth)

This last event can trick ML heuristics into believing the lens is still moving (it does not currently check the direction). In this case, the focus motor is going to hunt back and forth. Fixing this is non-trivial and requires a wide range of lenses to test on.

Long answer: https://www.magiclantern.fm/forum/index.php?topic=4997.msg175172#msg175172

For the Lua test, maybe I should limit the test to step sizes 3 and 2 (as 1 is likely very sensitive to lens mechanics).

dfort

The time it takes to complete the lens test can vary a lot. On the 700D the 28-105mm f/3.5-4.5 USM, which is quite old and beat up, runs through the tests quickly while my newest lens, a second generation 50mm 1.8 STM (with the metal lens mount), seems to take forever. When testing EF-M lenses on the EOSM I ended up using a power adapter because the lens test would take so long that sometimes the battery would run out before the test completed.

An interesting addition to the lua tests would be how long it takes to complete each lens test.

You can edit the lua script that is in the ML/scripts directory on your card. Comment out all the tests except the lens test:

api_test.lua
function api_tests()
    menu.close()
    console.clear()
    console.show()
    test_log = logger("LUATEST.LOG")

    -- note: each test routine must print a blank line at the end
    -- strict_tests()
    -- generic_tests()
   
    printf("Module tests...\n")
    -- test_io()
    -- test_camera_gui()
    -- test_menu()
    -- test_camera_take_pics()
    -- sleep(1)
    -- test_multitasking()
    -- test_keys()
    -- test_lv()
    test_lens_focus()
    -- test_camera_exposure()
    -- test_movie()
   
    printf("Done!\n")
   
    test_log:close()
    key.wait()
    console.hide()
end


Now put a freshly charged battery or use a power adapter and give it plenty of time to complete the test.

Note that there are some other things that we can check here. If you set your lens to manual focus it should print:

Please enable autofocus.
(or, remove the lens from the camera to skip this test)


If you mount a manual lens or lens cap or simply remove the lens, the test should print:

This test requires an electronic lens.
manual lenses can't autofocus


BTW--Did the 1200D pass all of the other tests, including the ones that come after the lens focusing test?

dterrahe

Quote from: dfort on April 29, 2018, 05:04:30 PM
BTW--Did the 1200D pass all of the other tests, including the ones that come after the lens focusing test?

Yep, I previously already ran all the other test (commenting out the three that were giving me trouble) so only the last, step 1, focus test is giving problems. I'm charging the battery now to see if I can run everything in one go and provide you with a clean log.

But to be honest, I'm not sure what the value is of knowing whether focusing with step 1 works, depending on the lens, if it takes many minutes. In my book, that means it doesn't work :-)

dfort

Quote from: dterrahe on April 29, 2018, 08:39:28 PM
...if it takes many minutes. In my book, that means it doesn't work :-)

Does the 1200D have a continuous autofocus setting? Reason I ask is because I started running some tests and after 33 minutes on one of the lenses it was obvious that something weird was going on. Turned out that the default Canon settings turned on continuous autofocus. It should be off to run these tests:



I thought it might be interesting to run through all my lenses and post how long it takes to complete the lens test. Since I've also got some EF-M lenses and wanted to run everything on the same body I put on the EF-M to EF adapter along with a plug in power supply on one of my EOSMs and started testing. I'll update this post as I run through the lenses but thought that you might be interested in seeing the results I've gotten so far.

Note that the lens test starts with a prompt to put the lens in AF mode and to do a half-shutter press. The bulk of the testing happens after the autofocus confirmation so make sure you've got something you can focus on before starting the test.






LensTime
Canon EF 28-105mm f/3.5-4.5 II USM1:00
Canon EF 50mm f/1.8 STM3:22
Canon EF-S 17-55mm f/2.8 IS USM0:50

I'll update this post as I run through the lenses but thought that you might be interested in seeing the results I've gotten so far.

[EDIT] This turned out to be worthy of a separate topic so I started one called lua test_lens_focus() -- opened another can of worms with this.

dterrahe

AF was set to "AI Servo". I switched to One Shot and now the lens focus test passed. Yeah!

However, the first time I had left the camera running unattended after it passed lens focus to complete the remaining tests and later found it switched off, with the log cut off after
Testing module 'lv'...
LiveView is running; stopping...
Starting LiveView...
Overlays: Canon
Overlays: ML


I had seen it run through the lens focus module completely, so the results simply did not get saved.

On a second attempt, I saw it hang for a long time with this screen

. I had to pull the battery because it was not responding to anything. The log was cut off at the same point.

The test_camera_exposure function had previously run on its own when I had commenting everything else out, so it only seems to have a problem when running after all the other tests. Or maybe I had some setting switched on at the time that helped it out somehow.

dfort

Good catch on the AF settings. Lens focus test passed--that's a major one.

So on one attempt it failed the LiveView test and on the other attempt it failed the exposure test. Hum, those are the tests immediately before and after the lens focus test.

Yet those tests have succeeded when run by themselves, right? It is only failing when you tried a full test run?

Well, we know now that the 1200D can pass all of the lua tests, maybe just not all at once. It also passed the selftest module test, right? Let's go through our check list:

Quote from: a1ex on December 16, 2017, 01:36:42 AM
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)

It is getting late here so I'm going offline for a while. Good luck with the tests!

dterrahe

Quote from: dfort on April 30, 2018, 08:58:39 AM
So on one attempt it failed the LiveView test and on the other attempt it failed the exposure test. Hum, those are the tests immediately before and after the lens focus test.

Nope, both times it passed all the tests up to and including focus test. Its just that the log file didn't record it. When it hung at the screen I showed the picture of, the log file still didn't show the focus test results even though I had seen it being completed successfully on the screen: the log was identical to the one for the first run that I posted. Maybe the file buffer doesn't get synced/flushed when the camera crashes hard?

dterrahe

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

Won't have time this evening, but will run bench soon.

If you'd read the London weather report, you wouldn't have suggested taking this build out. Unless it magically waterproofs the camera?

dfort

The exposure tests will prompt you to switch between M and Av modes. Did that happen? Maybe the prompt didn't come up? I found that if I don't respond to a prompt soon enough it eventually times out and doesn't complete the test. You should be able to run the exposure test in any mode and it should prompt you to switch mode. Anyway, something to do on a rainy day.

dfort

Posted a new test build on my downloads page. The changes we made are now in the main branch so the 1200D development will continue with Canon firmware version 1.0.2.

The test build includes the lua_fix code so feel free to run the lua tests though when the weather clears up in London I hope @dterrahe will share some images and video with us.

@Raov - hope your 1200D comes back to life with the new firmware.

dterrahe





Only saw now you've got a new build up, so this was still run with the old one.


dterrahe

A question:
I haven't used ML on any other camera so don't know what I should expect/what works and how.
In many menu's, for example the benchmark menu, when descending into it, it shows top right a back arrow and Q ("<Q"). Does that mean I should be able to go back/up/out of the menu by pressing the Q key? That does not seem to work.

Raov

Quote from: dfort on May 01, 2018, 06:01:11 AM
@Raov - hope your 1200D comes back to life with the new firmware.
i hope it will, cant wait to test the new build
7D.203 + 70-300mm f/4-5.6 IS USM

dterrahe

Ran the full lua test of the new build.

It spend quite a long time on the focus test again; since I didn't have that much time this morning, I half pressed the shutter once, which helped it get past that point.

It was then seemingly happily running the exposures test, feeding it random values, but suddenly (before it had asked me to do anything) it rebooted. Got back to the main screen with an overlayed message saying the camera had been uncleanly shut down and module loading was skipped.

a1ex

Quote from: dterrahe on May 01, 2018, 08:04:02 AM
In many menu's, for example the benchmark menu, when descending into it, it shows top right a back arrow and Q ("<Q"). Does that mean I should be able to go back/up/out of the menu by pressing the Q key? That does not seem to work.

Works here in QEMU. You will also need the Q key to enter most submenus (some sort of right-click).

If it still doesn't work, enable Debug -> Show GUI events, and write down the button code.

Posted a build on the main page, too: https://builds.magiclantern.fm/1200D-102.html

dfort

Quote from: dterrahe on May 01, 2018, 08:32:27 AM
It spend quite a long time on the focus test again; since I didn't have that much time this morning, I half pressed the shutter once, which helped it get past that point.

That sounds like you have Continuous AF activated. More information on this post.

Quote from: dterrahe on May 01, 2018, 08:32:27 AM
...suddenly (before it had asked me to do anything) it rebooted...

That's weird. Ok--time to clear out the Canon settings, make sure to disable Continuous AF and try the new "official" build. I'm removing the unofficial 1200D build on my downloads page.

dterrahe

Quote from: dfort on May 01, 2018, 04:32:32 PM
That sounds like you have Continuous AF activated. More information on this post.
No, I already disabled that (switched to "One Shot").

Quote from: dfort on May 01, 2018, 04:32:32 PM
That's weird. Ok--time to clear out the Canon settings, make sure to disable Continuous AF and try the new "official" build. I'm removing the unofficial 1200D build on my downloads page.
I didn't change anything apart from the AF setting above after the last time I restored all canon and ML setting to factory/default.

But I'll install the new official build, clear all settings, try to remember AF and then run everything again. Oh, and fully charge the battery. And watch the screen to see if I'm required to press any buttons ;-)

dterrahe

Quote from: a1ex on May 01, 2018, 10:33:30 AM
Works here in QEMU. You will also need the Q key to enter most submenus (some sort of right-click).
Hm, I sort of thought that's what it was supposed to do, but I don't think it has ever worked.

Quote from: a1ex on May 01, 2018, 10:33:30 AM
If it still doesn't work, enable Debug -> Show GUI events, and write down the button code.
I'm getting two key codes for each press of Q: 4C and 1C

However, I now also saw in the menu that Q and PLAY do the same thing? I tested the PLAY button and indeed it does seem to open submenus and go back as required.

a1ex

This issue is quite puzzling.

I could easily identify this button code in QEMU. Canon firmware accepts both codes - the new one is used in recent cameras, so that makes a bit of sense. The only models still using the old button code are 1100D, 600D and 550D.

550D/600D/1100D/1200D in QEMU: old code (05 01 on the MPU side) is translated into PRESS_DIRECT_PRINT_BUTTON, new code (20 01) is translated into PRESS_UNAVI_BUTTON. They both do the same action on Canon UI (e.g. activate the settings screen).

550D clearly uses the old MPU code (05 01).

The puzzling part is that previous reports reference submenu options that could not be opened without the Q button. So, it must have worked. How did you guys open the submenus on earlier builds?! This can be answered by anyone still running the old firmware.

Is the button code different, depending on the camera mode? (for example, do you get the same code while in PLAY mode, in Canon menu, in LiveView, or in plain photo mode outside LV)?

Did the previous firmware send different button codes? I highly doubt this one.

dterrahe

Quote from: a1ex on May 02, 2018, 11:42:05 AM
The puzzling part is that previous reports reference submenu options that could not be opened without the Q button. So, it must have worked. How did you guys open the submenus on earlier builds?!

It seems that, within ML menus, the PLAY button does exactly the same thing as the Q button is supposed to be doing. So people may have been using that? Or are there subtle differences/things that only work with Q?