Canon 100D / SL1

Started by nikfreak, October 19, 2015, 10:41:29 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

nikfreak

Best way is in crop_rec module. "Is_basic" refers to 100D / 700D / EOSM. You could add a new option or here "case" and name it like you which:

https://bitbucket.org/hudson/magic-lantern/src/d2da32f62e6cd7758171cd964ac80d3a28fd2af7/modules/crop_rec/crop_rec.c?at=crop_rec_4k&fileviewer=file-view-default#crop_rec.c-110

Important places:
https://bitbucket.org/hudson/magic-lantern/src/d2da32f62e6cd7758171cd964ac80d3a28fd2af7/modules/crop_rec/crop_rec.c?at=crop_rec_4k&fileviewer=file-view-default#crop_rec.c-522
https://bitbucket.org/hudson/magic-lantern/src/d2da32f62e6cd7758171cd964ac80d3a28fd2af7/modules/crop_rec/crop_rec.c?at=crop_rec_4k&fileviewer=file-view-default#crop_rec.c-843

Ofc you have to fiddle a lil bit but generally you just can return the values needed like this:
https://bitbucket.org/hudson/magic-lantern/src/d2da32f62e6cd7758171cd964ac80d3a28fd2af7/modules/crop_rec/crop_rec.c?at=crop_rec_4k&fileviewer=file-view-default#crop_rec.c-894

Hope you get what I mean. The code cheks for video modes etc. Maybe hard to understand at first but should be doable.. a1ex uses delta values and some hardcoded ones maybe that could be a way to unify it for apsc cams for e.g. find safe working deltas by comparing original to overriden values on all cameras.
[size=8pt]70D.112 & 100D.101[/size]

Danne

Thanks Nikfreak, I see what I can understand and not.
Clear preview with this. Breaks when increasing height. You probably know why. I have no idea  8):
QuoteFollowing gives 14bit-lossless 24 fps with good preview capabilities, 16:9, a good preset):
2520x1248
            case 0x6804:                /* C0F06804 - raw resolution */
                return 0x50802a1;

Danne

Even with pointers creating the preset seems complicated enough to have me occupied for a long while. ANother question on the topis this change:
2520x1080
            case 0x6804:                /* C0F06804 - raw resolution */
                return 0x45902a1;


A slight change gets valid 1080p instead of 1072p and seems working with all bits. I can´t see where this register change should be replaced when it comes to x5 zoom code? It's only one little number doing this 0x45802a1 to this 0x45902a1.

Danne

Posted two new versions for the 100D:
2.5k(with good preview)
https://bitbucket.org/Dannephoto/magic-lantern/downloads/magiclantern-Nightly.2018Jun12.100D101_adtg_gui_ver_06_2.5K.zip
3k(broken preview)
https://bitbucket.org/Dannephoto/magic-lantern/downloads/magiclantern-Nightly.2018Jun12.100D101_adtg_gui_ver_06_3K.zip

Could be run with the lua script SD overclock-adtg_gui helper.
Set global draw to off before running the script...

a1ex

Quote from: Danne on June 12, 2018, 05:37:28 PM
You absolutely need global draw set to off before running the script. Some bug.

As explained before, battery pull with sd_uhs == data lost. The SD patch happens while ML is saving its settings (since you have clicked a menu entry, ML believes some settings might have been changed). At least increase the delay ;)

With global draw off, saving the settings ends right before the SD patching begins (by some milliseconds or so); that's why it seems to work. With global draw on, saving takes a bit longer, as the CPU usage is higher. I wouldn't rely on the repeatability of this process.

Danne

 I hear you A1ex. I will take your advice with an extra paus.
By the way. To be added here it seems 100D has a bug when running global draw on trying to turn it off. Even without sd_uhs included the lua script will simply not start from time to time. Think it's related to adtg_gui module. Eosm seems to run fine with or without global draw on. Needs more testing.
On a sidenote I must say lua is a fantastic tool here saving so many steps getting right into business.

Edit: slight change in the lua script, uploaded new versions.

Danne

@Nikfreak
Seems Bilal* is having some nice progress with the adtg registers. Black border is gone on the eosm here:
https://www.magiclantern.fm/forum/index.php?topic=9741.msg202786#msg202786

Question. How can one do case changes to the CMOS7 register in the preset hack of yours? I can´t really understand how you got ig going? Here are the registers from Bilal in the eosm build:
    else if (is_camera("EOSM", "2.0.2"))
    {

       if (regs[reg].dst == 0xC0F0)
       {

           switch (regs[reg].reg)
           {
                case 0x6804:                /* C0F06804 - raw resolution */
                    return 0x5840298;       /* Valid liveview 2520x1248 24fps 14-bit lossless */
                 /* return 0x5040328;       /* crushed liveview 3096x1256 24fps 14-bit lossless */
                case 0x6014:
                   return 0x747;
                case 0x7150:
                  return 0x428;
                case 0x713c:
                   return 0x535;
     
            }

        }
        else if (regs[reg].dst == 2)        /* ADTG 2 */
        {
            switch (regs[reg].reg)
            {
                 case 0x8172:
                    return 0xfa8;
                 case 0x8178:
                    return 0xfa8;
                 case 0x82b6:
                    return 0x8f4;

            }

        }

    }


I still need to change
CMOS[7] 0xa49 to 0xaa9 manually...

theBilalFakhouri

@Danne

This is I used for 2520x1384 @ 23.976 :

static int crop_mode_reg(int reg)
{
    if (regs[reg].dst == DST_CMOS)
    {
        switch (regs[reg].reg)
        {
            case 7: return 0xaa9;       /* CMOS[7]: ISO related? */
        }
    }
    else if (regs[reg].dst == 2)        /* ADTG 2 */
    {
        switch (regs[reg].reg)
        {
            case 0x82b6: return 0x8f4;      /* it's 5 in zoom mode and 6 in 1080p; this also overrides ADTG4 */
            case 0x8172: return 0x87c; /* without this, you get some weird artifacts; this should only go to ADTG2, not 4 */
case 0x8178: return 0x87c;
        }
    }

    return 0;
}

static int res3k_reg(int reg)
{
    if (regs[reg].dst == 0xC0F0)
    {
        switch (regs[reg].reg)
        {
            case 0x6804:                /* C0F06804 - raw resolution */
                return 0x5840298;       /* from 0x528011B -> 3072px in raw_rec */

case 0x6014: return 0x747;
case 0x713c: return 0x535;

        }
    }


The code is the same in adtg_gui.c but I am only changed/added the new registers and the values without changing the main code.
You are missing:

  if (regs[reg].dst == DST_CMOS)
    {
        switch (regs[reg].reg)
        {
            case 7: return 0xaa9;       /* CMOS[7]: ISO related? */
        }


Hint:
ADTG2[8172] N (N means NRZI value)
ADTG2[8178] N

Quote from: theBilalFakhouri on February 22, 2018, 05:21:36 PM
The actual ADTG2[8172/8] N values is 6fd or 67c and you have to set it 8fd (I don't know why it's looks different from the outside)

This is what it's look like in the menu:

Quote from: theBilalFakhouri on February 22, 2018, 05:21:36 PM

Sett" border="0


This settings was for Full-res --> But when selecting one of the these registers to override it the value will be different (Which we use the *different* one in adtg_gui.c) and this is explaining the black border in the EOS M (wrong values) .

From your above code:
Quote from: Danne on June 16, 2018, 10:21:42 AM
             switch (regs[reg].reg)
            {
                 case 0x8172:
                    return 0xfa8; (***This value from outside --> the correct one is 0x87c )
                 case 0x8178:
                    return 0xfa8; (***This value from outside --> the correct one is 0x87c )
                 case 0x82b6:
                    return 0x8f4;

            }



More info

Hope this is helps!

Danne

ah, great Bilal. THis work for me:
    else if (is_camera("EOSM", "2.0.2"))
    {

       if (regs[reg].dst == DST_CMOS)
       {
           switch (regs[reg].reg)
           {
                 case 7: return 0xaa9;       /* CMOS[7]: ISO related? */
           }
       }

       if (regs[reg].dst == 0xC0F0 && DST_CMOS)
       {

           switch (regs[reg].reg)
           {
                case 7: return 0xaa9;       /* CMOS[7]: ISO related? */
                case 0x6804:                /* C0F06804 - raw resolution */
                    return 0x5840298;       /* Valid liveview 2520x1248 24fps 14-bit lossless */
                 /* return 0x5040328;       /* crushed liveview 3096x1256 24fps 14-bit lossless */
                case 0x6014:
                   return 0x747;
                case 0x7150:
                  return 0x428;
                case 0x713c:
                   return 0x535;
     
            }

        }
        else if (regs[reg].dst == 2)        /* ADTG 2 */
        {
            switch (regs[reg].reg)
            {
                 case 0x8172:
                    return 0xfa8;
                 case 0x8178:
                    return 0xfa8;
                 case 0x82b6:
                    return 0x8f4;

            }

        }

    }

Danne

2520x1304 24.006fps(increasing vertical resolution from here yields corruption)
    if (is_camera("100D", "1.0.1"))
    {

       if (regs[reg].dst == DST_CMOS)
       {
           switch (regs[reg].reg)
           {
                 case 7:
    return 0xaa9;       /* CMOS[7]: ISO related? */
           }
       }

       if (regs[reg].dst == 0xC0F0)
       {

           switch (regs[reg].reg)
           {
                case 0x6804:                /* C0F06804 - raw resolution */
                    return 0x53902a1;       /* 2520x1304 24.006fps 14-bit lossless */
                 /* return 0x50802a1;          2520x1248 24.006fps 14-bit lossless */
                case 0x6014:
                    return 0x71c;
    case 0x713c:
    return 0x535;
            }

        }
        else if (regs[reg].dst == 2)        /* ADTG 2 */
        {
            switch (regs[reg].reg)
            {
            case 0x82b6:
       return 0x8f4;      /* it's 5 in zoom mode and 6 in 1080p; this also overrides ADTG4 */
            case 0x8172:
       return 0x87c; /* without this, you get some weird artifacts; this should only go to ADTG2, not 4 */
    case 0x8178:
       return 0x87c;

            }

        }

    }


3096x1320 20fps (seems max, increasing gives black side)
     if (is_camera("100D", "1.0.1"))
    {

       if (regs[reg].dst == DST_CMOS)
       {
           switch (regs[reg].reg)
           {
case 5:
      return 0x280;       /* CMOS[5]: ISO related? */
                 case 7:
    return 0xa89;       /* CMOS[7]: ISO related? */
           }
       }

       if (regs[reg].dst == 0xC0F0)
       {

           switch (regs[reg].reg)
           {
                case 0x6804:                /* C0F06804 - raw resolution */
                    return 0x5490331;       /* 2904x1320 20fps 14-bit lossless */
    case 0x6824:
    return 0x3ca;
    case 0x6828:
    return 0x3ca;
    case 0x682c:
    return 0x3ca;
    case 0x6830:
    return 0x3ca;
    case 0x6008:
    return 0x37b037b;
    case 0x600c:
    return 0x37b037b;
    case 0x6010:
    return 0x37b;
    case 0x6014:
    return 0x6d7;
    case 0x713c:
    return 0x555;
            }

        }
        else if (regs[reg].dst == 2)        /* ADTG 2 */
        {
            switch (regs[reg].reg)
            {
            case 0x82b6:
       return 0x7f4;      /* it's 5 in zoom mode and 6 in 1080p; this also overrides ADTG4 */
            case 0x8172:
       return 0x77c; /* without this, you get some weird artifacts; this should only go to ADTG2, not 4 */
    case 0x8178:
       return 0x77c;

            }

        }

    }


4056x2552 9fps:
   if (is_camera("100D", "1.0.1"))
    {

       if (regs[reg].dst == DST_CMOS)
       {
           switch (regs[reg].reg)
           {
case 5:
      return 0x200;       /* CMOS[5]: ISO related? */
                 case 7:
    return 0xf20;       /* CMOS[7]: ISO related? */
           }
       }

       if (regs[reg].dst == 0xC0F0)
       {

           switch (regs[reg].reg)
           {
                case 0x6804:               
                    return 0xa1b0421;       /* 4056x2552 9fps 14-bit lossless */
    case 0x6824:
    return 0x4ca;
    case 0x6828:
    return 0x4ca;
    case 0x682c:
    return 0x4ca;
    case 0x6830:
    return 0x4ca;
    case 0x6008:
    return 0x45b045b;
    case 0x600c:
    return 0x45b045b;
    case 0x6010:
    return 0x45b;
    case 0x6014:
    return 0xbd4;
    case 0x713c:
    return 0xa55;
            }

        }
        else if (regs[reg].dst == 2)        /* ADTG 2 */
        {
            switch (regs[reg].reg)
            {
            case 0x82b6:
       return 0xbf4;      /* it's 5 in zoom mode and 6 in 1080p; this also overrides ADTG4 */
            case 0x8172:
       return 0x8fd;
          case 0x8178:
       return 0x8fd;

            }

        }

    }

Danne

New version(thanks to bilal)
2.5k (2520x1304 24fps)
https://bitbucket.org/Dannephoto/magic-lantern/downloads/magiclantern-Nightly.2018Jun16.100D101_2.5k.zip

Automation if wanted via lua script. Reworked/renamed to adtg_gui helper

OlRivrRat

                     @Danne

Running Your Latest > magiclantern-Nightly.2018Jun16.100D101_2.5k

Only 3 Scripts showing >

enable SD overclocking
Reboot
Show console

also unable to capture ScreenShot

What am I doing wrong this time?
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

Danne

That is strange. If the scripts are in the scripts folder could you try renaming them by removing spaces and see if that helps?
Are more users having this issue?

Danne

@OlRivrRat
Could you try downloading it again?
https://bitbucket.org/Dannephoto/magic-lantern/downloads/magiclantern-Nightly.2018Jun16.100D101_2.5k.zip

I renamed all scripts by removing . and _. Maybe those aren´t working at your end? Readability will take a hit but it should look ok in camera.

OlRivrRat

@Danne

DownLoaded Your ReName build > No Change. Will try some Shorter Names in a few & report back.
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

Walter Schulz

File name length problem. Mine throws screen messages clearly saying they could not be loaded.
-> Only 3 scripts visible in ML menu.

OlRivrRat

@Danne

If I get a Name down to 11 Characters it Shows Up .
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

OlRivrRat

& it does Show with Your Orig' Naming ~
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

OlRivrRat

Naming I am using tha works >

5x25k10bi1m.lua
5x25k10bi8m.lua
1080p12bi1m.lua
1080p12bi8m.lua
adtgguihlpr.lua
drkframcrtr.lua
lib
reboot.lua
SDoverclock.lua
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

OlRivrRat

Probably due to SL1 being So Small ~ {:~))
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

Danne

Ok, thanks both for reporting. Totally slipped my radar since my 100D plays all scripts nicely. How can it be? Menu language? Anyway. Will shorten names asap.

OlRivrRat

I am correct in assuming that Yours is a European Version & the Firmware is Diff'?
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

Walter Schulz

Nope, it's not language but file system. I just tried with 8 GB card (FAT32) and long file names are not a problem here. Used ExFAT and "Houston, we have a problem".

Debugging. What it looks like:

Source: Imgur

OlRivrRat

My card is 64GB ExFAT. I format all My Cards ExFAT.

I am also not getting the Same Scripts Display that Dannes Vid shows.

The "SD overclock-adtg_gui helper" choice is not Displayed.
ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)

OlRivrRat

Finally got ScreenShot of Scripts Page >

ORR~DeanB  ~~  80D-ML  &  SL1+ML  &  5D2+ML  &  5DC+ML  &  70D+ML(AliveAgain)