SX50 HS porting thread - page 33 - DryOS Development - CHDK Forum supplierdeeply

SX50 HS porting thread

  • 350 Replies
  • 102213 Views
*

Offline srsa_4c

  • ******
  • 4411
Re: SX50 HS porting thread
« Reply #320 on: 14 / April / 2015, 15:39:42 »
Advertisements
I have already understood it. Please tell me, what is the difference between firmware functions MoveFocusLensToDistance and MoveFocusLensWithDistance? And I wanted to know more about the functions of the family MoveFocusPosition.
None of the event procedures has any public documentation. We happen to know what MoveFocusLensToDistance does. For the rest, reverse engineering is required, and that's not easy.

Quote
Quote
In this case, you will need to find the appropriate registration functions for the eventprocs.
How and where to find these functions? In file funcs_by_address.csv (funcs_by_name.csv)?
You have to look for it in the disassembled firmware code. It would likely be possible to find this information with the sigfinder, but it is not currently implemented.

Quote
By analogy with http://chdk.setepontos.com/index.php?topic=12062.msg118282#msg118282:
Code: [Select]
if (call_event_proc("Mecha.Create") == -1) then
  if (call_event_proc("MechaRegisterEventProcedure") == -1) then
    error("Mecha.Create failed")
  end
end
p = 1000
err = call_event_proc("MoveFocusLensToDistance", p)
focus = get_focus()
print("Err: "..err..", Focus: "..focus)
Displays Err=-1, Focus - the previous value.
MoveFocusLensToDistance is registered by InitializeAdjustmentFunction or InitializeAdjustmentSystem. The latter two event procedures are registered by FA.Create.
So, in order to use MoveFocusLensToDistance, you have to previously call FA.Create followed by InitializeAdjustmentFunction or InitializeAdjustmentSystem.

*

Offline reyalp

  • ******
  • 13231
Re: SX50 HS porting thread
« Reply #321 on: 14 / April / 2015, 16:02:56 »
Please tell me, what is the difference between firmware functions MoveFocusLensToDistance and MoveFocusLensWithDistance? And I wanted to know more about the functions of the family MoveFocusPosition.
I don't know off hand. Generally what is known about these things comes from
1) Guessing based on the name
2) Reverse engineering the firmware
3) Experimenting and observing the behavior.

Quote
How and where to find these functions? In file funcs_by_address.csv (funcs_by_name.csv)?
For registration functions, you generally find a table of event procs in the firmware that contains the one you are interested in, find a function that registers that table, and then find a string that is used when registering that registration function. Some of these are in the data segment (copied from ROM to RAM on boot), which can complicate searching.

On my elph130, it looks like InitializeAdjustmentFunction is needed for "MoveFocusLensToDistance" and many similar functions. FA.Create may be needed first.
Don't forget what the H stands for.

Re: SX50 HS porting thread
« Reply #322 on: 15 / April / 2015, 08:45:16 »
Thank you very much. It's harder than I thought.

I found here: Re: Manual Focus @ Infinity not working
"MoveFocusLensWithPosition" has 3 arguments: 1) signed halfword 2) halfword 3) word
"MoveFocusLensToPosition" has two: 1) halfword 2) word
"MoveFocusPosition" has only one (halfword)

If less arguments are provided, the eventproc will get junk for the remaining arguments.
srsa_4c could you tell us more about these functions and their arguments?
I was not able to change focus by using "MoveFocusPosition".
« Last Edit: 15 / April / 2015, 09:47:38 by Malysh-ok »
Camera is SX50hs

*

Offline srsa_4c

  • ******
  • 4411
Re: SX50 HS porting thread
« Reply #323 on: 15 / April / 2015, 12:57:18 »
I found here: Re: Manual Focus @ Infinity not working
"MoveFocusLensWithPosition" has 3 arguments: 1) signed halfword 2) halfword 3) word
"MoveFocusLensToPosition" has two: 1) halfword 2) word
"MoveFocusPosition" has only one (halfword)

If less arguments are provided, the eventproc will get junk for the remaining arguments.
srsa_4c could you tell us more about these functions and their arguments?
What you see there is what I know. I suspect that event procedures that have both "Focus" and "Position" in their names, are related to the focus lens mechanical position inside the camera's lens. GetFocusLensCurrentPosition could be related.
Quote
I was not able to change focus by using "MoveFocusPosition".
I don't remember trying it, so I don't know if it is supposed to work. Did you register it correctly? Also note that the relation between focus lens mecha position and focus distance is highly nonlinear. Try using GetFocusLensCurrentPosition to have an idea about possible values.
But beware: some of the mecha related event procedures can be dangerous to the hardware. It might be possible that the focus position related event procedures just blindly follow your instructions and smash the focus lens into the zoom lens for example...


Re: SX50 HS porting thread
« Reply #324 on: 15 / April / 2015, 15:10:07 »
Quote
Try using GetFocusLensCurrentPosition to have an idea about possible values.
Have already used. Often gives the same results for different distances.  :blink:
Camera is SX50hs

*

Offline philmoz

  • *****
  • 3319
    • Photos
Re: SX50 HS porting thread
« Reply #325 on: 15 / April / 2015, 15:43:23 »
Quote
Try using GetFocusLensCurrentPosition to have an idea about possible values.
Have already used. Often gives the same results for different distances.  :blink:

The cameras don't have continuous focussing motors, they are stepped to discrete values - presumably to increase focussing speed. There are more focus positions close to the camera; but once you focus further out there are very few - you can request any focus distance you want; but you will only get the fixed ones built in.

See the graph for the G12 in this post - http://chdk.setepontos.com/index.php?topic=6570.msg69571#msg69571

The massive DOF of these cameras takes care of ensuring what you are focussing on is actually in focus (most of the time).

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)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: SX50 HS porting thread
« Reply #326 on: 15 / April / 2015, 18:51:36 »
Thank you very much. It's harder than I thought.
At this point in this thread, it would be interesting to know what you are trying to do?

Are you trying to fix the crashes?   Or are you looking for another way around the problem?

If the crashes are to be fixed,  I suspect that it will likely require finding a better place to insert the shooting_expo_param_override() patch into capt_seq.c .  Or possibly something like some additional delays in lens_set_focus_pos() in platform/generic/wrappers..c   

But those are just my first guesses.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SX50 HS porting thread
« Reply #327 on: 16 / April / 2015, 02:41:26 »
The cameras don't have continuous focussing motors, they are stepped to discrete values - presumably to increase focussing speed. There are more focus positions close to the camera; but once you focus further out there are very few - you can request any focus distance you want; but you will only get the fixed ones built in.
Don't quite understand your thought (My bad English). If you thought that the focus distance changes discretely, I already knew.
With regards to my quote: I thought that some value of the focus distance corresponds exactly one value of the focus position.
Camera is SX50hs


Re: SX50 HS porting thread
« Reply #328 on: 16 / April / 2015, 03:32:44 »
At this point in this thread, it would be interesting to know what you are trying to do?

Are you trying to fix the crashes?   Or are you looking for another way around the problem?
At the first stage I want to modify (improve) the unit responsible for the MF focus.
But I faced another problem: ill implemented algorithm function "MoveFocusLensToDistance"; trying to work around this problem.

At the second stage - I want to fix listed above bugs.

Camera is SX50hs

Re: SX50 HS porting thread
« Reply #329 on: 16 / April / 2015, 05:01:12 »
Hi I've just bought the sx50 and every thing is great
but i have some problems
First when I try to taje pictures with the shutter speed over one second,the ISO wont be manual anymore and it'll set for 80 automatically is there any port to do sth about this?
and the other problem is that the slowest shutter speed is 15 seconds and it's very high for taking pictures of stars  is there any port for this too?

And the last one can I control the shutter speed with the remote control?
Will it work on bridge cameras??

« Last Edit: 16 / April / 2015, 05:03:11 by pooyathr »

 

Related Topics