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

SX50 HS porting thread

  • 350 Replies
  • 102207 Views
Re: SX50 HS porting thread
« Reply #310 on: 08 / April / 2015, 08:27:30 »
Advertisements
I.e. to be resolved whether this problem is unknown? This bug is characteristic only for sx50?
There have been issues with CHDK manual focus on other camras but many of those were fixed with the changes made for the CHDK 1.3.0 release.  The SX50 might be the only one with know issues still based on the posts in the forum thread that I linked earlier.

Give that the SX50 support manual focus using the Canon menus, and that apparently manual focus from scripts works,  this is not a high priority that anyone has expressed an interest in trying to fix.  The most likely fix will be to simply "lock out" the SD override function if the camera is in AFL mode so that it does not crash rather than try to make it work.

Quote
ROMLOG A.LOG - log camera after the crash with AFL selected.
ROMLOG B.LOG - log camera after the crash with "Safe MF" is set to "Off."
As expected, 
Code: [Select]
ASSERT!! FocusLensController.c Line 834
Sorry, don't know in what topic to ask, so I ask here: What c++ module and which function is implemented display "SD: ..." and "Adj.: ..." (which is shown in red) ?
There are no C++ modules in CHDK - the code is all C or ARM assembler.  The strings you are looking for are in core/gui_osd.c  between lines 300 and 340.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SX50 HS porting thread
« Reply #311 on: 08 / April / 2015, 13:59:07 »
Quote
As expected,
Code: [Select]
ASSERT!! FocusLensController.c Line 834
I could not find module (file) FocusLensController.c in trank, as well as links to the this file.  :-[

Quote
The strings you are looking for are in core/gui_osd.c  between lines 300 and 340.

Thank you very much! How I have not guessed?
Camera is SX50hs

Re: SX50 HS porting thread
« Reply #312 on: 08 / April / 2015, 14:20:55 »
I could not find module (file) FocusLensController.c in trank, as well as links to the this file.
That's because the ROMLOG.LOG file is generated by the Canon firmware and the things included in there come from the Canon firmware - not CHDK.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4411
Re: SX50 HS porting thread
« Reply #313 on: 08 / April / 2015, 15:49:55 »
The most likely fix will be to simply "lock out" the SD override function if the camera is in AFL mode so that it does not crash rather than try to make it work.
@Malysh-ok

If you can compile CHDK, remove the following line from platform/sx50hs/platform_camera.h:
#define CAM_SD_OVER_IN_AFL 1


Re: SX50 HS porting thread
« Reply #314 on: 08 / April / 2015, 18:48:55 »
If you can compile CHDK, remove the following line from platform/sx50hs/platform_camera.h:
#define CAM_SD_OVER_IN_AFL 1
That will also remove the ability to focus in AFL mode - which apparently works in the test script? 

I guess understanding the interaction with Canon safety MF matters too.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SX50 HS porting thread
« Reply #315 on: 12 / April / 2015, 03:48:33 »
waterwingz thanks for the prompt replies.

Can't understand the algorithm set focus, using lens_set_focus_pos() (\platform\generic\wrappers.c) or using set_focus() (LUA).
I set 6770 mm, of the two closest values (6102, 7597; zoom -> min) camera set 7597.
I set 6771 mm, of the two closest values camera set 10062.


What the hell???  :blink:
« Last Edit: 12 / April / 2015, 04:53:32 by Malysh-ok »
Camera is SX50hs

Re: SX50 HS porting thread
« Reply #316 on: 12 / April / 2015, 04:08:24 »
The most likely fix will be to simply "lock out" the SD override function if the camera is in AFL mode so that it does not crash rather than try to make it work.
@Malysh-ok

If you can compile CHDK, remove the following line from platform/sx50hs/platform_camera.h:
#define CAM_SD_OVER_IN_AFL 1

If you can compile CHDK, remove the following line from platform/sx50hs/platform_camera.h:
#define CAM_SD_OVER_IN_AFL 1
That will also remove the ability to focus in AFL mode - which apparently works in the test script? 

I guess understanding the interaction with Canon safety MF matters too.

I turn on the camera, set AFL, then set MF, then set Adj<>Off, then exit ALT-mode, then press "shoot_half" -> Crash camera.
I turn on the camera, set AFL, then set MF, then set Adj=Off, then exit ALT-mode, then press "shoot_half" -> All right.
« Last Edit: 12 / April / 2015, 04:14:12 by Malysh-ok »
Camera is SX50hs

Re: SX50 HS porting thread
« Reply #317 on: 13 / April / 2015, 15:55:42 »
Can't understand the algorithm set focus, using lens_set_focus_pos() (\platform\generic\wrappers.c) or using set_focus() (LUA).
I set 6770 mm, of the two closest values (6102, 7597; zoom -> min) camera set 7597.
I set 6771 mm, of the two closest values camera set 10062.
Nobody will tell why the focus is set several unpredictable and how to solve it?  :(

And another question: how in LUA to pass arguments to functions in call_func_ptr(fptr,...) ? In particular - MoveFocusLensToPosition(), MoveFocusLensToDistance()?

Thanks in advance.
Camera is SX50hs


*

Offline reyalp

  • ******
  • 13231
Re: SX50 HS porting thread
« Reply #318 on: 13 / April / 2015, 17:17:04 »
Can't understand the algorithm set focus, using lens_set_focus_pos() (\platform\generic\wrappers.c) or using set_focus() (LUA).
I set 6770 mm, of the two closest values (6102, 7597; zoom -> min) camera set 7597.
I set 6771 mm, of the two closest values camera set 10062.
Nobody will tell why the focus is set several unpredictable and how to solve it?  :(
This is almost certainly the behavior of the underlying firmware functions. It's possible that slightly different measurements are involved, e.g. distance from lens vs distance from focal plane.

Quote
And another question: how in LUA to pass arguments to functions in call_func_ptr(fptr,...) ? In particular - MoveFocusLensToPosition(), MoveFocusLensToDistance()?
You just pass them as additional arguments to to call_func_ptr. However, you need to be aware that some event procs expect their arguments to be by reference. If you want to call these functions directly call_func_ptr, you need to arrange for the argument to be a pointer which points to the desired value, by using malloc and poke or putting it in a string.

In general, it's more convenient to use call_event_proc for functions like this, since the firmware eventproc system allows you to just pass the values as numbers. In this case, you will need to find the appropriate registration functions for the eventprocs.
Don't forget what the H stands for.

Re: SX50 HS porting thread
« Reply #319 on: 14 / April / 2015, 02:10:34 »
This is almost certainly the behavior of the underlying firmware functions.
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.

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)?

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.
« Last Edit: 14 / April / 2015, 03:56:48 by Malysh-ok »
Camera is SX50hs

 

Related Topics