Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - dpjpandone

#26
Quote from: names_are_hard on January 31, 2023, 12:03:37 AM
I can give some advice.

Firstly, modules are built outside of the context of any individual cam.  This is because modules are supposed to be portable: people can copy them from one card to another in a different cam and they're supposed to work.  TCC code on the cam handles loading modules and looking up symbols by name.  This is the way that modules find stubs.  If a symbol doesn't exist, the user will see an error and the module won't load (but ML won't crash, it's more like a warning than a real error).

If you define something in features.h for a cam, I think it won't be visible to the module during the build.  Even if it is, it won't work properly if you copy the module and use it with a different cam, so this isn't a correct approach.

I was suggesting that *things which are functions* could be moved to stubs.  I haven't looked at the variables like more_hacks_are_supported, so I don't know what these do or what the best way to handle them is.

You should be able to test your ideas in qemu.  First get the existing code working and test it emulates this far (should do I think).  Then make changes and see if you broke anything.

Quote from: names_are_hard on January 31, 2023, 04:18:17 AM
I suppose it depends what you mean by "doing stubs wrong" :)  In the module code, where it's just an address, I haven't checked how it's used.  In a stub context, it will be treated as a function pointer according to the definition of NSTUB (or ARM32_FN / THUMB_FN if you use those).  Is it appropriate to treat these addresses in that way?  That depends how the module uses them.  In the exact text you gave, you put them in as comments, which will do nothing (and the symbol won't get exported, so the modules won't find it).

Probably, but that's a bigger question than you might realise.  I think the intention when ML added lots of supported models was that they'd all get all the features eventually.  Later on (I guess) as you've found, FEATURE and CONFIG limit or specify features, but that doesn't work well with modules.  Modules are *supposed* to be cam independent, but actually this was never true, there were some edge cases that became apparent when we worked more on modern cams and found that some structs and other internals had changed enough that some assumptions around how modules worked failed.

So, what's an elegant way to let modules behave the right way on a range of cams?  My personal feeling is modules could, instead of doing this:


if (is_camera("5D3", "1.2.3"))
{
    screen_x = 0x0101; screen_y = 0x0202;
}
else if { // many other cameras omitted }


Do something like this:

    get_screen_x_y(screen) // screen is a struct with .x and .y members


That is: cleanly separate modules from ML code, so they can only work via exported functions.  Modules ask the cam what the right values are for that model.  No hard-coding values inside modules.

So in your specific example, create a stub for *all* cams maybe called is_more_hacks_supported() (this is a bad name, but you get the idea).  This would probably default to returning false, and be overridden by cams that did have support.  Then the module code is greatly simplified - no per cam checks, but something like this:


    more_hacks_supported = is_more_hacks_supported();


Is this the best way to go?  That's harder to say.  It would increase the size of the ML binary, while reducing the size of modules.  Size constraints are a real concern on some cams.

Quote from: names_are_hard on January 31, 2023, 04:18:17 AM
you put them in as comments

didn't want those to compile yet

Quote from: names_are_hard on January 31, 2023, 04:18:17 AM


So in your specific example, create a stub for *all* cams maybe called is_more_hacks_supported() (this is a bad name, but you get the idea).  This would probably default to returning false, and be overridden by cams that did have support.  Then the module code is greatly simplified - no per cam checks, but something like this:


    more_hacks_supported = is_more_hacks_supported();




is this the correct syntax to do such a thing?

NSTUB(1 - is_more_hacks_supported)

and cams that do not support it the stub needs to be 0 ? Or you start by saying:

more_hacks_supported = 0; //defaults to 0
more_hacks_supported = is_more_hacks_supported() //returns value set in stub


If there is no stub in another cam's Stubs.s does it return 0 automatically?
#27
Quote from: Danne on January 31, 2023, 01:28:02 AM
What build are you on? Always leave it at 14bit lossless. Then reduce bitdepth from Movie tab.

This is your Jan 9th build. perhaps you should change help to:

"reduce bitdepth from Movie tab" ??

and clarify that this is or is not compressed?

hey btw, is there any possible side effects for defining CONFIG_KILL_FLICKER on 5d3? It looks like this was an easy way to add Kill canon Gui, but could this possibly slow down other stuff that we dont wish to interfere with?
#28
Quote from: names_are_hard on January 31, 2023, 12:03:37 AM
I can't check it thoroughly because I don't have a 5D3 and I don't know what precise code you're working from.  I can give some advice.

Not asking you to test it, just to tell me if I'm doing stubs wrong.

Quote from: names_are_hard on January 31, 2023, 12:03:37 AM

If you define something in features.h for a cam, I think it won't be visible to the module during the build.  Even if it is, it won't work properly if you copy the module and use it with a different cam, so this isn't a correct approach.


This is helpful. On second glance I can't find an example of a module calling ifdef(feature xyz)


Quote from: names_are_hard on January 31, 2023, 12:03:37 AM


I was suggesting that *things which are functions* could be moved to stubs.  I haven't looked at the variables like more_hacks_are_supported, so I don't know what these do or what the best way to handle them is.


more_hacks_are_supported is basically just to hide the option from the menu in cams that don't support. Is there a more elegant way to accomplish this?
#29
#30
Quote from: Danne on January 30, 2023, 05:13:06 AM
But does it work?

Does not allow the user to select 12bit lossless in 3.5k mode. It automatically reverts to 14bit lossless. I think you reused the portion of the code that blocks lossless 12-8bit in HIGHER resolutions (4k...etc.) but 3.5k was always working from the inception of crop-rec on steroids
#31
Quote from: names_are_hard on January 28, 2023, 03:17:21 PM

These would likely be better as stubs.  That way you could remove the per cam code from the module, and just call the stubs - same name for all cams.

I'm trying to learn how to do this properly. Can you please check my work?

The code from TheBilal was:

if (is_camera("5D3", "1.2.3"))
    {
        lvfaceEnd  = (void *) 0xFF16E318;
aewbSuspend = (void *) 0xFF23FF10;
CartridgeCancel = (void *) 0xFF181340;
more_hacks_are_supported = 1;
CartridgeCancel_works = 1;


The first step I think is to add this to Stubs.s in 5D3.123:

/** LiveView Hacks For Write Speed Improvement **/
///NSTUB(0xFF16E318,  lvfaceEnd)
///NSTUB(0xFF23FF10,  aewbSuspend)
///NSTUB(0xFF181340, CartridgeCancel)


now when we get to:

CartridgeCancel_works = 1;
should this go in Features.h ?

like this?:
#define FEATURE_CARTRIDGE_CANCEL// write speed improvement in LiveView
#define FEATURE_MORE_HACKS// write speed improvement in LiveView 


Let me stop here because I dont know if it's ok to define a feature that is dependent on a module?



#32
Quote from: Danne on January 29, 2023, 06:21:20 AM
All bitdepths work when selected from Movie tab. If not, provide some screenshots of what you are doing to miss it.

help reports:
"compression does not work with higher resolutions" in 3.5k mode
#33
This question is for Danne. all of the bit depths and compression schemes should work with 3.5K
#34
Why do you have 12-bit lossless disabled in 3.5k mode?
#35
Quote from: Danne on January 28, 2023, 05:16:55 AM
I have the same. Some unclean code which needs some polishing I guess.

should we put those lines in the stubs file instead?
#36
I was putting it back to test again. why is it complaining about this:

mlv_lite.c:2170:9: warning: initialization of 'void (*)()' from 'unsigned int' makes pointer from integer without a cast [-Wint-conversion]
2170 |         cam_eos_m ? 0xff2606f4 :
      |         ^~~~~~~~~
mlv_lite.c:2176:9: warning: initialization of 'void (*)()' from 'unsigned int' makes pointer from integer without a cast [-Wint-conversion]
2176 |         cam_eos_m ? 0xff177ff8 :
      |         ^~~~~~~~~
mlv_lite.c:2196:9: warning: initialization of 'void (*)()' from 'unsigned int' makes pointer from integer without a cast [-Wint-conversion]
2196 |         cam_eos_m ? 0xffa7e7d8 :
      |         ^~~~~~~~~


void hack_liveview_more()
{
    if (more_hacks && shamem_read(0xc0f383d4) != 0x4f0010) /* excludes mcm mode on eosm */
    {
        void (*aewbSuspend)() =
        cam_eos_m ? 0xff2606f4 :
        cam_5d3_113 ? 0xff23bc60 :
        cam_5d3_123 ? 0xff23ff10 :
        0;
       
        void (*lvfaceEnd)() =
        cam_eos_m ? 0xff177ff8 :
        cam_5d3_113 ? 0xff16d77c :
        cam_5d3_123 ? 0xff16e318 :
        0;
       
        lvfaceEnd();
       
        if (more_hacks == 2)
        {
            aewbSuspend();
        }
    }
   




    if (one_more_hack)
    {
        void (*CartridgeCancel)() =
        cam_eos_m ? 0xffa7e7d8 :
        cam_5d3_113 ? 0xff17fd68 :
        cam_5d3_123 ? 0xff181340 :
        0;
        CartridgeCancel();
        msleep(40);
    }
}


is this compiler just being picky or is there a problem?
#37
Quote from: Danne on January 27, 2023, 03:42:45 PM
Good thing bilal also solved 240Mhz sd patch solving most overhead issues even without the aewb hack :).
Truly amazing
#38
Quote from: theBilalFakhouri on January 26, 2023, 11:01:01 PM

-Last note:
You can see the most gain for each hack once that hack is enabled alone, e.g. if you enable small hacks you will see *large* write speed improvement compared to if small hacks disabled, if you turned off small hacks, and only enable lvface and aewb, you will see the most gain for these two hacks, but if you enable small hacks + lvface and aewb, the total gain will be reduced:


this makes sense, I'll try it without the other hacks and let you know
#39
Quote from: Grognard on January 26, 2023, 08:36:56 PM
And what about. Small hacks + LVFACE (without AEWB)?

it's less without AEWB. Pretty close to just small hacks. AEWB nets the massive 7 MB/s improvement

It's a pretty huge sacrifice to lose shutter fine tuning, but this hack makes it possible to record continuous 12-bit lossless 3k 2.39 to SD card at very high ISO's which is the most I will ever ask the camera to do in real life. I have no use for broken preview modes. 3.5k with a realtime 5x preview is perfect for extreme closeups or macro shots, I do the rest of my work in 1080p and the 5D3 is DAMN SHARP and rolling shutter is acceptable.
#40
Quote from: theBilalFakhouri on January 26, 2023, 05:37:15 AM
Nope, it does make a difference . . at least my benchmarks prove that.

How did you make your calculations?

5D3 Sandisk Extreme Pro 170MB/s SD card @240 MHz

Real world RECORDING (not benchmark) speeds (global draw enabled, but no histogram/zebras or other performance sucking overlays)

Small hacks = 81MB/s
Small hacks +LVFACE/AEWB = 88MB/s
Small hacks +LVFACE/AEWB + Cartridge cancel = 88MB/s

what are your actual sustained RECORDING speeds?
#41
Quote from: Walter Schulz on January 26, 2023, 08:11:17 AM
Well, I would be interested how EOS M temperature rise differs for powering options: internal Battery, dummy battery powered by 9V (powerbank with PD), dummy battery powered by 7.2/7.4 Volts (external LiON battery pack).
If you are equipped with those, of course.

I've several different powering schemes (external battery or AC adapter through step-down converter to dummy battery) It makes no difference as the lp-e12 does not generate a lot of heat to begin with
#42
Scripting Corner / Preferred Lua Debugger for VSC?
January 25, 2023, 09:57:05 PM
When i attempted to debug my first lua script in Visual Studio Code I was presented with several options from the ext market. Lua, Lua Debug, Lua Debugger, Local Lua Debugger, etc. etc.

anyone have a favorite?
#43
From the Lua doc:

KEY
Key Codes
Fields:
HALFSHUTTER
UNPRESS_HALFSHUTTER
FULLSHUTTER
UNPRESS_FULLSHUTTER
WHEEL_UP
WHEEL_DOWN
WHEEL_LEFT
WHEEL_RIGHT
SET
UNPRESS_SET
JOY_CENTER
UP
UP_RIGHT
UP_LEFT
RIGHT
LEFT
DOWN_RIGHT
DOWN_LEFT
DOWN
UNPRESS_UDLR
ZOOMIN
MENU
INFO
PLAY
TRASH
RATE
REC
LV
Q
PICSTYLE
FLASH_MOVIE
UNPRESS_FLASH_MOVIE
DP
UNPRES_DP
TOUCH_1_FINGER
UNTOUCH_1_FINGER
TOUCH_2_FINGER
UNTOUCH_2_FINGER


like the subject line says, is "DP" short for Depth of field preview button? also, is there a way to intercept the AF point button to use with LUA scripts? I think this button would be ideal since it is the only button (to my knowledge) that isn't currently utilized by some other feature of ML. How about "silent shooting touchpad" ? I'm still learning this body, but aparrently the 5d3's set dial has a four way capacitive touch pad built in!

I'm surprised this was not already implemented (perhaps the author did not own a body with these buttons?)

also, what is "flash movie" ? is this the button that pops up the built in flash on small bodies?

#44
Quote from: Danne on January 25, 2023, 02:45:18 PM
I see. Do you see any difference in speed/performance here between the two?

LV+AEWB adds 7MB/s
Carteridge makes no difference

I should note that this is 5D3 tested with Sandisk Extreme Pro 170MB/s SD card @240 MHz. Best record speed was around 88MB/s.  closer to 81MB/s without LVFace+AEWB. These are real world recording speeds.

  Speeds with  my CF card are about 10MB/s lower across the board, the CF I own is the bottleneck in that case so no reason to test CF. No desire to purchase faster CF since SD has enough bandwith for my use.
#45
Quote from: ML700D on January 25, 2023, 03:20:24 PM
I mean is it just use 1+2 hack and 240mhz only or anything else need for speed..?
somehow the speed is drop sometimes when I benchmark again..

easy to test. forget about card benchmark it's meaningless. set your resolution to something higher than you can record continuously. record a short clip. check raw menu for sustained bitrate. add a hack. test again. add another hack, test again, keep going back to raw menu to check the write speed that was achieved during previous recording. use the settings that produced the highest write speed during recording
#46
Quote from: Danne on January 25, 2023, 01:02:52 PM
I was more curious about why dpjpandone added code already in place :).

I worded that poorly. What I meant was I added the changes

FROM: (Danne's) committs
TO: MY (based on mainline crop_rec) mlv_lite
#47
General Development / Re: Card spanning code
January 25, 2023, 01:26:35 PM
Thanks Danne,

  I was sifting through your experimental thread last night when I found that; is it still recommended to turn SD overclock OFF with spanning enabled? Or is everything fine now?
#49
Quote from: Walter Schulz on January 23, 2023, 08:32:03 PM
The post you answered is from more than 11 months ago and user dream951 last online date: June, 2022.


You're right
#50
I did some testing of my own, adding the lines from the following commits to Danne's 5d3 repo:


8a57a24:  https://bitbucket.org/Dannephoto/magic-lantern_dannephoto_git/commits/8a57a244b767337904f18f3c1bcf1199c3a3ac24

61c2a5a: https://bitbucket.org/Dannephoto/magic-lantern_dannephoto_git/commits/61c2a5a38fedc273156882850ebe5ce302cc858b


LvFace+AEWB nets a realworld gain of 7MB/s

Cartridge cancel has No effect on real world write speed.

This of course only applies to 5D3 1.23