G1X + others ISO override issues (was Re: rawopint.lua) - page 3 - General Discussion and Assistance - CHDK Forum supplierdeeply

G1X + others ISO override issues (was Re: rawopint.lua)

  • 65 Replies
  • 21240 Views
*

Offline reyalp

  • ******
  • 12542
Advertisements
For review - patch to enable G1X ISO adjustment value to be passed to the rawop.meter function.


This adds a new value to the camera_sensor structure, which rawop_meter can use to cook the meter calculation.
The value is set by the patched G1X code for each shot.


reyalp - is this ok, can you think of a better way to handle this?
Thanks for doing this. I moved it here since it seems more development oriented, I'm trying to leave the sticky thread for users of the script.

I'll have to think about it more, but I'm wary of making meter return different values that get_pixel or histogram, and gluing it into all of them seems hairy. It seems like ideally it would be better as a factor in exposure calculation (get_canon_weird_iso_adjustment96() :p) but I haven't looked at what it would take to do that in practice. If it was in the exposure calculation, it wouldn't need to be converted from apex96.

If it was available as a separate factor, helpers could be added to rawoplib.lua to provide adjusted versions of meter, get_pixel etc.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3155
    • Photos
For review - patch to enable G1X ISO adjustment value to be passed to the rawop.meter function.


This adds a new value to the camera_sensor structure, which rawop_meter can use to cook the meter calculation.
The value is set by the patched G1X code for each shot.


reyalp - is this ok, can you think of a better way to handle this?
Thanks for doing this. I moved it here since it seems more development oriented, I'm trying to leave the sticky thread for users of the script.

I'll have to think about it more, but I'm wary of making meter return different values that get_pixel or histogram, and gluing it into all of them seems hairy. It seems like ideally it would be better as a factor in exposure calculation (get_canon_weird_iso_adjustment96() :p) but I haven't looked at what it would take to do that in practice. If it was in the exposure calculation, it wouldn't need to be converted from apex96.

If it was available as a separate factor, helpers could be added to rawoplib.lua to provide adjusted versions of meter, get_pixel etc.


Thanks for the feedback.


I was trying to make it compatible with existing scripts without having to add any extra logic.


I agree, it makes the meter reading technically not reflect the actual capture; but it does make it match the resulting image files.
If the raw hook was somehow moved to after the image data gets cooked the result would be the same; but you would never know.

Edit: This is no longer needed. I have been able to disable G1X raw data cooking, so meter & DNG now match the JPG/CR2 images.

Phil.

« Last Edit: 08 / July / 2017, 00:37:11 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline philmoz

  • *****
  • 3155
    • Photos
Re: G1X + others ISO override issues (was Re: rawopint.lua)
« Reply #22 on: 06 / July / 2017, 06:30:37 »
Do you notice this:
Lapser fix works in rawopint but not in isoinc. We got different results. Why? We don’t know
This was lapsers answer

I'm not sure sure how isoinc does this, but the timing is critical when the script can do this and have it work. It has to be in continuous mode while hook_raw is ready and before hook_raw.continue().


The reason rawopint works differently to isoinc with lapser's version of set_sv96 is because his version of rawopint never calls set_sv96, so it never calls the CHDK code to switch the camera to Auto ISO mode. The rawopint script starts from whatever Tv/Sv/Av values are set on the camera before running the script.


The isoinc script always calls the CHDK set_sv96 function to set the initial Sv override value, which executes the code to change to Auto ISO.


I have confirmed that changing iosinc to not call set_sv96 first makes it behave the same as rawopint.


It's probable that the Auto ISO setting is not correct for the G1X or needs to be modified somehow. This code dates back to the early days of CHDK, so an update might be in order  ???


I have tried removing the Auto ISO setting in set_sv96 and it appears that I can still set Sv overrides in CHDK. This also seems to remove both the black point change and the raw data cooking. This will need further testing and verification; but may ultimately be a better solution  :D

Edit: Further testing shows that this will not work - the G1X still needs the Auto ISO mode set for CHDK overrides to work. Without it the script always starts at the Canon settings, this is ok for rawopint; but not much use for anything else. It also only works in continuous mode.

Phil.
« Last Edit: 07 / July / 2017, 04:54:15 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: G1X + others ISO override issues (was Re: rawopint.lua)
« Reply #23 on: 06 / July / 2017, 07:38:40 »
The reason rawopint works differently to isoinc with lapser's version of set_sv96 is because his version of rawopint never calls set_sv96, so it never calls the CHDK code to switch the camera to Auto ISO mode. The rawopint script starts from whatever Tv/Sv/Av values are set on the camera before running the script.

The isoinc script always calls the CHDK set_sv96 function to set the initial Sv override value, which executes the code to change to Auto ISO.

Interesting. Only the initial call of set_sv96 is the different.
Spend a lot of time with isoinc to test lapser changes. Good to know what the reason was.
 
I have confirmed that changing iosinc to not call set_sv96 first makes it behave the same as rawopint.

Good to know what that I didn’t made something wrong with my test.

I have tried removing the Auto ISO setting in set_sv96 and it appears that I can still set Sv overrides in CHDK. This also seems to remove both the black point change and the raw data cooking. This will need further testing and verification; but may ultimately be a better solution

Great. Thanks that you take care about it…

M100 100a, M3 101a, 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd


*

Offline philmoz

  • *****
  • 3155
    • Photos
Re: G1X + others ISO override issues (was Re: rawopint.lua)
« Reply #24 on: 07 / July / 2017, 20:30:49 »
After more firmware spelunking I can now completely disable the ISO cooking on my G1X  :D


So no more shooting at 1/2 ISO and having the camera adjust the JPG/CR2 images.
It still does the black level change to 2048, haven't found an override for this yet.


This means:
- rawopint and isoinc work for all modes
- rawop meter calculates correct value without needing any ugly hacks
- CHDK DNG files match the JPG/CR2 brightness.


Once I'm satisfied there are no other side effects, I will commit this to SVN.

Edit: Fix for all G1X versions is now in SVN revision 4853.

Phil.
« Last Edit: 08 / July / 2017, 03:08:18 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: G1X + others ISO override issues (was Re: rawopint.lua)
« Reply #25 on: 08 / July / 2017, 03:17:03 »
After more firmware spelunking I can now completely disable the ISO cooking on my G1X  :D 

Do you think this investigation could help to fix other cams like S110 or SX50?
 
This means:
- rawopint and isoinc work for all modes
- rawop meter calculates correct value without needing any ugly hacks
- CHDK DNG files match the JPG/CR2 brightness.
Great job 

Once I'm satisfied there are no other side effects, I will commit this to SVN.
Edit: Fix for all G1X versions is now in SVN revision 4853.
 
I’m looking forward to test it…
M100 100a, M3 101a, 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline philmoz

  • *****
  • 3155
    • Photos
Re: G1X + others ISO override issues (was Re: rawopint.lua)
« Reply #26 on: 08 / July / 2017, 03:44:16 »
After more firmware spelunking I can now completely disable the ISO cooking on my G1X  :D   
Do you think this investigation could help to fix other cams like S110 or SX50?



Possibly, if its the same problem.


I can see similar code in the firmware for both the S110, and SX50.
I can try creating test builds with the fix if you want to try them.


Are the firmware versions in your signature correct?


Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: G1X + others ISO override issues (was Re: rawopint.lua)
« Reply #27 on: 08 / July / 2017, 03:55:37 »
I can see similar code in the firmware for both the S110, and SX50.
I can try creating test builds with the fix if you want to try them.

Great…

Are the firmware versions in your signature correct?
 
Yes, but do not hurry. I have no chance to test it in the next 8 days.
May be @udo can test S110..
M100 100a, M3 101a, 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd


*

Offline philmoz

  • *****
  • 3155
    • Photos
Re: G1X + others ISO override issues (was Re: rawopint.lua)
« Reply #28 on: 08 / July / 2017, 04:00:20 »
Test version for S110 1.03a.


Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline philmoz

  • *****
  • 3155
    • Photos
Re: G1X + others ISO override issues (was Re: rawopint.lua)
« Reply #29 on: 08 / July / 2017, 04:01:25 »
Test version for SX50HS 1.00c.


Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)