"Press shutter to close" error - LUA Scripting - CHDK Forum

"Press shutter to close" error

  • 5 Replies
  • 6795 Views
*

Offline waldo

  • ***
  • 238
"Press shutter to close" error
« on: 28 / December / 2010, 17:39:27 »
Advertisements
I've been having problems getting a Lua time lapse scrip to run reliably.  The problem is that the message "Press shutter to close" will appear after a period of time.  Searching the forum, I've noticed that others have also had this kind of problem.

I've managed to reduce the script to a few lines containing a delay loop and still create the problem. 

The following script will produce the "Press shutter to close" on my S95 after a random amount of time.  It seems to be more likely to fail if the script is run immediately after starting up the camera and the CHDK splash goes away.
Code: [Select]
--[[
@title Stress Test
--]]

while (1) do
start = get_tick_count()

while (get_tick_count() < start + 10000) do
end
end

The following script seems more reliable, but will also crash eventually on my S95:

Code: [Select]
--[[
@title Stress Test
--]]

while (1) do
start = get_tick_count()

while (get_tick_count() < start + 10000) do
sleep(100)
end
end

I have tested the above scripts on a S95 and a SD940, both running CHDK release 100x.  The S95 fails consistently, but after a random amount of time.  The SD940 does not seem to fail so far with these scripts.


The following script will consistently crash by making the camera shut down within about 1 minute.  Both the S95 and the SD940 fail the same way.

Code: [Select]
--[[
@title Stress Test
--]]

while (1) do
start = get_tick_count()

while (get_tick_count() < start + 10000) do
print("test")
end
end

Perhaps those that have had this error message can try the above scripts to help narrow down the problem.

Re: "Press shutter to close" error
« Reply #1 on: 28 / December / 2010, 19:53:51 »
Same results with my 1.03C version of the SD940.   I know you are probably not looking for a fix that involves changing the code but this modified version of your code has been running for over 10 minutes now :
Code: [Select]
--[[
@title LUA 4
--]]

while (1) do
start = get_tick_count()
i = 0
while (get_tick_count() < start + 60000) do
print("test", i)
i=i+1
sleep(500)
end
end

Update :  took out the sleep(500) line - still seems to run withough crashing ???
« Last Edit: 28 / December / 2010, 19:57:35 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14125
Re: "Press shutter to close" error
« Reply #2 on: 28 / December / 2010, 22:35:38 »
ooops. I should read more carefully.

Have you tried putting in a collectgarbage("collect") in the loop ?
shouldn't be generating garbage with the first version.

edit:
first script ran for an hour without any problem on d10 ??? It was in playback mode, don't know if that makes any difference.
« Last Edit: 28 / December / 2010, 23:45:21 by reyalp »
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: "Press shutter to close" error
« Reply #3 on: 29 / December / 2010, 05:19:12 »
Code: [Select]
--[[
@title Stress Test
--]]

while (1) do
start = get_tick_count()

while (get_tick_count() < start + 10000) do
print("test")
end
end

Perhaps those that have had this error message can try the above scripts to help narrow down the problem.

SX30 - record mode, shuts down in ~ 20 seconds.
SX30 - play mode, no problem.

G12 - record mode, shuts down in ~ 1 minute.
G12 - play mode, no problem.

Could it be a memory problem in the LUA script system?
Why only in record mode?

Dumping the camera log after the crash gives:
    ASSERT!! FsIoNotify.c Line 457
    Occured Time  2010:12:29 17:07:17
    Task ID: 15073312
    Task name: SpyTask

Regards,
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 reyalp

  • ******
  • 14125
Re: "Press shutter to close" error
« Reply #4 on: 29 / December / 2010, 16:22:29 »
SX30 - record mode, shuts down in ~ 20 seconds.
SX30 - play mode, no problem.

G12 - record mode, shuts down in ~ 1 minute.
G12 - play mode, no problem.

Could it be a memory problem in the LUA script system?
If it's a memory problem, you should get a lua error when malloc fails, or an assert when some part of the canon firmware tries to malloc and fail.

Lua *can* eat all available memory without garbage collecting, but this kind of script doesn't seem like it should do that.
Quote
Why only in record mode?
That's what they call a good question ;)
There is generally less free memory in rec mode, but the difference shouldn't be that big. More likely it relates to other tasks being more active somehow...
Quote
Dumping the camera log after the crash gives:
    ASSERT!! FsIoNotify.c Line 457
    Occured Time  2010:12:29 17:07:17
    Task ID: 15073312
    Task name: SpyTask
Wait, does it crash, or does the script just die and give you "press shutter to continue" ? Or sometimes one and sometimes the other ?

Is the time in the log above around the time you were testing, or is it just an old crash from the log ?

In the former case, I suggest finding all the places lua can die with an error, and putting some debug code there. A simple way would be to trigger a crash, so you get a stack dump and romlog.  Make sure you save the main.dump form that build so you can use the stack dump.  http://chdk.wikia.com/wiki/Debugging has some advice for using the romlog.
Don't forget what the H stands for.

*

Offline waldo

  • ***
  • 238
Re: "Press shutter to close" error
« Reply #5 on: 29 / December / 2010, 17:27:05 »

There is generally less free memory in rec mode, but the difference shouldn't be that big. More likely it relates to other tasks being more active somehow...

My S95 shows about 500K free memory in rec mode (but 300K in play mode for some reason) and it is unchanged after running scripts that end with the "Press shutter to close" message, if that's any help.

Quote
Wait, does it crash, or does the script just die and give you "press shutter to continue" ? Or sometimes one and sometimes the other ?

Depending on the script run, I can produce both failure modes.

I'll have to look into using the romlog.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal