crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView

Started by a1ex, April 01, 2017, 11:15:41 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

theBilalFakhouri

77 FPS @ 1736x390 (1736x650) Works too, the camera crashes at some point,

The camera also becomes very slow when hitting 80 FPS, it freezes when trying to get above 80 FPS, I think the main reason is the camera is trying to process 80 FPS in liveview, it can't handle it, if we can limit the FPS preview in LiveView or disable LiveView completely maybe it will work a bit nicer.

theBilalFakhouri

Fortunately I was wrong, it seems applying the settings from adtg_gui make the camera crashes and will perform more corrupted frames and will make the camera slower, ported the last preset to crop_rec with a little adjustment to FPS timer B and we have stable:

80 FPS @ 1736x390 (1736x650) ;D

Canon-700-D-80-FPS" border="0


didn't have any crash yet on 700D

theBilalFakhouri

Yes I had crashes at some point, same preset works @ 92 FPS, there is a line on top of the frame, it might be fixable, good news there are no corrupted frames, but the camera crash faster at 92 FPS.

theBilalFakhouri

Quote from: a1ex on April 01, 2017, 11:15:41 AM
* Canon preview is broken in most modes; you need to use the grayscale preview in the raw recording module.
Not today:

Fixed broken LiveView in Higher resolutions:

https://youtu.be/DSSc-1arTjQ

My understanding is improving about broken horizontal resolutions, here is the one register that fixes it:

C0F38024 Its Value: 0x4530287, there is a factor between this register and resolution register which is C0F06804 = 0x4540298
You can show it using adtg_gui between e.g mv1080 and x5 mode.

You need to increase C0F38024 as you increase C0F06804 for resolution, e.g on 700D start increasing C0F06804 from 0x4540298 to 0x4540299 and set C0F38024 from 0x4530287 to 0x4530288.

Max value before C0F38024 freeze the LiveView is 0x45303c9 which can fix resolution of 3808x1080 (0x4540298 = 45403da) on 700D, there is a limit we should figure out where it comes from, I expect on 5D3 can fix more than this resolution.

Note: focus pixels showed in LiveView, also some barely visible lines.

@a1ex @Danne @Levas
There is an easy task to do :D

Danne


theBilalFakhouri

Quote from: theBilalFakhouri on August 10, 2020, 05:56:27 AM
Max value before C0F38024 freeze the LiveView is 0x45303c9 which can fix resolution of 3808x1080 (0x4540298 = 45403da) on 700D, there is a limit we should figure out where it comes from, I expect on 5D3 can fix more than this resolution.

The limit comes from these Known Preview registers:

C0F383D4
C0F383DC

Its values change when moving preview box around in x5, these values allowed me to fix up to 3896x1080 resolution preview instead of 3808x1080:

C0F383D4 tweaked to 0x1b00af
C0F383DC tweaked to 0x3d401b7

Some values of these two registers won't allow you to fix high resolution preview like 3072x1080, it will limit C0F38024 range to fix more high resolutions, be aware for this.

Also it seems from all three registers above at some values I can lower resolution in mv1080 and mv720 without frozen LiveView, not lowering it too much yet, but it does something :D

Danne

You my friend, are a genius.

How did you figure out to reduce these for real time preview in even higher resolutions?
C0F383D4 tweaked to 0x1b00af
C0F383DC tweaked to 0x3d401b7


Anyway. Applied cropped real time preview for all 3k modes on eosm so far. Looks like this in eosm code. Check the EngDrvOutLV

3k modes.
static inline uint32_t reg_override_3K_eosm(uint32_t reg, uint32_t old_val)
{
        EngDrvOutLV(0xc0f383d4, 0x1b00af + reg_83d4);
        EngDrvOutLV(0xc0f383dc, 0x3d401b7 + reg_83dc);
   
    if (ratios == 0x0)
    {
EngDrvOutLV(0xC0F38024, 0x4530307);
        switch (reg)
        {
            case 0xC0F06804: return 0x5b90318 + reg_6804_width + (reg_6804_height << 16); // 3032x1436  x5 Mode;
            case 0xC0F06014: return (get_halfshutter_pressed() && zoomaid && !RECORDING) ? 0x839: 0x83a + reg_6014;
            case 0xC0F0713c: return 0x5b9 + reg_713c;
            case 0xC0F06824: return 0x3ca;
            case 0xC0F06828: return 0x3ca;
            case 0xC0F0682C: return 0x3ca;
            case 0xC0F06830: return 0x3ca;
            case 0xC0F06010: return 0x34b + reg_6008;
            case 0xC0F06008: return 0x34b034b + reg_6008 + (reg_6008 << 16);
            case 0xC0F0600C: return 0x34b034b + reg_6008 + (reg_6008 << 16);
               
                /* reset dummy reg in raw.c */
            case 0xC0f0b13c: return 0xf;
        }
    }
   
    if ((ratios == 0x1 || ratios == 0x2) && !set_25fps)
    {
EngDrvOutLV(0xC0F38024, 0x45302ff);
        switch (reg)
        {
                /* will change to 19fps for continous action */
            case 0xC0F06804: return 0x5190310 + reg_6804_width + (reg_6804_height << 16);
            case 0xC0F0713c: return 0x519 + reg_713c;
            case 0xC0F07150: return 0x514 + reg_7150;
            case 0xC0F06014: return 0x767 + reg_6014;
            case 0xC0F06824: return 0x3ca;
            case 0xC0F06828: return 0x3ca;
            case 0xC0F0682C: return 0x3ca;
            case 0xC0F06830: return 0x3ca;
            case 0xC0F06010: return 0x34b + reg_6008;
            case 0xC0F06008: return 0x34b034b + reg_6008 + (reg_6008 << 16);
            case 0xC0F0600C: return 0x34b034b + reg_6008 + (reg_6008 << 16);
        }
    }
   
    if (ratios == 0x1 && set_25fps)
    {
EngDrvOutLV(0xC0F38024, 0x45302b5);
        switch (reg)
        {
                /* will change to 24fps for continous action 2.39:1 */
            case 0xC0F06804: return 0x49b02c6 + reg_6804_width + (reg_6804_height << 16);
            case 0xC0F0713c: return 0x49b + reg_713c;
            case 0xC0F07150: return 0x514 + reg_7150;
            case 0xC0F06014: return 0x62c + reg_6014;
            case 0xC0F06824: return 0x3ca;
            case 0xC0F06828: return 0x3ca;
            case 0xC0F0682C: return 0x3ca;
            case 0xC0F06830: return 0x3ca;
            case 0xC0F06010: return 0x34b + reg_6008;
            case 0xC0F06008: return 0x34b034b + reg_6008 + (reg_6008 << 16);
            case 0xC0F0600C: return 0x34b034b + reg_6008 + (reg_6008 << 16);
        }
    }
   
    if (ratios == 0x2 && set_25fps)
    {
EngDrvOutLV(0xC0F38024, 0x45302b5);
        switch (reg)
        {
                /* will change to 24fps for continous action 2.35:1 */
            case 0xC0F06804: return 0x49b02c6 + reg_6804_width + (reg_6804_height << 16);
            case 0xC0F0713c: return 0x49b + reg_713c;
            case 0xC0F07150: return 0x514 + reg_7150;
            case 0xC0F06014: return 0x62c + reg_6014;
            case 0xC0F06824: return 0x3ca;
            case 0xC0F06828: return 0x3ca;
            case 0xC0F0682C: return 0x3ca;
            case 0xC0F06830: return 0x3ca;
            case 0xC0F06010: return 0x34b + reg_6008;
            case 0xC0F06008: return 0x34b034b + reg_6008 + (reg_6008 << 16);
            case 0xC0F0600C: return 0x34b034b + reg_6008 + (reg_6008 << 16);
        }
    }
   
    if (ratios == 0x3)
    {
EngDrvOutLV(0xC0F38024, 0x45302ff);
        switch (reg)
        {
            case 0xC0F06804: return 0x9d50310 + reg_6804_width + (reg_6804_height << 16);
            case 0xC0F0713c: return 0x9d5 + reg_713c;
            case 0xC0F06824: return 0x4ca;
            case 0xC0F06828: return 0x4ca;
            case 0xC0F0682C: return 0x4ca;
            case 0xC0F06830: return 0x4ca;
            case 0xC0F06014: return 0xbe3 + reg_6014;
            case 0xC0F06010: return 0x36b + reg_6008;
            case 0xC0F06008: return 0x36b036b + reg_6008 + (reg_6008 << 16);
            case 0xC0F0600C: return 0x36b036b + reg_6008 + (reg_6008 << 16);
        }
    }
   
    return reg_override_bits(reg, old_val);
}


4k/5k still awaits and of course. 5d3. In time...

domasa


GullRaDriel


theBilalFakhouri

Quote from: Danne on August 10, 2020, 04:17:38 PM
How did you figure out to reduce these for real time preview in even higher resolutions?
C0F383D4 tweaked to 0x1b00af
C0F383DC tweaked to 0x3d401b7


I couldn't reproduce the fixable cropped LiveView @ 3072x1080, I stuck with max fixable cropped LiveView with 2696x1080 resolution, I was pretty sure I didn't do something wrong, until I started playing with arrows while in x5 mode, noticed I can get fixable 3072 again, I looked for what registers has changed using adtg_gui and saw the above two guys :P

These values can fix up to 4034x1080 on 700D

C0F383D4 to 0x100bf
C0F383DC to 0x2e401c7

Quote from: Danne on August 10, 2020, 04:17:38 PM
Check the EngDrvOutLV

I tried to override the three registers in crop_rec.mo, but didn't make any effect, it didn't patch them, have you added ENG_DRV_OUT_FUNC = 0xFF2C29E8; but for EOS M in crop_rec ? like in adtg_gui, Did you add a patch hook for that?

Could you share your code please



Quote from: domasa on August 10, 2020, 05:04:35 PM
(YouTube video is unavailable.)

Strange, it's working here, here is the link:
www.youtube.com/watch?v=DSSc-1arTjQ

Danne

Syntax in my post above:
        EngDrvOutLV(0xc0f383d4, 0x1b00af);
        EngDrvOutLV(0xc0f383dc, 0x3d401b7);

and example:
EngDrvOutLV(0xC0F38024, 0x4530307);
Nice stuff! Will test some more later.

domasa


theBilalFakhouri

Quote from: Danne on August 10, 2020, 07:02:50 PM
Syntax in my post above:
        EngDrvOutLV(0xc0f383d4, 0x1b00af);
        EngDrvOutLV(0xc0f383dc, 0x3d401b7);

and example:
EngDrvOutLV(0xC0F38024, 0x4530307);

Yes, I added these lines, still no effect:

static inline uint32_t reg_override_3K_700d_gwb(uint32_t reg, uint32_t old_val)
{
    switch (reg)
    {
        /* raw resolution (end line/column) */
        /* X: (3072+140)/8 + 0x17, adjusted for 3072 in raw_rec */
        case 0xC0F06804: return 0x5340322; // 3072x1306  x5 Mode;

        case 0xC0F06824: return 0x3ca;
        case 0xC0F06828: return 0x3ca;
        case 0xC0F0682C: return 0x3ca;
        case 0xC0F06830: return 0x3ca;
       
        case 0xC0F06010: return 0x35b;
        case 0xC0F06008: return 0x35b035b;
        case 0xC0F0600C: return 0x35b035b;

        case 0xC0F06014: return 0x60f;

        case 0xC0F0713c: return 0x535;

/* case 0xC0F383D4: return 0x1b00af;
        case 0xC0F383DC: return 0x3d401b7;
case 0xC0F38024: return 0x4530311;*/

EngDrvOutLV(0xc0f383d4, 0x1b00af);
        EngDrvOutLV(0xc0f383dc, 0x3d401b7);
EngDrvOutLV(0xC0F38024, 0x4530311);
    }

    return 0;
}


Is there something I am missing ?

Danne

Try adding them outside switch (reg) function.
This isn´t working right?
/* case 0xC0F383D4: return 0x1b00af;
        case 0xC0F383DC: return 0x3d401b7;
case 0xC0F38024: return 0x4530311;*

theBilalFakhouri

Quote from: Danne on August 10, 2020, 07:11:46 PM
Try adding them outside switch (reg) function.

Nice, it worked, Thanks!

Quote from: Danne on August 10, 2020, 07:11:46 PM
This isn´t working right?
/* case 0xC0F383D4: return 0x1b00af;
        case 0xC0F383DC: return 0x3d401b7;
case 0xC0F38024: return 0x4530311;*


Yes, this is right

Levas

Already had the liveview fix with C0F38024 register in the latest 6d builds.
But there is indeed a certain limit I couldn't pass.
On 6d I could fix liveview for 2880x1200, but couldn't get it to work on higher resolutions then that, like 3072x1152.
It also has a minimum limit for vertical resolution, if I want to fix liveview with presets below a vertical resolution something about 960, it also doens't work.

Didn't know about the C0F383D4 and C0F383DC, so maybe messing with those I can stretch it a little.

Levas

@theBilalFakhouri

For extreme high fps presets, it worked for me to set the following 4 register to value 1.
Liveview is gone when doing that, but the camera doesn't freeze (most of the times  :P)

C0F08184
C0F08188
C0F08194
C0F08198

I use this messy code to have set these registers to value 1 for presets >60fps, it's put in the same block of code where you override resolution and A and B timer registers etc.

//720P_HighFPS_6D
static inline uint32_t reg_override_720P_HighFPS_6D(uint32_t reg, uint32_t old_val)
{
if (CropReadoutPresetChoice_720P > 5 )
    {
        F08184 = 0x295;
        F08188 = 0x3be;
        F08194 = 0x1ef;
        F08198 = 0x3be;
    }
    else
    {
        F08184 = 0x0;
        F08188 = 0x0;
        F08194 = 0x0;
        F08198 = 0x0;
    }


       switch (reg)
       {

// fix for >60fps will destroy liveview
        case 0xC0F08184: return 0x296 - F08184;
        case 0xC0F08188: return 0x3bf - F08188;
        case 0xC0F08194: return 0x1f0 - F08194;
        case 0xC0F08198: return 0x3bf - F08198;


//           case 0xC0F06804: return 0x5be02a0 - SelectableResolutionFix + (((((Horizontal_Res_720P/3) - 2560)/4)/4)*4)  + ((((Vertical_Res_720P - 1440)/4)*4) << 16) ;

           case 0xC0F06804: return 0x5be02a0 - SelectableResolutionFix + (((((Horizontal_Res_720P/3) - 2560)/4)/4)*4)  + ((((Vertical_Res_720P - 1440)/4)*4) << 16) ;


           case 0xC0F06824: return 0x2b0 + (((Horizontal_Res_720P/3) - 2560)/4);
           case 0xC0F06828: return 0x2b0 + (((Horizontal_Res_720P/3) - 2560)/4);
           case 0xC0F0682C: return 0x2b0 + (((Horizontal_Res_720P/3) - 2560)/4);
           case 0xC0F06830: return 0x2b0 + (((Horizontal_Res_720P/3) - 2560)/4);

           case 0xC0F06010: return 0x2b5 + (((Horizontal_Res_720P/3) - 2560)/4);
           case 0xC0F06008: return 0x2b502b5 + (((Horizontal_Res_720P/3) - 2560)/4) + (((Horizontal_Res_720P - 2560)/4) << 16);/*  for dec 690*/
           case 0xC0F0600C: return 0x2b502b5 + (((Horizontal_Res_720P/3) - 2560)/4) + (((Horizontal_Res_720P - 2560)/4) << 16);

           case 0xC0F06014: return 0x603 + (((Vertical_Res_720P - 1440)/4)*4) + SafetyMargin_720P; /*  dec 1543*/

           case 0xC0F0713c: return 0x5b8 + (((Vertical_Res_720P - 1440)/4)*4) + Head_3_timer_offset_720P;        //5b8 works best for 5472
           case 0xC0F07150: return 0x5b8 + (((Vertical_Res_720P - 1440)/4)*4) + Head_4_timer_offset_720P;        //5b7 works best for 5472

       }

    return reg_override_bits(reg, old_val);
}

theBilalFakhouri

Quote from: Levas on August 10, 2020, 07:58:36 PM
Already had the liveview fix with C0F38024 register in the latest 6d builds.
Didn't know that before, good work

Quote from: Levas on August 10, 2020, 07:58:36 PM
but couldn't get it to work on higher resolutions then that, like 3072x1152.
Didn't know about the C0F383D4 and C0F383DC, so maybe messing with those I can stretch it a little.
Now you can!

Guess Whose Back!

https://youtu.be/1JiJMThS-Dk

Link:
https://youtu.be/1JiJMThS-Dk

Download Guess Whose Back crop_rec.mo , only for 700D. Edit: Deleted download link.
**
(Edit 6-6-2021) You will find 3K Preset with fixed preview in this build:
https://www.magiclantern.fm/forum/index.php?topic=25784.msg231049#msg231049
**




Quote from: Levas on August 10, 2020, 08:06:06 PM
@theBilalFakhouri

For extreme high fps presets, it worked for me to set the following 4 register to value 1.
Liveview is gone when doing that, but the camera doesn't freeze (most of the times  :P)
C0F08184
C0F08188
C0F08194
C0F08198

Yes I took a look on your old 96 FPS preset, and noticed you mentioned this thing, but the main problem the camera is crashing, I don't have enough time to start recording e.g. @ 96 FPS on 700D, the camera is slow and can't record immediately, and LiveView is frozen I will have a camera crash before the recording starts, I am trying to fix frozen LiveView to prevent the camera from crashing, then I will try to get more high FPS :D , not mentioned the write speed drops to 15 MB/s or 9 MB/s @ these high FPS mods :P .

Danne

Have 4k working up to 4040 now on eosm. I guess next level would be 5k. Gotta do some new pixel maps with slightly reduced width but that's quite ok considering what we get in return.

GullRaDriel

It is sure very interesting, if you search for someone I'm willing to test your next MKIII build  ^^

theBilalFakhouri

There is a simple trick to semi-fix Canon preview @ 5K , valid for focusing:

Normal x5 Mode @ 2520x1080:
Normal-x5" border="0

5K @ 5208x1080 Full-Width Before:
5-K-Mode-5208x1080" border="0

5k@ 5208x1080 Full-Width After:
5-K-Mode-5208x1080-Semi-Fix" border="0

I called it Half-Way fix, we can get semi valid Canon preview image if we set C0F38024 to fix half of the desired resolution, e.g:

C0F38024 Original value in x5 (2520x1080) is: 0x453x287, I tweaked it to 0x453x293 to semi-fix 5208x1080 resolution, the tweaked value 0x453x293 should fix 2604x1080 resolution and give clean preview which is half width of 5208x1080, that's the trick we can make a semi-fix for higher resolution than 4K by finding a fix for the half of desired resolution, you maybe should tweak it a bit more or higher to find the sweet spot.

amrali

am  using nightly build july2018 on my 5d3 it only record 2sec on 3k or 2k videos and also cant Fing the option which I can adjust the bit rate please can anyone help me


hungrygeneraiton

I am using the latest 1.2.3 experimental build for 3.5k / compression. When I select record indicator (REC Indicator) and select "remaining time" it is still showing elapsed time I believe. Is there a way to get an estimate on remaining  card?
BTW I just used this for professional work (with an HDMI backup) and it worked flawlessly with 12 bit lossless. Thank you!!

Quentin

Is there a build with 60+ FPS somewhere ?
Some GoPro camera clones, record up to 120FPS at 720p and its awesome.
I wish I had this option on ML :(