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 - aprofiti

#101
Reverse Engineering / Re: UHS-I / SD cards investigation
September 27, 2018, 03:01:56 AM
Quote from: waza57 on September 14, 2018, 08:51:48 AM
I used DIGIC POKE to simply modify this values I found in  http://magiclantern.wikia.com/wiki/Register_Map#CFDMA :

0xC062850C --> 0x1213 and I obtain UDMA 0 speed (around 15MB/s)
                     --> ...........
                     --> ...........
                     -->0x0202 and I obtain UDMA 6 speed (around 80MB/s) i suppose original value
                     -->0x0101 and sadly I obtain UDMA 6 speed  too :(

Does this address refers to Word 88 of CF Software Interface specifications?

if so, bit 14 is for selection of udma6 and bit 15 is for udma7 (just a guess but can be right):
0x8CF  Select UDMA4 and support from 0 to 4
0x403F Select UDMA6 and support from 0 to 6
0x807F Select UDMA7 and support from 0 to 7

Quote from: a1ex on September 14, 2018, 09:00:55 AM

CF 5D3:
0.932.277   CSMgrTask:ff6aa02c:MMIO : [0xC0628504] <- 0x04060503
0.932.285   CSMgrTask:ff6aa050:MMIO : [0xC0628508] <- 0x010A1105
0.932.291   CSMgrTask:ff6a9e4c:MMIO : [0xC062850C] <- 0x00000202

    0xC0628504 0xC0628508 0xC062850C
u7: 0x04060503 0x010A1105 0x00000202
u6: 0x04060503 0x010A1105 0x00000303
u5: 0x04060503 0x010A1105 0x00000303
u4: 0x04060503 0x010A1405 0x01000505
u3: 0x04060503 0x030A1405 0x01000808
u2: 0x04060503 0x060A1405 0x01000B0B
u1: 0x04060503 0x090A1905 0x01000F0E
u0: 0x05040402 0x04060503 0x01001616


Can you try 102 or 201?

Maybe 403 for udma6 and 807 for udma7???


825FE>  CSMgrTask:00095f98:00:00: *** register_interrupt("CFDriver", 0x82, 0xffb8b8cc, 0x0), from ffb8bb58

Does this initialise supported features of the reader? (Word 82 Features/command sets supported from specifications)
Or maybe is Word 130 (Vendor unique bytes). Does this changes in logs?
#102
Quote from: reddeercity on September 23, 2018, 08:41:49 AM
Found a very complete CF Card specifications pdf from 2005 , a little old (CF+ & CF SPECIFICATION REV. 3.0)
Also revision 4.0 (2006) can be found just by googling, but apparently no rev.4.1a neither 6.0

Instead latest revision can be bought from CFA website
#103
Quote from: Lars Steenhoff on September 26, 2018, 10:08:43 PM
this one form experiments or one from your branch?
Take the ones from my branch (manual_lens_info and crop_rec_4k_mlv_snd_elns).

The build from experimental page is an older one, not with the "dynamic" field length, it only include fix for compilation of selftest module but can also be less stable due to missing merge of latest lua_fix used to avoid camera crash when recording raw.

Quote from: dfort on September 24, 2018, 09:24:58 PM
I looked into this and the merge conflicts shouldn't be difficult to resolve. I resolved it by taking the mem.c changes from the lua_fix branch because it has the newer memory backend updates. However, a problem after merging is that the selftest module will no longer compile. I believe that the latest changes to that module was done in the lua_fix branch and simply copying selftest.c from lua_fix it compiles and seems to work properly.
yes, they aren't difficult to resolve, just include the changes regarding allocator to fix conflicts, but there is something which will mess selftest's module functionality.

Just taking selftest from lua_fix will be missing "Small-block malloc" test which is failing after merging; same thing if just copying mem.c (some improvement in memory management was done for manual lens); maybe there are some changes in mem.c from lua_fix which will interfere with the version in manual_lens_info
#104
Quote from: Lars Steenhoff on September 22, 2018, 06:56:14 PM
Wish I could help
Having additional feedback is welcome.

You can have a look about this list:
1. Overall camera stability
2. Raw recording and silent pictures stability, especially mlv_rec which was the most problematic to make it works
3. General feedback about the script and metadata correctness
4. Eventually other bugs that can pop out

Those should be checked on both PR (take the branches from my repo); if you are a main crop_rec_4k branch user, having that on a daily usage is a nice addition to extensively testing it.

Waiting for you feedback. After all, you starter the thread :)
#105
Quote from: a1ex on September 21, 2018, 03:21:12 PM
the correct stubs should start with 0xFF9 instead of 0xFF1. That means, you should patch some address that Canon code is going to execute, not a mirrored copy.

Make sure the hook is actually executing (add some printf, for example).

/** LiveView RAW patches **/
NSTUB(0xff9db254, StartImagePass_x1_SetEDmac)               /* right before the SetEDmac call from StartImagePass_x1/x5 CrawAddr / KindOfCraw */
NSTUB(0xff9dbce8, StartImagePass_x5_SetEDmac)               /* FIXME: why it fails when the hook is placed on the BL instruction?! */


Looks good! I didn't tried to set second stub to BL instruction yet.

Will show up 2 patches in PatchMgr Dialog (lv_x1 and lv_x5) and value returned by raw_lv_get_resolution() in raw_lv_setedmac_patch()i s "1"; also no branch due to errors in patch_hook_function()
#106
Quote from: a1ex on September 21, 2018, 01:26:10 PM
On 5D2, when compiling without CONFIG_EDMAC_RAW_PATCH, I get some sync issues (half of the frame is sometimes from previous frame). Compiling with CONFIG_EDMAC_RAW_PATCH (i.e. default configuration on the raw_video_10bit_12bit_LVState branch) solves this issue, but does not address any other quirks, such as in-camera playback or preview/overlays while recording at lower bit depths.

I get half of the frame issue with CONFIG_EDMAC_RAW_PATCH !
Tried to undefined it and will  run the same way on camera, isn't this strange?

Also Preview of Raw video is set to auto, which will looks like Framing when not recording and Frozen when rec start, but I can set to Realtime without apparently any issues... Why?

Quote from: Danne on September 21, 2018, 01:13:36 PM
Developing with dcraw?
dcraw -T input.dng

Compiled raw_tweak and can playback in camera
Not sure how to use dcraw with mlv, do I need to convert to dng with mlv_dump first?

Tried with MLVFS but CF refuses to cooperate...
So I downloaded MLV App 1.0 and it playback .mlv files like mlv_play
#107
Tried to pattern match stubs for 50D:

/** LiveView RAW patches **/
NSTUB(0xFF1DB254, StartImagePass_x1_SetEDmac)               /* right before the SetEDmac call from StartImagePass_x1/x5 CrawAddr / KindOfCraw */
NSTUB(0xFF1DBCE9, StartImagePass_x5_SetEDmac)               /* FIXME: why it fails when the hook is placed on the BL instruction?! */


Movie records in 10bit but can't be reviewed on camera (black frames) nor with mlRawViewer (artefacts).
I'm not sure about the stubs, looks a bit different in code
#108
Scripting Corner / Re: Lua Scripting (lua.mo)
September 21, 2018, 12:57:02 PM
Quote from: a1ex on September 21, 2018, 07:15:42 AM
That must be from those half-shutter tricks, so we'll probably need to disengage these somehow.

That fake_simple_button considering UI locks must be a bit overkill; I should double-check that. At least, the shutter bit should not affect things, so we may leave it out (gui-common.c, try 0xFFFE instead of 0xFFFF).

Now it stop the movie :) Still trigger an Assertion at line 1454 but that's movie review which is not available on 50D.

If I enter LV manually, I get in console "UILock: 00000000 -> 41000000 -> 00000000"
when recoding start it prints "UILock: 8300017f -> 41000001 -> 8300017f (!!!)"

May be useful to know? Maybe is not halfshutter?
#109
Scripting Corner / Re: Lua Scripting (lua.mo)
September 21, 2018, 12:25:10 AM
Quote from: a1ex on September 20, 2018, 08:21:02 PM
AF test: maybe worth trying some other lens? Follow focus working? Maybe it breaks after AF test? (you could try commenting out the calls to lens.autofocus).
I suspect that is more likely the lens not supported... It's a Tamron lens that doesn't report focus distance in Focus tab and also no Follow focus after pressing PLAY button...

Unfortunately I don't have another AF lens to try, just another couple of manuals lenses...
However just the steps increment AF test seems to fail

Quote from: a1ex on September 20, 2018, 08:21:02 PM
Movie recording test: you could run just that (remove other tests from the script) and see if there's any message on the screen. Maybe add some printf's in movie_end (shoot.c) and see where it fails. It presses SET and checks some pre- and post-conditions.
Already backtracked code previously because I was suspecting for SET button not pressed as I noticed some times ago that half shutter doesn't work with non raw movie recording in 50D, don't know if it the same for other camera.

I tried to put some debugging messages and seems problem is that fake_simble_button() doesn't works due to Locked UI:



Tried with and without REC Key set to HalfShutter
#110
Scripting Corner / Re: Lua Scripting (lua.mo)
September 20, 2018, 06:10:45 PM
Looks good on 50D apart the movie stop command apparently not working.

I switched to movie mode by entering lv and enabling movie record (simple, not raw) in ML menu, then recording started automatically and wasn't stopping (waited less tan a minute, it should stop after sleep(1)), so i stopped manually by pressing set and exited LV, then assert were triggered.

I'll retry later
Edit: noting to do.. now it freezes

Here is the log:


===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-9-20 16:56:10
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 75
    apex = 2.375
    ms = 193
    value = 0.192776
  aperture = table:
    raw = 0
    apex = 0
    value = 0
    min = table:
      raw = 0
      apex = 0
      value = 0
    max = table:
      raw = 0
      apex = 0
      value = 0
  iso = table:
    raw = 104
    apex = 9.
    value = 1600
  ec = table:
    raw = 0
    value = 0
  flash = true
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 5500
  mode = 3
  metering_mode = 3
  drive_mode = 0
  model = "Canon EOS 50D"
  model_short = "50D"
  firmware = "1.0.9"
  temperature = 158
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  wait = function: 0xa00a50
  shoot = function: 0xa01b24
  reboot = function: 0xa01af8
  bulb = function: 0xa01d58
  burst = function: 0xa01dd8
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  write = function: 0x9ff478
  clear = function: 0x9ff3c4
  hide = function: 0x9ff3d4
  show = function: 0x9ff3e4
lv = table:
  enabled = false
  paused = false
  running = false
  zoom = 1
  overlays = false
  info = function: 0xa02304
  start = function: 0xa01f60
  stop = function: 0xa01f70
  resume = function: 0xa025f8
  wait = function: 0xa029c8
  pause = function: 0xa02608
lens = table:
  name = ""
  focal_length = 0
  focus_distance = 14080
  hyperfocal = 0
  dof_near = 0
  dof_far = 0
  af = false
  af_mode = 771
  autofocus = function: 0xa034ac
  focus = function: 0xa03674
display = table:
  idle = nil
  height = 480
  width = 720
  on = function: 0xa03f00
  pixel = function: 0xa05154
  notify_box = function: 0xa03fb4
  rect = function: 0xa04b28
  screenshot = function: 0xa03e1c
  line = function: 0xa04e8c
  draw = function: 0xa0409c
  off = function: 0xa03ef0
  load = function: 0xa041e4
  circle = function: 0xa04858
  clear = function: 0xa03e0c
  print = function: 0xa05320
key = table:
  last = 20
  wait = function: 0xa05830
  press = function: 0xa05af8
menu = table:
  visible = false
  new = function: 0xa07f20
  select = function: 0xa07010
  get = function: 0xa072c4
  close = function: 0xa05e58
  block = function: 0xa06060
  open = function: 0xa05e70
  set = function: 0xa070e4
movie = table:
  recording = false
  stop = function: 0xa03a74
  start = function: 0xa03b08
dryos = table:
  clock = 10
  ms_clock = 10306
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0xa09214
    children = function: 0xa090cc
    files = function: 0xa08fb0
    parent = table:
      exists = true
      create = function: 0xa09214
      children = function: 0xa090cc
      files = function: 0xa08fb0
      parent = table:
        exists = true
        create = function: 0xa09214
        children = function: 0xa090cc
        files = function: 0xa08fb0
        parent = nil
        path = "A:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xa09214
      children = function: 0xa090cc
      files = function: 0xa08fb0
      parent = table:
        exists = true
        create = function: 0xa09214
        children = function: 0xa090cc
        files = function: 0xa08fb0
        parent = table:
          exists = true
          create = function: 0xa09214
          children = function: 0xa090cc
          files = function: 0xa08fb0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/101CANON/"
    file_number = 1790
    folder_number = 101
    free_space = 6608
    image_path = function: 0xa093f0
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  shooting_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xa09214
      children = function: 0xa090cc
      files = function: 0xa08fb0
      parent = table:
        exists = true
        create = function: 0xa09214
        children = function: 0xa090cc
        files = function: 0xa08fb0
        parent = table:
          exists = true
          create = function: 0xa09214
          children = function: 0xa090cc
          files = function: 0xa08fb0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/101CANON/"
    file_number = 1790
    folder_number = 101
    free_space = 6608
    image_path = function: 0xa093f0
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  cf_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0xa09214
      children = function: 0xa090cc
      files = function: 0xa08fb0
      parent = table:
        exists = true
        create = function: 0xa09214
        children = function: 0xa090cc
        files = function: 0xa08fb0
        parent = table:
          exists = true
          create = function: 0xa09214
          children = function: 0xa090cc
          files = function: 0xa08fb0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/101CANON/"
    file_number = 1790
    folder_number = 101
    free_space = 6608
    image_path = function: 0xa093f0
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  sd_card = nil
  date = table:
    day = 20
    yday = 1
    month = 9
    wday = 2
    hour = 16
    min = 56
    isdst = false
    year = 2018
    sec = 11
  remove = function: 0xa08aa4
  call = function: 0xa087cc
  rename = function: 0xa089d0
  directory = function: 0xa08b10
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0xa09e30
battery = table:
function not available on this camera
stack traceback:
[C]: in ?
[C]: in for iterator 'for iterator'
ML/SCRIPTS/LIB/logger.lua:125: in function 'logger.serialize'
ML/SCRIPTS/API_TEST.LUA:45: in function <ML/SCRIPTS/API_TEST.LUA:44>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:44: in function 'globals.print_table'
ML/SCRIPTS/API_TEST.LUA:90: in function 'globals.generic_tests'
ML/SCRIPTS/API_TEST.LUA:1471: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunktask = table:
  yield = function: 0xa0a498
  create = function: 0xa0a618
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
CF card (A:/) present
- free space: 6608 MiB
- next image: A:/DCIM/101CANON/IMG_1791.CR2
- DCIM dir. : A:/DCIM/101CANON/
File I/O tests completed.

Testing Canon GUI functions...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter PLAY mode...
Exit PLAY mode...
Stop LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Stop LiveView...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Stop LiveView...
Start LiveView...
Stop LiveView...
Start LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Stop LiveView...
Start LiveView...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Canon GUI tests completed.

Testing ML menu API...
Menu tests completed.

Testing picture taking functions...
Snap simulation test...
Single picture...
A:/DCIM/101CANON/IMG_1791.CR2: 21376548
A:/DCIM/101CANON/IMG_1791.JPG not found.
Two burst pictures...
Ideally, the camera should be in some continuous shooting mode (not checked).
A:/DCIM/101CANON/ABC_1792.CR2: 21336894
A:/DCIM/101CANON/ABC_1792.JPG not found.
A:/DCIM/101CANON/ABC_1793.CR2: 21336837
A:/DCIM/101CANON/ABC_1793.JPG not found.
Bracketed pictures...
A:/DCIM/101CANON/IMG_1794.CR2: 18407421
A:/DCIM/101CANON/IMG_1794.JPG not found.
A:/DCIM/101CANON/IMG_1795.CR2: 21310153
A:/DCIM/101CANON/IMG_1795.JPG not found.
A:/DCIM/101CANON/IMG_1796.CR2: 20568828
A:/DCIM/101CANON/IMG_1796.JPG not found.
Bulb picture...
Elapsed time: 11737
A:/DCIM/101CANON/IMG_1797.CR2: 11930947
A:/DCIM/101CANON/IMG_1797.JPG not found.
Picture taking tests completed.

Testing multitasking...
Only one task allowed to interrupt...
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Multitasking tests completed.

Testing half-shutter...
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
Half-shutter test OK.

Testing module 'lv'...
Starting LiveView...
Overlays: ML
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: ML
Setting zoom to x1...
Setting zoom to x5...
Setting zoom to x10...
Setting zoom to x5...
Setting zoom to x1...
Setting zoom to x10...
Setting zoom to x1...
Pausing LiveView...
Resuming LiveView...
Stopping LiveView...
LiveView tests completed.


Testing lens focus functionality...
This test requires an electronic lens.
Testing exposure settings...
Camera    : Canon EOS 50D (50D) 1.0.9
Lens      :
Shoot mode: 3
Shutter   : Ç5 (raw 75, 0.192776s, 193ms, apex 2.375)
Aperture  : Å0.0 (raw 0, f/0, apex 0)
Av range  : Å0.0..Å0.0 (raw 0..0, f/0..f/0, apex 0..0)
ISO       : Ä1600 (raw 104, 1600, apex 9.)
EC        : 0.0 (raw 0, 0 EV)
Flash EC  : 0.0 (raw 0, 0 EV)
Setting shutter to random values...
Setting ISO to random values...
This lens does not have variable aperture (skipping test).
Please switch to Av mode.
Setting EC to random values...
Setting Flash EC to random values...
Exposure tests completed.


Testing movie recording...
Please switch to Movie mode.

ML/SCRIPTS/API_TEST.LUA:1447: assertion failed!
stack traceback:
[C]: in function 'globals.assert'
ML/SCRIPTS/API_TEST.LUA:1447: in function 'globals.test_movie'
ML/SCRIPTS/API_TEST.LUA:1484: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'globals.xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'globals.api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunk


Using previous build it will fail at line 552 under test_keys() function. New build prints a warning in log about half shutter button

P.S: A1ex, Do you have more commits to push on lua_fix? Can you have a look why selftest "Small-block malloc test" will not works if I merge this on manual_lens?

Edit2: I noticed that lens wasn't screwed, so Af test wasn't enabled. Redone test and first AF test was ok, then it get in a loop trying to focus over infinity and and printing "lens is stuck?"


===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-9-20 18:38:37
===============================================================================

Strict mode tests...
Strict mode tests passed.

Generic tests...
arg = table:
  [0] = "API_TEST.LUA"
camera = table:
  shutter = table:
    raw = 75
    apex = 2.375
    ms = 193
    value = 0.192776
  aperture = table:
    raw = 40
    apex = 4.
    value = 4.
    min = table:
      raw = 32
      apex = 3.
      value = 2.8
    max = table:
      raw = 88
      apex = 10.
      value = 32
  iso = table:
    raw = 104
    apex = 9.
    value = 1600
  ec = table:
    raw = 0
    value = 0
  flash = true
  flash_ec = table:
    raw = 0
    value = 0
  kelvin = 5500
  mode = 3
  metering_mode = 3
  drive_mode = 0
  model = "Canon EOS 50D"
  model_short = "50D"
  firmware = "1.0.9"
  temperature = 158
  gui = table:
    menu = false
    play = false
    play_photo = false
    play_movie = false
    qr = false
    idle = true
  burst = function: 0x9f37e8
  wait = function: 0x9f2460
  reboot = function: 0x9f3508
  bulb = function: 0x9f3768
  shoot = function: 0x9f3534
event = table:
  pre_shoot = nil
  post_shoot = nil
  shoot_task = nil
  seconds_clock = nil
  keypress = nil
  custom_picture_taking = nil
  intervalometer = nil
  config_save = nil
console = table:
  hide = function: 0x9f0de4
  write = function: 0x9f0e88
  clear = function: 0x9f0dd4
  show = function: 0x9f0df4
lv = table:
  enabled = false
  paused = false
  running = false
  zoom = 1
  overlays = false
  start = function: 0x9f3970
  pause = function: 0x9f4018
  stop = function: 0x9f3980
  info = function: 0x9f3d14
  wait = function: 0x9f43d8
  resume = function: 0x9f4008
lens = table:
  name = "17-50mm"
  focal_length = 17
  focus_distance = 0
  hyperfocal = 3836
  dof_near = 1358705152
  dof_far = 1000000
  af = true
  af_mode = 0
  focus = function: 0x9f5084
  autofocus = function: 0x9f4ebc
display = table:
  idle = nil
  height = 480
  width = 720
  pixel = function: 0x9f6b64
  circle = function: 0x9f6268
  line = function: 0x9f689c
  load = function: 0x9f5bf4
  print = function: 0x9f6d30
  rect = function: 0x9f6538
  notify_box = function: 0x9f59c4
  draw = function: 0x9f5aac
  off = function: 0x9f5900
  on = function: 0x9f5910
  clear = function: 0x9f581c
  screenshot = function: 0x9f582c
key = table:
  last = 20
  press = function: 0x9f7508
  wait = function: 0x9f7240
menu = table:
  visible = false
  set = function: 0x9f8af4
  open = function: 0x9f7880
  close = function: 0x9f7868
  get = function: 0x9f8cd4
  select = function: 0x9f8a20
  new = function: 0x9f9930
  block = function: 0x9f7a70
movie = table:
  recording = false
  start = function: 0x9f5518
  stop = function: 0x9f5484
dryos = table:
  clock = 12
  ms_clock = 12899
  image_prefix = "IMG_"
  config_dir = table:
    exists = true
    create = function: 0x9fac24
    children = function: 0x9faadc
    files = function: 0x9fa9c0
    parent = table:
      exists = true
      create = function: 0x9fac24
      children = function: 0x9faadc
      files = function: 0x9fa9c0
      parent = table:
        exists = true
        create = function: 0x9fac24
        children = function: 0x9faadc
        files = function: 0x9fa9c0
        parent = nil
        path = "A:/"
      path = "ML/"
    path = "ML/SETTINGS/"
  ml_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0x9fac24
      children = function: 0x9faadc
      files = function: 0x9fa9c0
      parent = table:
        exists = true
        create = function: 0x9fac24
        children = function: 0x9faadc
        files = function: 0x9fa9c0
        parent = table:
          exists = true
          create = function: 0x9fac24
          children = function: 0x9faadc
          files = function: 0x9fa9c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/102CANON/"
    file_number = 1812
    folder_number = 102
    free_space = 5412
    image_path = function: 0x9fae00
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  shooting_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0x9fac24
      children = function: 0x9faadc
      files = function: 0x9fa9c0
      parent = table:
        exists = true
        create = function: 0x9fac24
        children = function: 0x9faadc
        files = function: 0x9fa9c0
        parent = table:
          exists = true
          create = function: 0x9fac24
          children = function: 0x9faadc
          files = function: 0x9fa9c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/102CANON/"
    file_number = 1812
    folder_number = 102
    free_space = 5412
    image_path = function: 0x9fae00
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  cf_card = table:
    drive_letter = "A"
    dcim_dir = table:
      exists = true
      create = function: 0x9fac24
      children = function: 0x9faadc
      files = function: 0x9fa9c0
      parent = table:
        exists = true
        create = function: 0x9fac24
        children = function: 0x9faadc
        files = function: 0x9fa9c0
        parent = table:
          exists = true
          create = function: 0x9fac24
          children = function: 0x9faadc
          files = function: 0x9fa9c0
          parent = nil
          path = "A:/"
        path = "A:/DCIM/"
      path = "A:/DCIM/102CANON/"
    file_number = 1812
    folder_number = 102
    free_space = 5412
    image_path = function: 0x9fae00
    type = "CF"
    path = "A:/"
    _card_ptr = userdata
  sd_card = nil
  date = table:
    day = 20
    hour = 18
    month = 9
    yday = 1
    wday = 2
    sec = 38
    isdst = false
    min = 38
    year = 2018
  rename = function: 0x9fa3e0
  call = function: 0x9fa1dc
  remove = function: 0x9fa4b4
  directory = function: 0x9fa520
interval = table:
  time = 10
  count = 0
  running = false
  stop = function: 0x9fb840
battery = table:
function not available on this camera
stack traceback:
[C]: in ?
[C]: in for iterator 'for iterator'
ML/SCRIPTS/LIB/logger.lua:125: in function 'logger.serialize'
ML/SCRIPTS/API_TEST.LUA:45: in function <ML/SCRIPTS/API_TEST.LUA:44>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:44: in function 'print_table'
ML/SCRIPTS/API_TEST.LUA:90: in function 'generic_tests'
ML/SCRIPTS/API_TEST.LUA:1471: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunktask = table:
  create = function: 0x9fc028
  yield = function: 0x9fbea8
property = table:
Generic tests completed.

Module tests...
Testing file I/O...
Copy test: autoexec.bin -> tmp.bin
Copy test OK
Append test: tmp.txt
Append test OK
Rename test: apple.txt -> banana.txt
Rename test OK
Rename test: apple.txt -> ML/banana.txt
Rename test OK
CF card (A:/) present
- free space: 5412 MiB
- next image: A:/DCIM/102CANON/IMG_1813.CR2
- DCIM dir. : A:/DCIM/102CANON/
File I/O tests completed.

Testing Canon GUI functions...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Start LiveView...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Resume LiveView...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter PLAY mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Resume LiveView...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter PLAY mode...
Exit PLAY mode...
Enter MENU mode...
Enter MENU mode...
Exit MENU mode...
Enter MENU mode...
Enter PLAY mode...
Enter MENU mode...
Exit MENU mode...
Pause LiveView...
Enter PLAY mode...
Enter MENU mode...
Enter PLAY mode...
Exit PLAY mode...
Pause LiveView...
Enter MENU mode...
Enter MENU mode...
Enter PLAY mode...
Canon GUI tests completed.

Testing ML menu API...
Menu tests completed.

Testing picture taking functions...
Snap simulation test...
Single picture...
A:/DCIM/102CANON/IMG_1813.CR2: 18622312
A:/DCIM/102CANON/IMG_1813.JPG not found.
Two burst pictures...
Ideally, the camera should be in some continuous shooting mode (not checked).
A:/DCIM/102CANON/ABC_1814.CR2: 18612035
A:/DCIM/102CANON/ABC_1814.JPG not found.
A:/DCIM/102CANON/ABC_1815.CR2: 18636418
A:/DCIM/102CANON/ABC_1815.JPG not found.
Bracketed pictures...
A:/DCIM/102CANON/IMG_1816.CR2: 17129986
A:/DCIM/102CANON/IMG_1816.JPG not found.
A:/DCIM/102CANON/IMG_1817.CR2: 18624202
A:/DCIM/102CANON/IMG_1817.JPG not found.
A:/DCIM/102CANON/IMG_1818.CR2: 21540350
A:/DCIM/102CANON/IMG_1818.JPG not found.
Bulb picture...
Elapsed time: 11848
A:/DCIM/102CANON/IMG_1819.CR2: 15562635
A:/DCIM/102CANON/IMG_1819.JPG not found.
Picture taking tests completed.

Testing multitasking...
Only one task allowed to interrupt...
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Main task yielding.
Task C started.
Task C finished.
Main task back.
Multitasking tests completed.

Testing half-shutter...
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
warning: last key not half-shutter, but 20
Half-shutter test OK.

Testing module 'lv'...
Starting LiveView...
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: ML
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: Canon
Overlays: Canon
Overlays: Canon
Overlays: disabled
Overlays: ML
Overlays: disabled
Overlays: ML
Setting zoom to x1...
Setting zoom to x5...
Setting zoom to x10...
Setting zoom to x5...
Setting zoom to x1...
Setting zoom to x10...
Setting zoom to x1...
Pausing LiveView...
Resuming LiveView...
Stopping LiveView...
LiveView tests completed.


Testing lens focus functionality...
Autofocus outside LiveView...
Focus distance: 0
Autofocus in LiveView...
Is there something to focus on?
29...Please trigger autofocus (half-shutter / AF-ON / * ).
59...58...57...56...55...54...53...52...51...50...49...48...Autofocus triggered.
Autofocus completed.
Focus distance: 0
Focusing backward...
Focus distance: 0
Focus motor position: 13242
Focusing forward with step size 3, wait=true...
...
ML/SCRIPTS/API_TEST.LUA:1362: lens.focus() requires autofocus enabled.
stack traceback:
[C]: in function 'lens.focus'
ML/SCRIPTS/API_TEST.LUA:1362: in function 'test_lens_focus'
ML/SCRIPTS/API_TEST.LUA:1482: in function <ML/SCRIPTS/API_TEST.LUA:1467>
[C]: in function 'xpcall'
ML/SCRIPTS/API_TEST.LUA:1467: in function 'api_tests'
ML/SCRIPTS/API_TEST.LUA:1506: in main chunk
#111
That is referred to an old version of ML.

raw_rec.mo as been discontinued some years ago, now mlv_rec.mo (replace raw_rec) and mlv_lite.mo (is planned to replace mlv_rec in the future) are the currently modules which will handle raw recording on camera.

You can download current "stable" build from Nightly page or you can try the experimental Lossless build from here

If you like the latter, you may found useful information on crop_rec thread and you may have an eye on latest news as there are some experiments on increasing fps for your camera; you can Levas's find post here

You can extract the archive and copy all the files in the root of your card if you already followed install instructions to enable the bootflag on camera and make card bootable
#112
Having troubles again with selftest module.

With the fix for fast_malloc return type it can be compiled and run on camera, but the test for "Small-block malloc test" will not works (ui freezes and ERR99 in viewfinder) when I merge lua_fix into it...
Tried also the inverse (manual_lens_info -> lua_fix) but same problem occurs, only works as current state of manual_lens_info branch.

@a1ex Can you merge lua_fix into manual_lens_info an solve conflicts for me?

Also I have a doubt about the script:
It set lens_info.exists to true to enable all the extra info (lens info menu, aperture/focal length in lv etc...) to works with a manual lens.

Noticed that this commit by dmilligan where it was originally adding a field is_Chipped, now replaced with d0e55b3 (use field lens_info.exists).
Here setting field exists will have as consequence some menu text to be displayed, enable dot_tune for non chipped adapter and the one is questioning me more: ETTR exposure bug with manual_lens

Is better to add another field like is_mManual or is_Chipped to be set by lens.lua and replace adapt those checks?
#113
General Development / Re: ML UI rationalization
September 13, 2018, 04:09:15 PM
From a quick check it appears to do nothing when pressing ISO + Joistick (Q equivalent) or AF mode + Joistick on 50D.
Does this do not works on camera without dedicated Q button?

Quote from: a1ex on September 13, 2018, 03:19:53 PM
For lens parameters, the DOF button would have been nice; unfortunately it's not triggered at all with a manual lens.
Maybe can be used with Chipped Adapter? If I switch to LV and press DOF button, it will hang a moment (where it will close aperture with an AF Lens) and doesn't append if I simply remove lens, like if it is receiving interrupt from button press event

Extending with touch interface could also be useful for some users with a compatible camera
#114
General Development / Re: ML UI rationalization
September 13, 2018, 02:46:49 PM
Just wondering if could be possible to map long press of Joystick as a shortcut to quick open a user customizable ML submenu.

Currently from lua_fix changes it play an animation and then simply open last ML category tab.

As example it could be used in conjunction with manual lenses to quickly changes Aperture and Focal Length values by pointing to his specific submenu.
#115
Reverse Engineering / Re: battery grip pins
September 08, 2018, 08:20:42 PM
Here are some photos of the 50D battery grip:



Didn't go further with disassembly as there was something I cannot find out that was blocking.
Tried with multimeter to find some of the connection on the test pad of the pcb, but only a couple was beeping...

On rear of the small pcb (camera side) there are only GND (most off) and VCC (2 or 3 near red cable) test pads

I appears to have all the connection and maybe also UART.
Does anyone know the pinout?
#116
I was interested in long exposure fix some time ago, but wasn't able to understand how to work on this module and dig manually into commit's history to make Greg code works on update codebase.

So I remembered about this and managed to update FRSP Bulb code with latest changes in ML repository.

Here is the diff for unified branch (test also in lua-fix, not tested on top of crop_rec_4k)

# HG changeset patch
# User Alessandro Profiti <[email protected]>
# Date 1535128403 -7200
#      Fri Aug 24 18:33:23 2018 +0200
# Branch frsp_bulb
# Node ID 77ea846906c328eaf10c71a0050f8cf6ea2b7780
# Parent  7a3b5fa3f4c6f085e5bb9d58ab4da0002c01e4a3
silent.c: Add FRSP support to longer exposure up to 15 minutes. Credits to Greg for original code and dmilligan for gist: https://gist.github.com/davidmilligan/6b8f78383a1e11cbecc620874e129cbb

diff --git a/modules/silent/silent.c b/modules/silent/silent.c
--- a/modules/silent/silent.c
+++ b/modules/silent/silent.c
@@ -17,6 +17,7 @@
#include <powersave.h>
#include "../lv_rec/lv_rec.h"
#include "../mlv_rec/mlv.h"
+#include <cache_hacks.h>

static uint64_t ret_0_long() { return 0; }

@@ -69,6 +70,8 @@
static int mlv_file_frame_number = 0;

static int long_exposure_fix_enabled = 0;
+static uint32_t bulb_end_addr = 0;
+static uint32_t capture_err_time_addr = 0;

/* forward reference */
static struct menu_entry silent_menu[];
@@ -1153,6 +1156,11 @@
     }
}

+static void bulb_stop()
+{
+    MEM(bulb_end_addr) = 1;
+}
+
static int
silent_pic_take_fullres(int interactive)
{
@@ -1224,6 +1232,19 @@
      * and creates a "job" object (CreateSkeltonJob)
      */
     struct JobClass * job = (void*) call("FA_CreateTestImage");
+
+    unsigned shutter_old = lens_info.raw_shutter;
+    if (shutter_old == SHUTTER_BULB)
+    {
+        int bulb_time = menu_get_value_from_script("Bulb Timer", "Exposure duration");
+   
+        if(bulb_time > 900) //15 minutes limit
+        {
+            bulb_time = 0;
+        }
+       
+        delayed_call(bulb_time * 1000, bulb_stop, 0);
+    }
     
     lens_info.job_state = 1;
     info_led_on();
@@ -1520,6 +1541,23 @@
         silent_pic_take(1);
     }
     
+    /* some cameras (5D2) reset the cache fake after FRSP, we need it again */
+    if (bulb_end_addr && capture_err_time_addr)
+    {
+        if ((*(uint32_t*)capture_err_time_addr) != 960000)
+        {
+            cache_fake(capture_err_time_addr, 960000, TYPE_DCACHE);
+        }
+    }
+   
+    if (!bulb_end_addr && capture_err_time_addr)
+    {
+        if ((*(uint32_t*)capture_err_time_addr) != 35000)
+        {
+            cache_fake(capture_err_time_addr, 35000, TYPE_DCACHE);
+        }
+    }
+   
     return 0;
}

@@ -1608,6 +1646,36 @@
         long_exposure_fix_enabled = 1;
     }

+    if (is_camera("500D", "1.1.1"))
+    {
+        bulb_end_addr = 0x3324;
+        capture_err_time_addr = 0xff08afb8;
+    }
+    /*if (is_camera("550D", "1.0.9"))
+    {
+        bulb_end_addr = 0x31D8; // not tested please confirm
+        capture_err_time_addr = 0xFF090174; // not tested please confirm
+    }*/
+    if (is_camera("5D2",  "2.1.2"))
+    {
+        //bulb_end_addr = 0x3174; // cameras with SHOOTMODE_BULB not support FRSP bulb
+        capture_err_time_addr = 0xFF88DB68;
+    }
+   
+    if (!bulb_end_addr && capture_err_time_addr)
+    {
+        SLOWEST_SHUTTER = SHUTTER_30s;
+        cache_lock();
+        cache_fake(capture_err_time_addr, 35000, TYPE_DCACHE); // 30 + 5 seconds
+    }
+   
+    if (bulb_end_addr && capture_err_time_addr)
+    {
+        SLOWEST_SHUTTER = SHUTTER_BULB;
+        cache_lock();
+        cache_fake(capture_err_time_addr, 960000, TYPE_DCACHE); // 15 + 1 minutes
+    }
+
     menu_add("Shoot", silent_menu, COUNT(silent_menu));
     return 0;
}
# HG changeset patch
# User Alessandro Profiti <[email protected]>
# Date 1535191697 -7200
#      Sat Aug 25 12:08:17 2018 +0200
# Branch frsp_bulb
# Node ID bb91393123dd016c4497a12379b7041d4b4b5a73
# Parent  77ea846906c328eaf10c71a0050f8cf6ea2b7780
silen.c: Add FRSP support for dedicated BULB mode (SHOOTMODE_BULB). Credit milank https://bitbucket.org/milank/ml-frsp-long-expo/branch/BULB%20dial%20test#diff

diff --git a/modules/silent/silent.c b/modules/silent/silent.c
--- a/modules/silent/silent.c
+++ b/modules/silent/silent.c
@@ -72,6 +72,7 @@
static int long_exposure_fix_enabled = 0;
static uint32_t bulb_end_addr = 0;
static uint32_t capture_err_time_addr = 0;
+static uint16_t frsp_tv_addr = 0;

/* forward reference */
static struct menu_entry silent_menu[];
@@ -147,9 +148,9 @@
         MENU_APPEND_VALUE(", DNG");
     }
     
-    if (silent_pic_mode == SILENT_PIC_MODE_FULLRES && (shooting_mode != SHOOTMODE_M || is_movie_mode()))
+    if (silent_pic_mode == SILENT_PIC_MODE_FULLRES && ((shooting_mode != SHOOTMODE_M && shooting_mode != SHOOTMODE_BULB) || is_movie_mode()))
     {
-        MENU_SET_WARNING(MENU_WARN_NOT_WORKING, "Full-res pictures only work in Manual (M) photo mode.");
+        MENU_SET_WARNING(MENU_WARN_NOT_WORKING, "Full-res pictures only work in Manual (M) or Bulb (B) photo mode.");
     }
     
     silent_pic_check_mlv(entry, info);
@@ -1156,6 +1157,7 @@
     }
}

+/* scsBulbEnd - it will stop Bulb exposure */
static void bulb_stop()
{
     MEM(bulb_end_addr) = 1;
@@ -1177,10 +1179,10 @@
     
     char* error_msg = 0;

-    if (shooting_mode != SHOOTMODE_M)
+    if (shooting_mode != SHOOTMODE_M && shooting_mode != SHOOTMODE_BULB)
     {
-        error_msg = "Manual (M) mode is required.";
-        goto err;
+       error_msg = "Manual (M) or Bulb (B) mode is required.";
+       goto err;
     }

     if (prop_iso == 0 || prop_shutter == 0)
@@ -1218,6 +1220,18 @@
         goto err;
     }
     
+    int bulb_time = menu_get_value_from_script("Bulb Timer", "Exposure duration");
+   
+    /* Maximum Bulb time with FRSP (I think we don't need more than 15 minutes) */
+    if (prop_shutter == SHUTTER_BULB || (shooting_mode == SHOOTMODE_BULB && frsp_tv_addr))
+    {
+        if(bulb_time > 900) //15 minutes limit
+        {
+            error_msg = "FRSP Bulb - 15 minutes limit.";
+            goto err;
+        }
+    }
+   
     display_off();

     /* we'll need these later */
@@ -1231,16 +1245,36 @@
      * reads PROP_ISO, PROP_SHUTTER and PROP_APERTURE,
      * and creates a "job" object (CreateSkeltonJob)
      */
-    struct JobClass * job = (void*) call("FA_CreateTestImage");
+    void* job = (void*) call("FA_CreateTestImage");

-    unsigned shutter_old = lens_info.raw_shutter;
-    if (shutter_old == SHUTTER_BULB)
+    if (prop_shutter == SHUTTER_BULB || (shooting_mode == SHOOTMODE_BULB && frsp_tv_addr))
     {
-        int bulb_time = menu_get_value_from_script("Bulb Timer", "Exposure duration");
-   
-        if(bulb_time > 900) //15 minutes limit
+        /* some cameras reset the cache fake after FRSP, we need it again */
+        if (bulb_end_addr && capture_err_time_addr)
         {
-            bulb_time = 0;
+            if ((*(uint32_t*)capture_err_time_addr) != 960000)
+            {
+                cache_fake(capture_err_time_addr, 960000, TYPE_DCACHE);
+            }
+        }
+       
+        /* cameras with SHOOTMODE_BULB need fake SHUTTER_BULB */
+        if (shooting_mode == SHOOTMODE_BULB && frsp_tv_addr)
+        {
+          printf("job: %x\n", job);
+          printf("prop_shutter: 0x%x\n", prop_shutter);
+
+          for (int i = 0; i < 1000; i++)
+          {
+               if(prop_shutter == *(uint8_t*)(job + i))
+               {
+                    printf("FA_CreateTestImage Tv Addr : 0x%x\n", i);
+               }
+          }
+
+          ASSERT(*(uint8_t*)(job + frsp_tv_addr) == prop_shutter);
+          *(uint8_t*)(job + frsp_tv_addr) = SHUTTER_BULB;
+          //*(uint8_t*)(job + frsp_tv_addr + 2) = SHUTTER_BULB;
         }
         
         delayed_call(bulb_time * 1000, bulb_stop, 0);
@@ -1464,9 +1498,9 @@
     if (!silent_pic_enabled)
         return 0;

-    /* fullres silent pics only work in M mode,
+    /* fullres silent pics only work in M or B mode,
      * and they may screw up things if triggered while recording. */
-    if (silent_pic_mode == SILENT_PIC_MODE_FULLRES && (shooting_mode != SHOOTMODE_M || is_movie_mode()))
+    if (silent_pic_mode == SILENT_PIC_MODE_FULLRES && ((shooting_mode != SHOOTMODE_M && shooting_mode != SHOOTMODE_BULB) || is_movie_mode()))
         return 0;

     static int silent_pic_countdown;
@@ -1541,23 +1575,6 @@
         silent_pic_take(1);
     }
     
-    /* some cameras (5D2) reset the cache fake after FRSP, we need it again */
-    if (bulb_end_addr && capture_err_time_addr)
-    {
-        if ((*(uint32_t*)capture_err_time_addr) != 960000)
-        {
-            cache_fake(capture_err_time_addr, 960000, TYPE_DCACHE);
-        }
-    }
-   
-    if (!bulb_end_addr && capture_err_time_addr)
-    {
-        if ((*(uint32_t*)capture_err_time_addr) != 35000)
-        {
-            cache_fake(capture_err_time_addr, 35000, TYPE_DCACHE);
-        }
-    }
-   
     return 0;
}

@@ -1649,26 +1666,35 @@
     if (is_camera("500D", "1.1.1"))
     {
         bulb_end_addr = 0x3324;
-        capture_err_time_addr = 0xff08afb8;
+        capture_err_time_addr = 0xFF08AFB8;
     }
     /*if (is_camera("550D", "1.0.9"))
     {
         bulb_end_addr = 0x31D8; // not tested please confirm
         capture_err_time_addr = 0xFF090174; // not tested please confirm
     }*/
+    if (is_camera("50D",  "1.0.9"))
+    {
+        bulb_end_addr = 0x3218;
+        capture_err_time_addr = 0xFF885B14;
+    }
     if (is_camera("5D2",  "2.1.2"))
     {
-        //bulb_end_addr = 0x3174; // cameras with SHOOTMODE_BULB not support FRSP bulb
+        bulb_end_addr = 0x3174;
         capture_err_time_addr = 0xFF88DB68;
+        frsp_tv_addr = 0x64; // cameras with SHOOTMODE_BULB need fake SHUTTER_BULB
     }
     
-    if (!bulb_end_addr && capture_err_time_addr)
+    if (is_camera("5D3",  "1.1.3"))
     {
-        SLOWEST_SHUTTER = SHUTTER_30s;
-        cache_lock();
-        cache_fake(capture_err_time_addr, 35000, TYPE_DCACHE); // 30 + 5 seconds
-    }
-   
+        bulb_end_addr = 0x25294;
+        capture_err_time_addr = 0xFF1BF358;
+        frsp_tv_addr = 0x280; // cameras with SHOOTMODE_BULB need fake SHUTTER_BULB
+     }
+
+
+    /* cache fake "ERROR Take Semaphore" time in "FA_CaptureTestImage" */
+    /* 20 seconds to (15 + 1) minutes */
     if (bulb_end_addr && capture_err_time_addr)
     {
         SLOWEST_SHUTTER = SHUTTER_BULB;
# HG changeset patch
# User Alessandro Profiti <[email protected]>
# Date 1535191978 -7200
#      Sat Aug 25 12:12:58 2018 +0200
# Branch frsp_bulb
# Node ID 50d24ac04eea9e6bda683c249791bf6c87fa9f65
# Parent  bb91393123dd016c4497a12379b7041d4b4b5a73
silent.c: Add FRSP Bulb support to 700D, 550D and EOS M

diff --git a/modules/silent/silent.c b/modules/silent/silent.c
--- a/modules/silent/silent.c
+++ b/modules/silent/silent.c
@@ -1668,11 +1668,11 @@
         bulb_end_addr = 0x3324;
         capture_err_time_addr = 0xFF08AFB8;
     }
-    /*if (is_camera("550D", "1.0.9"))
+    if (is_camera("550D", "1.0.9"))
     {
         bulb_end_addr = 0x31D8; // not tested please confirm
         capture_err_time_addr = 0xFF090174; // not tested please confirm
-    }*/
+    }
     if (is_camera("50D",  "1.0.9"))
     {
         bulb_end_addr = 0x3218;
@@ -1684,7 +1684,16 @@
         capture_err_time_addr = 0xFF88DB68;
         frsp_tv_addr = 0x64; // cameras with SHOOTMODE_BULB need fake SHUTTER_BULB
     }
-   
+    if (is_camera("700D", "1.1.4"))
+    {
+        bulb_end_addr = 0x24960;
+        capture_err_time_addr = 0xff1e1dd8;
+    }
+    if (is_camera("EOSM", "2.0.2"))
+    {
+        bulb_end_addr = 0x3F300;
+        capture_err_time_addr = 0xff1df1fc;
+    }
     if (is_camera("5D3",  "1.1.3"))
     {
         bulb_end_addr = 0x25294;
# HG changeset patch
# User Alessandro Profiti <[email protected]>
# Date 1535194347 -7200
#      Sat Aug 25 12:52:27 2018 +0200
# Branch frsp_bulb
# Node ID 8ee5b34a8aa81b5a4196a90ca22d17f3f90336db
# Parent  50d24ac04eea9e6bda683c249791bf6c87fa9f65
silent.c: FRSP moved cache_fake hack to original position. Fix exposure time bug in 20-32s range introduced from milank code

diff --git a/modules/silent/silent.c b/modules/silent/silent.c
--- a/modules/silent/silent.c
+++ b/modules/silent/silent.c
@@ -1249,15 +1249,6 @@

     if (prop_shutter == SHUTTER_BULB || (shooting_mode == SHOOTMODE_BULB && frsp_tv_addr))
     {
-        /* some cameras reset the cache fake after FRSP, we need it again */
-        if (bulb_end_addr && capture_err_time_addr)
-        {
-            if ((*(uint32_t*)capture_err_time_addr) != 960000)
-            {
-                cache_fake(capture_err_time_addr, 960000, TYPE_DCACHE);
-            }
-        }
-       
         /* cameras with SHOOTMODE_BULB need fake SHUTTER_BULB */
         if (shooting_mode == SHOOTMODE_BULB && frsp_tv_addr)
         {
@@ -1574,7 +1565,16 @@
         
         silent_pic_take(1);
     }
-   
+
+    /* some cameras reset the cache fake after FRSP, we need it again */
+    if (bulb_end_addr && capture_err_time_addr)
+    {
+        if ((*(uint32_t*)capture_err_time_addr) != 960000)
+        {
+            cache_fake(capture_err_time_addr, 960000, TYPE_DCACHE);
+        }
+    }
+
     return 0;
}


Quote from: a1ex on June 03, 2017, 06:25:54 PM
The approach was, indeed, a bit of a maintenance burden, as different camera models use different offsets (so it's easy to make mistakes). However, it is something that can be validated in recent QEMU (which, back then, wasn't advanced enough).

I'd also prefer to have it on top of the patch manager backend - which works pretty well, with one exception: when I take it outside, it gives ERR70. When I get back inside to track the error, it works fine.

For the above reasons, I did not decline the PR, but preferred to wait. Unfortunately, the PR was declined by the author.
Apart from patching bulb address, how to patch cache? Do refactoring this to use patch manager would require much time?
Maybe I can looks how to use it in the free time.

Submitted PR #941 to main repo to have it as reference (Greg PR was discontinued and code can only be found digging deep into this thread).
I hope that is still interesting to someone :)
#117
I was using wrong log to look for 0xC0F13*** and found the correct one, here are MMIO traces regarding RABBIT:

2.743.052  FrontShtDe:ff97d91c:MMIO : [0xC0F13060] <- 0x80000000
2.743.183  FrontShtDe:ff97d91c:MMIO : [0xC0F13064] <- 0x00000E08
2.743.185  FrontShtDe:ff97d91c:MMIO : [0xC0F13068] <- 0x0C9B12DF
2.743.187  FrontShtDe:ff97d91c:MMIO : [0xC0F13050] <- 0x00000014
2.743.189  FrontShtDe:ff97d91c:MMIO : [0xC0F13054] <- 0x00000000
2.743.190  FrontShtDe:ff97d91c:MMIO : [0xC0F13058] <- 0x00000000
2.743.922  FrontShtDe:ff97d91c:MMIO : [0xC0F13048] <- 0x00000003
2.743.924  FrontShtDe:ff97d91c:MMIO : [0xC0F13060] <- 0x00000000
2.743.929  FrontShtDe:ff97d7d0:MMIO : [0xC0F13000] <- 0x00000000
2.743.931  FrontShtDe:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000003
2.743.934  FrontShtDe:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000000
2.743.936  FrontShtDe:ff97d7d0:MMIO : [0xC0F13004] <- 0x00000001
2.866.854  FrontShtDe:ff97d91c:MMIO : [0xC0F13060] <- 0x80000000
2.872.860  FrontShtDe:ff97d91c:MMIO : [0xC0F13000] <- 0x80000000
2.873.155  FrontShtDe:ff97d91c:MMIO : [0xC0F13008] <- 0x00000101
2.873.156  FrontShtDe:ff97d91c:MMIO : [0xC0F1300C] <- 0x00000880
2.873.158  FrontShtDe:ff97d91c:MMIO : [0xC0F13010] <- 0x00000CC0
2.873.160  FrontShtDe:ff97d91c:MMIO : [0xC0F13014] <- 0x00000008
2.873.162  FrontShtDe:ff97d91c:MMIO : [0xC0F13018] <- 0x0C5F020F
2.873.163  FrontShtDe:ff97d91c:MMIO : [0xC0F1301C] <- 0x0000020F
2.873.165  FrontShtDe:ff97d91c:MMIO : [0xC0F13020] <- 0x00000001
2.873.167  FrontShtDe:ff97d91c:MMIO : [0xC0F13050] <- 0x00000000
2.873.169  FrontShtDe:ff97d91c:MMIO : [0xC0F13054] <- 0x00000000
2.873.170  FrontShtDe:ff97d91c:MMIO : [0xC0F13058] <- 0x00000000
2.876.725  FrontShtDe:ff97d91c:MMIO : [0xC0F13000] <- 0x00000000
2.876.729  FrontShtDe:ff97d7d0:MMIO : [0xC0F13000] <- 0x00000000
2.876.732  FrontShtDe:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000003
2.876.735  FrontShtDe:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000000
2.876.737  FrontShtDe:ff97d7d0:MMIO : [0xC0F13004] <- 0x00000001
2.991.160  FrontShtDe:ff97d91c:MMIO : [0xC0F13000] <- 0x80000000
2.995.403  RearShtDev:ff97d91c:MMIO : [0xC0F13000] <- 0x80000000
2.995.483  RearShtDev:ff97d91c:MMIO : [0xC0F13008] <- 0x00000101
2.995.484  RearShtDev:ff97d91c:MMIO : [0xC0F1300C] <- 0x00000280
2.995.486  RearShtDev:ff97d91c:MMIO : [0xC0F13010] <- 0x000003C0
2.995.488  RearShtDev:ff97d91c:MMIO : [0xC0F13014] <- 0x00000000
2.995.490  RearShtDev:ff97d91c:MMIO : [0xC0F13018] <- 0x0077009F
2.995.491  RearShtDev:ff97d91c:MMIO : [0xC0F1301C] <- 0x00000000
2.995.493  RearShtDev:ff97d91c:MMIO : [0xC0F13020] <- 0x00000001
2.995.495  RearShtDev:ff97d91c:MMIO : [0xC0F13050] <- 0x00000000
2.995.497  RearShtDev:ff97d91c:MMIO : [0xC0F13054] <- 0x00000000
2.995.499  RearShtDev:ff97d91c:MMIO : [0xC0F13058] <- 0x00000000
2.995.547  RearShtDev:ff97d91c:MMIO : [0xC0F13000] <- 0x00000000
2.995.551  RearShtDev:ff97d7d0:MMIO : [0xC0F13000] <- 0x00000000
2.995.554  RearShtDev:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000003
2.995.556  RearShtDev:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000000
2.995.559  RearShtDev:ff97d7d0:MMIO : [0xC0F13004] <- 0x00000001
2.997.414  RearShtDev:ff97d91c:MMIO : [0xC0F13000] <- 0x80000000
3.261.519  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13000] <- 0x00000000
3.261.522  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000030
3.261.524  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000001
3.261.527  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13004] <- 0x00000001
3.262.055  **INT-64h*:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000000
3.262.057  **INT-64h*:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000000
3.262.060  **INT-64h*:ff97d7d0:MMIO : [0xC0F13000] <- 0x80000000
3.265.204  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000000
3.265.205  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000000
3.265.209  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13000] <- 0x80000000
3.268.690  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13000] <- 0x00000000
3.268.693  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000030
3.268.694  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000001
3.268.698  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13004] <- 0x00000001
3.269.408  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13000] <- 0x80000000
3.269.411  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13008] <- 0x00000111
3.269.415  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F1300C] <- 0x00000E00
3.269.417  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13010] <- 0x00001500
3.269.420  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13014] <- 0x0000001D
3.269.422  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13018] <- 0x0C5F009F
3.269.424  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F1301C] <- 0x0000006F
3.269.426  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13050] <- 0x00000000
3.269.861  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13000] <- 0x00000000
3.269.863  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000030
3.269.865  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000001
3.269.868  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13004] <- 0x00000001
3.373.401  **INT-5Bh*:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000000
3.373.403  **INT-5Bh*:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000000
3.373.406  **INT-5Bh*:ff97d7d0:MMIO : [0xC0F13000] <- 0x80000000
3.373.616  **INT-6Eh*:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000000
3.373.864  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13048] <- 0x00000000
3.373.866  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F1304C] <- 0x00000000
3.373.869  ImgPlayDrv:ff97d7d0:MMIO : [0xC0F13000] <- 0x80000000

Something to notice about apart the PACK32(Sensor Width - 1, Sensor Height -1)?

I tried EngDrvOut with these values:

      EngDrvOut(0xC0F2E02C, 0x064D0C9B); // here is PACK32(Sensor Width - 1, Sensor Height/2 -1) in canon configuration. Replaced with ML configuration for "slices"
      EngDrvOut(0xC0F13068, 0x0C9B12DF); // FrontShutter PACK32(Sensor Width - 1, Sensor Height -1)
      EngDrvOut(0xC0F13064, 0x00000E08);
      EngDrvOut(0xC0F13050, 0x00000014);
      EngDrvOut(0xC0F13054, 0x00000000);
      EngDrvOut(0xC0F13058, 0x00000000);
      EngDrvOut(0xC0F13060, 0x80000000);
      EngDrvOut(0xC0F13000, 0x80000000);


Unfortunately camera still freezes after taking a silent picture and I'm still trying to figure out what informations to extract from MMIO traces

Quote from: reddeercity on August 23, 2018, 06:26:13 AM
Slices are as far as I know are a set size in the encoder for each camera .
Looking in to those reg's again

  [0xC0F12010] <- 0x0E9F078F
  [0xC0F12014] <- 0x0E9F077F
  [0xC0F1201C] <- 0x00E90078
  [0xC0F12020] <- 0x00E90077


If you do the math on the last reg's  0x00E90078 = 15270008 , 0x00E90077 = 15270007 
then add the Decimal number together you get 30540015 very close to the (see post #417) compressed size for 5d2 5632x3752 = 30842880
if I did my math right . Maybe I'll try "c0f1201c & c0f12020 and see if it works .


2.743.197  FrontShtDe:ff97d91c:MMIO : [0xC0F12010] <- 0x0C5F064F  // PACK32(? , Image Height - 1)
2.743.199  FrontShtDe:ff97d91c:MMIO : [0xC0F12014] <- 0x0C5F063F  // PACK32(? , Image Height - 1)
2.743.203  FrontShtDe:ff97d91c:MMIO : [0xC0F1201C] <- 0x018B00C9 // PACK32(close to image width * 12 , ?)
2.743.204  FrontShtDe:ff97d91c:MMIO : [0xC0F12020] <- 0x018B00C7 // PACK32(close to image width * 12 , ?)

They appears to be used also on 50D. Their values are close to sensor/image size
#118
To my understanding, to make lossless works we need to "tell" to camera via registry values what is the size of the image to process and others possible values to fix image;
Also image is processed into two "slices" from LossLess routine. Are they calculated from sensor size, image size or jpeg size?

Using dfort's spreadsheet as a reference for sensor size, some possible values found in logs and used to make it works could be:

Camera 50D:
Sensor Width:  4832  -> 0x12E0
Sensor Height: 3228  -> 0xC9C
Image Width:   4752  -> 0x1290
Image Height:  3168  -> 0xC60

PACK32(Sensor Width - 1, Sensor Height -1)      -> 0000 1100 1001 1011 (0xC9B) 0001 0010 1101 1111 (0x12DF)   -> 0xC9B12DF
PACK32(Sensor Width - 1, Sensor Height/2 -1)    -> 0000 0110 0100 1101 (0x64D) 0001 0010 1101 1111 (0x12DF)   -> 0x64D12DF


Quote from: ArcziPL on August 21, 2018, 01:46:22 PM
Yes. Or logs done by running io-trace-full build on a real camera.
Unfortunately looking into logs for RABBIT's address range 0xc0f1*, I can find only those lines:

15.702.354     CtrlSrv:ff85de78:82:01: ImgDDev Reg c0f140e0 01b00000
15.702.389     CtrlSrv:ff85de78:82:01: ImgDDev Reg c0f140e4 01b005a0


@a1ex Is again logging 50D a bit different from others camera and need to be taken care of it? (500D logs appears to have it)
How does full-io-trace's logs looks like from D5 ProcessTwoInTwoOutJpegPath cameras (ex. 700D)?

Edit:
Found pack32 sensor size at a different address than expected:

2.505.534  ShootCaptu:ff97d91c:MMIO : [0xC0F080B0] <- 0x0C9B12DF
2.743.185  FrontShtDe:ff97d91c:MMIO : [0xC0F13068] <- 0x0C9B12DF
#119
Quote from: reddeercity on August 21, 2018, 08:00:16 AM
Here my sources code for Lossless on digic 4/5d2 I'm working from eXperimental4kLossless_magic-lantern.zip
also here is the build for Lossless on 5d2 , doesn't work but if someone what to try and see what happen ......
magiclantern-eXperimental4kLossless.2018Aug20.5D2212.zip
Thank you reddeercity, this is what i noticed:

    if (is_camera("5D2", "2.1.2"))
    {
        /* ProcessTwoInTwoOutJpegPath, 5D2 2.1.2 */
        TTL_SetArgs     = (void *) 0xFF1BEB18;      /* fills TTJ_Args struct; PictureSize(Mem1ToRaw) */
        TTL_Prepare     = (void *) 0xFF259B58;      /* called right after ProcessTwoInTwoOutJpegPath */
                                                    /* calls [TTJ] GetPathResources and sets up the encoder for RAW/SRAW/MRAW */
        TTL_RegisterCBR = (void *) 0xFF258E70;      /* RegisterTwoInTwoOutJpegPathCompleteCBR */
        TTL_SetFlags    = (void *) 0xFF0AA9D4;      /* called next, with PictureType as arguments */
        TTL_Start       = (void *) 0xFF259E3C;      /* called next; starts the EDmac transfers */
        TTL_Stop        = (void *) 0xFF259E74;      /* called right after sssStopMem1ToRawPath */
        TTL_Finish      = (void *) 0xFF259EAC;      /* called next; calls UnlockEngineResources and returns output size from JpCoreCompleteCBR */
    }

Cross-checked with 50D and 7D from me and dfort and they appears to be good, they appears point out at the same functions.
This mean that is less likely to be bad but can't be sure because we don't have lossless working on these camera...

Quote from: dfort on August 21, 2018, 12:39:17 AM
I tried finding it in the 50D using pattern matching but couldn't do it. It might be buried somewhere in the log files when shooting CR2 files.
Same here, as it's a "ProcessTwoInTwoOutJpegPath" camera instead of "ProcessTwoInTwoOutLosslessPath", it I tried looking for string regarding Jpeg printed by "ImgPlayDrv" from logs:

    if (is_camera("50D", "*"))
    {
        Setup_DecodeLosslessRawPath = (void *) 0xff962c60; //<<<<<< ImagePlayDriverTask ProcessID = 6 - not sure if need to start from here or if the bottom one are better, but this is in the same address range like the one from D5 cameras
    //    Setup_DecodeLosslessRawPath = (void *) 0xffa17290; //DEC RequestDecodeJpeg(mode:1) 193
    //    Setup_DecodeLosslessRawPath = (void *) 0xffa16e68; //DEC SetParameterDecodeJpeg 148
        Start_DecodeLosslessPath    = (void *) 0xFF960AE8; //StartJpegDecoding 614
        Cleanup_DecodeLosslessPath  = (void *) 0xff963e2c; //ClearDecodeJpegPath 414
    }

Maybe a better idea is to sneak peek address from a working d5 camera using ProcessTwoInTwoOutJpegPath (700D, 650D, M, 100D).
What do you think about @dfort?

Tried this with 50D with no results, but I wasn't expecting to works:

    if (is_camera("5D2", "*"))
    {
        EngDrvOut(0xC0F12010,        width    - 1                 );  /* 0xB8F     */
        EngDrvOut(0xC0F12014, PACK32(width    - 1,  height/2    - 1));/* 0xF6D0B8F */
        EngDrvOut(0xC0F1201C,        width/10 - 1                 );  /* 0x127     */
        EngDrvOut(0xC0F12020, PACK32(width/10 - 1,  height/20 - 1));  /* 0x18A0127 */
    }

@reddeercity can you explain how you got these address and values? Is due to this procedure?
#120
Commented "total_movie_gain *= _raw_lv_get_iso_post_gain();" in a similar way of an old reddeercity's post.

It show option for lossless compressed DNG, but camera freezes right after taking a lossless picture (full-res or simple).
It print overexposed areas but does't print info about compression (max_compressed_size infobox)




Maybe is because it miss EngDrvOut() code for 50D? or it is not necessary?
#121
Used 7D as a reference for pattern matching and come to this:

    if (is_camera("50D", "*"))
    {
        TTL_SetArgs     = (void *) 0xFF195924;      /* fills TTJ_Args struct; PictureSize(Mem1ToRaw) */
        TTL_Prepare     = (void *) 0xFF236248;      /* called right after ProcessTwoInTwoOutJpegPath */
                                                    /* calls [TTJ] GetPathResources and sets up the encoder for RAW/SRAW/MRAW */
        TTL_RegisterCBR = (void *) 0xFFA3555C;      /* RegisterTwoInTwoOutJpegPathCompleteCBR */
        TTL_SetFlags    = (void *) 0xFF0A2534;      /* called next, with PictureType as arguments */
        TTL_Start       = (void *) 0xFFA3652C;      /* called next; starts the EDmac transfers */
        TTL_Stop        = (void *) 0xFFA36564;      /* called right after sssStopMem1ToRawPath */
        TTL_Finish      = (void *) 0xFFA3659C;      /* called next; calls UnlockEngineResources and returns output size from JpCoreCompleteCBR */
    }

@dfort can you double check please? Mostly used strings to find adjacent code and then checked argument number/function code.
First one is a bit different as argument numbers passed to function, but look like it is the right one.

Code related to resources:

    else if (is_camera("50D", "*"))
    {
        uint32_t resources[] = {
            0x00000 | edmac_channel_to_index(edmac_write_chan),
            0x10002 | edmac_channel_to_index(edmac_read_chan),
            0x30000,    /* read  connection  0 */
            0x20005,    /* write connection  5 */
            0x20016,    /* write connection 16 */
            0x50003,
            0x5000d,
            0x5000f,
            0x5001a,
            0x80000,
            0x90000,
            0xa0000,
            0x160000,
            0x130003,
            0x130004,
            0x130005,
            0x130006,
            0x130007,
            0x130008,
            0x13000c,
            0x130010,
            0x130011,
            0x130012,
            0x130013,
            0x130014,
            0x130015,
            0x130018,
            0x13001a,
            0x13001b,
            0x13001c,
        };

Is the write_channel set to 0 good instead 0x10003/0x10004 from logs?

Can't find stubs for decompress_init using 7D... Im'a bit stuck... Also what are all the "EngDrvOut(...)" stuff?

@reddeercity Can you update you repository please? It should be very useful to understand what to change from the dfort's repo (won't compile also for 5d2)
#122
Quote from: reddeercity on August 20, 2018, 06:03:25 AM
Great ! can you post the full Logs some where ?
Cr2TakeDetailed Cr2ReviewDetailed

Is this code working for 5d2/7d? I got this when I tried to compile dfort's branch for 50D:

lv-img-engio.o: In function `digic_iso_step':
/Users/alex/Desktop/pullML/dfort/platform/50D.109/../../src/lv-img-engio.c:847: undefined reference to `_raw_lv_get_iso_post_gain'
make: *** [magiclantern] Error 1


Can I have rom dumps of both camera? I would like to patter match stubs for 50D
#123
Quote from: reddeercity on August 19, 2018, 02:22:51 AM
Edit: a1ex , the 50D logs don't have the same level of Resources details as 5d2 , 550d is that the way it is on 50D or did I miss something when I compiled "io_trace_full" for 50D ?
Quote from: a1ex on August 19, 2018, 04:46:28 PM
Something like this should work for all cameras (in dm-spy-extra.c):


    STUB_ENTRY(CreateResLockEntry, 2 | RET, CreateResLockEntry_log),
    STUB_ENTRY(LockEngineResources, 1, LockEngineResources_log),
    STUB_ENTRY(UnLockEngineResources, 1, UnLockEngineResources_log),


Will test some more and enable it by default.

9.633.183  FrontShtDe:ff882068:96:05: ->sdsPostJob InsertStageJob(32186)
9.633.233  FrontShtDe:ff8a2830:00:03: [JOB] PostNextStage (ID = 32186, Class = 150, Pos = 4)
9.633.324  FrontShtDe:ff8820dc:96:05: sdsPostJob Start(32186)
9.633.360  FrontShtDe:ff882108:96:05: sdfGetDevelopDevType(32186)(0x7000)
9.633.406  FrontShtDe:ff88217c:96:05: ENABLE(Poster:0)(Ohyear:0)
9.633.452  FrontShtDe:ff88148c:96:05: sdfAllocateMemoryDevelopSuite(32186)
9.636.780  FrontShtDe:ff882c90:96:05: sdsMem1ToRawCompression
9.638.127  FrontShtDe:ff880e4c:96:05: sdfExecuteMem1ToRawPath(32186)
9.638.227  FrontShtDe:ff881060:96:05: sdfExecuteMem1ToRawPath(32186)Å©(SemOK)
9.638.261  FrontShtDe:ff881098:96:05: ProcessTwoInTwoOutJpegPath(32186)
9.638.326  FrontShtDe:ffa3620c:00:00: *** LockEngineResources(72089c) x31:
9.638.371  FrontShtDe:00090c34:00:00:      1)    10002 (read channel 0xa)
9.638.399  FrontShtDe:00090c34:00:00:      2)        3 (write channel 0x3)
9.638.422  FrontShtDe:00090c34:00:00:      3)        4 (write channel 0x4)
9.638.454  FrontShtDe:00090c34:00:00:      4)    30000 (read connection 0x0)
9.638.488  FrontShtDe:00090c34:00:00:      5)    20005 (write connection 0x5)
9.638.519  FrontShtDe:00090c34:00:00:      6)    20016 (write connection 0x16)
9.638.543  FrontShtDe:00090c34:00:00:      7)    50003 (?)
9.638.566  FrontShtDe:00090c34:00:00:      8)    5000d (?)
9.638.588  FrontShtDe:00090c34:00:00:      9)    5000f (?)
9.638.612  FrontShtDe:00090c34:00:00:     10)    5001a (?)
9.638.639  FrontShtDe:00090c34:00:00:     11)    80000 (?)
9.638.663  FrontShtDe:00090c34:00:00:     12)    90000 (?)
9.638.685  FrontShtDe:00090c34:00:00:     13)    a0000 (?)
9.638.710  FrontShtDe:00090c34:00:00:     14)   160000 (?)
9.638.736  FrontShtDe:00090c34:00:00:     15)   130003 (?)
9.638.760  FrontShtDe:00090c34:00:00:     16)   130004 (?)
9.638.785  FrontShtDe:00090c34:00:00:     17)   130005 (?)
9.638.810  FrontShtDe:00090c34:00:00:     18)   130006 (?)
9.638.836  FrontShtDe:00090c34:00:00:     19)   130007 (?)
9.638.861  FrontShtDe:00090c34:00:00:     20)   130008 (?)
9.638.888  FrontShtDe:00090c34:00:00:     21)   13000c (?)
9.638.912  FrontShtDe:00090c34:00:00:     22)   130010 (?)
9.638.937  FrontShtDe:00090c34:00:00:     23)   130011 (?)
9.638.962  FrontShtDe:00090c34:00:00:     24)   130012 (?)
9.638.987  FrontShtDe:00090c34:00:00:     25)   130013 (?)
9.639.011  FrontShtDe:00090c34:00:00:     26)   130014 (?)
9.639.035  FrontShtDe:00090c34:00:00:     27)   130015 (?)
9.639.058  FrontShtDe:00090c34:00:00:     28)   130018 (?)
9.639.085  FrontShtDe:00090c34:00:00:     29)   13001a (?)
9.639.109  FrontShtDe:00090c34:00:00:     30)   13001b (?)
9.639.137  FrontShtDe:00090c34:00:00:     31)   13001c (?)


This looks much better for our needs :)
#124
Quote from: a1ex on August 13, 2018, 06:27:02 PM
- load edmac.mo during the experiment (the log contains some lines telling you to do so). It's a nitpick because the information printed is a bit redundant (I can figure it out from MMIO lines), but it's still nice to have.

Here is the same procedure but with edmac.mo copied from nightly (as the io-trace-full build doesn't have it):
Cr2TakeEdmac and Cr2ReviewEdmac

Also no bunch of zeroes int these logs... Don't know why it happened previously

Had a look to find read and write channels and the appears a bit different from reddeercity's logs
#125
Submitted a new pull request with changes for crop_rec_4k and another one to update manual_lens_info branch (also here lua_fix can be merged into the official repo's branch, to make it easier to see what's changed).

To make the first one I started with a merge from manual_lens_info and then removed all manual_lens_info diffs (except the one not included in lua_fix like property.c, modules.c... they are in first commit) from files by reverting changes to crop_rec_4k_mlv_snd revision.
After that I started to reapply diffs to implement ELNS processing and committed into separate changesets.

Is this an acceptable way to guarantee the maintainability that @g3gg0 was looking for?