Author Topic: Canon 100D / SL1  (Read 526304 times)

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1275 on: May 26, 2018, 02:25:46 PM »
Thanks A1ex. Will check your hg command.
I just now put the raw.c from crop_rec_4k in my branch and surely that cured the top bar issue as stated. Will upload new builds to my downloads section.

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1276 on: May 26, 2018, 02:41:31 PM »
Nice command, hg diff...
Code: [Select]
Last login: Sat May 26 14:34:33 on ttys007
dans-MacBook-Pro:magic-lantern-dannephoto dan$ hg diff -r crop_rec_4k -r crop_rec_4k_mlv_lite_snd_sd_uhs_HDR_extended src/raw.c
diff -r 0075d0fa70f2 -r 5d6d2d2e32d5 src/raw.c
--- a/src/raw.c Fri Mar 23 13:35:07 2018 +0100
+++ b/src/raw.c Thu May 24 16:25:27 2018 +0200
@@ -109,9 +109,16 @@
 #define DEFAULT_RAW_BUFFER_SIZE (0x4e000000 - 0x4d31a000)
 #endif
 
+#ifdef CONFIG_5D3
+/* for higher resolutions we'll allocate a new buffer, as needed */
+#define CONFIG_ALLOCATE_RAW_LV_BUFFER
+/* buffer size for a full-res LiveView image */
+#define RAW_LV_BUFFER_ALLOC_SIZE ((0x527 + 2612) * (0x2FE - 0x18)*8 * 14/8)
+#endif
+
+
 #ifdef CONFIG_650D
 #define DEFAULT_RAW_BUFFER MEM(0x25B00 + 0x3C)
-#define DEFAULT_RAW_BUFFER_SIZE (0x47F00000 - 0x46798080)
 #endif
 
 #ifdef CONFIG_700D
@@ -126,7 +133,6 @@

:

OlRivrRat

  • Hero Member
  • *****
  • Posts: 538
Re: Canon 100D / SL1
« Reply #1277 on: May 28, 2018, 12:09:03 AM »
           @Alex

       724 Good, 722 starts to show bad right edge. With Dannes 26May Build am now getting 2520x1072.
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1278 on: June 02, 2018, 12:32:29 PM »
live view framing feature doesn´t work for the 100D. THought it would maybe only work for the 5D mark III but eosm is a happy camper working gladly with 5x zoom and correct framing when doing half shutter press or enabling framing. Is the 100D not included? What´s missing? Something in raw.c?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Canon 100D / SL1
« Reply #1279 on: June 02, 2018, 01:25:01 PM »
Are other features using the same backend (such as fisheye correction or anamorphic preview) working? It seems to be enabled in the source, but I'm not sure if anyone tested these features yet (search results returned nothing).

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1280 on: June 02, 2018, 01:56:47 PM »
Will do some tests soon. Gotta get those lv ram dumps produced too...

OlRivrRat

  • Hero Member
  • *****
  • Posts: 538
Re: Canon 100D / SL1
« Reply #1281 on: June 02, 2018, 06:31:14 PM »
                     @Danne

       Just noticed that "Global Draw" settings get turned off during Start up when using

 magiclantern-Nightly.2018Jun01.100D101sd_uhs

       Need to be turned back on Manually on each Start.

Update > Same issue with all 3 latest builds.

magiclantern-Nightly.2018May29.100D101sd_uhs_allbits , Keeps "Global Draw" settings.
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1282 on: June 02, 2018, 06:53:41 PM »
Ok, thanks for telling, will do some lua refinements which will check if on or not before starting the sd_uhs procedure.

OlRivrRat

  • Hero Member
  • *****
  • Posts: 538
Re: Canon 100D / SL1
« Reply #1283 on: June 02, 2018, 07:03:53 PM »
"Are other features using the same backend (such as fisheye correction or anamorphic preview) working?"

Defishing is Available & Settable

Anamorphic is there but Greyed out > Assume maybe an Anamorphic Lens Needs to be mounted ?
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

OlRivrRat

  • Hero Member
  • *****
  • Posts: 538
Re: Canon 100D / SL1
« Reply #1284 on: June 02, 2018, 07:07:11 PM »
           @Danne

It appears to be On as Cam Starts & then gets Turned Off as SDUHS Script runs, then does not come back on.
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Canon 100D / SL1
« Reply #1285 on: June 02, 2018, 07:19:57 PM »
Defishing is Available & Settable

OK, but does it have any effect on the LiveView image?

Quote
Anamorphic is there but Greyed out > Assume maybe an Anamorphic Lens Needs to be mounted ?

When something is grayed out in ML menu, there's always a message telling you why. I'm unable to guess the reason.

OlRivrRat

  • Hero Member
  • *****
  • Posts: 538
Re: Canon 100D / SL1
« Reply #1286 on: June 02, 2018, 07:40:27 PM »
Does not seem to have effect on LiveView Image but does go thru an "Image Squeeze" routine during Image Preview.

Anamorphic wanted Canon Displays Turned Off.
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1287 on: June 02, 2018, 08:42:23 PM »
Defishing and Anamorphic are selectable but like "framing" it doesn't affect live view image at all. Not working in other words.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Canon 100D / SL1
« Reply #1288 on: June 02, 2018, 08:56:14 PM »
You can start debugging in tweaks.c, display_filter_lv_vsync. Does that get called? Add a printf or a NotifyBox there.

If yes: under CONFIG_CAN_REDIRECT_DISPLAY_BUFFER_EASILY, does it reach the last line? If not, why not? If yes, what values does it set? (print the values of current_buffer and display_filter_buffer).

Same for defish_draw_lv_color(). Does it get called? What image buffers does it get? (print src_buf and dst_buf after the call to display_filter_get_buffers). Does it return early for any reason? If yes, where?

A bit tedious to debug this one; the emulator doesn't go far enough either.

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1289 on: June 03, 2018, 08:49:06 AM »
Thanks @Alex. Will get on it asap.
@OlRivrRat
Fixed the global draw off thingy in the script

OlRivrRat

  • Hero Member
  • *****
  • Posts: 538
Re: Canon 100D / SL1
« Reply #1290 on: June 03, 2018, 05:14:44 PM »
                      @Danne

           Works Great & it seems that the speed of the SDUHS Launch is Quicker > Back to where it was in 29May Build.
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1291 on: June 03, 2018, 05:24:26 PM »
Yes, shortened it with about one second. Seems ok.

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1292 on: June 05, 2018, 02:15:03 PM »
You can start debugging in tweaks.c, display_filter_lv_vsync. Does that get called? Add a printf or a NotifyBox there.

If yes: under CONFIG_CAN_REDIRECT_DISPLAY_BUFFER_EASILY, does it reach the last line? If not, why not? If yes, what values does it set? (print the values of current_buffer and display_filter_buffer).

There is contact with tweaks.c. Doing following:
Code: [Select]
#elif defined(CONFIG_CAN_REDIRECT_DISPLAY_BUFFER_EASILY) // all new cameras should work with this method

    if (!display_filter_buffer) return CBR_RET_CONTINUE;
    if (!display_filter_valid_image) return CBR_RET_CONTINUE;
    if (!display_filter_enabled()) { display_filter_valid_image = 0;  return CBR_RET_CONTINUE; }
   
    /* save the old buffer (to restore it when turning off display filters) */
    void* current_buffer = (void*) YUV422_LV_BUFFER_DISPLAY_ADDR;
    if (current_buffer != display_filter_buffer) last_canon_buffer = current_buffer;

NotifyBox(5000, "current_buffer 0x%x", current_buffer);

Ok, when setting Preview to framing and pressing halfshutter I´m getting this:
0x4bde7800

When in Preview auto and pressing halfshutter I get random results:
0x4bde7800
0x4b9d7800
0x4c1f7800

Tried setting defishing and register goes whirling between these three registers.

display_filter_buffer is:
0xb24238




Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1293 on: June 05, 2018, 03:55:57 PM »
Regarding display_filter_lv_vsync:
Code: [Select]
int display_filter_lv_vsync(int old_state, int x, int input, int z, int t)
{

NotifyBox(5000, "HELLO");

#if defined(CONFIG_5D2)
    int sync = (MEM(x+0xe0) == YUV422_LV_BUFFER_1);
    int hacked = ( MEM(0x44fc+0xBC) == MEM(0x44fc+0xc4) && MEM(0x44fc+0xc4) == MEM(x+0xe0));
    display_broken = hacked;

prints HELLO constantly so used always?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Canon 100D / SL1
« Reply #1294 on: June 05, 2018, 04:20:50 PM »
Try this:

Code: [Select]
int display_filter_lv_vsync(int old_state, int x, int input, int z, int t)
{
    if (HALFSHUTTER_PRESSED) {
        YUV422_LV_BUFFER_DISPLAY_ADDR = rand() & 0xFFFFFF;
        return;
    }
    ...

You should see the LiveView image going crazy (displaying random things from memory) when pressing the shutter halfway, and back to normal when releasing it. Try it on a camera known to work, to see how it looks like.

If that doesn't work, go back to the caller of this function (state-object.c, stateobj_lv_spy). Do the same thing there (without the return). If it works, we have to change INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER. Try 25 (named_functions.idc -> DisplayStateWithImgMute_S01_I25 -> EnableImagePhysicalScreenParameter pCBR=%x; same pattern on 5D3 in DisplayStateWithImgMute_S01_I20).



P.S. Some fun stuff with random walks:

Code: [Select]
    if (HALFSHUTTER_PRESSED) {
        static int pos = 0;
        pos += (rand() & 1) ? rand() % 10 : - rand() % 10;
        YUV422_LV_BUFFER_DISPLAY_ADDR += pos * 1440;
        return;
    }

Exercise for the reader: explain how it works (e.g. with a plot in octave or python), what's up with the magic number (1440) and why it doesn't do a double integration.

Anyone who understands the above stuff will be able to implement this feature request in no time.

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1295 on: June 05, 2018, 05:48:15 PM »
Code: [Select]
int display_filter_lv_vsync(int old_state, int x, int input, int z, int t)
{
    if (HALFSHUTTER_PRESSED) {
        YUV422_LV_BUFFER_DISPLAY_ADDR = rand() & 0xFFFFFF;
        return;
    }
#if defined(CONFIG_5D2)
    int sync = (MEM(x+0xe0) == YUV422_LV_BUFFER_1);
    int hacked = ( MEM(0x44fc+0xBC) == MEM(0x44fc+0xc4) && MEM(0x44fc+0xc4) == MEM(x+0xe0));
    display_broken = hacked;
Works for the eosm(scrambled output) but no respone on HALFSHUTTER_PRESSED for the 100D.

Code: [Select]
    if (HALFSHUTTER_PRESSED) {
        static int pos = 0;
        pos += (rand() & 1) ? rand() % 10 : - rand() % 10;
        YUV422_LV_BUFFER_DISPLAY_ADDR += pos * 1440;
        return;
    }
Eh, wut, super resolution? Small jumps in image on HALFSHUTTER_PRESSED

Trying this:
Quote
If that doesn't work, go back to the caller of this function (state-object.c, stateobj_lv_spy). Do the same thing there (without the return). If it works, we have to change INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER. Try 25 (named_functions.idc -> DisplayStateWithImgMute_S01_I25 -> EnableImagePhysicalScreenParameter pCBR=%x; same pattern on 5D3 in DisplayStateWithImgMute_S01_I20).

This works for the eosm but not for the 100D(state-object.c):
Code: [Select]
static void state_init(void* unused)
{

    if (HALFSHUTTER_PRESSED) {
        YUV422_LV_BUFFER_DISPLAY_ADDR = rand() & 0xFFFFFF;

    }
    #ifdef DISPLAY_STATE
        stateobj_start_spy(DISPLAY_STATE, stateobj_lv_spy);
    #endif
    #ifdef LV_STATE


Didn´t do this. Still valid?
Quote
If it works, we have to change INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER. Try 25 (named_functions.idc -> DisplayStateWithImgMute_S01_I25 -> EnableImagePhysicalScreenParameter pCBR=%x; same pattern on 5D3 in DisplayStateWithImgMute_S01_I20).

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1296 on: June 05, 2018, 05:57:16 PM »
Kid me not, it worked!
in state-object.h:
Code: [Select]
#define INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER 24to:
Code: [Select]
#define INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER 25Defishing
Anamorphic
Clear overlays
All works! Bloody magic.

Here is a build for the 100D. THis camera got even more useful then before. Thanks A1ex.
https://bitbucket.org/Dannephoto/magic-lantern/downloads/magiclantern-Nightly.2018Jun05.100D101sd_uhs.zip

nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 1193
Re: Canon 100D / SL1
« Reply #1297 on: June 05, 2018, 06:13:41 PM »
Good job, Danne. Thank you.
70D.112 & 100D.101

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7188
Re: Canon 100D / SL1
« Reply #1298 on: June 05, 2018, 06:20:07 PM »
Thank you guys for helping out. Also a nice tour in small parts of some great c code. And thanks A1ex.

nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 1193
Re: Canon 100D / SL1
« Reply #1299 on: June 05, 2018, 08:32:19 PM »
As I can't do myself atm:
can someone provide me a working build with adtg module included for 100D plz??

last one I used to compile should have been this:
https://bitbucket.org/nikfreak/magic-lantern/branch/isoresearch
70D.112 & 100D.101