A490 Porting - page 8 - DryOS Development - CHDK Forum supplierdeeply

A490 Porting

  • 224 Replies
  • 69323 Views
Re: A490 Porting
« Reply #70 on: 12 / October / 2011, 20:49:38 »
Advertisements
sorry for repeating
but Some news about porting on firmware E?
CHDK FAQ : My camera isn't ported yet
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline tpont

  • **
  • 81
Re: A490 Porting
« Reply #71 on: 13 / October / 2011, 16:06:53 »
I'm seeing something similar on my SD940.  I've started looking through the USB remote code in kbd.c and tried a few things without much success.   The delay is exactly 10 seconds unless I toggle the USB power - which makes me think its a timeout problem.   I'll keep looking.

Tell me if I can help out and test something. Though I don't even know what kbd.c is (some source file I guess?) so I might not be of so much help here.

Re: A490 Porting
« Reply #72 on: 13 / October / 2011, 16:42:30 »
The delay is exactly 10 seconds

If the CHDK code is similar to the SDM code, it is indeed a time-out.

It means that it has not detected USB going low (or USB has NOT gone low).


David

Re: A490 Porting
« Reply #73 on: 13 / October / 2011, 17:32:45 »
The delay is exactly 10 seconds
If the CHDK code is similar to the SDM code, it is indeed a time-out. It means that it has not detected USB going low (or USB has NOT gone low).
Seems reasonable.  However,  as you know,  the USB remote code in CHDK is a bit of a mess.  I scanned through looking for anything that would resolve to a 10 second value, and then changed that value to something else as a test.  I was not able to find anything usefull.  Its also curious that the same code works differently on different cameras - I need to track down what causes that.  Like most debugging,  this will be a combination of reading the code, partitioning things to isolate the bug, a little trial and error and a little brute force.  In other words,  it will take time when I have a quiet moment.

Update :  the 10 seconds is determined in the kbd.c code specific to each camera - not in the core/kbd.c file.  Is a #define DELAY_TIMEOUT 10000 statement.  Doh.
« Last Edit: 25 / October / 2011, 19:49:37 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


Re: A490 Porting
« Reply #74 on: 13 / October / 2011, 17:43:23 »
Tell me if I can help out and test something. Though I don't even know what kbd.c is (some source file I guess?) so I might not be of so much help here.
See my post right above this.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: A490 Porting
« Reply #75 on: 25 / October / 2011, 19:45:53 »
I have the script running (thanks!) but I still get the long lag before the shot fires.
Update :  I've traced source of the long lag before the shot fires when using a USB remote script.   Or at least I've figured it out on my two cameras. 

In the Remote parameters menu,  you need to have Enable Remote at the top of the menu selected but syncable remote : Enable Syncable Remote down below that not selected.   Once I setup things that way,  the script referenced above works properly with no delay when the USB power is applied and removed.

Having said that,  I've only just begun exploring the underlying code.  I'm discovering fun things like hard coded timing loops (for the sync delay function) that will change in duration if the ARM processor has a different clock speed from one camera model to another.   I'll keep exploring for now.


« Last Edit: 25 / October / 2011, 20:10:10 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: A490 Porting
« Reply #76 on: 26 / October / 2011, 05:49:15 »
I'm discovering fun things like hard coded timing loops (for the sync delay function) that will change in duration if the ARM processor has a different clock speed from one camera model to another.

This is true, how else would you get delays of less than 10 msec ?

In this device, the user is able to set a 'magic value' to set the one millisecond base value :-

http://www.gentles.ltd.uk/clickpan/sdm.htm

The code in the microcontroller measures the resulting pulse-width.

Re: A490 Porting
« Reply #77 on: 26 / October / 2011, 06:48:35 »
This is true, how else would you get delays of less than 10 msec ?
I understand why it was written that way.  My point was that its usually considered bad programming practice to embed hard coded numbers that might be device specific deep in the middle of a big piece of code.    A #define in a setup file (like camera.h) or at least at the top of the source file, hopefully with a descriptive name and maybe even a comment about how to determine the correct value, is usually a polite way to handle something like this.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: A490 Porting
« Reply #78 on: 27 / October / 2011, 09:40:28 »
A #define in a setup file (like camera.h) or at least at the top of the source file, hopefully with a descriptive name and maybe even a comment about how to determine the correct value, is usually a polite way to handle something like this.

Of course it is but you have to be aware of the long history of CHDK.

The code has been like that from the very start.

CHDK (and SDM) are both full of junk, but if the functions work nothing has been done about it.

The source code is available, if someone wants to spend considerable time cleaning it up they are welcome to do so.

My experience is that people are quick to ask but extremely reluctant to act.

End users are blissfully unaware of the lack of elegance in the code and could not care less, they just want to take photos.

Re: A490 Porting
« Reply #79 on: 27 / October / 2011, 10:10:25 »
My experience is that people are quick to ask but extremely reluctant to act.
I think you've summarized things nicely.  However, several of us have done our share on the "act" front so its not all bad.
« Last Edit: 27 / October / 2011, 10:13:33 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics