50D and 7D DUAL_ISO in MOVIE mode PORTING thread

Started by dlrpgmsvc, October 14, 2014, 11:54:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dlrpgmsvc

This thread is for concentraring all the findings, discoveries, and tries to port the dual_iso feature in movie mode for the 50D and 7D (currently it works only in photo mode on both cameras).
All bits of useful informations on how to obtain this goal are welcome here.

Why 50D and 7D together in a single thread ? Just because 50D has the same display filter method used on 7D, so, if someone discovers something on 50D or 7D, then the other camera can benefit immediately of the same findings.

Everyone that tried or is currently active into porting this feature on the above cameras, is invited to post here his current efforts, in order to be of help for others and to be helped from others also.

This first post is kept updated with the last findings highlights and with the current porting status.


50D CURRENT STATUS : NOT PORTED YET
7D CURRENT STATUS   : NOT PORTED YET


GENERAL UP-TO-DATE FINDINGS :

[1] The unified method used into current "dual_iso" module, regarding dual iso in MOVIE mode, seems not applicable for 50D and 7D.
     A completely NEW method seems to be discovered and developed for these cameras. But works are in progress to validate this thinking.
     As stated by 1% : "the only real hope would be finding other regs for dual ISO that directly configure the digic/sensor".

[2] 50D has the same display filter method used on 7D, so, if someone discovers something on 50D or 7D, then the other camera can benefit immediately
      of the same findings. So, feel free to take advantage of findings found on both cameras, without concentrating only on a specific one when reading there.

[3] Starting from 7D to discover how to do dual iso for movies, is the hard but only way if you own only the 7D. Instead, based on point [2] of the findings section,
     it is a better and easier way to find how to do this on 50D, and then, once discovered, the porting on 7D will be likely an (almost) copy-paste matter.


7D UP-TO-DATE FINDINGS :

[1] Based on 1% and other valuable developers current experiences, SLAVE debugging will get you nowhere : Dual_ISO for photo on the 7D is on the master, so likely it is also for video.
                                     

GENERAL UP-TO-DATE DIRECTIONS :

[1] You can find the dual_iso module sources by following this source path : " Magic Lantern / modules / dual_iso / "

[2] You can open the file " dual_iso.c " and find the line number 675 where the function " static unsigned int isoless_init() " is defined.
     Inside this function, you can find all the constants definitions subdivided by camera model. Concentrate on the block that is for 50D or 7D.
     You can see there is a constant declaration serie named " PHOTO_CMOS_ISO_xxxx ", where " xxxx " are various names: these are for PHOTO mode.
    We have to find the constants named " FRAME_CMOS_ISO_xxx ", present on other camera models blocks definitions, that are for VIDEO mode.

[3] The values to find are the following (WARNING: be careful trying to find them, it seems that a new method must be developed, read further down) :
     FRAME_CMOS_ISO_START = it is the CMOS register 0000 - for LiveView, ISO 100 (check in movie mode, not photo!)
     FRAME_CMOS_ISO_COUNT = it is the number of different ISO values from ISO 100 to xxxx, where xxxx is the max ISO value allowed for 50D or 7D
     FRAME_CMOS_ISO_SIZE  = it is the distance between ISO 100 and ISO 200 CMOS registers addresses, in bytes
     You can simply add these constants declarations into the 50D or 7D block and compile, then you can see if the values found are right or not by running ML on camera,
     by activating dual iso in movie mode and start recording, then evaluating the resulting recorded video file. Beware: possible camera brickings are your
     responsability only. Nor me or ML can be held responsible for any damage caused by these experimentations on your camera or equipment.

[4] Example PHOTO findings for 550D (WARNING: be careful reading this, because it seems that a new method must be developed, read further down) :
     By examining the disassembly of the 550D ROM, the following was found :
                  ADDRESS
     00 0000 406941E4               = 100     ISO
     00 0024 406941F6               = 200     ISO
     00 0048 40694208               = 400     ISO
     00 006C 4069421A               = 800     ISO
     00 0090 4069422C               = 1600   ISO
     00 00B4 4069423E               = 3200   ISO
     Hence, the registers values are :
     PHOTO_CMOS_ISO_START = 0x406941E4;  // CMOS register 0000 - for photo mode, ISO 100
     PHOTO_CMOS_ISO_COUNT = 6;                 // from ISO 100 to 3200
     PHOTO_CMOS_ISO_SIZE  = 18;                 // distance between ISO 100 and ISO 200 addresses, in bytes

[5] On 50D or 7D SLAVE, just compile with the switch GDB=Y and use the ADTG_LOG module. 1% have the addresses in his repo where all the functions are :
      https://bitbucket.org/OtherOnePercent/tragic-lantern-6d/src/80d0d727990254e45184b2a4e57aef5ae182a23b/modules/adtg_log/adtg_log.c?at=unified
      Copy the 50D or 7D addresses to whatever ML you are compiling and get rid of whats there. the modules only work for one camera at a time.
      As per 1%, uncomment whatever the ones you need. The reg on 50D or 7D should show up in the logs pretty quickly, ISO value matches photo mode values. Changing it did nothing
      so you need to find a completely new method to dual ISO or see what is going on. For more info on this method, see point [3] under "INSTRUMENTS YOU CAN USE IN GENERAL
      (50D AND 7D SLAVE MODE ONLY)" under here. However, if you are on a 7D, BEWARE on point [1] under "7D UP-TO-DATE FINDINGS": in SLAVE mode there is nothing to find, so you
      have to use this method under MASTER processor, but in this case you have to "sign" the BIN (see point [1] on "7D UP-TO-DATE DIRECTIONS" just here below).


7D UP-TO-DATE DIRECTIONS :

[1] Please, note that 7D has TWO processors inside. So, debugging is a bit more complicated: two different processors (the "master" and
     the "slave") must be debugged separately in order to find complete informations.
     The processor on which ML is based is the SLAVE. It can run ML code with a simple compiled BIN file, like for the majority of the other cams.
     The MASTER processor, on the other hand, can run ML code only if the BIN file is "signed" with a particular private "signing key" (known only to few
     ML developers, because it cannot be of public domain, peraphs for Canon copyright reasons). So, if you want to debug the MASTER processor,
     you have not only to compile the BIN as usual (by using the same procedures for the SLAVE processor), but you have, as the final step, to
     "sign" it, making it becoming a file with .FIR extension. You can try to ask devs for the key, or you can ask them to sign your BIN for you, but
     they have to agree to your request, and this is not assured by any way. Compiling for MASTER is useful (for now) only to find registers changes and others
     manipulations done by the master, but then, once discovered these operations, you can implement them down to the SLAVE without problems.
     Like 1% says, you can read/write small amounts of data to the master through canon provided mechanisms (using the SLAVE processor), and this is enough
     for headphone/fps and few registers. Taking over canon functions (ie: to do GDB or registers logging on MASTER) needs our own code running there (on MASTER).
     You can follow directions and you can start compiling for the MASTER processor in the 7D MASTER processor branch here:
     https://bitbucket.org/hudson/magic-lantern/src/a27e3b9df491d1bfa2cba70def5fb873486980e1/platform/7D_MASTER.203/?at=unified

                                             
INSTRUMENTS YOU CAN USE IN GENERAL (50D AND 7D SLAVE MODE ONLY) :
                                                       
[1]  On dmilligan advice, you can use a more visually engaging and immediate debug method by using ADTG_GUI module you can find here:
       https://bitbucket.org/hudson/magic-lantern/src/a27e3b9df491d1bfa2cba70def5fb873486980e1/modules/adtg_gui/?at=unified
       you can compile it and then you can put the compiled files inside the other modules directory, then you can select it from the ML modules menu.
       Also, you need a special compilation switch when compiling the main BIN file: follow the directions inside the above link.

[2]  As on 1% advice, GDB (a log file debugging method) can be used in order to discover behaviors and registers on 50D and 7D. GDB is a debugging
      environment that is loaded into camera like the normal ML main program and in LIEU of it. This writes debug data to a
      log file inside the memory card, from which you can analyze data inside it by downloading and reading it through a PC and a card reader.
      More info and files to download in order to get started can be found here: http://www.magiclantern.fm/forum/index.php?topic=2940.0.

[3] You can use ADTG_LOG module. It's similar to ADTG_GUI module as on point [1], but it's not visual, and instead of writing registers on screen, it
     writes results on a log file inside a directory located on camera memory card. Also, you cannot write into register as you can do in ADTG_GUI.
     You can find 1% version on his repository here (disregard it's for 6D):
     https://bitbucket.org/OtherOnePercent/tragic-lantern-6d/src/80d0d727990254e45184b2a4e57aef5ae182a23b/modules/adtg_log/adtg_log.c?at=unified
     or, alternatively, you can find it on the unified original ML repository here:
     https://bitbucket.org/hudson/magic-lantern/src/a27e3b9df491d1bfa2cba70def5fb873486980e1/modules/adtg_log/?at=unified


INSTRUMENTS YOU CAN USE FOR 7D MASTER ONLY :

[1] Same as point [2] under previous section (read it for more info) but there is a difference:
      in order to work inside the 7D MASTER processor, based on 1% instructions, you need to set up code in the 7D master branch
      (there are skeletons in there for other registers), but then you need to "sign" the bin in order for it to be run on MASTER: more info on this
      can be found above under "7D UP-TO-DATE DIRECTIONS" at point [1]. The 7D MASTER branch can be found on 1% repository there:
      https://bitbucket.org/OtherOnePercent/tragic-lantern-2.0/src/fe768c4e30178ab7625346d8530e6b135c92a11d/platform/7D_MASTER.203/?at=unified
      or it can be found also under the official ML repository there :
      https://bitbucket.org/hudson/magic-lantern/src/a27e3b9df491d1bfa2cba70def5fb873486980e1/platform/7D_MASTER.203/?at=unified

[2] Same as point [3] under previous section (read it for more info) but there is a difference:
      in order to work inside the 7D MASTER processor, based on 1% instructions, you need to "sign" the resulting BIN in order to make it running on
      MASTER processor: more info on this process can be found above under "7D UP-TO-DATE DIRECTIONS" at point [1].
If you think it's impossible, you have lost beforehand

1%

Where did you find the addresses in 550D rom? I thought these all had to be logged. 50D and 5DII don't have changing regs for LV iso. g3gg0 logged the photo regs on the master proc. SO the question is, did he ever find changing LV iso regs. And finally 550D has display state? 7D/50D/5DII does not.

dlrpgmsvc

For 1% :

The addresses was found by mk11174 more than one year ago. You can find his post here: http://www.magiclantern.fm/forum/index.php?topic=5582.900 and scroll down towards the end of the page. How they was found I don't know, and for this reason I wrote to him a PM. When he will reply, I will post here the method he used. I don't know if he logged these values or if he simply reviewed the sources for some clues, and where. I'm waiting a reply from him.

Do you have a link or hints on how to discover changing regs for LV for ISO? Also: do you think that an absence of changing regs when changing ISO is a sure clue that the camera cannot use dual iso in movie mode, or is it simply a lack of clear grips on where we can hang in order to achieve this feature? In the first case we will cease to put efforts on this, but in the latter we can still search, even with more difficulties, perhaps by manually searching the sources for clues. If dual_iso module works by manipulanting registers, then the lack of changing registers is a clear sign that it will never work if no registers are changing, but what if another method can be implemented for those cameras that have no changing registers? What is your thinking?

550D has LCD state, you can find it here: http://magiclantern.wikia.com/wiki/Properties/550D by searching for "LCD STATE" inside the page. How this register can be involved into this finding problem ?
If you think it's impossible, you have lost beforehand

mk11174

Quote from: dlrpgmsvc on October 14, 2014, 02:10:18 PM
The addresses was found by mk11174 more than one year ago. You can find his post here: http://magiclantern.fm/forum/index.php?topic=5582.900 and scroll down towards the end of the page. How they was found I don't know, and for this reason I wrote to him a PM. When he will reply, I will post here the method he used. I don't know if he logged these values or if he simply reviewed the sources for some clues, and where. I'm waiting a reply from him.
Dang! lol, that was awhile ago, I have messed with so much code getting more and more brained fried along the way, I really can't remember exactly the process, I think it was some log file I had to look through for certain repeating numbers that led me to find what was ISO 100, 200, 400, 800, 1600, 3200 and then the numbers stayed the same when changing to the higher ISO's so those were considered digital I think and only the lower ones from 100 to 3200 were analog.

I dont remember what I had to do to get the log file though, sorry, to long ago.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

tonybeccar


1%

yea, you had to log them with GDB. I did like 2 or 3 cameras the same way. 50D didn't have the changing regs just 1 reg which did not produce what you wanted if changed. 7D is very much like 50D, same display filter method, etc. the chance for this working is like 20%. logging on the master would prove it completely

the only real hope would be finding other regs for dual ISO that directly configure the digic/sensor. 50D or 5DII would be waay easier to work on since they are single proc.


dlrpgmsvc

@ mk11174 : Hi ! Many thanks for your intervention ! Don't worry if you don't remember, it's normal. Many thanks anyway !

@ 1% : Many thanks for the GDB hint and for the findings updates so far ! I updated the head post ! On the link I posted on the head here, I read that GDB ML part have to be changed in order to be adapted for different cameras. Do you have the modifications to be done in order to make it working for 7D ? Do you have hints on how to debug the master and the (slave?) processor separately ? Also: do exists a debugger for this GDB (for the Windows PC side) that works in Windows OS instead of the one proposed that works inside Linux OS ? Do you have more info on the 50D single register found and, if already discovered, more info on the 7D register ? Many thanks again ! 50D is another interesting camera, and I will soon open a "dual_iso for movie mode porting" thread also for her ! Because, like you said, if one developer can break-in in 7D or 50D solution, then the other camera can benefit immediately of the discoveries made: same display filter method. So they can be paralleled.
If you think it's impossible, you have lost beforehand

1%

The GDB in ML makes logs, you don't need to connect to it from the PC side.

On 7D, set up code in the 7D master branch (there are skeletons in there for other regs), sign a bin so it runs.

On 50D, just compile GDB=Y and use the ADTG_LOG module. I have the addresses in my repo where all the functions are. Uncomment whatever the ones you need.

The reg on 50D should show up in the logs pretty quickly, ISO value matches photo mode values. Changing it did nothing so you need to find a completely new method to dual ISO or see what is going on.  I also posted it to the forum before or its in some old commits.

dlrpgmsvc

Great !


Some confirmation requests, just to not take the wrong files up :

[1] So, do I have to use your branch here: https://bitbucket.org/OtherOnePercent/tragic-lantern-2.0/src/fe768c4e30178ab7625346d8530e6b135c92a11d/platform/7D_MASTER.203/?at=unified (do this is your current and right repo?)
or do I have to use the official repo branch here : https://bitbucket.org/hudson/magic-lantern/src/a27e3b9df491d1bfa2cba70def5fb873486980e1/platform/7D_MASTER.203/?at=unified   ?

[2] What do you mean by "sign a bin so it runs" ? Do you mean to simply compile it ?

[3] For 50D addresses where all functions are, Do you mean here: https://bitbucket.org/OtherOnePercent/tragic-lantern-2.0/src/fe768c4e30178ab7625346d8530e6b135c92a11d/modules/adtg_log/?at=unified   -->  inside "adtg_log.c" source file ? (just to be sure not to take the wrong repo)


And some other questions :

[4] We are currently debugging the MASTER processor (as the branch name implies). How to debug the (secondary? slave?) one ? If no one knows how, do there are clues on how to hook it ?

[5] Do there are chances to find interesting actions into the secondary processor, even perhaps these dual iso registries manipulations ? Or do it has been cleared that slave proc is uninteresting ?
If you think it's impossible, you have lost beforehand

dmilligan

I think it's probably easier to just use the adtg_gui from the ISO research branch (which should already have all the necessary stubs for all cameras). You don't have to go look through logs, you can see the registers in the menu as they are changing. And then you can play with them to see what they do. You can actually use adtg_gui itself to get a dual ISO shot by tweaking the registers in the right way. This is how I took the first dual ISO shot on the 1100D when I was trying to port it.

1%

https://bitbucket.org/OtherOnePercent/tragic-lantern-6d/src/80d0d727990254e45184b2a4e57aef5ae182a23b/modules/adtg_log/adtg_log.c?at=unified

has all the addresses, you probably won't be able to do master side on 7D since it has to be a SIGNED bin... ie a fir

copy the 50D addresses to whatever ML you are compiling and get rid of whats there. the modules only work for one camera at a time.


dmiligan's suggestion is good too if the address shows up there. I haven't tried to use it for iso regs on non display state cameras.

dlrpgmsvc

@ dmilligan : many thanks for this hint ! I will try it surely in first place ! I updated the head post


@ 1% :

[1] About "signing" 7D code, I found this thread : http://www.magiclantern.fm/forum/index.php?topic=7795.0, where it's stated that we can't sign a .BIN to make it a .FIR. Do this is correct ? But I don't understand if the tool to sign the BIN is a thing that only some ML coders knows, or if it's a thing that no one in ML pool knows or have in his hands. Also, if we can compile regular official 2.3 ML and nightly BINs for the 7D branch, and they works, this implies that all we know how to sign 7D BINs, right ? And this should be clearly written inside a makefile, right ? Here there is written that we CAN sign BINs for 7d : http://magiclantern.wikia.com/wiki/FAQ. So ? What is the thing that can stop us (and me) into trying to sign a bin, as you wrote "you probably won't be able to do master side on 7D since it has to be a SIGNED bin... ie a fir" ? Can you head me to a link where I can learn the process to sign a BIN for 7D ? Many thanks !

[2] We are currently debugging the MASTER processor (as the branch name implies). How to debug the (secondary? slave?) one ? If no one knows how, do there are clues on how to hook it ? Do it would be of interest ?
If you think it's impossible, you have lost beforehand

dmilligan

1. You need the private encryption keys to sign the bins. I don't even know who has these, but I imagine at least the main developers do, but they cannot be made public (there are public scripts to sign and create fir files, but they need the keys to work). You can ask for the keys privately (IDK if they will be willing to give them out to you or not) or break the encryption yourself. Or you could ask for someone who can sign the bins to compile this for you.

2. AFAIK, the slave is the default, it's the one that the standard ML runs on. If you want to debug on the slave, just compile the regular 7D branch with CONFIG_GDB=y. But it sounds like from what 1% has said, that this will probably be a dead end (and it's already been tried).

1%

Yep, pretty much, you won't be able to sign it unless you independently figure out the encryption. But 99% sure you have to figure it out for 50D/5DII before it works on the 7D.

Slave debugging will get you nowhere. Dual_ISO for photo on the 7D is on the master.

dlrpgmsvc

Many thanks dmilligan and 1% for all this info! I'm reporting and organizing all this hints in the head post! Another question: if, as dmilligan say, ML is running on slave processor, how can dual iso for photo be up and working if (as 1% say) it must be programmed on master proc?
If you think it's impossible, you have lost beforehand

dmilligan

I don't think you have to be running on the master to set the registers. It's just that to find them we need to see what the master is doing since apparently Canon uses the master to set these registers.

1%

You can read/write small amounts of data to the master through canon provided mechanisms. Enough for headphone/fps/a few regs. Taking over canon functions ie to do GDB or register logging needs our own code running there.

dlrpgmsvc

Many thanks !
So, beside starting simple debug on 50D in first place, if I want to start debugging with adtg_gui on the master, do it is as simple as to compile it (producing a BIN) and then sign it (if I manage to find how) (producing a FIR) ? Do this automatically tells to the 7D to load and execute the code on MASTER processor ? Or do this involves other operations and steps ?
If you think it's impossible, you have lost beforehand

1%

The modules run on the slave, its actually pretty complex to port ADTG gui to the master.

oc_masta

Hey, if you guys need a guinea pig or help from a layman like me, I'm here to help. Have a 50d and 7d.
Love what you guys are doing.

StefanB

Love the Idéa with Dual ISO, I have 5D2 and 50D and it would be exellent to be able to use the feature during video recording. Tell me if you want me to test anything :) Keep it up guys!

johansugarev

Any update from the developers on wether this is going to happen?

smok29


N/A

Adtg_gui module didn't support 7d so I've asked Audionut to compile a working build to run tests with. I'm interested in this as well, I found a little bug that lets us record normal aspect 48 fps mlv that doesn't need stretching in post, so between that and dual iso video, 7d would be a raw beast.
7D. 600D. Rokinon 35 cine. Sigma 30 1.4
Audio and video recording/production, Random Photography
Want to help with the latest development but don't know how to compile?

mssrihari1

hey guys! why is this forum so silent?! Hope its the silence before the storm! :D