Author Topic: Full-resolution silent pictures (silent.mo)  (Read 765001 times)

pulsar124

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #900 on: June 16, 2016, 06:38:15 PM »
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

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #901 on: June 17, 2016, 05:24:00 PM »
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

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #902 on: June 17, 2016, 05:58:00 PM »
Code: [Select]
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

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Full-resolution silent pictures
« Reply #903 on: June 17, 2016, 05:58:29 PM »
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

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #904 on: June 17, 2016, 06:26:05 PM »
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

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #905 on: June 18, 2016, 01:08:14 AM »
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

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #906 on: June 18, 2016, 10:27:36 AM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #907 on: June 18, 2016, 10:35:29 AM »
For 50D, try 0xff885b14.

josepvm

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #908 on: June 18, 2016, 10:58:19 AM »
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

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #909 on: June 18, 2016, 04:12:20 PM »
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:

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

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #910 on: June 18, 2016, 04:30:47 PM »
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

  • Member
  • ***
  • Posts: 120
Re: Full-resolution silent pictures
« Reply #911 on: June 18, 2016, 05:33:42 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 607
Re: Full-resolution silent pictures
« Reply #912 on: June 18, 2016, 07:49:05 PM »
Is "bulb_end_addr" related to the value between parentheses  (00003208) ?   :-\

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

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #913 on: June 18, 2016, 08:59:06 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

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #914 on: June 18, 2016, 09:08:43 PM »
500D
Code: [Select]
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:

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

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #915 on: June 18, 2016, 09:37:14 PM »
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:

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

  • Contributor
  • Hero Member
  • *****
  • Posts: 607
Re: Full-resolution silent pictures
« Reply #916 on: June 18, 2016, 09:46:52 PM »
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

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #917 on: June 18, 2016, 10:02:31 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 607
Re: Full-resolution silent pictures
« Reply #918 on: June 18, 2016, 10:11:44 PM »
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

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Full-resolution silent pictures
« Reply #919 on: June 18, 2016, 11:23:37 PM »
Here's Greg's silent.c merged with the latest ML core: https://gist.github.com/davidmilligan/6b8f78383a1e11cbecc620874e129cbb

To do this yourself:
Code: [Select]
hg clone -r unified ssh://hg@bitbucket.org/Gr3g01/magic-lantern-frsp-long-expo
cd magic-lantern-frsp-long-expo
hg pull -b unified ssh://hg@bitbucket.org/hudson/magic-lantern
hg merge
But you get a conflict (easy to fix)

josepvm

  • Member
  • ***
  • Posts: 212
Re: Full-resolution silent pictures
« Reply #920 on: June 19, 2016, 12:02:18 AM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #921 on: June 20, 2016, 07:31:38 AM »
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.

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

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Full-resolution silent pictures
« Reply #922 on: June 20, 2016, 08:08:24 AM »
60D:

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

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

  • Contributor
  • Hero Member
  • *****
  • Posts: 607
Re: Full-resolution silent pictures
« Reply #923 on: June 20, 2016, 11:04:51 PM »
5D2, 500D, 50D  :
Code: [Select]
(job + 0x64) // not tested
Easy code to find the register if you have a camera :
Code: [Select]
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");
}

Greg

  • Contributor
  • Hero Member
  • *****
  • Posts: 607