Author Topic: Front AF LED (PROP_LED_LIGHT)  (Read 2054 times)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Front AF LED (PROP_LED_LIGHT)
« on: April 14, 2018, 08:25:27 PM »
Background: the front LED was something we had no idea how to activate (other than some unreliable hack based on red eye reduction settings).

One hint: https://bitbucket.org/hudson/magic-lantern/issues/2351/front-led-does-not-light-when-recording (this LED might be triggered by a RC-6 remote). I don't have one to try, maybe I should get one, but I don't really have any other use for it.

Anyway - while looking for a possible LED address in 6D2, I've noticed an interesting piece of code referencing these strings:
Code: [Select]
fLedOn_Bv %x %x
AFAE LED %d %d %d %d
[LED] OFF -> ON %x
[LED] ON -> OFF %x

That hints the 6D2 might be turning the front LED to autofocus, and that LED might be controllable from software.

Going further in the low-level routine, it sends a MPU message (in other words, it might be asking the MPU - a secondary CPU - to turn on the AF LED). A closer look reveals similar strings in the 5D3 (though not as clear). On this camera, the low-level LED routine changes property 0x80050035 (size=2, arguments appear to be previous and requested LED state). There are some more interesting strings:
Code: [Select]
AEWB_DSTOCK_GetLedLightMode
AEWB_DSTOCK_GetLedLightEnable
AEWB_DSTOCK_GetLedLightState
AEWB_DSTOCK_GetLedLightGuideNumber
AEWB_DSTOCK_SetLedLightInfo

The front LED even has a guide number!

Where are these initialized? Breakpoint on SetLedLightInfo in QEMU:
Code: [Select]
[        AeWb:ff23c230 ] (98:01) [AEWB] aewbProperty ID=0x80030042(0x3)
...
    0xFF23C1E8(6b2df4, 6b85ac, 0, ff23c1e8)                                      at [AeWb:1796c:185c40] (pc:sp)
     0xFF23DBA0(6b2ea8 &"AEWB_DataStocker", 3, 0, 0, 0)                             at [AeWb:ff23c2d0:185be0] (pc:sp)

0x80030042 is PROP_LED_LIGHT (from known_spells.py). Value 3 means LedLightMode 3 and all others 0. Things start making sense.

Manually changing property 0x80050035 doesn't seem to work. When does Canon firmware turn the front LED?! (other than with RC-6 remote)

Some more: 0x80050035 appears to be 09 22 on the MPU side. 6D2 sends message 09 20 (SpecificToPartner). Changing property 0x80050035 to 0x101 sends the following message to MPU:
Code: [Select]
CA19D>    PropMgr:ff2e9f18:01:03: ###RequestPropertyLVLEDLightRequestResultCBR 9 32 1 1
CA1D5>    PropMgr:000b0d48:00:00: *** mpu_send(08 06 09 20 01 01 00), from ff122df8

From what I could tell, that's exactly what 6D2 does. Yet, the LED doesn't turn on...

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #1 on: April 14, 2018, 08:37:37 PM »
If I'm not mistaken, the front led also blinks with countdown on self timer options.
Try self timer at 10 seconds...

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #2 on: April 14, 2018, 08:45:07 PM »
That's handled by the MPU (it takes the decision to turn on that LED, beep, raise the mirror etc, but doesn't report much back to the main CPU).

The above piece of code suggests the LED might be used in LiveView, to assist autofocus. Do you know how to trigger that?

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #3 on: April 14, 2018, 09:01:27 PM »
Can't remember a single time the front led light up during liveview.
It's just a red led light and not very bright, can't help the focus that much I guess  :-\

But I do know that when a external canon flashlight is put on, the flashlight can turn on a red led light which throws a pattern out to help focus.
Maybe the code is about led in external flashlights ?


Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #4 on: April 14, 2018, 09:11:34 PM »
Genuine Canon manual calls the red light on the front of the 6d 'Self timer lamp'


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #5 on: April 14, 2018, 09:27:59 PM »
But I do know that when a external canon flashlight is put on, the flashlight can turn on a red led light which throws a pattern out to help focus.
Maybe the code is about led in external flashlights ?

Possible. A startup log in these conditions might help.

A similar log would be welcome if you have a RC-6 remote and can turn on the front LED with it.

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #6 on: April 14, 2018, 09:34:28 PM »
I don't have a RC-6 remote.

But I do have a canon speed light, so a startup log with activated speed light autofocus pattern should be doable I guess.
Can't do it now, maybe tomorrow.

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #7 on: April 14, 2018, 11:18:24 PM »
Did a startup log, with Canon 430EX II speed light, and let the camera autofocus 5 times(5x half shutter press), the red autofocus pattern led of the flashlight is used 5 times (probably flashed 10 times, looks like it's fired twice(confirms autofocus?) for each time the autofocus is used).

Here's the log

https://drive.google.com/drive/folders/1OrES_a652kjSQTrXC9ELLJJdDkpPXZ63?usp=sharing

Edit: did this test in photo mode, without live view enabled

350D

  • New to the forum
  • *
  • Posts: 36
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #8 on: April 15, 2018, 05:40:17 AM »
Some ideas about how to use this LED: blink on clipping (for self mode shooting mode or something like that) or blink if flash card buffering warning is happening.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #9 on: April 15, 2018, 06:10:10 AM »
Did a startup log, with Canon 430EX II speed light, and let the camera autofocus 5 times(5x half shutter press), the red autofocus pattern led of the flashlight is used 5 times (probably flashed 10 times, looks like it's fired twice(confirms autofocus?) for each time the autofocus is used).

In this case, the decision to turn on the LED was taken by the MPU:
Code: [Select]
11.790.740  **INT-36h*:00035af4:00:00: *** mpu_recv(06 05 06 26 01 00)                               ; GMT_GUICMD_PRESS_BUTTON_SOMETHING
11.797.689  **INT-36h*:00035af4:00:00: *** mpu_recv(06 04 05 00 00)                                  ; EVENTID_METERING_START_SW1ON
11.799.512     PropMgr:00006030:00:00: *** mpu_send(06 05 03 19 01 00)                               ; PROP_TFT_STATUS
11.801.606  **INT-36h*:00035af4:00:00: *** mpu_recv(0e 0c 0a 08 00 01 00 00 01 00 00 01 00)          ; PD_NotifyOlcInfoChanged
11.822.458  **INT-36h*:00035af4:00:00: *** mpu_recv(10 0e 0a 08 03 00 02 08 01 01 74 10 00 55 00)    ; PD_NotifyOlcInfoChanged
12.311.781  **INT-36h*:00035af4:00:00: *** mpu_recv(16 14 0a 08 00 09 00 00 01 00 01 01 04 00 00 00 04 ef ff ff 00) ; PD_NotifyOlcInfoChanged
12.628.272  **INT-36h*:00035af4:00:00: *** mpu_recv(10 0e 0a 08 01 01 03 08 00 00 01 00 01 00 00)    ; PD_NotifyOlcInfoChanged
12.631.944  **INT-36h*:00035af4:00:00: *** mpu_recv(06 04 05 0b 00)                                  ; EVENTID_METERING_TIMER_START_SW1OFF
12.643.952  **INT-36h*:00035af4:00:00: *** mpu_recv(16 14 0a 08 00 09 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00) ; PD_NotifyOlcInfoChanged
12.713.828  **INT-36h*:00035af4:00:00: *** mpu_recv(0e 0c 0a 08 02 00 01 01 74 10 00 53 00)          ; PD_NotifyOlcInfoChanged
13.116.121  **INT-36h*:00035af4:00:00: *** mpu_recv(0e 0c 0a 08 02 00 01 01 74 10 00 4d 00)          ; PD_NotifyOlcInfoChanged
13.570.286  **INT-36h*:00035af4:00:00: *** mpu_recv(06 05 06 26 01 00)                               ; GMT_GUICMD_PRESS_BUTTON_SOMETHING
13.574.560  **INT-36h*:00035af4:00:00: *** mpu_recv(06 04 05 00 00)                                  ; EVENTID_METERING_START_SW1ON
13.576.248  **INT-36h*:00035af4:00:00: *** mpu_recv(0e 0c 0a 08 00 01 00 00 01 00 00 01 00)          ; PD_NotifyOlcInfoChanged
13.576.803     PropMgr:00006030:00:00: *** mpu_send(06 05 03 19 01 00)                               ; PROP_TFT_STATUS
13.811.834  **INT-36h*:00035af4:00:00: *** mpu_recv(0a 08 0a 08 01 00 02 08 00)                      ; PD_NotifyOlcInfoChanged
14.092.621  **INT-36h*:00035af4:00:00: *** mpu_recv(16 14 0a 08 00 09 00 00 01 00 01 01 04 00 00 00 04 ef ff ff 00) ; PD_NotifyOlcInfoChanged
14.659.005  **INT-36h*:00035af4:00:00: *** mpu_recv(0a 08 0a 08 01 00 03 08 00)                      ; PD_NotifyOlcInfoChanged
14.659.291  **INT-36h*:00035af4:00:00: *** mpu_recv(0e 0c 0a 08 00 01 00 00 01 00 01 00 00)          ; PD_NotifyOlcInfoChanged
14.670.627  **INT-36h*:00035af4:00:00: *** mpu_recv(06 04 05 0b 00)                                  ; EVENTID_METERING_TIMER_START_SW1OFF

The only mpu_send is to tell the MPU whether the screen is on or off.



I've also noticed the following on a 60D in LiveView:
- the LED is turned on after the autofocus is successful, as soon as LiveView brightess drops below some threshold
- the LED is turned off after releasing half-shutter
- triggering property 0x80050035 (09 20) with any value while holding half-shutter causes the LED to remain ON after releasing half-shutter

Here's a log from the following sequence:
- camera in LiveView, full auto mode, red eye enabled, flash raised
- half-shutter press, camera starts autofocusing, focus locked after 1-2 seconds, test scene too bright to trigger the LED
- camera pointed to a darker scene 1-2 seconds after autofocus finished (LED turned on)
- half-shutter released ~ 1 second after

Code: [Select]
5.478.350  **INT-36h*:ff1bf420:00:00: *** mpu_recv(08 06 09 0c 01 00 00)                            ; PROP_LV_HALF_SHUTTER
 5.478.758  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 04 05 00 00)                                  ; EVENTID_METERING_START_SW1ON
 5.483.025     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6e 00)                ; PROP_LV_BV
 5.484.818  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 7e 48 67 e0 00 00)                   ; PROP_BV
 5.502.835     PropMgr:ff05e224:00:00: *** mpu_send(12 11 09 15 00 00 00 00 06 00 00 00 00 00 00 00 00 00) ; PROP 80050020
 5.617.165     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6e 00)                ; PROP_LV_BV
 5.618.048  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 7e 48 67 e0 00 00)                   ; PROP_BV
 5.703.887     PropMgr:ff05e224:00:00: *** mpu_send(06 04 09 12 00)                                  ; PROP_LVCAF_STATE
 5.705.775  **INT-36h*:ff1bf420:00:00: *** mpu_recv(3e 3c 09 12 ba 18 40 00 c0 dc 40 00 3d 4c e0 00 3c 5a e0 00 00 00 00 00 3d 5a c0 00 3c 37 c0 00 00 00 00 00 00 00 03 05 21 20 50 42 02 7f 95 95 00 18 00 23 00 1e 04 01 00 00 00 00 00) ; PROP_LVCAF_STATE
 5.706.770     PropMgr:ff05e224:00:00: *** mpu_send(06 04 09 19 00)                                  ; PROP 80050028
 5.708.329  **INT-36h*:ff1bf420:00:00: *** mpu_recv(08 06 09 18 02 30 00)                            ; PROP_LV_FOCUS_CMD
 5.717.395     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6e 00)                ; PROP_LV_BV
 5.718.320  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 7e 48 67 e0 00 00)                   ; PROP_BV
 5.785.031  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 04 09 16 00)                                  ; ???
 5.899.059     PropMgr:ff05e224:00:00: *** mpu_send(06 04 09 12 00)                                  ; PROP_LVCAF_STATE
 5.903.533  **INT-36h*:ff1bf420:00:00: *** mpu_recv(3e 3c 09 12 ba 18 40 00 c0 dc 40 00 3d 4c e0 00 3c 5a e0 00 00 00 00 00 3d 5a c0 00 3c 37 c0 00 00 00 00 00 00 00 03 05 21 20 50 42 02 7f 95 95 00 18 00 23 00 1e 04 01 00 01 00 00 00) ; PROP_LVCAF_STATE
 5.904.238     PropMgr:ff05e224:00:00: *** mpu_send(06 04 09 19 00)                                  ; PROP 80050028
 6.150.991     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6e 00)                ; PROP_LV_BV
 6.218.580  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 04 09 16 00)                                  ; ???
 6.332.520     PropMgr:ff05e224:00:00: *** mpu_send(06 04 09 12 00)                                  ; PROP_LVCAF_STATE
 6.336.946  **INT-36h*:ff1bf420:00:00: *** mpu_recv(3e 3c 09 12 ba 18 40 00 c0 dc 40 00 3d 4c e0 00 3c 5a e0 00 00 00 00 00 3d 5a c0 00 3c 37 c0 00 00 00 00 00 00 00 04 04 22 20 50 43 02 6f 95 93 00 18 00 19 00 16 04 00 00 00 00 00 00) ; PROP_LVCAF_STATE
 6.337.557     PropMgr:ff05e224:00:00: *** mpu_send(06 04 09 19 00)                                  ; PROP 80050028
 6.451.180  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 05 03 38 a2 00)                               ; PROP 80030035
 6.867.322  **INT-36h*:ff1bf420:00:00: *** mpu_recv(08 06 09 18 06 00 00)                            ; PROP_LV_FOCUS_CMD
 6.918.457     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6e 00)                ; PROP_LV_BV
 6.971.453     PropMgr:ff05e224:00:00: *** mpu_send(06 04 09 12 00)                                  ; PROP_LVCAF_STATE
 6.973.366  **INT-36h*:ff1bf420:00:00: *** mpu_recv(3e 3c 09 12 ba 18 40 00 c0 dc 40 00 3d 4c e0 00 3c 5a e0 00 00 00 00 00 3d 5a c0 00 3c 37 c0 00 00 00 00 00 00 00 04 04 22 20 50 43 02 6f 95 93 00 18 00 19 00 16 04 00 00 00 00 00 00) ; PROP_LVCAF_STATE
 6.973.996     PropMgr:ff05e224:00:00: *** mpu_send(06 04 09 19 00)                                  ; PROP 80050028
 8.256.341     PropMgr:ff05e224:00:00: *** mpu_send(06 05 09 0b 00 00)                               ; PROP_LV_AF_RESULT
 8.350.597     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6e 00)                ; PROP_LV_BV
 8.354.059  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 7e 48 67 e0 00 00)                   ; PROP_BV
 8.486.910     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 20 48 6e 00)                ; PROP_LV_BV
 8.490.154  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 7e 48 67 e0 00 00)                   ; PROP_BV
 8.887.291     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7b 78 01 21 49 6d 00)                ; PROP_LV_BV
 8.890.551  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 7b 48 66 e0 00 00)                   ; PROP_BV
 9.688.050     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7b 78 01 21 49 6d 00)                ; PROP_LV_BV
 9.890.129     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6d 00)                ; PROP_LV_BV
 9.893.596  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 7e 48 67 e0 00 00)                   ; PROP_BV
10.088.361     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6d 00)                ; PROP_LV_BV
10.091.720  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 7e 48 67 e0 00 00)                   ; PROP_BV
10.290.549     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 7e 7d 01 21 48 6d 00)                ; PROP_LV_BV
10.488.699     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 79 77 01 21 49 6d 00)                ; PROP_LV_BV
10.492.118  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 79 48 65 e0 00 00)                   ; PROP_BV
10.691.062     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 5d 5d 00 21 54 60 00)                ; PROP_LV_BV
10.694.467  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 5d 58 68 ff 00 00)                   ; PROP_BV
10.694.740  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 05 09 0e 01 00)                               ; PROP_STROBO_CHARGE_INFO_MAYBE
10.889.336     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 50 50 00 21 65 60 00)                ; PROP_LV_BV
11.091.111     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 42 42 00 21 73 60 00)                ; PROP_LV_BV
11.094.366  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 42 58 68 ff 00 00)                   ; PROP_BV
11.289.626     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 2d 2d 00 21 78 60 00)                ; PROP_LV_BV
11.292.811  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 2d 58 68 ff 00 00)                   ; PROP_BV
11.449.541  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 05 03 38 a3 00)                               ; PROP 80030035
11.491.621     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 2e 2e 01 21 78 60 00)                ; PROP_LV_BV
11.549.138  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 04 09 07 00)                                  ; ???
11.550.016     PropMgr:ff05e224:00:00: *** mpu_send(06 05 09 0b 02 00)                               ; PROP_LV_AF_RESULT
11.550.921  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 04 05 0b 00)                                  ; EVENTID_METERING_TIMER_START_SW1OFF
11.551.406  **INT-36h*:ff1bf420:00:00: *** mpu_recv(08 06 09 0c 00 00 00)                            ; PROP_LV_HALF_SHUTTER
11.690.505     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 29 29 01 21 78 60 00)                ; PROP_LV_BV
11.693.739  **INT-36h*:ff1bf420:00:00: *** mpu_recv(0a 09 09 10 29 70 41 e0 00 00)                   ; PROP_BV
11.694.008  **INT-36h*:ff1bf420:00:00: *** mpu_recv(06 05 09 0e 00 00)                               ; PROP_STROBO_CHARGE_INFO_MAYBE
11.891.988     PropMgr:ff05e224:00:00: *** mpu_send(0c 0a 09 0a 29 29 01 21 78 60 00)                ; PROP_LV_BV

PROP_LV_AF_RESULT likely confirms the autofocus completion. In LiveView, main CPU sends brightness values to the MPU periodically (the MPU can't figure them out on its own, as the sensor is read out by the main CPU, which also receives the image processing results; this is unlike in photo mode where the MPU reads the AE sensors and sends the result back to main CPU to update the exposure meter).

The decision to turn on the LED seems to be taken by the MPU as soon as the boolean field from PROP_LV_BV changes from 01 to 00. The MPU probably announces the LED status back to main CPU with 09 0e (just a guess). This sequence does not use property 0x80050035, but on this camera, code referencing this property does not appear to be called from anywhere (unlike 5D3 and possibly other D5 models).

edit: PROP_STROBO_CHARGE_INFO_MAYBE (09 0e) becomes 1 as soon as the camera is pointed to a darker scene and gets back to 0 when pointing to a brighter scene. The LED turns on at the first transition (0->1), but remains on afterwards as long as the half-shutter is held.

@Levas: can you reproduce the above scenario while capturing the log?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #10 on: April 15, 2018, 09:38:42 AM »
EOS M2 is the only DIGIC 5 model (with ARM code, a lot easier to understand) with the following strings, also present in D6 and D7:
Code: [Select]
EV_LED_LIGHT_AUX_REQ_GMT
EV_LED_LIGHT_END_GMT

These two are events (inputs) 43 and 42 for GMTState (0xffa6f898, inputs=45, states=23). The handler for event 43 is FF185790 LedAuxReq (1.0.2), which calls a function that references the following:
Code: [Select]
[LED-BILT(MPU)] OFF -> ON %x
[LED-BILT(MPU)] ON -> OFF %x

and sends message 09 31 to MPU. The last two strings (without MPU) are also present on 100D, 650D, 6D, 700D, 70D and EOS M (but not on 5D3).

EOS M2 1.0.3:
Code: [Select]
void (*led_bilt_mpu)(int) = 0xFF38A200;
led_bilt_mpu(1);

[MPU] Received: 08 07 09 31 01 00 00 00  (unknown - unnamed)

@dfort: mind trying the above snippet on the M2?


6D (1.1.6) is even more interesting, as this LED is a plain GPIO, handled by main CPU (not by MPU):
Code: [Select]
# this routine appears to check a property, but for some reason, it never returns in QEMU
# skip it and just return the expected value
b *0x25444
commands
  silent
  set $r0 = 0x80000331
  set $pc = 0x25448
  c
end

void (*led_bilt)(int) = 0x2543C;
led_bilt(1);

=>

[GPIO]  at run_test:00025484:00450AD8 [0xC022C1FC] <- 0x93D800  : DSPL
[    run_test:0002549c ] (af:03) [LED-BILT] OFF -> ON 1

@Levas: can you try this? e.g. from don't click me (any branch; it makes no difference for this test):

Code: [Select]
static void run_test()
{
    msleep(2000);
    MEM(0xC022C1FC) = 0x93D800;
    NotifyBox(2000, "LED should be on");
}

The above should also work on 700D, 650D, EOSM, 100D and 70D (same GPIO).

Eventprocs lvae_afledon and lvae_afledoff are doing pretty much the same thing. The surprise appears on EOS M2, where they are using the GPIO, so the above snippet is worth trying there, too.

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #11 on: April 15, 2018, 10:48:28 AM »
Code: [Select]
static void run_test()
{
    msleep(2000);
    MEM(0xC022C1FC) = 0x93D800;
    NotifyBox(2000, "LED should be on");
}

The above should also work on 700D, 650D, EOSM, 100D and 70D (same GPIO).

No LED ON on the 700D???

Or maybe I misunderstood and this only is meant if you have speedlight attached, specific, Canon, which I don't, if so, sorry.  :-[
500D/T1i  550D/T2i  600D/T3i  700D/T5i

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #12 on: April 15, 2018, 11:41:22 AM »
Boo. OK, maybe these messages refer to the AF assist light from the external flash, rather than the front LED on the camera.

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #13 on: April 15, 2018, 11:44:51 AM »
Alex, not really sure how to use the piece of code you write above for the don't click me option.

Do I have to put in 'debug.c' file, in the part where this is now ?
Code: [Select]
static void run_test()
{
    printf("Gotcha!\n");
    ASSERT(0);
}

So it becomes like this
Code: [Select]
static void run_test()
{
# this routine appears to check a property, but for some reason, it never returns in QEMU
# skip it and just return the expected value
b *0x25444
commands
  silent
  set $r0 = 0x80000331
  set $pc = 0x25448
  c
end

void (*led_bilt)(int) = 0x2543C;
led_bilt(1);

=>

[GPIO]  at run_test:00025484:00450AD8 [0xC022C1FC] <- 0x93D800  : DSPL
[    run_test:0002549c ] (af:03) [LED-BILT] OFF -> ON 1
}

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #14 on: April 15, 2018, 12:59:00 PM »
Sort of, but run only what I've asked you to run, not what I've already tried. See the post from mk11174, although since it didn't work for him, I doubt it will work on other models.

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #15 on: April 15, 2018, 01:47:30 PM »
Boo. OK, maybe these messages refer to the AF assist light from the external flash, rather than the front LED on the camera.
I do have an external flash with the red pattern flash like on Canon speedlight, its just not a Canon.

I tried it with that also, and nothing happens on camera or external flash, if that helps?
500D/T1i  550D/T2i  600D/T3i  700D/T5i

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #16 on: April 16, 2018, 06:18:59 AM »
EOS M2 1.0.3:
Code: [Select]
void (*led_bilt_mpu)(int) = 0xFF38A200;
led_bilt_mpu(1);

[MPU] Received: 08 07 09 31 01 00 00 00  (unknown - unnamed)

@dfort: mind trying the above snippet on the M2?

Whoa, cool. Turns on the red focus LED.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #17 on: April 16, 2018, 07:01:35 AM »
Finally, working on at least one camera!

I assume the generic version (with 0xC022C1FC) doesn't turn on the LED, right?

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #18 on: April 16, 2018, 03:48:59 PM »
I assume the generic version (with 0xC022C1FC) doesn't turn on the LED, right?

Nope--not on the EOSM2.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: Front AF LED (PROP_LED_LIGHT)
« Reply #19 on: April 18, 2018, 10:24:38 AM »
edit: PROP_STROBO_CHARGE_INFO_MAYBE (09 0e) becomes 1 as soon as the camera is pointed to a darker scene and gets back to 0 when pointing to a brighter scene. The LED turns on at the first transition (0->1), but remains on afterwards as long as the half-shutter is held.
@Levas: can you reproduce the above scenario while capturing the log?

Not sure if I did it right, but I captured a log while doing this:
Half shutter press with speed light attached pointing to a dark scene(Red LED flashes to focus), while keeping the half shutter pressed, I moved the camera to a bright scene.
While keep half shutter pressed, I moved the camera back to a darker scene. While still being pointed to the darker scene I did a few half shutter presses(Red LED flashes for focusing).

Now I must say that the Red focus LED on the speed light  does only a short flash, it's not on or off, it just quickly turns on and when autofocus is done, it's off(less then a second)
The log is too big to put in this message (exceeds 100000 characters :P)
The log:
https://drive.google.com/open?id=1wJ8yPpaTFQIQd4vcMPBq0SfBD_u4wH0A