Full-resolution silent pictures (silent.mo)

Started by a1ex, July 01, 2014, 05:11:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pulsar124

The only changes shown by hg diff are the Makefile customizations, and a bunch of changes in silent.c . I just replaced the official silent.c with the Greg's version - I guess that wasn't the appropriate way, and I should have checked out his branch? How can I do that (I am not familiar with hg; I know svn and git).

pulsar124

Greg: I did "hg clone -r unified https://bitbucket.org/Gr3g01/magic-lantern-frsp-long-expo", and it compiles okay for 50D (make 50D and make all_modules work okay), without the error messages I saw with the official version, but running "make" or  "make install" fails because of some issues with 7D and 1100D branches.

Is it possible to run make install for a specific model (50D)? I guess I can just run "make 50D; make all_modules" and then collect the files I need by hand, but perhaps there is an easier way?

josepvm

make 50D
cd modules
make
cd ..
cd platform/50D.109
make zip


Then you will find a file "magiclantern-Nightly.2016Jun17.50D109.zip" on platform/50D.109 directory.

Unzip this file and copy content to your CF card



dmilligan

You can insert the SD card and use: make install -C platform/<cam directory>

This will build the core for the specified platform and all the modules and copy them all and other support files directly to the SD card.

pulsar124

josepvm : Thanks! That did the trick!

dmilligan: Thanks. I wasn't sure how to provide the "cam directory" (/media/EOS_DIGITAL), but after some tinkering I simply added it to the Makefile.user.default file, and ran

make install -C platform/50D.109

without issues.

pulsar124

No, it doesn't work for me. Summary:

a) When I simply copied the Greg's silent.c to official magic lantern nightly source, added my fix for 50D, and then compiled, everything worked fine (e.f. FRSP at 15s), but when I use FRSP at 30s, it does the 30s exposure, then I get error message "RAW error, falling back to YUV overlays", and them my display dies (I have to remove battery to bring it back to life).

b) When I cloned the whole Greg's branch and compiled for 50D, it kills my camera instantly, the moment I turn the power on  - camera shows no signs of life until I switch the card and remove battery.

So something is screwy here. I think I better wait until the Greg's long exposure fix makes it to nightlies.

A question: can RAW video FPS be made to go below 0.125? (That's what my 50D currently have.) Because another way to shoot these long exposure FRSP shots would be to record RAW video at very low FPS.

josepvm

Different results for me. 

Greg's branch works Ok on my 50D, no camera locks at all.  I have modified silent.c  (my version here)  adding an entry for 50D 1.0.9 in silent_init() and assigning capture_err_time_addr = 0xff085b14;

The build works, and I can take silent pictures ... but with a maximum of 16 sec. exposure time. If I try to set a longer exposure (20 s or 30 s) I see a "raw error" message, and the picture is not recorded on CF card. The camera does not freeze, however, I can continue setting a different exposure time and taking more silent pictures.

Tested only with DNG silent pictures, MLV format not tested yet.

The same code built for my 500D works perfectly, I can get 30 sec FRSP and bulb also works with FRSP

a1ex


josepvm

Thanks A1ex. Tested, and it works now, I can take 30 sec. silent pictures.

I have updated the link to my slient.c in my previous post with the correct value.


josepvm

I see that 50D does not have a dedicated bulb mode, only a "Bulb" exposure setting in M mode, so I wonder if Bulb FRSP could be possible in this camera.

Any hint to find "bulb_end_addr" for 50D? 

I suppose I need to find "scsBulbEnd" on Canon firmware. I have done it, and I see code like this:


ff079854: e28f20ac add r2, pc, #172 ; ff079908: (42736373)  *"scsBulbEnd"
ff079858: e3a01003 mov r1, #3
ff07985c: e20000ff and r0, r0, #255 ; 0xff
ff079860: ebffa8aa bl loc_ff063b10
ff079864: e51f088c ldr r0, [pc, #-2188] ; ff078fe0: (00003208)     


Is "bulb_end_addr" related to the value between parentheses  (00003208) ?   :-\

a1ex

Try to see what the function does (besides printing that message). This particular function is simple enough to understand with pen and paper (for a beginner).

Hint 1: here's a good tutorial: http://www.davespace.co.uk/arm/introduction-to-arm/addressing.html

Hint 2: it's not 00003208, but it's close.

pulsar124

josepvm: Thanks for the info. My modded silent.c is exactly like yours, but I do get the RAW write error at 30s exposure. There must be some difference in either the compiling environment, or camera settings. I wonder if the ML version makes a difference? Which version are you using - is it the Greg's branch, or one of nightlies (which one?) with the silent.c replaced by the Greg's version?

EDIT: I just notice that you are using the Greg's branch. It kills my camera for some reason - it must be the compiling environment difference. Which gcc version are you using? What about the arm cross-compiler? Mine are:

gcc: 5.1.1
arm-linux-gnu-gcc: 5.3.1

I think I saw recommendation to use 4.8.x (for both?).

Greg

Quote from: josepvm on June 18, 2016, 04:12:20 PM
Is "bulb_end_addr" related to the value between parentheses  (00003208) ?   :-\

500D
0x3314 + 0x10 = 0x3324

So try 0x3218 (I'm not 100% sure I don't have 50D ROM).
You can check if the address is correct with 30s exposure and delayed_call.

josepvm

Quote from: pulsar124 on June 18, 2016, 05:33:42 PM
Which gcc version are you using? What about the arm cross-compiler? Mine are:
gcc: 5.1.1
arm-linux-gnu-gcc: 5.3.1
I think I saw recommendation to use 4.8.x (for both?).

I am using gcc  4.8.2  (Ubuntu 14.04 default package, 4:4.8.2-1ubuntu6) and 4.8.4 for the ARM cross-compiler (gcc-arm-none-eabi-4_8-2014q2)


josepvm

Quote from: Greg on June 18, 2016, 07:49:05 PM
500D
0x3314 + 0x10 = 0x3324

So try 0x3218 (I'm not 100% sure I don't have 50D ROM).
You can check if the address is correct with 30s exposure and delayed_call.


Ok, I see, for 500D:


ff07ccf0: e28f20a8 add r2, pc, #168 ; ff07cda0: (42736373)  *"scsBulbEnd"
ff07ccf4: e3a01003 mov r1, #3
ff07ccf8: e20000ff and r0, r0, #255 ; 0xff
ff07ccfc: ebffa765 bl loc_ff066a98
ff07cd00: e51f0500 ldr r0, [pc, #-1280] ; ff07c808: (00003314)
ff07cd04: e3a01001 mov r1, #1
ff07cd08: e5801010 str r1, [r0, #16]     <------------------


And for 50D:

ff879854: e28f20ac add r2, pc, #172 ; ff879908: (42736373)  *"scsBulbEnd"
ff879858: e3a01003 mov r1, #3
ff87985c: e20000ff and r0, r0, #255 ; 0xff
ff879860: ebffa8aa bl loc_ff863b10
ff879864: e51f088c ldr r0, [pc, #-2188] ; ff878fe0: (00003208)
ff879868: e3a01001 mov r1, #1
ff87986c: e5801010 str r1, [r0, #16]   <--------------------


So can I assume that "#16" in the last lines is a decimal value, and that's why I should add 0x10 to 00003208  ?

josepvm

Ok, tested, with bulb_end_addr = 0x3218.  It works.

So FRSP in bulb mode for 50D is working. 

I have updated my "silent.c" file. I repeat the link here


Update:
----------

It works using Greg's branch.  If I put the modified "silent.c" file in the current "unified" branch, the silent module fails to build:


Building module silent...
Updated HGVERSION
[ README   ]   module_strings.h
[ CC       ]   silent.o
silent.c: In function 'silent_pic_take_lv':
silent.c:969:9: error: implicit declaration of function 'PauseLiveView' [-Werror=implicit-function-declaration]
         PauseLiveView();
         ^
silent.c:1014:9: error: implicit declaration of function 'ResumeLiveView' [-Werror=implicit-function-declaration]
         if (LV_PAUSED) ResumeLiveView();
         ^
silent.c: In function 'display_off_if_qr_mode':
silent.c:1083:13: error: implicit declaration of function 'display_off' [-Werror=implicit-function-declaration]
             display_off();
             ^
silent.c: In function 'silent_pic_take_fullres':
silent.c:1228:9: error: implicit declaration of function 'display_on' [-Werror=implicit-function-declaration]
         display_on();
         ^
cc1: some warnings being treated as errors
make[3]: *** [silent.o] Error 1

********************************************************
WARNING: module silent failed to build, deleting
********************************************************


Greg

But the shutter speed should be from M mode.
So the the maximum time 30 seconds.

Now you need to find a way to "Bulb Start" for cameras without Bulb shutter speed in M mode.

josepvm

The 50D has a "bulb" shutter speed setting in M mode, exactly as the 500D.  I have tested 45 sec. exposures (using ML bulb timer) and it works.

In other words: the 50D has not a "B" mode in the main dial. The 5D Mk II and 60D have this dedicated "B" mode.

Greg

I thought it was like 5D2  :o

So in this way should work on the EOSM, 50D, 500D, 550D, 600D, 650D, 700D, 1100D
This can be helpful to finding solutions for other cameras - http://www.magiclantern.fm/forum/index.php?topic=1915.0

dmilligan

Here's Greg's silent.c merged with the latest ML core: https://gist.github.com/davidmilligan/6b8f78383a1e11cbecc620874e129cbb

To do this yourself:

hg clone -r unified ssh://[email protected]/Gr3g01/magic-lantern-frsp-long-expo
cd magic-lantern-frsp-long-expo
hg pull -b unified ssh://[email protected]/hudson/magic-lantern
hg merge

But you get a conflict (easy to fix)

josepvm

Thanks, David !!!

This is my modified "silent.c" based on your version, but with included support for 30 sec.  and bulb mode FRSP for the 50D:

silent.c

Works with the latest unified branch, already tested in camera.

a1ex

Quote from: Greg on June 18, 2016, 09:46:52 PM
Now you need to find a way to "Bulb Start" for cameras without Bulb shutter speed in M mode.

This one is tricky, since the FA_CreateTestImage gets the shutter setting from property 0x80000005 (PROP_SHUTTER). On 60D, in BULB mode, PROP_SHUTTER has the previous value from M mode.

Once in BULB mode, the 60D no longer accepts any changes to PROP_SHUTTER.

If you try to set PROP_SHUTTER to SHUTTER_BULB = 12 from M mode, the change is refused by Canon code.

I guess the behavior is similar on other cameras that have a dedicated BULB mode.

Patching the shutter speed in the structure returned by FA_CreateTestImage might work.


run_test:ff09e1ac:90:16: hJob(0x43b00070)(tv=0x88,av=0x24,iso=0x48)
...
ShootCaptu:ff0848b4:93:16: ->FA DARK_MEM1 iso:0x48,tv:0x88,av:0x24,tp:153,po:185

a1ex

60D:


void* job = (void*) call("FA_CreateTestImage");
ASSERT(*(uint8_t*)(job + 0x78) == prop_shutter);
*(uint8_t*)(job + 0x78) = SHUTTER_BULB;
delayed_call(bulb_time * 1000, bulb_stop, 0);
call("FA_CaptureTestImage", job);



run_test:ff09e1ac:90:16: hJob(0x43b00070)(tv=0x88,av=0x24,iso=0x48)
...
ShootCaptu:ff0848b4:93:16: ->FA DARK_MEM1 iso:0x48,tv:0xc,av:0x24,tp:153,po:185
...
ShootCaptu:ff086138:93:03: scsVdInterrupt
...
ShootCaptu:ff086138:93:03: scsVdInterrupt
...
ShootCaptu:ff086138:93:03: scsVdInterrupt
ShootCaptu:ff086188:93:03: Accumulation Stop
ShootCaptu:ff0861c4:93:03: Last VD Count


:)

Greg

5D2, 500D, 50D  :
(job + 0x64) // not tested

Easy code to find the register if you have a camera :
static void run_test()
{
    msleep(500);
    console_show();
    void* job = (void*) call("FA_CreateTestImage");
   
    FILE* f = FIO_CreateFile("FRSP.LOG");
   
    my_fprintf(f, "Tv val = 0x%x\n", lens_info.raw_shutter);
    my_fprintf(f, "Av val = 0x%x\n", lens_info.raw_aperture);
    my_fprintf(f, "ISO val = 0x%x\n\n", lens_info.raw_iso);
   
    for (int i = 0; i < 1000; i++)
    {
        if(lens_info.raw_shutter == *(uint8_t*)(job + i))
        {
            printf("FA_CreateTestImage Tv Addr : 0x%x\n", i);
        }

        if (f)
        {
            my_fprintf(f, "Addr = 0x%03x Val = 0x%x\n", i, *(uint8_t*)(job + i));
        }
    }
   
    if (f)
    {
        FIO_CloseFile(f);
    }
   
    call("FA_DeleteTestImage", job);
    printf("Done.\n");
}