Thanks for looking into this phil. My impression from c_joerg's post was that exposure of canon jpegs also jumps at the 320 switch, which suggests something triggered by CHDK overrides, rather than just canon doing something funky under the hood with the raw data.
Also noted in http://chdk.setepontos.com/index.php?topic=11081.msg121572#msg121572 at somewhat higher ISO, the value reported by get_prop(props.SV) stops matching the value set with overrides, somewhat similar to what happens if ISO_BASE was wrong.
I'd lay odds that Canon are doing something funky with the ADC.
Attached are two more images:
- the first is 2 secs @ ISO 400 (Canon manual settings), DNG converted with black point at 2048
- the second is 2 secs @ ISO 800 (CHDK settings), DNG converted with black point at 512
As you can see they look pretty much the same.
When using CHDK ISO overrides, the DNG and JPEG ISO values do not match once the ISO goes over 320. The DNG files always shows 1/2 the selected ISO and has 1/2 the exposure of the JPEG. For some reason the image is being exposed at 1/2 the selected ISO; but the JPEG is then overexposed to compensate. This is why I used ISO 800 in the sample attached image with CHDK settings - the ISO reported in the file is 400.
If I use Canon M mode to manually set Tv >= 1.3 seconds and ISO >= 320 then I get bad DNG files as described earlier.
If I used CHDK overrides to do the same thing, the DNG files are fine regardless of the ISO selected (but I get the exposure issue above).
I have no idea why setting the Tv and Sv values in the script does not behave like setting them in the CHDK overrides menu.
Phil.