Author Topic: CMOS/ADTG/Digic register investigation on ISO  (Read 553641 times)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12256
  • Emergencies only
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #775 on: August 01, 2014, 01:51:38 PM »
Just download it again.

Stedda

  • Hero Member
  • *****
  • Posts: 504
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #776 on: August 01, 2014, 01:53:16 PM »
Thank you Sir...  :)
5D Mark III -- 7D   SOLD -- EOS M 22mm 18-55mm STM -- Fuji X-T1 18-55 F2.8-F4 & 35 F1.4
Canon Glass   100L F2.8 IS -- 70-200L F4 -- 135L F2 -- 85 F1.8 -- 17-40L --  40 F2.8 -- 35 F2 IS  Sigma Glass  120-300 F2.8 OS -- 50 F1.4 -- 85 F1.4  Tamron Glass   24-70 2.8 VC   600EX-RT X3

l_d_allan

  • Senior
  • ****
  • Posts: 258
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #777 on: August 04, 2014, 07:10:22 AM »
OK, I'll put that cube next to a light bulb and lock everything down like the last test.

Any time I've used that cube I've gotten blown highlights and pure black.

The Datacolor SpyderCube is one of the neatest little devices I've come across. Overpriced, however.

BTW, it isn't difficult to make your own:
  • small box, like what smaller Canon lens come in
  • cut out hole, and paint interior black for the "black trap"
  • maybe put in black unmatched sock
  • put stainless steel spoon next to it for spectral highlights.
  • gray gaffers tape is decent for gray card

http://berean.zenfolio.com/dual_iso/h101028e1#h101028e1

http://berean.zenfolio.com/dual_iso/h101028e1#h3e0c323b

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3565
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #778 on: August 08, 2014, 05:59:35 AM »
On the 6D I'm only seeing ADTG2, CMOS and Digic, no ADTG4/6.  Do you think this is 6D specific, or simply wrong/missing stub?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12256
  • Emergencies only
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #779 on: August 08, 2014, 09:01:05 AM »
Right, I see the same thing in the logs. Probably the 6D has only one chip, while most other cameras have two?

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #780 on: August 08, 2014, 09:56:48 AM »
Did some testing with the "adtg_gui.mo" on 6d.
Changing the iso in canon menu gives the following numbers for CMOS[3]
Weird thing is, why doesn't use iso 6400 0x66 ? (checked it twice, it really uses 0x77)
And do you know what will happen if I override it to 0x88 or 0x99  ??? Will my precious cmos chip catch fire  :D
And how do you get the iso's lower than 100, it's not done in the CMOS register is it, how to approach ?

ISO     CMOS[3]
100      0x0
200      0x11
400      0x22
800      0x33
1600      0x44
3200      0x55
6400      0x77
12800    0x77
25600    0x77
    Hi1    0x77


EDIT: when I override it to 0x66 it shows ISO6400 in the exif, but I get exact same exposure results as ISO 800, weird  :o

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12256
  • Emergencies only
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #781 on: August 08, 2014, 10:43:53 AM »
These are some "hidden" ISOs - 5D3 has them too, and a few of them seem cleaner then Canon's.

Can you do a dynamic range test for all of them? (just like you did before). Set ISO 100 in Canon menu, use a manual lens, then set CMOS[3] to 0x00, 0x11 ... 0xFF => 16 ISOs (all based on Canon's ISO 100, and we'll only change one parameter).

I'd also like the same test on 5D3. Here you would set CMOS[0] to 0x003, 0x113 ... 0xFF3. Don't change any other settings, just ISO 100, manual lens, and this testing procedure. If you can't compile ML yourself, ask for a build here.

These ISOs are applicable in both photo and movie; you may test any of these modes, but if you can do all of them, that's even better.

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #782 on: August 08, 2014, 12:26:57 PM »
Did test some cmos[3] overrides, from 0x00 to 0xff (CMOS did not catch fire  :D).

CMOS[3] override on 6d   
Setting         ISO according to full well capacity numbers.
0x00                 100
0x11                 200
0x22                 400
0x33                 800
0x44                 1600
0x55                 3200
0x66                 640  :o  Weird one, full well capacity is between iso 800 and iso 400, looks like a "native" iso 640.
0x77                 6400
0x88                 100
0x99                 200
0xaa                 400
0xbb                 800
0xcc                 1600
0xdd                 3200
0xee                 1250   :o  Weird one, full well capacity is between iso 800 and iso 1600, looks like a "native" iso 1250.
0xff                   6400

The ISO settings that aren't used by Canon(the bold ones) don't seem much better/cleaner/different (But I did the test "Quick and dirty" so my measurement may not be accurate enough)
SNR curves are available on my google drive:
https://drive.google.com/folderview?id=0B1BxGc3dfMDabkZybDB6YldXR3M&usp=sharing

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12256
  • Emergencies only
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #783 on: August 08, 2014, 12:55:06 PM »
Ha, that was fast.

0xFF even seems to be a bit cleaner than 0x77, but it would be nice to have some more data points in the dark areas on the graph.

The dynamic range is from the intersection between SNR curve (red line) and the X axis at 0 EV (the bold one) - that is, from the point where SNR = 1, until the far right on the X axis (look for the last red pixel on the curve), where you have the white level (clipping point).

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #784 on: August 08, 2014, 02:32:14 PM »
I remeasured the 0x77 and 0xff with more shadow points, now the difference is even smaller then before.
See the "remeasured" files on google drive:
https://drive.google.com/folderview?id=0B1BxGc3dfMDabkZybDB6YldXR3M&usp=sharing

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #785 on: August 08, 2014, 03:03:20 PM »
Some other stuff for 6d
CMOS[0] Default value is 0x593, changing it seems to do nothing.

CMOS[1] and CMOS[2] seems to be used for vertical and horizontal offset (didn't test it though)

CMOS[3] controls the analog iso (see posts above)

CMOS[4] on the 6d seems to give control over (digitally?) pulling back a few stops.
CMOS[4] default value = 0x4f0
CMOS[4] set to value 0x8f0, for the first digit, 4 and 8 can be used and it seems that 8 pulls back the whole histogram by 2 stops.  (Is this Canon's Auto lighting optimizer ?)
CMOS[4] set to value 0x800 seems to only pull back the highlights, so the second digit can give use some highlight pulling/crushing

CMOS[5] didn't test it yet, but probably does control vertical squeeze

CMOS[6] gives control over horizontal squeeze, not interesting.
Although it could be used to squeeze an 16:9 to a 4:3 ratio and record in 4:3 ratio and stretch it back to 16:9 in post, sort of fake anamorphic format(means lower bitrate for 16:9 aspect ratio and 1.33x stretch).
EDIT (The squeeze is probably used for smaller raw types, sRaw ?)

CMOS[7] and CMOS[8] gives weird dark frames/blackframes/readoutframes stuff ?
CMOS[8] default value 0xa
CMOS[8] value 0xf and 0x7 seems to give some blackframe or dark frame or something

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #786 on: August 08, 2014, 03:10:42 PM »
Some other interesting registers, don't know what normal values are for them and what values I should try, they do however change with iso setting, so maybe some fine-tuning for iso ?

EDIT: these four registers, seems to be some amplifiers and are per color channel, the first two are Red and Blue(or vice versa), the last two seems to be the two Green channels
EDIT 2 :Looking at the pictures now in lightroom, every 4th pixel is missing, so it's not used per color channel.
   
ISO               ADTG2[8882]   ADTG2[8884]   ADTG2[8886]   ADTG2[8888]
L1                    0x416                   0x416           0x416        0x417
100                  0x416                   0x416           0x416        0x417
200                  0x400                   0x400           0x400        0x400
400                  0x422                   0x422               0x423        0x423
800                  0x42d                   0x42d           0x42e        0x42e
1600                0x440                   0x440           0x441        0x442
3200                0x485                   0x484           0x484        0x484
6400                0x4a9                   0x4a8           0x4a7         0x4a7
12800              0x952                    0x950           0x94e           0x94e
25600              0x12a4                   0x12a0           0x129c        0x129c
Hi1                  0x12a4                   0x12a0           0x129c        0x129c

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #787 on: August 08, 2014, 04:35:14 PM »
Those are the registers this entire discussion is about. They control some amplifier stage that is between CMOS and ADC. We can get about 0.5 EV more DR by turning them down. You might want to read the first couple of pages of this thread at least.

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #788 on: August 08, 2014, 04:43:27 PM »
Read about the first ten pages of this thread, but didn't know it was about exact these registers.
Since the 5d3 has a nice module "iso_regs.mo" - 5D3 only
A lot of talk is only about one ADTG register, not 4 of them. So a bit confusing for me  :-[

But now I start to get the idea a little, the trick is to pull these numbers down.
They're in the 400 range, 250 seems to be a good starting point...
The sweet spot has to be found by trial and error with the raw-diag tool I Guess ?


ayshih

  • Contributor
  • Senior
  • *****
  • Posts: 266
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #789 on: August 08, 2014, 05:12:18 PM »
EDIT: these four registers, seems to be some amplifiers and are per color channel, the first two are Red and Blue(or vice versa), the last two seems to be the two Green channels
EDIT 2 :Looking at the pictures now in lightroom, every 4th pixel is missing, so it's not used per color channel.
You might be interested in this description that I wrote in another thread.  Because of how the colors are distributed between the vertical lines, you are somewhat correct in that the red pixels are affected by only 2 of the 4 registers (and the blue pixels are affected only by the other 2), but all 4 registers will affect green pixels.

For the purposes of the investigation in this thread, we've been setting all 4 registers to the same value, but Canon has some fine-tuning differences (as you can see in your table), which were presumably/hopefully determined from their calibration of the electronics.
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #790 on: August 08, 2014, 05:39:11 PM »
Juicing up the battery now, so will try some more later on  :D
But theoreticaly , some very low iso's could be achieved by lowering the 400 number in these registers.
Has anyone tried using the number 50 in these registers ? Did it look like an ISO 12,5 ?

ayshih

  • Contributor
  • Senior
  • *****
  • Posts: 266
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #791 on: August 08, 2014, 05:48:45 PM »
That won't accomplish what you're thinking because the ADTG/DFE amplification comes after the CMOS amplification.  The brightness at which you saturate in the first stage will still be saturated in the second stage, so you really can't reduce the gain of the second stage all that far before it becomes pointless (the effective ISO stops decreasing).
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #792 on: August 08, 2014, 05:53:41 PM »
Hmmm.... :(, shall try later on, and see the results...

Other suggestions to get low ISO ?

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #793 on: August 08, 2014, 08:16:26 PM »
Here are some curves from fake iso's below 100 (with lower ADTG gain).
https://drive.google.com/folderview?id=0B1BxGc3dfMDaU1NJd0dHUWNsNGc&usp=sharing

Used iso 100 as base iso and set registers to 300, 250, 200, 100 and 25.
Creating ISO's of about 75, 63, 50, 25 and 6.

Did get pink highlights, and it seems that highlights are cut off(by about using 250(ISO 63) or something, have to try some real photo's with it, but I think you could get away with ISO 25 if you want.

Seems like 275 is the number to go with if you care about dynamic range.
https://drive.google.com/folderview?id=0B1BxGc3dfMDaNGszU2g5aHBfTUE&usp=sharing
Did curves for ISO 200, 800 and 6400.
Dynamic range with ISO 200 -> 11,80 eV
Dynamic range with ISO 800 -> 11,36 eV
Dynamic range with ISO 6400 -> 9,60 eV

EDIT: Didn't alter any black or white levels, should I do that  :-\ and where do I do that ?

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #794 on: August 10, 2014, 12:53:59 PM »
This "adtg_gui.mo" is very addicting.
Is there some overview page where known registers and the effects they have are reported ?
 

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3565
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #795 on: August 10, 2014, 01:07:37 PM »
Hit page 1 of this thread and start reading  :P

My quick observations show that we will probably only get 0.4EV on the 6D.  ADTG [FE] is at 0 by default.
However, I'm seeing 11.4 EV of DR at stock, so 11.8 EV is decent enough I guess.

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1474
  • 6d - Nightly build user
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #796 on: August 10, 2014, 01:42:37 PM »
Hit page 1 of this thread and start reading  :P
Was already afraid that this topic is the way all findings in these registers are organized...

The 0.4 eV extra is what I get too, fits perfectly with the theoretical values graph A1ex posted before:


I'm also messing around a lot with the 8 CMOS registers.
CMOS[0], I have no idea what it does.
CMOS[6], is set on 400 in video mode (3x pixelbinning horizontal ?), setting it to 800, gives a stretched image and shows real pixels horizontal, if you make the image 3 times smaller horizontal in post, the aspect ratio is normal.
CMOS[7] seems to be used by switching from 1080p to 720p...

Have you done some other register testing ?

josepvm

  • Member
  • ***
  • Posts: 212
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #797 on: August 10, 2014, 09:47:36 PM »
After finding enough time to read most of this long (and quite intimidating ;)) thread I have done my first tests in my 500D using the iso-research branch and adtg_gui module.

I can play modifying C0F0[819c] (SaturateOffset) and also CMOS[0] (to change analog ISO), and everything seems to work.

But if I try to modify C0F0[8034] (BlackLevel/BW offset) my camera hangs.  As soon as I press "Set" button to modify it, the menu screen gets frozen, I cannot move with arrow keys, or exit with LV button. The shutter button works, but only to get a blank screen, and I cannot shutdown the camera, I need to remove the battery.

I am missing something? ( do I need a specific camera setup?). It happens equally with manual or EF lenses.

The procedure I have followed is:

1 - "hg clone" the iso-research branch.
2 - modify "Makefile_user" with CONFIG_GDB=y and Makefile.modules.default to include adtg_gui and raw_diag in the build.
3 - modify "adtg_gui.c" to include missing values for 500D, "ENGIO_WRITE_FUNC" and "ENG_DRV_OUT_FUNC"

Code: [Select]
else if (is_camera("500D", "1.1.1")) // http://www.magiclantern.fm/forum/index.php?topic=6751.msg70325#msg70325
    {
        ADTG_WRITE_FUNC = 0xFF22F8F4; //"[REG] @@@@@@@@@@@@ Start ADTG[CS:%lx]"
        CMOS_WRITE_FUNC = 0xFF22F9DC; //"[REG] ############ Start CMOS"
ENGIO_WRITE_FUNC = 0xFF190CF4;
        ENG_DRV_OUT_FUNC = 0xFF190B84;
    }


I have copied these values from stubs.S, and double checked them, comparing the stubs with ROM dumps from other cameras, the stubs are Ok.



With these values adtg_gui is able to find DIGIC registers. Everything seems to be working fine ... but I cannot edit C0F0[8034]  :(

And according to Greg's posts in this thread, modifying C0F0[819c] and C0F0[8034] is the only way so far to get some DR gain on 500D (0,33EV).

Any thoughts? I am doing something wrong?






Greg

  • Contributor
  • Hero Member
  • *****
  • Posts: 589
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #798 on: August 10, 2014, 10:36:37 PM »
I know this problem. Number of known regs is too large.
The easiest solution to remove unnecessary in adtg_gui.c


josepvm

  • Member
  • ***
  • Posts: 212
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #799 on: August 10, 2014, 10:54:18 PM »
The easiest solution to remove unnecessary in adtg_gui.c

Where? Are you refering to this struct list, at the beginning of "adtg_gui.c" ?

Code: [Select]
/* todo: check for duplicates */
static struct known_reg known_regs[] = {
    {DST_CMOS,      0, 0, "Analog ISO (most cameras)"},
    {DST_CMOS,      1, 0, "Vertical offset"},
    {DST_CMOS,      2, 0, "Horizontal offset / column skipping"},
    {DST_CMOS,      3, 0, "Analog ISO on 6D"},
    {DST_CMOS,      4, 0, "ISO-related?"},
    {DST_CMOS,      5, 0, "Fine vertical offset, black area maybe"},
    {DST_CMOS,      6, 0, "ISO 50 or timing related: FFF => darker image"},
    {DST_CMOS,      7, 0, "Looks like the cmos is dieing (g3gg0)"},
    {DST_ADTG, 0x8000, 0, "Causes interlacing (g3gg0)"},

...