CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD - page 58 - Creative Uses of CHDK - CHDK Forum

CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD

  • 704 Replies
  • 196844 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #570 on: 18 / August / 2013, 15:54:24 »
Advertisements
Hmmm.

PTM_SetCurrentItem(0x800a,0) -> auto iso
PTM_SetCurrentItem(0x800a,1) -> iso 80
PTM_SetCurrentItem(0x800a,2) -> iso 100
PTM_SetCurrentItem(0x800a,14) -> iso 1600

On the a3200. Changes the UI ISO control for real. PTM_GetCurrentItem is the next candidate for the CHDK "debug data display"...


How to use:

1) The PTM event procedures are registered by the following call:
Code: [Select]
=return call_event_proc("UI.CreatePublic")
2) One of the IDs around 0x800a will be the ISO control. At least I think so.
How to find it:
Set ISO to the lowest value using the Canon control.
Execute
Code: [Select]
=return call_event_proc("PTM_GetCurrentItem",0x800a)If 0x800a is the ISO control, the return value will be 1. If it's not 1, choose another value (these IDs start from 0x8000, and end around 0x8081, other IDs will cause an assert).

If ISO is set to 1600 using the Canon UI, the correct ID will return 14.

Someone could hack together a script that continuously scans an ID range, that could help with finding the correct ID for the ISO control.
« Last Edit: 18 / August / 2013, 16:47:06 by srsa_4c »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #571 on: 18 / August / 2013, 17:07:58 »
I'm not totally sure I understand this, but I would expect the limits have to do with the specific conditions.
I added an edit to that post, perhaps that could provide a better explanation.

Quote
On my A540, the live view gets noticeably brighter up to 5 seconds at ISO 80, but stops around 1 sec for ISO 400
Sounds reasonable.  Camera model behavior must be different.

Quote
M mode should try to make the live view representative of what you would actually see with the selected exposure settings, but obviously there are limits to how much it can crank up the gain and exposure time when capturing the actual live view image.
That's exactly what happens and what I noticed as I mentioned just earlier that my S90 at ISO 3200 it does not get any brighter for Tv longer than 1/2s.  That's normal and not an issue, it was just an informational flag.

Quote
I don't see any way to update it directly from CHDK after setting ISO_MODE. Based on looking the camera log, I'm pretty sure there is not an levent for this.
Oh darn!

Quote
On a540, it does appear to update if I change the Tv or Av value in the Canon UI. Since your camera doesn't actual have an adjustable aperture any more (? I think) perhaps telling it you changed the Av is a way to get it to re-evaluate?
Correct.  I am a bit afraid of trying to move any mechanics for a possibility of lens error.  Iris is not covered by my MECHA SIM during normal (fully assembled camera) operation.

Quote
=post_levent_to_ui('PressAvExpButton') will jump the canon control to the Av setting, but I don't see an obvious way to jump back to Tv, though once you know which one you are on, you should be able to use left/right.
It looks like I would have to paly with "buttons," which is the kludge with my method (ie reset_ISO() in code below), and is what I'm trying to avoid and fix.

Quote
I added an isomode option to shoot in chdkptp r398. This simply sets the ISO_MODE for the shot, it won't directly help you with the "live view" ISO.
I'd like to know more about this one.  Doesn't shoot -tv -av -sv already do that on-the-fly ??  I use it all the time and it certainly works for me (in the code you can see I keep -av pegged at 2 so I don't move any mechanics).  What is different about the new feature from the current version?   I think that function is the crown jewel of CHDKPTP (srsa should try it -- he'll get hooked!)   

Quote
Don't really understand what you mean. Setting ISO_MODE outside of the shooting process won't make overrides not work. If you post the actual code you used, we might be able to help.
I think I see your point.  ISO override does lock up when I use your shoot -tv -av -sv after your set propcase call.  For example, if I change the liveview by your recent propcase procedure (or by srsa's procedure), then all subsequent shots with shoot -tv -av -sv will expose at the ISO value I set via that last set propcase call.  Basically, if the ISO override didn't get suppressed in shoot -tv -av -sv, you'd have a 100% solution!  ... it's feels like it's almost there.  By the way,  I never use the SHOOT button in CHDKPTP, so maybe there it works OK ... I don't know and it's not useful for me.  I hope this helps.

Code:
Code: [Select]
function reset_ISO()  -- After taking a with myshoot(), Canon ISO is left at the override value.  Function resets liveview Canon ISO after taking a shot
con:execwait('click "set"')
sys.sleep(400)
con:execwait('click "left"')
sys.sleep(200)
con:execwait('click "right"')
sys.sleep(200)
con:execwait('click "set"')
sys.sleep(400)
end

-- usage: >!local_shoot(1/8, 2.8, 400, "C:\\CANON_S90\\")
function local_shoot(tv, av, canon_sv, destdir)
local sv = canon_sv / 1.6461 -- ISO correction for S90 so that CHDK EXIF data is the same as Canon.
cli:execute('shoot -tv='..tv..' -av='..av..' -sv='..sv..'')
sys.sleep(2400)

local l,r=con:execwait('return get_meminfo().free_size') 
print(" free", r)   
printf(" free: %s\n",r)   
dcimdl(destdir, true, false)
reset_ISO()
end

function shoot_SticK(Tv, Sv)
local_shoot(Tv, 2, Sv, "G:\\CANON_S90\\")  -- Av is always 2 not to move mechanics.
end

Hmmm.
PTM_SetCurrentItem(0x800a,0) -> auto iso
PTM_SetCurrentItem(0x800a,1) -> iso 80
PTM_SetCurrentItem(0x800a,2) -> iso 100
PTM_SetCurrentItem(0x800a,14) -> iso 1600
Please give me some time to decipher what you have here.
« Last Edit: 18 / August / 2013, 17:18:41 by SticK »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #572 on: 18 / August / 2013, 17:28:39 »
Someone could hack together a script that continuously scans an ID range, that could help with finding the correct ID for the ISO control.
I'll try this by hand.

Quote
If ISO is set to 1600 using the Canon UI, the correct ID will return 14.
For example if I set Canon ISO to 1600, peek at each location, and find one that returns 14 (0x14, right?), then I can stop there and try other ISO values to see if they follow.  Correct?

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #573 on: 18 / August / 2013, 18:06:43 »
@srsa_4c

ISO PTM event location attached.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #574 on: 18 / August / 2013, 18:33:45 »
ISO PTM event location attached.
Congrats, you found it. You can now try

Code: [Select]
=return call_event_proc("PTM_SetCurrentItem",0x8006,<one of the available values>)
Note that apparently no-one else has used this method yet, be extra careful: if you manage to set an invalid value, you may brick the camera... Only set ISO this way if the current camera mode offers native control over ISO (obviously M mode is one such mode).
This setting will act as if you set it through the native Canon control (e.g. the camera will save it when you switch it off).

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #575 on: 18 / August / 2013, 19:35:31 »
if you manage to set an invalid value, you may brick the camera
Hmmm ...  before I try anything, how do I interpret that?  Could that be a permanent brick?  ... such writing something to persistent RAM that makes the cam irrecoverable even after a reboot?

Quote
This setting will act as if you set it through the native Canon control (e.g. the camera will save it when you switch it off).
Very interesting.  Depending on how you reply, I will decide which of the two cams is more expendable.

*

Offline reyalp

  • ******
  • 14128
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #576 on: 18 / August / 2013, 19:59:37 »
It looks like I would have to paly with "buttons," which is the kludge with my method (ie reset_ISO() in code below), and is what I'm trying to avoid and fix.
The point is that a quicker, less complicated kludge might be possible.
Quote
I'd like to know more about this one.  Doesn't shoot -tv -av -sv already do that on-the-fly ??
Yes. ISO mode sets it in a different way (roughly equivalent to setting ISO in the Canon menu), which may result in different behavior of the live view, if you leave out the -sv command. The normal sv override relies on putting the ISO into "auto" mode. Using ISO_MODE would also allow you to use Canon units directly (e.g. 80, 100 etc).

Since the normal ISO override relies on putting ISO in "auto" but "auto" doesn't really make sense in manual mode, that may explain some of the weirdness you see in the live view behavior.
Quote
I think I see your point.  ISO override does lock up when I use your shoot -tv -av -sv after your set propcase call.  For example, if I change the liveview by your recent propcase procedure (or by srsa's procedure), then all subsequent shots with shoot -tv -av -sv will expose at the ISO value I set via that last set propcase call.
It sounds like you are saying ISO override (-sv) is broken if you set ISO_MODE with a propcase call before shooting started? This is very strange, since ISO override should itself sets ISO_MODE to 0 (auto).... but I observe the same behavior on a540. This may have been broken in the recent ISO override changes.

edit:
OK, it looks like if you set ISO_MODE, the override for the next shot fails. The following shot after that works. Not clear why, it looks like ISO_MODE does get set to 0, but maybe it's too late.
« Last Edit: 18 / August / 2013, 20:26:25 by reyalp »
Don't forget what the H stands for.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #577 on: 18 / August / 2013, 20:27:43 »
The point is that a quicker, less complicated kludge might be possible.
Sure, that would be OK so long as it's solid and be accessed from any OSD state, because mine relies on having the ISO icon highlighted before leaving the SET menu.  That's a serious kludge.

Quote
Using ISO_MODE would also allow you to use Canon units directly (e.g. 80, 100 etc).
In my code you can see that I do the inverse ISO function prior to your shoot call, so I think I'm OK there, ie when I ask for ISO 400 say, I do get 400 in EXIF, etc.

Quote
This is very strange, since ISO override should itself sets ISO_MODE to 0 (auto).... but I observe the same behavior on a540.
It's good I'm not alone!

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #578 on: 18 / August / 2013, 21:31:22 »
edit:
OK, it looks like if you set ISO_MODE, the override for the next shot fails. The following shot after that works. Not clear why, it looks like ISO_MODE does get set to 0, but maybe it's too late.
Yes, that is what I'm seeing here, next shot fails but the rest are OK.  eg.
  > I send ISO propcase 1600,
  > press half-shoot,  (liveview responds)
  > shoot_SticK(1/8,400)  (I get a dark image)
  > shoot_SticK(1/8,400)  (I get the balanced exposure)
  > etc OK until I send another propcase

*

Offline reyalp

  • ******
  • 14128
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #579 on: 19 / August / 2013, 01:08:03 »
Sure, that would be OK so long as it's solid and be accessed from any OSD state, because mine relies on having the ISO icon highlighted before leaving the SET menu.  That's a serious kludge.
Right, that's why I noted the =post_levent_to_ui('PressAvExpButton') jumps the UI directly to that item, without caring about the previous state current state. Of course, your camera may be different.

Quote
  > I send ISO propcase 1600,
  > press half-shoot,  (liveview responds)
  > shoot_SticK(1/8,400)  (I get a dark image)
  > shoot_SticK(1/8,400)  (I get the balanced exposure)
Not sure why you get a dark image above, from my testing I would expect it to be over exposed.

Anyway if you used ISO_MODE to set 400 before the shot rather than using -sv, it should all be OK. The shoot command doesn't try to set values you don't specify, so you can simply leave the -sv out and call set_prop() beforehand.

Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal