Adding new cameras, applying patches into trunk (with source code prepared) - page 91 - General Discussion and Assistance - CHDK Forum

Adding new cameras, applying patches into trunk (with source code prepared)

  • 1679 Replies
  • 782784 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #900 on: 24 / November / 2012, 07:32:02 »
Advertisements
When I looked at this I started out recording the before and after file counter values to see how often the loop went to the full delay period. On the cameras I have that are affected by this it happened very rarely so I decided to stick with a simple solution. It's no worse than the previous code and in most cases exits the loop after 10 - 20ms.
I don't have direct experience with this as AFAIK none of my DryOS cams is affected. It's also not a question that it's better than the fixed delay.
Quote
There's no guarantee that capturing the file counter in capt_seq_hook_set_nr will behave any differently - the call to this is not that much earlier than the call to capt_seq_hook_raw_here and there is no sleep between them
capt_seq_hook_set_nr, wait_until_remote_button_is_released are all called before the shot, the raw hook is called after it. I've traced back the update of the file counter param on a DryOS cam (don't remember which, maybe A470), and it seems that the task responsible for it is DvlpSeqTask.
Quote
  so in all likelihood it would get the same file counter value.
That could be true, I don't know when the other task decides to increment the counter, the shot will happen anyway at that point. shooting_expo_param_override is called before decision, but it's in a different source module and in some ports it might even be skipped, so it's probably not entirely reliable (could result in overwritten files).

So, in short: I don't know a better solution that doesn't require messing with every affected port's source.

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #901 on: 24 / November / 2012, 11:46:12 »
A small patch to
  • fix up a problem with the print_screen() function in Lua
  • close any open log file when logging is turned off  (i.e. print_screen(false) or print_screen(0) or print_screen 0)

Currently  script_print_screen_statement(n) in core/scripts.c opens a log file named LOG_nnnn.TXT in overwrite mode if n>0 or in append mode if n<0.   If n=0 it disables logging (but does not close any open log files).

In luascript.c,  luaCB_print_screen(n) adds 10000 to the passed value of n from the print_screen(n) function call before calling script_print_screen_statement(n).  There is no (obvious) reason why it does this as the log file name uses only the 4 least significant digits.  However, it means that you need to specify n < -10000 if you want to open a log file in "append" mode using print_screen() in Lua.

The corresponding uBASIC statement treats any negative number as a request for a log file in append mode.

Patch should not break any existing code although the file numbers created using print_screen() in lua will sometimes be different.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #902 on: 24 / November / 2012, 23:22:57 »
Thanks! I noticed that print_screen(false) didn't close the file when I tried to rename it. Hopefully, rename will work now.

I also found that my log files were lost with low battery shut down, which doesn't call restore(). My solution was to close and re-open the log file for each picture, which works well. I assume now it will work with print_screen in Basic and Lua?

Code: (lua) [Select]
for i=1,10 do
  print_screen(-1)
  print ("testing",i)
  print_screen(false)
  --sleep(100)
end

EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #903 on: 24 / November / 2012, 23:28:34 »
A small patch to
  • fix up a problem with the print_screen() function in Lua
  • close any open log file when logging is turned off  (i.e. print_screen(false) or print_screen(0) or print_screen 0)

Currently  script_print_screen_statement(n) in core/scripts.c opens a log file named LOG_nnnn.TXT in overwrite mode if n>0 or in append mode if n<0.   If n=0 it disables logging (but does not close any open log files).

In luascript.c,  luaCB_print_screen(n) adds 10000 to the passed value of n from the print_screen(n) function call before calling script_print_screen_statement(n).  There is no (obvious) reason why it does this as the log file name uses only the 4 least significant digits.  However, it means that you need to specify n < -10000 if you want to open a log file in "append" mode using print_screen() in Lua.

The corresponding uBASIC statement treats any negative number as a request for a log file in append mode.

Patch should not break any existing code although the file numbers created using print_screen() in lua will sometimes be different.

Added in revisions 2317 (trunk) and 2318 (release-1.1)

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)


*

Offline nafraf

  • *****
  • 1308
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #904 on: 27 / November / 2012, 01:09:53 »
a1300 100e port
Firmware dump and test done by calculusrunner

This port is a copy of a810 100e, but with the PLATFORMID=12862.

*

Offline nafraf

  • *****
  • 1308
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #905 on: 27 / November / 2012, 06:47:41 »
a495 new loader patch. Tested using a495 100f.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #906 on: 27 / November / 2012, 06:58:13 »
a1300 100e port
Firmware dump and test done by calculusrunner

This port is a copy of a810 100e, but with the PLATFORMID=12862.


Added in revision 2326 (trunk) and 2327 (release-1.1).

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)

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #907 on: 27 / November / 2012, 06:59:59 »
a495 new loader patch. Tested using a495 100f.


Added in revision 2328 (trunk).

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)


*

Offline nafraf

  • *****
  • 1308
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #908 on: 27 / November / 2012, 18:09:01 »
patch to a495 and a810

a495
Removed references to the RESTARTSTART in makefile.inc 100d, 100e, 100f

a810
New loader implemented, boot tested using 100b, 100d, 100e
EXMEM_BUFFER_SIZE and MEMISOSTART set to the values for 1mb buffer. As reported here by SnowLeopard
I think that a810 can be released as beta now.

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #909 on: 27 / November / 2012, 20:16:01 »
New loader patch for
Quote
A series:       A590-101b,   A620-100f,   A630-100c
ixus series:     ixus70_sd1000-101b,   ixus115_elph100hs-101b,   ixus220_elph300hs-100c
                 ixus230_elph310hs-100b,   ixus300_sd4000-100c,   ixus870_sd880-101a
S series:       S95-100h


Patch attached here
Warning: created with gnu diff - I did include a stripped version which hopefully works for you guys,
although the /resetcode dirs will need to be removed manually afterwards.
By the way, nafraf's a495 patch in post #905 also appears to have left an (empty) /resetcode dir in
trunk 2328.

wim

 

Related Topics