Canon 100D / SL1

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

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Danne

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

Nice command, hg diff...
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

           @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

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

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

Will do some tests soon. Gotta get those lv ram dumps produced too...

OlRivrRat

                     @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

Ok, thanks for telling, will do some lua refinements which will check if on or not before starting the sd_uhs procedure.

OlRivrRat

"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

           @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

Quote from: OlRivrRat on June 02, 2018, 07:03:53 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

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

Defishing and Anamorphic are selectable but like "framing" it doesn't affect live view image at all. Not working in other words.

a1ex

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

Thanks @Alex. Will get on it asap.
@OlRivrRat
Fixed the global draw off thingy in the script

OlRivrRat

                      @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

Yes, shortened it with about one second. Seems ok.

Danne

Quote from: a1ex 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).

There is contact with tweaks.c. Doing following:
#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

Regarding display_filter_lv_vsync:
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

Try this:


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:


    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

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.


    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:
QuoteIf 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):
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?
QuoteIf 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

Kid me not, it worked!
in state-object.h:
#define INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER 24
to:
#define INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER 25
Defishing
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

Good job, Danne. Thank you.
[size=8pt]70D.112 & 100D.101[/size]

Danne

Thank you guys for helping out. Also a nice tour in small parts of some great c code. And thanks A1ex.

nikfreak

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
[size=8pt]70D.112 & 100D.101[/size]