Auto ETTR on EOSM

Started by Morghus, March 04, 2014, 12:46:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

a1ex

Yes, sounds good. You will need to export it to modules as a function though (since camera-specific ifdef's won't end up in module code).

I'm not sure what to suggest about SET (without trying, it's hard to evaluate how it feels like, and I don't know how essential is the Q menu on the M). Maybe sketching up some UI scenarios or maybe a mockup could be useful.

Another button... I guess it's unlikely to find one. Gestures would be probably cool, but not sure how practical (not to mention the implementation). An icon where you could tap? no idea, never tried a touch-screen camera.

Morghus

Made a pull request, double tapping the screen will trigger ETTR.

I also found out why ETTR in combination with the intervalometer doesn't work: in auto_ettr_step() the following line fails:

    if (lens_info.raw_shutter == 0 && is_m) return;

raw_shutter seems to be 0, right before taking a photo it is set correctly, something seems to set it to 0 while or after taking a photo... I tried commenting out that line and it seems to fix it but I think corrections aren't always dead on, it takes one or two photos to settle fully.

a1ex

Will check it, thanks.

In M mode, auto_ettr_work_m starts with tv = lens_info.raw_shutter. If that one is not valid (does not contain your current shutter speed), the math will be broken. Normally, on other cameras, it happens while flash is recharging, but not in QR. Maybe you can have a loop that prints this value to see whether we may need to wait or something?

So... were you able to turn off LiveView on the M? I've asked somewhere else and IIRC it wasn't possible.

Morghus

Quote from: a1ex on March 07, 2014, 07:42:14 AM
So... were you able to turn off LiveView on the M? I've asked somewhere else and IIRC it wasn't possible.
NotifyBox(1000, "%d %d ", lv, raw_lv_is_enabled());

Pressing INFO cycles through these modes:

I'll test lens_info.raw_shutter next!

a1ex

Yap. Can you take pictures from that screen with photo settings without going back to LiveView?

(this is what ETTR expects in Always On / Auto Snap settings outside LiveView)

Morghus

No, unfortunately as soon as you press half shutter it goes back to LV

Morghus

I tried a few things:

  • lens_info.raw_shutter regains a value around 1 second after QR popped up
  • In PROP_HANDLER(PROP_GUI_STATE) I can't wait for that value because lens_info.raw_shutter only regains a value after this function returned (I actually tried this, as if I waited 2 seconds it took exactly 2 seconds for raw_shutter to get a value)
  • I tried creating a task with TASK_CREATE() and waiting for raw_shutter there, same behavior as if I just wait in PROP_HANDLER(PROP_GUI_STATE)
  • vsync_cbr is not called while QR is active, so I can't check raw_shutter there and, if necessary, start ETTR
  • debug_task sees raw_shutter regain a value before QR is over

I don't know if I should create a background task in ettr that always runs, like the vsync_cbr, checking for the right conditions... would be a waste of resources. I don't know if there are any background tasks that I could use for that, any suggestions?

a1ex

What about something like this?


diff -r 811c68f776a5 modules/ettr/ettr.c
--- a/modules/ettr/ettr.c Thu Mar 06 22:29:09 2014 +0200
+++ b/modules/ettr/ettr.c Fri Mar 07 23:57:52 2014 +0200
@@ -620,6 +620,16 @@

static int auto_ettr_work(int corr)
{
+    if (it's going to call auto_ettr_work_m)
+    {
+        /* in M mode, wait until shutter speed is reported by Canon firmware */
+        while (lens_info.raw_shutter == 0)
+        {
+            msleep(50);
+            /* add some timeout handling, e.g. 1-2 seconds */
+        }
+    }
+
     /* save initial exposure settings so we can print them */
     char* expo_settings = get_current_exposure_settings();
     snprintf(prev_exposure_settings, sizeof(prev_exposure_settings), "%s", expo_settings);
@@ -699,7 +709,6 @@
     if (shooting_mode != SHOOTMODE_M && shooting_mode != SHOOTMODE_AV && shooting_mode != SHOOTMODE_TV && shooting_mode != SHOOTMODE_P && shooting_mode != SHOOTMODE_MOVIE) return;
     int is_m = (shooting_mode == SHOOTMODE_M || shooting_mode == SHOOTMODE_MOVIE);
     if (lens_info.raw_iso == 0 && is_m) return;
-    if (lens_info.raw_shutter == 0 && is_m) return;
     if (auto_ettr_running) return;
     if (is_hdr_bracketing_enabled() && !AUTO_ETTR_TRIGGER_BY_SET) return;


Basically, I've moved that check in the background task created from the prop handler; there you don't have any restrictions regarding waiting, and there should be no side effects for the other cameras.

1%

why is it instant in av/tv?

a1ex

In av/tv it only has to adjust exposure compensation; in M it decides shutter and ISO.

Imagine how it would look if it would also decide aperture.

Morghus

Works perfectly now! I added a timeout and a status, how does this look?

diff -r 811c68f776a5 modules/ettr/ettr.c
--- a/modules/ettr/ettr.c Thu Mar 06 22:29:09 2014 +0200
+++ b/modules/ettr/ettr.c Fri Mar 07 23:19:25 2014 +0100
@@ -40,6 +40,7 @@
#define AUTO_ETTR_TRIGGER_BY_HALFSHUTTER_DBLCLICK (auto_ettr_trigger == 3)

/* status codes */
+#define ETTR_EXPO_PRECOND_TIMEOUT -2
#define ETTR_EXPO_LIMITS_REACHED -1
#define ETTR_NEED_MORE_SHOTS 0
#define ETTR_SETTLED 1
@@ -620,6 +621,21 @@

static int auto_ettr_work(int corr)
{
+    if (shooting_mode == SHOOTMODE_M || shooting_mode == SHOOTMODE_MOVIE)
+    {
+        /* in M mode, wait until shutter speed is reported by Canon firmware */
+        int waited = 0;
+        while (lens_info.raw_shutter == 0)
+        {
+            if (waited > 2000)
+            {
+                return ETTR_EXPO_PRECOND_TIMEOUT;
+            }
+            msleep(50);
+            waited += 50;
+        }
+    }
+
     /* save initial exposure settings so we can print them */
     char* expo_settings = get_current_exposure_settings();
     snprintf(prev_exposure_settings, sizeof(prev_exposure_settings), "%s", expo_settings);
@@ -671,6 +687,13 @@
         msleep(1000);
         bmp_printf(FONT_MED, 0, os.y0, "ETTR: expo limits reached\n%s", get_current_exposure_settings());
     }
+    else if (status == ETTR_EXPO_PRECOND_TIMEOUT)
+    {
+        beep_times(3);
+        ettr_pics_took = 0;
+        msleep(1000);
+        bmp_printf(FONT_MED, 0, os.y0, "ETTR: timeout while waiting for preconditions\n");
+    }
     else if (AUTO_ETTR_TRIGGER_AUTO_SNAP)
     {
         /* take another pic */
@@ -699,7 +722,6 @@
     if (shooting_mode != SHOOTMODE_M && shooting_mode != SHOOTMODE_AV && shooting_mode != SHOOTMODE_TV && shooting_mode != SHOOTMODE_P && shooting_mode != SHOOTMODE_MOVIE) return;
     int is_m = (shooting_mode == SHOOTMODE_M || shooting_mode == SHOOTMODE_MOVIE);
     if (lens_info.raw_iso == 0 && is_m) return;
-    if (lens_info.raw_shutter == 0 && is_m) return;
     if (auto_ettr_running) return;
     if (is_hdr_bracketing_enabled() && !AUTO_ETTR_TRIGGER_BY_SET) return;

Morghus


a1ex

Great! Will try to polish them and merge later today or tomorrow, along with a few others in the queue that I have yet to try myself.