Author Topic: ML on EOS-M2  (Read 112271 times)

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #400 on: December 27, 2018, 05:15:27 PM »
Thanks a1ex!

Found I had the wrong value for INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER on some of my branches, including that build we've been using that is somewhat stable. Posted a new test build to my downloads page.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12258
  • Emergencies only
Re: ML on EOS-M2
« Reply #401 on: December 27, 2018, 05:29:30 PM »
Actually I've looked at it again and it seems to be 28, sorry about that...

"EnableImagePhysicalScreenParameter pCBR=%x" used in 100D DisplayStateWithImgMute_S01_I25 and EOSM2  DisplayStateWithImgMute_S01_I28.

Edit: please find some initial state object graphs for EOSM2 here (still checking the output).

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #402 on: December 27, 2018, 05:47:59 PM »
Got it -- thanks again.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #403 on: December 27, 2018, 07:38:32 PM »
Cool. Framing preview now working!
Hm, still not able to see why freezes occur with RAW video. Can mostly be dodged by increasing fps override a-timer but that doesn´t relly help when running in idle mode with fps override set to off.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #404 on: December 27, 2018, 08:01:36 PM »
Probably because we still need to figure this out:

src/fps-engine.c
Code: [Select]
#elif defined(CONFIG_EOSM2) // using EOSM values for now
    #define TG_FREQ_BASE 32000000
    #define FPS_TIMER_A_MIN (ZOOM ? 716 : MV1080CROP ? 532 : 520)
    #undef FPS_TIMER_B_MIN
    #define FPS_TIMER_B_MIN ( \
    RECORDING_H264 ? (MV1080CROP ? 1750 : MV720 ? 990 : 1970) \
                   : (ZOOM || MV1080CROP ? 1336 : 1970))
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #405 on: December 27, 2018, 08:05:32 PM »
I don't think so. This is only enabled when fps override is on. Not in idle and set to off. Even if it's timer related it might not be in fps-engio.c.

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #406 on: December 28, 2018, 02:39:04 AM »
Did the same test with 5D3, with current CMOS/ADTG build from the Experiments page. Result: 36 registers logged, all of them from the ShootCapture task. Not sure what's wrong - maybe M2 doesn't get out of LiveView when taking a picture. To check this, make sure PROP_LV_ACTION actually gets executed (add a printf there, for example). If it does, write down the value of buf[0] before taking the picture (expected 1) and after returning to LiveView (expected 0).

In propvaluse.c:
Code: [Select]
#ifdef CONFIG_LIVEVIEW
PROP_HANDLER( PROP_LV_ACTION )
{
    lv = !buf[0];
NotifyBox(5000, "lv 0x%x", lv);
}
#endif
Gives 0x1 on the eosm2 when camera is on telling me liveview is on. Taking a picture briefly shows 0x0 then back to 0x1. This goes for both photo and movie mode.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #407 on: December 28, 2018, 03:14:25 AM »
Guess that proves the M2 briefly gets out of LiveView when taking a picture but maybe all of the ShootCapture tasks aren't being logged?

Combing through the log files I found the shutter blanking values were consistent, at least on the two cameras that were tested:

Code: [Select]
0002805f:      c1 ISO=0 Tv=60 Av=56 lv=0 zoom=1 mv=0 res=-1 crop=-1 task=Evf pc=46270 addr=416d7b7c Shutter blanking for x5/x10 zoom
00028061:      c1 ISO=0 Tv=60 Av=56 lv=0 zoom=1 mv=0 res=-1 crop=-1 task=Evf pc=46270 addr=416d7b80 Shutter blanking for LiveView 1x

So it confirms this is correct:

platform/EOSM2.103/consts.h
Code: [Select]
#define FRAME_SHUTTER_BLANKING_ZOOM   (*(uint16_t*)0x416D7B7C) // ADTG register 805f
#define FRAME_SHUTTER_BLANKING_NOZOOM (*(uint16_t*)0x416D7B80) // ADTG register 8061

However, it might not apply to all M2's. Why? Because it happened on the 700D. It would help to get log files from several M2's.

The next few lines are also interesting:

Code: [Select]
/* when reading, use the other mode, as it contains the original value (not overriden) */
#define FRAME_SHUTTER_BLANKING_READ   (lv_dispsize > 1 ? FRAME_SHUTTER_BLANKING_NOZOOM : FRAME_SHUTTER_BLANKING_ZOOM)
#define FRAME_SHUTTER_BLANKING_WRITE  (lv_dispsize > 1 ? &FRAME_SHUTTER_BLANKING_ZOOM : &FRAME_SHUTTER_BLANKING_NOZOOM) // commented out on EOSM

That line commented out on the EOSM was recently activated but only on the crop_rec_4k branch. It is still commented out on the EOSM in the iso-research branch we're using. Why? Here's the commit where it was commented out. Note that it also affects the 50D. So maybe this should also be commented out on the EOSM2? Let's try that and see if there's any improvement. Uploaded a new iso-research test build.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #408 on: December 28, 2018, 03:21:59 AM »
Shutter blanking might change from cam to cam on this model:
https://www.magiclantern.fm/forum/index.php?topic=19300.msg208546#msg208546

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #409 on: December 28, 2018, 03:38:11 AM »
Well if shutter blanking changes on the 100D and 700D, it probably also applies to the EOSM2. They are all about the same vintage.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #410 on: December 28, 2018, 07:17:47 AM »
Danne's experiment on Reply #404 gave me an idea.

We know that the camera is pretty much always in LiveView.



But when it goes into image review mode it is out of LiveView:



When I set Image review to Off I can't even see it get out of LiveView but when set to Hold it stays out of LiveView.

Pressing the INFO button until you get to this screen also gets the camera out of LiveView (funky colors with Screenshot is a known issue):



So, using JohanJ's steps in Reply #384 to get a log file with a few changes, in red:

 - work in photo mode 2, M expo, Exp.Sim off. Image review from Canon menu set to Hold
 - load adtg_gui.mo
 - Debug: ADTG Registers on
 - Enter ADTG registers submenu Advanced
 - Set Disable logging in Live view
 - Set Auto Log registers after taking a pic
 - leave ML menu
 - Press INFO button until the camera is out of LiveView
 - take a picture (releasing the shutter from the non-LiveView INFO screen)
 - message on the display - Saved XX registers, XXXXX bytes

Maybe that will log the elusive task=ShootCapture...Analog ISO (most cameras) we're looking for?
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #411 on: December 28, 2018, 09:42:43 AM »

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #412 on: December 28, 2018, 04:42:27 PM »
Still can't find it. Looks like it is different on the 6D so it might also be the case on the EOSM2? It is probably in the logs but we don't know which one it is?

Code: [Select]
00f00000:     803 ISO=100 Tv=60 Av=35 lv=0 zoom=1 mv=0 res=-1 crop=-1 task=Evf pc=46284 addr=416d93f0 Analog ISO (most cameras)
...
00f00003:     f08 ISO=100 Tv=60 Av=35 lv=0 zoom=1 mv=0 res=-1 crop=-1 task=Evf pc=46284 addr=416d93f6 Analog ISO on 6D

@Danne -- Don't see any task=ShootCapture events in your logs.  ???

Something @JohanJ pointed out that might help is turning on this ML image review option:



Something else that just occurred to me is that we can only save JPEG stills on the EOSM, right? Could that the ShootCapture event we're looking for isn't happening? That address is needed for the Dual ISO module and that works with MLV, DNG and CR2 but not JPEG.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #413 on: December 28, 2018, 04:55:54 PM »
Cr2 files are saved just fine.
How to get ShootCapture events?
Image Review trick don't seem to work.


EDIT:
ShootCapture seems to register saving to log manually:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/ADTG_shoot.LOG



On a regular EOSM it looks like this. Assume this is what we´re after but on the eosm2?
Code: [Select]
Canon EOS M 2.0.2
00f00000:     803 ISO=100 Tv=50 Av=45 lv=1 zoom=1 mv=0 res=-1 crop=-1 task=ShootCapture pc=16d14 addr=4048124c Analog ISO (most cameras)

Yup. In dual_iso.c:
Code: [Select]
        PHOTO_CMOS_ISO_START = 0x4048124C;

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #414 on: December 28, 2018, 05:35:54 PM »
Ok--now you're getting the ShootCapture events but what we're looking for still doesn't show up in the log. I take it that manual logging isn't happing at the same time the shutter fires?

Maybe figure out how to release the shutter when invoking manual logging?

[EDIT]
On a regular EOSM it looks like this. Assume this is what we´re after but on the eosm2?
Code: [Select]
Canon EOS M 2.0.2
00f00000:     803 ISO=100 Tv=50 Av=45 lv=1 zoom=1 mv=0 res=-1 crop=-1 task=ShootCapture pc=16d14 addr=4048124c Analog ISO (most cameras)

Yes, that's what we're looking for on the EOSM2.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #415 on: December 28, 2018, 10:15:36 PM »
Tried trigger the shootCapture event by logging regs while intervalometer would shoot a cr2 but with no success  :P

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #416 on: December 28, 2018, 11:09:53 PM »
This works on the EOSM:

Code: [Select]
diff --git a/modules/adtg_gui/adtg_gui.c b/modules/adtg_gui/adtg_gui.c
--- a/modules/adtg_gui/adtg_gui.c
+++ b/modules/adtg_gui/adtg_gui.c
@@ -20,6 +20,8 @@
 #include "io_trace.c"
 #endif
 
+#include <shoot.h>
+
 #define DST_DFE     0xF000
 #define DST_CMOS16  0x0F00
 #define DST_CMOS    0x00F0
@@ -1006,6 +1008,8 @@
     msg[0] = 0;
     int len = 0;
     int saved_regs = 0;
+   
+    take_a_pic(0);
 
     len += snprintf(msg+len, size-len, "%s %s\n", camera_model, firmware_version);
     for (int i = 0; i < reg_num; i++)

Then just go into the ADTG Registers Advanced menu and run Log Registers Now.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #417 on: December 29, 2018, 12:27:12 AM »
Never mind. My EOSM2 arrived just now so I tried it and these were the only ShootCapture events it logged:

Code: [Select]
Canon EOS M2 1.0.3
...
0002c517:     500 (was 0)        ISO=100 Tv=100 Av=80 lv=1 zoom=1 mv=0 res=-1 crop=-1 task=ShootCapture pc=240ec addr=416d736c
0002c518:       0 ISO=100 Tv=100 Av=80 lv=1 zoom=1 mv=0 res=-1 crop=-1 task=ShootCapture pc=240ec addr=416d7370
0002c519:       0 ISO=100 Tv=100 Av=80 lv=1 zoom=1 mv=0 res=-1 crop=-1 task=ShootCapture pc=240ec addr=416d7374
0002c026:       0 ISO=100 Tv=100 Av=80 lv=1 zoom=1 mv=0 res=-1 crop=-1 task=ShootCapture pc=240ec addr=416d7368
...

Maybe that first one is the one we're looking for?

[EDIT] No, that gives "ISOless PH err(2)"
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #418 on: December 29, 2018, 09:39:46 AM »
Err 2 instead of err 8. Always something  8)

JohanJ

  • Freshman
  • **
  • Posts: 88
Re: ML on EOS-M2
« Reply #419 on: December 29, 2018, 10:59:22 PM »


There is another way to log photo capture alongside with LiveView - in adtg_gui, in the Advanced menu, set "Unique Key" to "Register + caller task". That way, still photo and LiveView registers will be logged as separate entities, rather than grouped together (even if both tasks will override the same register).

Caveat: you have to enable that option *before* enabling ADTG registers (i.e. it's not something you can change during a logging session). Go to the submenu first, while the stuff is still grayed out, change the unique key, then go back to enable the main menu entry.

Tried to set "Unique Key" to "Register + caller task" before doing anything else in the  ADTG Register Advanced submenu but as soon as I hit any key in Unique Key submenu I get the following yellow  message in ML bottom bar: "You can no longer change  this, sorry. Restart the camera."

Tried both dfort's latest nightly and the ISO research build. Both come up with this message.  adtg_gui.mo was the only thing active, everything else in ML menus like global draw etc. was inactivated before. Has this message been hard coded and the needed function been removed?

Sent from my SM-T719 using Tapatalk

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

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #420 on: December 29, 2018, 11:21:49 PM »
Did you restart camera and went into the unique setting without turning adtg_gui on? After selection turn on adtg_gui.

JohanJ

  • Freshman
  • **
  • Posts: 88
Re: ML on EOS-M2
« Reply #421 on: December 29, 2018, 11:26:39 PM »
Did you restart camera and went into the unique setting without turning adtg_gui on? After selection turn on adtg_gui.
Ah, my bad. Was not aware of that I can enter ADTG menu w/o activation. Now it works

Edit: still the same result,only Evf tasks logged

00f00000:     8b7 ISO=100 Tv=100 Av=20 lv=0 zoom=1 mv=0 res=-1 crop=-1 task=Evf pc=46284 addr=416d949a Analog ISO (most cameras)

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

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #422 on: December 30, 2018, 02:32:15 AM »
@JohanJ - I spent several hours on it today and couldn't get that elusive address either.

Found out what was causing the LiveView screen freezes in photo mode was the raw histogram. I took out that feature for now and discovered that one line is out of place:

src/zebra.c
Code: [Select]
             {
                 .name = "Histogram type",
                 .priv = &hist_type,
+                #ifdef FEATURE_RAW_HISTOGRAM
                 .update = raw_histo_update,
-                #ifdef FEATURE_RAW_HISTOGRAM
                 .max = 3,
                 #else
                 .max = 1,

Taking out this feature prevents a few modules from building but we're far from getting all the modules and features working properly on this camera.

I put up a new test build on my downloads page. This time I wanted to see how many modules would compile. If you want to test any of these modules please read up on them first. So far we know dual_iso isn't working, simple silent is but full resolution silent isn't, no raw video recording yet and well, you tell me what else.

Found something interesting on this camera. It looks like they brought back Digital Zoom:



What's interesting is that ML Movie crop mode is also working.

I'll be off for a week on vacation with an EOSM2 in my hands. I'll post some pictures using this latest build, provided it doesn't blow up!

[EDIT] On the bright side, the EOSM2 doesn't have the nasty shutter-bug that plagues the EOSM.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5714
Re: ML on EOS-M2
« Reply #423 on: December 30, 2018, 08:55:39 AM »
Regarding finding adress for dual iso wonder if it's a timing issue. When I check registers set in crop_rec I can see registers flash by in raw.c. first they will be set but quickly goes back to original registers. This is not the case when registers are set manually from adtg_gui. One  theory is that shootCapture might be shown briefly but it won't be logged because of some interrupting issue causing registers back into original state.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: ML on EOS-M2
« Reply #424 on: December 30, 2018, 03:21:38 PM »
In cases like that what I would do is shoot a video of the screen then look at it frame-by-frame to find what the changed registers are doing. Here's a fun example.

Since we found the CMOS 0 value for LiveView I thought I'd check and see if the change for ShootCapture could be calculated but only the 650D and 700D values match. The others are all over the place and to find it by brute force would require something like 2,000 iterations. Ugh!

Interesting that shooting simple silent DNG's works but not MLV's. Figuring that out might also solve other issues like raw histogram freezing the screen.

I'm still thinking that a few stubs are off but critix and I have gone over them several times and they all seem to check out fine.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102