Questions about ML AUTO ISO (in Av mode)

Started by teaspoon, February 07, 2013, 01:35:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

teaspoon

So here is my very slightly modified code for the ML AUTO ISO: http://pastebin.com/ZEdePUc9

I've managed to set the maximum ISO to 6400 (what I want it at, although this would be nicer as a menu option but I don't have skills for that yet) by setting the raw iso to 120 (using the lookup table in lens.h)

Next, I want to change the desired shutter speeds from the ones that are currently available in the menu system. I want to add more gradual increments to the shutter speed options and have more of them.

This line appears above the code I put in the pastebin:
CONFIG_INT("auto.iso.av.tv", ml_auto_iso_av_shutter, 3);
I'm not sure what it's doing exactly as I can't find 'auto.iso.av.tv' when I grep the source code for it anywhere else. Is it pulling a value out of the menu system? Is it an integer value index starting at 0?

It doesn't look like the code here sets any shutter speed itself so it must be seeing how much different the shutter speed is from the one the camera has set. It looks like 'ref_tv' is the required shutter speed, 'e' is the error between the required and the one set by the camera, 'er' is a transformation of scale from shutter speed to ISO. Then it looks like the adjustment on raw iso by this code happens again and again until the camera sets the shutter speed as close to ref_tv as it can (maybe this improves accuracy over trying to do this in one step through calculation). Am I getting this all correctly? Could anyone explain the details of the ranges.

For example, what does 88 and 8 represent here?: int ref_tv = 88 + 8*ml_auto_iso_av_shutter;
and, how does this scale transformation work exactly?: int er = (e+4)/8*8;
why isn't the correction done in one step as opposed to the multiple steps it looks like will be carried out through the program loops?

also, and this is an add on question: I'm using the following two lines to debug but I have to switch liveview on to see the output and ML AUTO ISO doesn't work in liveview.
bmp_printf( FONT_LARGE, 30, 30, "Testing: %d", max_iso );
bmp_printf( FONT_LARGE, 30, 60, "Testing2: %d", ml_auto_iso_av_shutter );
is there a better way of printing values to see what the code is doing? Is liveview the only way to get feedback?

This is the first mod I'm trying so apologies if the questions are a little lame. Also, let me know if I need to change the way I ask questions here in any way. Thanks!
ML for stills: 5DII, 16-35 f2.8 II, 50 f1.4, 100 f2.8, 135 f2, 300 f4, 1.4X extender.

Buzzz57

I'm happy to see someone else struggling with the ML_AUTO_ISO code.  :)

Regarding the the calculation of aperture and shutter values, you might take a look at lens.c and lens.h files. There are tables and formulas to convert between real world values and raw values.

You're analysis is correct, ML doesn't force speed or shutter, it just compares the values calculated by the camera and compares it to the values you have set in your ML menu. If it doesn't fit, it applies a correction to the Iso, and does the test again until the speed or aperture is OK.

a1ex

CONFIG_INT's are variables saved in the config file (used in menu).

Exposure values are stored internally in 1/8 EV steps (so 8 units are 1 EV). You already found the lookup tables.

(e+4)/8*8 is rounding to 1 EV.

To print values, you may also try NotifyBox (the output is persistent for a couple of seconds).

teaspoon

Thanks for the replies... I'll see what I can do with this.

However, you didn't say why the correction was done multiple times? Wouldn't one adjustment to the iso be enough for the camera to set the shutter speed to how you want it? Is there something I'm missing? Does it work out more accurately if done like this?

Also, what significance is the constant 88? I've looked at the tables for a few minutes but can't figure it out :(
ML for stills: 5DII, 16-35 f2.8 II, 50 f1.4, 100 f2.8, 135 f2, 300 f4, 1.4X extender.

Buzzz57

I think there are 2 reasons :
1) to check if the new Iso value gives the expected shutter speed.
2) because except if you lock exposure, the ISO will have to adapt each time you change the exposure.