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

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

  • 704 Replies
  • 140847 Views
*

Offline srsa_4c

  • ******
  • 4450
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #460 on: 03 / August / 2013, 10:54:26 »
Advertisements
I still have BIN V1.2 on the 100c (ie the version-sensitive MODULES).  Is the BIN in your ZIP V 1.2 (to keep the same MODULES) ?
The modules are probably compatible, but you do need the new diskboot.bin file and the 2 scripts.
Quote
Next question ... to execute the LUA files .. can I execute them from the PC
I did not test that, give it a try. They should probably work.

*

Offline ahull

  • *****
  • 634
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #461 on: 03 / August / 2013, 10:56:29 »
Looking for context for HIV, I see these strings (Ixus Wireless)....

dump.bin.strings:ffb5db2c CAP_HIVSHD_IR
dump.bin.strings:ffb5db3c CAP_HIVSHD_H
dump.bin.strings:ffb5db4c CAP_HIVSHD_V
dump.bin.strings:ffb5db5c MOV_HIVSHD_IR
dump.bin.strings:ffb5db6c MOV_HIVSHD_H
dump.bin.strings:ffb5db7c MOV_HIVSHD_V
dump.bin.strings:ffb5db8c EVF_HIVSHD_IR
dump.bin.strings:ffb5db9c EVF_HIVSHD_H
dump.bin.strings:ffb5dbac EVF_HIVSHD_V
Thx for that guess. Did you really find HIVSHD strings in a DIGIC II firmware?
Yes, however it is one of the unported cameras.

PRIMARY.BIN.strings:007ec93f Canon DIGITAL IXUS WIRELESS

It just happened to be the first PRIMARY.BIN I found... I didn't grep through them all. The "odd" string in the list above is EVF_HIVSDR_IR which suggests either infra red colour curve correction, or that the string relates to the IR position sensors in the mechanism.


*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #462 on: 03 / August / 2013, 11:11:07 »
@srsa_4c

Quote
Dark frame subtraction on/off could be also important (I don't know which parts of the code take an actual picture and which parts take a dark frame).
This is quite important.  In the 101a, I plan to use dark subtract always ON, even for shots under 1s (another clever bonus from CHDK).  From what I know with extensive testing that might be helpful to you, is that the only two differences between a normal shot and a dark frame shot, is the dark frame appears to me as a normal shot but with mechanical shutter in the CLOSED state (rather than OPEN), and, naturally, the subtract operation takes place afterwards.  Theoretically, for the subtraction, all normal shooting parameters (set for the normal shot just prior) that get corrected should remain the same.  Hence in my opinion, the only major difference between the two, is the shutter state.

edit:
That is: because corrections(normal shot) - corrections(dark frame) must equal ZERO, therefore corrections must be the same in both.
« Last Edit: 03 / August / 2013, 11:16:55 by SticK »

*

Offline srsa_4c

  • ******
  • 4450
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #463 on: 03 / August / 2013, 11:23:49 »
That is: because corrections(normal shot) - corrections(dark frame) must equal ZERO, therefore corrections must be the same in both.
Exactly. I hope that the timestamps of the log will help differentiating normal and dark shots.

@ahull
You're right, there are some DIGIC II models with that string. I thought 'shading'-correction is a DIGIC 4+ feature.


*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #464 on: 03 / August / 2013, 11:46:53 »
@srsa_4c

AGREEING on the MATRIX of TEST OPERATIONS.

   JPG & DNG ON
   ZOOM (10 levels) - will chose every two for 5 levels, OK ?
   APERTURE (many levels) - will chose at every std f-stop, OK ?
   DARK ON
   DARK OFF

Do you want anything added/removed ?

*

Offline srsa_4c

  • ******
  • 4450
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #465 on: 03 / August / 2013, 11:54:05 »
MATRIX of TEST OPERATIONS.

   JPG & DNG ON
   ZOOM (10 levels) - will chose every two for 5 levels, OK ?
   APERTURE (many levels) - will chose at every std f-stop, OK ?
   DARK ON
   DARK OFF
You can probably leave out most zoom steps. It could be like: wide end, tele end, somewhere in the middle. I'd go similarly with Av.

However, please start with just a few shots, and upload the log. Having to repeat the whole test because some failure on my part would not be too great...

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #466 on: 03 / August / 2013, 14:13:00 »
To make you LUA code work from CHDKPTP, one has to put some wrappers around your calls:
Code: [Select]
function
do_conf()
--[[
@title Reconfigures camera log to use a bigger buffer
requires CHDK built with native function call support
--]]
if (type(call_event_proc) ~= "function" ) then
    error("ERROR: requires native function call support.")
end

con:execwait(call_event_proc("StopCameraLog"))
con:execwait(call_event_proc("StartCameraLog",0x20,0x8000))

-- include lualib module (uartr.lua)
uartr=require("uartr")

-- redirect UART to specific file
uartr.start("A/DEBUG.LOG", 0)
end

function do_log()
--[[
@title Take a shot and put log to file
requires CHDK built with native function call support
--]]
if (type(call_event_proc) ~= "function" ) then
    error("ERROR: requires native function call support.")
end
-- include lualib module (uartr.lua)
-- uartr=require("uartr")

-- redirect UART to specific file
-- uartr.start("A/DEBUG.LOG", 0)

con:execwait(press("shoot_half"))
sys.sleep(2000)
con:execwait(press("shoot_full"))
sys.sleep(100)
con:execwait(release("shoot_full"))

con:execwait(call_event_proc("ShowCameraLog"))

-- uartr.stop()
end

When I call !do_conf(), CHDKPTP show this error:

Code: [Select]
stack traceback:
[C]: in function 'error'
C:\CHDKPTP\r291\lua\myfile.lua:65: in function 'do_conf'
[string "do_conf()"]:1: in main chunk
[C]: in function 'xpcall'
C:\CHDKPTP\r291\lua\cli.lua:378: in function <C:\CHDKPTP\r291\lua\cli.lua:375>
(tail call): ?
(tail call): ?
[C]: in function 'xpcall'
C:\CHDKPTP\r291\lua\cli.lua:239: in function 'execute'
C:\CHDKPTP\r291\lua\gui.lua:662: in function 'action'
C:\CHDKPTP\r291\lua\gui.lua:629: in function <C:\CHDKPTP\r291\lua\gui.lua:627>
(tail call): ?
[C]: in function 'Popup'
dialog.lua:27: in function 'popup'
iuplua.lua:249: in function <iuplua.lua:239>
[C]: in function 'MainLoop'
C:\CHDKPTP\r291\lua\gui.lua:684: in function <C:\CHDKPTP\r291\lua\gui.lua:670>
(tail call): ?
C:\CHDKPTP\r291\lua\main.lua:220: in main chunk
[C]: in function 'require'
[string "require('main')"]:1: in main chunk
One of the functions is probably not being presented well, and you have some calls/requires I don't know how to wrap/convert.  Could you help please?

*

Offline srsa_4c

  • ******
  • 4450
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #467 on: 03 / August / 2013, 14:38:33 »
I'm sure reyalp would spot several issues in the above modified script. For one, chdkptp doesn't have native functions.

Since the scripts are pretty trivial, I'd go for the following approach:
To init the debuglog stuff (single line chdkptp command, meant to be executed from the command line):
Code: [Select]
.call_event_proc("StopCameraLog");call_event_proc("StartCameraLog",0x20,0x8000);uartr=require("uartr");uartr.start("A/DEBUG0.LOG",0)To shoot:
Code: [Select]
.press("shoot_half");sleep(2000);press("shoot_full");sleep(100);release("shoot_full");sleep(100);call_event_proc("ShowCameraLog")All this can be done much better (like using the shoot command instead of keypresses), but I'm not too good at scripting. You still have to adjust the needed camera settings - I guess you can do that with the chdkptp GUI.

None of the above code snippets will tell you if you don't have 'native calls' enabled. I'd suggest you to do that by hand, if you haven't already done so.

edit:
Actually, if you do it like this, you can shoot the way you like, just don't forget to execute
Code: [Select]
.call_event_proc("ShowCameraLog")every once in a while (after a few shots).
« Last Edit: 03 / August / 2013, 14:41:01 by srsa_4c »


*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #468 on: 03 / August / 2013, 15:22:08 »
This looks like a very good way of doing it.  But right now, if I execute your first code snippet, the debug menu comes up, but I get "Native Calls Disabled" in the OSD in CHDKPTP.

*

Offline srsa_4c

  • ******
  • 4450
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #469 on: 03 / August / 2013, 15:33:29 »
To be able to use the scripts, please enable 'miscellaneous stuff -> Enable Lua native calls'.
Use the CHDK menu on camera. You can use the physical camera buttons even when connected over USB.

 

Related Topics