#787 Open
Repository
Dannephoto
Branch
crop-hack-config
Repository
hudson
Branch
unified

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update 7a3b5fa3f4c6
hg pull -r crop-hack-config https://bitbucket.org/Dannephoto/magic-lantern
# Note: This will create a new head!
hg merge crop-hack-config
hg commit -m 'Merged in Dannephoto/magic-lantern/crop-hack-config (pull request #787)'
Author
  1. danne
Reviewers
Description

Re-enable movie crop mode if set in menu when shutting down camera. Reads the config file on startup. Most work done by Daniel Fort. Boothack lines by bouncyball.

Comments (10)

  1. Alex

    Can be done directly in crop-mode-hack.c, without changing boot-hack.c (do the same thing from crop_mode_hack_init).

    There is a problem with this implementation: at shutdown, movie_crop_hack_disable() gets called, and after that, config_save_at_shutdown(). Usually, config_save_at_shutdown() is also called earlier, if the early signs of shutdown are caught, which is why it seems to work; however, there are some edge cases present (and the behavior may be model-dependent).

    Will think about removing the early shutdown hook, to get deterministic behavior.

  2. danne author

    bouncyball gave me some code to test and it now works crop-mode-hack.c Not sure at all what do about the shutdown hook. Thanks all for helping.

  3. Daniel Fort

    Tested on the EOSM and it works great. However, the shutdown hook doesn't seem to be working on the 700D. Method: Put camera in Movie crop mode, shutdown, remove card and start camera. EOSM is fine but 700D stays in crop mode.

    1. Alex

      It doesn't get called at all?

      To be sure, call this at the beginning of ml_shutdown: cli(); while(1);

      If that function gets called, the above will lock up the camera.

      1. Daniel Fort
        static void ml_shutdown()
        {
            cli(); while(1);
        

        Does lock up the camera. Red LED on, requires battery pull.

        However, movie_crop_hack_disable(); in the same place (tasks.c) doesn't turn off crop mode on the 700D.

        Sorry, didn't think of testing pull request #776 on the 700D until you mentioned about the behavior may be model-dependent.

        1. Alex

          Understood, so probably the hook is called after Canon settings get saved. Not sure what event triggers that, though, but I can imagine some ways to find out (such as blinking debug messages during shutdown).

    2. Alex

      @daniel_fort and @Dannephoto : I might have reproduced it on 700D (this branch merged with current unified):

      • with ML card, enable crop mode, shutdown by opening card door, reboot (it starts in crop mode)
      • with ML card, disable crop mode, shutdown by opening card door, reboot (it starts in 1x)
      • with ML card, enable crop mode, shutdown by opening card door, remove card, reboot without card (it starts in 1x)
      • with ML card, enable crop mode, shutdown by power switch, remove card, reboot without card (it starts in crop mode; expecting to start in 1x, right?)

      This means the crop mode setting is persistent on the 700D when shutting down from photo mode? With vanilla unified on 700D 115:

      • with ML card, enable crop mode, shutdown by opening card door, reboot (it starts in 1x)
      • with ML card, disable crop mode, shutdown by opening card door, reboot (it starts in 1x)
      • with ML card, enable crop mode, shutdown by power switch, reboot (it starts in crop mode)
      • with ML card, disable crop mode, shutdown by opening card door, reboot (it starts in 1x, unexpected)
      • with ML card, enable crop mode, shutdown by power switch, reboot (it starts in crop mode)
      • with ML card, disable crop mode, shutdown by power switch, reboot (it starts in 1x)

      Something else: if you comment out movie_crop_hack_disable() from ml_shutdown (tasks.c), this feature becomes persistent on 700D. Is this the same on EOSM and 100D?

      1. Daniel Fort
        • with ML card, enable crop mode, shutdown by power switch, remove card, reboot without card (it starts in crop mode; expecting to start in 1x, right?)

        Exactly. This means that PR #776 isn’t working on the 700D. I didn’t realize this at first with this PR because it is supposed to unset crop mode on shutdown and reset it on startup--if necessary according to the saved settings.

        I just checked if the startup in Movie crop mode is working and it is.

        • with ML card, enable crop mode, shutdown by power switch, remove card, reboot (it starts in crop mode), use Canon menu to switch off crop mode, shutdown by power switch, insert ML card, reboot (it starts in crop mode as expected)

        So the only part that isn’t working on the 700D is movie_crop_hack_disable() in tasks.c. Commenting this out should make every camera behave the same way which is keep Movie crop mode persistent but is that what we want to do? Unsetting on shutdown then resetting on startup via a settings file seems like a more elegant way of working with Movie crop mode.

      2. Daniel Fort

        Something else: if you comment out movie_crop_hack_disable() from ml_shutdown (tasks.c), this feature becomes persistent on 700D. Is this the same on EOSM and 100D?

        Yes on the EOSM.