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.


Topics - dpjpandone

Pages: [1] 2
1
General Development / Fine-tuning Framing preview to speed it up
« on: February 02, 2023, 10:26:04 PM »

This part of code:
Code: [Select]
    /* be gentle with the CPU, save it for recording (especially if the buffer is almost full) */
    msleep(
        (need_for_speed)
            ? ((queued_frames > valid_slot_count / 2) ? 1000 : 500)
            : 50
    );

Controls when it's okay to refresh Framing preview depending on RAW recording state, this part of code add delays while recording for Framing preview to slow down refresh rate.
If you removed this part of code you will have semi real-time preview in B&W during RAW recording, of course this will make CPU usage 100% all time and there is high chance you will have corrupted frames.

But we can probably fine-tune the delay (reduce it), play with 1000 and 500 values (decrease them).
1000 and 500 are in milliseconds.

I am playing with this now. I think the only way to test for stability is to record in a resolution that is higher than continuous because the slot error happens when the buffer is full, any thoughts?

also:

I noticed Danne modified these values in Raw.c:

Code: [Select]
     /* scale useful range (black...white) to 0...1023 or less */
+    /* changing from 1024 to 700 for speed reasons */
     int black = raw_info.black_level;
     int white = raw_info.white_level;
     int div = 0;
-    while (((white-black) >> div) >= 1024)
+    while (((white-black) >> div) >= 700)
     {
         div++;
     }
 
-    uint8_t gamma[1024];
+    uint8_t gamma[700];
     
-    for (int i = 0; i < 1024; i++)
+    for (int i = 0; i < 700; i++)

Does this reduce CPU overhead?

2
General Development / Using stubs vs. Hardcoding stuff into modules
« on: January 31, 2023, 02:41:32 PM »
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.

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:

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

Do something like this:
Code: [Select]
    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:

Code: [Select]
    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.

you put them in as comments

didn't want those to compile yet



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:

Code: [Select]
    more_hacks_supported = is_more_hacks_supported();



is this the correct syntax to do such a thing?

Code: [Select]
NSTUB(1 - is_more_hacks_supported)
and cams that do not support it the stub needs to be 0 ? Or you start by saying:

Code: [Select]
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?

3
Scripting Corner / Preferred Lua Debugger for VSC?
« on: 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?

4
From the Lua doc:

Code: [Select]
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?


5
General Development / Card spanning code
« on: January 25, 2023, 01:30:51 AM »
I'm trying to track down the repository that has card spanning ported to MLV lite. I realize this exists in Dannes super bleeding edge builds but there's so much going on it's hard for me to follow. For the most part I'm happy with the handling of MLV lite that the latest 2018 crop-rec iteration that Alex left off on.  I would just like to see an example of card spanning ported to MLV lite in its simplest form. Can anyone please  point me in the right direction?

6
Share Your Videos / "Prime time of your life" (70d MLV)
« on: January 08, 2023, 04:36:18 AM »
Not mine,

but very good, had to share:


7
Raw Video / High ISO = Low noise + Shadow detail
« on: December 31, 2022, 08:37:36 PM »
I'm doing research on this topic, this first post is a temporary placeholder where I will link to relevant threads and articles on the subject. Once I have gathered as much data as possible I will replace with a properly formatted essay.

https://www.magiclantern.fm/forum/index.php?topic=24379.0

8
Hey guys,

 Anyone have a solution for live preview that would simulate exposure after post-processing while exposing to the right? For example, I'm exposing to the right for the cleanest shadows, the preview on the monitor or the LCD looks overexposed, load a custom picture style that pulls down exposure so the preview more closely approximates what the final image will look like after post processing? I have downstream hardware (monitors and sdi conveters) that allow me to load custom LUT's, does anyone use this technique for monitoring? It's hard for me to explain to the director or the client why I'm ettr, they generally don't understand and just want to see a rec709 image that is properly exposed. Can anyone reccomend some LUT's or picture styles that would help in this case?

The other thing is since all the footage appears 1.2 stops underexposed when CDNG is imported to resolve I think even when not ETTR it would be useful to make a picture style that pulls at least one stop for the preview.

9
General Development / .hg not found
« on: December 24, 2022, 07:32:23 PM »
please forgive my ignorance, I have never encountered this error until I tried to build from the repository hosted on heptapod

Code: [Select]
dpjpandone@MSI:/mnt/d/DEVELOPMENT/MLdev5D3/platform/5D3.123$ make
Using /usr/bin/arm-none-eabi-gcc (from PATH).
[ VERSION  ]   ../../platform/5D3.123/version.bin
abort: there is no Mercurial repository here (.hg not found)
abort: no repository found in '/mnt/d/DEVELOPMENT/MLdev5D3/platform/5D3.123' (.hg not found)!
make: *** [../../src/Makefile.src:360: ../../platform/5D3.123/version.bin] Error 255

I have tried the following:

- copying my makefile.user from the folder that I can already build from (danne's eosm experiments)
  - (error persists)

I then copied the entire hg folder from dannes repository and it works, I mean i can build  from the source downloaded from heptapod, is this safe to do? why is there no .hg folder on heptapod? Is there a way to disable it since I'm just working locally?

I'm sure it's something small I'm missing. Thanks in advance.

10
Can we do this? I no longer have the laptop I was using for development a few years ago, but I DO have the test builds that I published at the time. Is there a way to extract the source from one of those test builds?

11
General Development / Coding Alignment of Focus Peak/Zebras on HDMI ouput
« on: November 16, 2022, 02:01:04 AM »
Hey guys, can someone point me toward the line(s) in the source where the position of overlays (pertaining to HDMI output) is coded? I want to work on getting proper alignment of focus peaking and zebras on an external monitor

12
Hey guys, I'm back!

Way back in 2016 We used adobe camera raw via After Effects and Visionlog to develop our MLV files. Nowadays I am exporting CDNG's from MLVapp and dragging the folders directly into Resolve.

Can someone advise the correct settings for the "camera raw" settings in davinci?

It seems that if "Cinema DNG Default" is selected in the (decode) drop-down it defaults to using rec.709 for the color space and gamma

If I choose "clip" in the decode field I have the options to choose between Rec.709, P3 D60, or Blackmagic Design in the color space.

If I choose blackmagic d.esign the only gamma available is BMD Film. If I choose Rec.709 the available gamma options are: 2.4, 2.6, Rec.709, SRBG, and Linear

What settings are you guys using?

Also, why does the camera metadata always have the tint set to 7.42 regardless of camera settings?




13
General Development / Proposal for more useful magic zoom overlay sizes
« on: August 19, 2015, 04:33:01 AM »
It is my opinion that the current magic zoom overlay sizes could be improved. First of all, does anyone ever use it with the size set to "small" ? I mean, it's so small it's pretty much useless (for me at least)

I propose the following values:

Code: [Select]
   switch(zoom_overlay_size)
    {
        case 0:
            W = os.x_ex / 3;
            H = os.y_ex * 2/5;
            break;
        case 1:
            W = os.x_ex / 2;
            H = os.y_ex / 2;
            break;
        case 2:
            W = os.x_ex * 3/5;
            H = os.y_ex * 3/5;
            break;

BTW,  I have tested on EOSM (which supposedly does not support full screen magic zoom) and the full screen works perfectly in crop mode, but flickers a little in full frame . What do you think?

14
General Development / In over my head with state-object
« on: August 17, 2015, 04:03:24 AM »
Magic zoom flickers so bad in crop mode (EOS-M), that it's impossible to use.

One-Percent got it to sync well enough that it's useful, but never pushed those changes to main. I believe I have found them here:

Code: [Select]
#ifdef SSS_STATE
static int stateobj_sss_spy(struct state_object * self, int x, int input, int z, int t)
{
    int old_state = self->current_state;
int ans = StateTransition(self, x, input, z, t);

    #if defined(CONFIG_5D3) || defined(CONFIG_6D)
    if (old_state == 6 && input == 6) // before sssCompletePrepareLcdJpeg
    {
        raw_buffer_intercept_from_stateobj();
        module_exec_cbr(CBR_HOOK_BEFORE_JPG_PREVIEW);
    }
    #endif
       
    #if defined(CONFIG_5D3) || defined(CONFIG_6D)
    if (old_state == 6 && input == 6) // after sssCompletePrepareLcdJpeg
    {
        module_exec_cbr(CBR_HOOK_AFTER_JPG_PREVIEW);
    }
    #endif

    #if defined(CONFIG_EOSM) || defined(CONFIG_650D) || defined(CONFIG_700D) || defined(CONIFG_100D) //TODO: Check 700D and 100D
    //~ int new_state = self->current_state; // 10 - 11 - 2
    if (old_state == 10 && input == 11) // delayCompleteRawtoSraw
        raw_buffer_intercept_from_stateobj();
    #endif

*/
//~ Not Enough memory to undo?
/*
#ifdef CONFIG_EOSM
    int new_state = self->current_state;
    if (old_state == 10 && input == 11) // delayCompleteRawtoSraw
{ raw_buffer_intercept_from_stateobj();
module_exec_cbr(CBR_HOOK_BEFORE_JPG_PREVIEW);
    }

    if (old_state == 10 && input == 10) // input 8 CompleteRawtoSraw input 10: CompleteRawtoLCDjpeg input 6: may work too
    {
        module_exec_cbr(CBR_HOOK_AFTER_JPG_PREVIEW);
    }
#endif     
    return ans;
}
#endif

Also this from v_sync_lite:

Code: [Select]
#if defined(CONFIG_EOSM) || defined(CONFIG_600D)
    RegisterVDInterruptHigherPriCBR(lv_vsync_signal, 0);
#endif

 I'm afraid I'm in over my head on this one. Can someone please help me with this? Which pieces are relevant to fixing magic zoom?

15
General Development / New Discussion about the merits of Video Hacks
« on: August 13, 2015, 05:31:22 AM »
I am test various fps settings on EOSM, and I need to enable gop and flush rate to find the upper limits of overcranking. I have successfully recorded up to 45fps in 1080p crop mode (h264), but to do this, gop must be set to 1 and flush set to 4. (This was on an earlier build that had video hacks enabled)

I have
Code: [Select]
#define FEATURE_VIDEO_HACKS in my features file, but the video hacks don't show up in the menu. What else do i need to change to get this back?


16
General Development / Improving menu navigation for external monitors
« on: August 12, 2015, 04:41:24 AM »
EOSM does not have a Q button, so it's done by using a 1-finger touch on the screen. This is a major problem because touchscreen is disabled when an external monitor is connected. I have fixed this by adding the following to menu.c

Code: [Select]
#if defined(CONFIG_EOSM)// No Q Button on EOSM, use PLAY if ml menu is open
    if (button_code == BGMT_PLAY && gui_menu_shown()) button_code = BGMT_Q;
#endif


It works perfectly like this. Now you can open ml menu with long-press trash, and you can enter "q" menus with play button. Finally! I don't have to unplug my monitor just to change ml settings.....

I realize that play normally increments values in ml menu, the loss of that functionality is not important to me, since you can already increment values with left/right, however, I would like to submit this fix in a pull request, so I think to do this in an acceptable way it needs to say:

if if (button_code == BGMT_PLAY && gui_menu_shown() || menu has submenu or we are in a submenu)

this way, play only acts as Q if there is a submenu,or to exit a submenu, otherwise play increments values as normal

How do I write this? Alex?

17
General Development / Improving menu navigation for external monitors
« on: August 12, 2015, 04:40:47 AM »
EOSM does not have a Q button, so it's done by using a 1-finger touch on the screen. This is a major problem because touchscreen is disabled when an external monitor is connected. I have fixed this by adding the following to menu.c

Code: [Select]
#if defined(CONFIG_EOSM)// No Q Button on EOSM, use PLAY if ml menu is open
    if (button_code == BGMT_PLAY && gui_menu_shown()) button_code = BGMT_Q;
#endif


It works perfectly like this. Now you can open ml menu with long-press trash, and you can enter "q" menus with play button. Finally! I don't have to unplug my monitor just to change ml settings.....

I realize that play normally increments values in ml menu, the loss of that functionality is not important to me, since you can already increment values with left/right, however, I would like to submit this fix in a pull request, so I think to do this in an acceptable way it needs to say:

if if (button_code == BGMT_PLAY && gui_menu_shown() || menu has submenu or we are in a submenu)

this way, play only acts as Q if there is a submenu,or to exit a submenu, otherwise play increments values as normal

How do I write this? Alex?

18
Code: [Select]
Jon@Jon-PC /cygdrive/c/magic-lantern/platform/eosm.202
$ make zip
../../Makefile.inc:79: remove /cygdrive/c/magic-lantern/platform/eosm.202/zip
[ RM dir ]  /cygdrive/c/magic-lantern/platform/eosm.202/zip/
mkdir -p /cygdrive/c/magic-lantern/platform/eosm.202/zip
[ VERSION  ]   ../../platform/EOSM.202/version.c
abort: there is no Mercurial repository here (.hg not found)
[ CC       ]   version.o
[ CC       ]   fps-engio.o
../../src/fps-engio.c:237:6: error: #error fixme: FPS_TIMER_B_MIN and FPS_TIMER_B_MIN are plain wrong
     #error fixme: FPS_TIMER_B_MIN and FPS_TIMER_B_MIN are plain wrong
      ^
../../src/fps-engio.c:295:12: warning: 'fps_timer_b_method' defined but not used [-Wunused-variable]
 static int fps_timer_b_method = 0;
            ^
../../Makefile.filerules:23: recipe for target 'fps-engio.o' failed
make: *** [fps-engio.o] Error 1

I know I have to fix fps.engio, but what's up w/ .hg not found, never saw that before...

19
Share Your Videos / Homeland Security - Shot in ML Raw
« on: December 13, 2014, 12:04:59 AM »
Hey guys, here is a trailer for a short film i worked on last summer, shot in ML Raw on 7D and 5D2


20
Shoot Preparation / Formatting SD cards for maximum write speed
« on: December 07, 2014, 06:04:26 PM »
I seem to get more consistent write speeds when I use the sd card formatter from sdcard.org. I found out about it via this article: http://www.slrlounge.com/really-format-sd-cards-optimal-performance/

When shooting raw on my EOSM I get a solid 37.7mbps write speed after using the formatter. just wanted to share this tool which has helped me.

21
General Development / EOSM Video Hacks disabled, unclean patching?
« on: September 28, 2014, 02:46:01 AM »
I would really like to see the gop/flushrate hacks enabled in nightlies for EOSM. Can someone tell me what is wrong with these video hacks in their current state and what I must focus on to make them acceptable for nightlies?

22
General Development / DIGIC4 cameras, faster DMA flags - please test
« on: September 07, 2014, 05:12:30 PM »
I need help testing DMA flags on DIGIC4 cameras. "Enhanced" shows improvement on 5D3, but it seems that the "Original" flags are working better on older cameras (confirmed on 7D, and likely to show improvement on 50D, 5D2, etc...)

from edmac-memcpy.c (starting on line 122)

Code: [Select]
/* see wiki, register map, EDMAC what the flags mean. they are for setting up copy block size */
    #if defined(CONFIG_7D)
    uint32_t dmaFlags = 0x20001000; //Original are faster on 7D and possibly other DIGIC IV cameras
    #else   
    uint32_t dmaFlags = 0x40001000; //Enhanced
    #endif

if you have a digic4 camera and can compile, please add your camera to the if statement, and report your results in this thread, or in  pull request #589

Thanks!


 

23
Hey guys,

 I am doing all my post production on a ASUS motherboard based windows PC I built last year, and I'm looking to purchase a graphics card to replace the onboard graphics (which does not support resolve)

I use the adobe AE and Premiere and I would like to stat using resolve. So I think I want something that has CUDA, OPEN CL, and supports mercury playback engine etc...

I would like to keep the price around $200.00

can someone recommend a card that meets these criteria?

24
I have created this issue: https://bitbucket.org/hudson/magic-lantern/issue/2110/mlv_play-7d-5d2-garbage-borders-oer-hdmi

 to coincide with this post:

from the issue:

When viewing MLV_PLAY on and external HDMI monitor, Top and bottom borders of the display (which should be masked in black per image size) display garbage. You can see an example of this in the following images:

![mlv play psychadelic borders 1.jpg](https://bitbucket.org/repo/8b7b/images/555390794-mlv%20play%20psychadelic%20borders%201.jpg)![mlv play psychadelic borders 2.jpg](https://bitbucket.org/repo/8b7b/images/2571322861-mlv%20play%20psychadelic%20borders%202.jpg)

I will be reading through the mlv_play.c code this afternoon, if someone has any hints about the relevant lines I should focus on, please post them here.

Thanks!

25
General Development / how to "safely" remap buttons
« on: August 29, 2014, 05:35:16 AM »
I often use my 7D with a letus MCS camera cage which is great, but it's very difficult to press the trash button to access ML menus. I never use the raw/jpeg button on 7D, (I prefer to do file conversions on a computer instead...) and it's in a comfortable to reach place, so I decided to lie in the gui.h file and tell ML that raw/jpg is actually trash.

Does anyone see a problem with this? I get the desired result, but I'd really like to know the correct way to do this.

I found this thread, which was related, but not very helpful: http://www.magiclantern.fm/forum/index.php?topic=7816.msg70766#msg70766


Pages: [1] 2