IXUS160/ELPH160 Porting attempt - page 18 - DryOS Development - CHDK Forum  

IXUS160/ELPH160 Porting attempt

  • 497 Replies
  • 174359 Views
Re: IXUS160/ELPH160 Porting attempt
« Reply #170 on: 17 / August / 2015, 21:59:04 »
Advertisements
Hi. I own an ELPH160 camera that I am willing to risk for the cause. What steps would I take using the latest build to check to reproduce the problem, possibly brick my camera, and see whether or not the bug is indeed fixed?

*

Offline reyalp

  • ******
  • 13450
Re: IXUS160/ELPH160 Porting attempt
« Reply #171 on: 18 / August / 2015, 00:43:22 »
Hi. I own an ELPH160 camera that I am willing to risk for the cause. What steps would I take using the latest build to check to reproduce the problem, possibly brick my camera, and see whether or not the bug is indeed fixed?
I'll PM you a build, but unfortunately, there isn't a simple answer.

The problem happened when Scannerall tried to shoot using an SD card that had been partitioned so with very little free space (old cameras required partitioning to boot on a large card, but this is not needed for this cam): http://chdk.setepontos.com/index.php?topic=12321.150

So one theory is that the problem was somehow triggered by the SD card filling up between when the shot started and when the camera tried to save the jpeg. This isn't totally impossible, but it seems strange. A full disk would not normally be expected to affect lens hardware.

The current CHDK trunk (including the build I sent you) will prevent saving raw if there isn't enough space, so if that was the problem, it's solved. However, shooting with a full card and not bricking the camera doesn't really tell us if the problem was solved, because we don't know if that was the real cause.

A more reliable way to test this theory would be to make a build without the low space protection, verify that it works on a card with plenty of space, and then see if it bricks the camera when using a tiny partition. If it does, that would pretty much be case closed. If it doesn't, the result would be inconclusive, because even if the low space caused the problem, it's not safe to assume it would trigger it every time.

At this point, the best we can do may be have those willing to take the risk keep using it, and see if the problem happens again.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS160/ELPH160 Porting attempt
« Reply #172 on: 20 / August / 2015, 06:46:48 »
Can somebody with the camera try
- ND filter override
- subject distance override
?
For SD override, you'll need
Code: [Select]
    #define CAM_SD_OVER_IN_AF               1
    #define CAM_SD_OVER_IN_AFL              1
    #define CAM_SD_OVER_IN_MF               1
in platform_camera.h
For the ND, you need
Code: [Select]
    #undef  CAM_HAS_IRIS_DIAPHRAGM
    #define CAM_HAS_ND_FILTER               1
Expected outcome: crash, so be careful. I'm considering a new thread to discuss the root cause...
Here's information about the cause.
« Last Edit: 20 / August / 2015, 12:52:47 by srsa_4c »

*

Offline nafraf

  • *****
  • 1308
Re: IXUS160/ELPH160 Porting attempt
« Reply #173 on: 20 / August / 2015, 22:26:15 »
Yes, camera crashes. If it helps, ROMLOG in attachment.


*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS160/ELPH160 Porting attempt
« Reply #174 on: 21 / August / 2015, 18:20:34 »
Yes, camera crashes. If it helps, ROMLOG in attachment.
Thanks for confirming.

I have written a howto, but it will quickly become obsolete because this workaround is not ideal. If you choose to commit it, please put notes in that this is a temporary measure.
It's possible that other CHDK operations are also affected by the change detailed in the linked thread.



Trace back the parameter passed to ClearEventFlag in the following event procedures (note I'm using names provided by sigfinder):
MoveFocusLensToDistance_FW
PutInNdFilter_FW
Then find the two functions that initialize them, they are called from InitializeAdjustmentFunction (you have to look in the function called from InitializeAdjustmentFunction, actually).
Trace back the parameter passed to TakeSemaphore in the following event procedure:
TurnOnNdFilter_FW
Then find the function that initializes it, it is called from Mecha.Create .
Note that the sigfinder will use TurnOnNdFilter if both TurnOnNdFilter and PutInNdFilter are available. If this is the case, the ND filter eventflag doesn't need to be initialized.

For ixus160 100a:
sub_ffad6344: ND semaphore init (also registers some event procedures)
sub_ffaa8558: ND eventflag init (not needed, because the other ND funtions are used)
sub_ffb7ebfc: focus eventflag init

You can call the above 2 required functions right after taskcreatePhySw_my in boot.c (that's just a suggestion).
This will fix:
- ND override
- subject distance override
- set_zoom (this one is only affected because CHDK attempts re-focusing after adjusting zoom)

*

Offline nafraf

  • *****
  • 1308
Re: IXUS160/ELPH160 Porting attempt
« Reply #175 on: 23 / August / 2015, 14:26:54 »
Using the functions you found, I modified platform/generic/wrappers.c, patch in attachment.
set_focus() and set_nd_filter() were tested using chdkptp and they are working.
« Last Edit: 27 / August / 2015, 20:18:28 by nafraf »

Re: IXUS160/ELPH160 Porting attempt
« Reply #176 on: 27 / August / 2015, 20:01:11 »
Using the functions you found, I modified platform/generic/wrappers.c, patch in attachment.
set_focus() and set_nd_filter() were tested using chdkptp and they are working.
Couldn't get your patch to apply cleanly.  Updated version that I think is correct attached.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline nafraf

  • *****
  • 1308
Re: IXUS160/ELPH160 Porting attempt
« Reply #177 on: 27 / August / 2015, 20:18:15 »
Thanks for fixing the patch. I'm not sure if that's the right choice, It is only for documentation purposes, it depends on changes on platform/ixus160_elph160 changes which has not been included.

EDIT: fix typo :)
« Last Edit: 27 / August / 2015, 21:05:45 by nafraf »


Re: IXUS160/ELPH160 Porting attempt
« Reply #178 on: 27 / August / 2015, 20:37:16 »
Thanks for fixing the path. I'm not sure if that's the right choice, It is only for documentation purposes, it depends on changes on platform/ixus160_elph160 changes which has not been included.
It wasn't the path.  There was an extra patch segment at the end of your file that made no sense.  So I removed it.

Edit :  oh .. wait.  You meant "Thanks for fixing the patch"?  Never mind then ..
« Last Edit: 27 / August / 2015, 20:40:53 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: IXUS160/ELPH160 Porting attempt
« Reply #179 on: 01 / September / 2015, 15:20:35 »
Hi Guys,
first of all thanks to waterwingz for compiling and giving me the last version of the firmware for IXUS_160.
I'm trying to solve problem with focus.

How do you try the last patch for focus?
I'm not able to understand if I'm wrong.

I use chdkptp to comunicate to the camera.
If I type:

set_aflock(1)
set_focus(10000)
get_focus()

it returns a random value (not 10000)

if I try with
set_mf(1)
set_focus(10000)
get_focus()

it returns another random value and if I change set_focus value, it returns other random value without a logic.

Same procedure works perfectly for zoom.
set_zoom(20)
get_zoom()

returns 20.

Other issue with last firmware update 4229 (not present in a release of beginning of August) is this error
ERROR: I/O error
attempted to close non-present device XXX:XXX
when I type two focus command together

set_aflock(1)
set_aflock(0)
return error

set_mf(1)
set_mf(0)
return error

Let me know if I can help you with more details

Luca

 

Related Topics