Setting focus from scripts or menus - page 35 - General Discussion and Assistance - CHDK Forum

Setting focus from scripts or menus

  • 601 Replies
  • 154213 Views
Re: Setting focus from scripts or menus
« Reply #340 on: 12 / March / 2014, 22:18:05 »
Advertisements
Your adding extra time made me wonder whether my saving the RAW images might be affecting things.  It usually takes about 5 to 7 seconds to recover from a shot.  So, I did a second set of tests with RAW photos disabled.  This time, it crashed further on where it did before when I didn't have shooting enabled, i.e. at the SS.Create/PT_MFOn test.  I added "noraw" to the names of the files for the second set of tests.  I also needed two posts to upload all four attachments (Bah!).

Re: Setting focus from scripts or menus
« Reply #341 on: 12 / March / 2014, 22:22:55 »
Your adding extra time made me wonder whether my saving the RAW images might be affecting things.  It usually takes about 5 to 7 seconds to recover from a shot.  So, I did a second set of tests with RAW photos disabled.  This time, it crashed further on where it did before when I didn't have shooting enabled, i.e. at the SS.Create/PT_MFOn test.
PROGRESS!

Once you turned off RAW,  everything in the set_aflock() test worked.   Can you rerun the original version of the script that way?   

The PT_MFOn test crash is something different - just disable it.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline dvip

  • ****
  • 451
Re: Setting focus from scripts or menus
« Reply #342 on: 12 / March / 2014, 22:27:58 »
The SX40HS crashes after set_focus(). Tested with both raw turned off and on.


« Last Edit: 12 / March / 2014, 23:04:18 by dvip »

Re: Setting focus from scripts or menus
« Reply #343 on: 12 / March / 2014, 22:30:34 »
PROGRESS!

Once you turned off RAW,  everything in the set_aflock() test worked.   Can you rerun the original version of the script that way?   

The PT_MFOn test crash is something different - just disable it.

Okay.  I've left RAW photos disabled and re-ran the last MF_test.lua script.  It crashed in the aflock test.


Re: Setting focus from scripts or menus
« Reply #344 on: 12 / March / 2014, 22:34:01 »
Okay.  I've left RAW photos disabled and re-ran the last MF_test.lua script.  It crashed in the aflock test.
Thanks for doing this.   

I think what we have learned is that doing a set_focus() while the camera is still cleaning up from the precious shot can be fatal.  I guess we need to check something like get_shooting() before letting set_focus() complete - reyalp posted some ideas about this earlier.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 13673
Re: Setting focus from scripts or menus
« Reply #345 on: 12 / March / 2014, 23:41:11 »
I''m hoping someone with a camera that crashes when Shoot Full is enabled can test and post the ROMLOG.
For complete one was posted here http://chdk.setepontos.com/index.php?topic=11078.msg110961#msg110961 followed by my dissection.

Quote
Or just leave CAN_SD_OVER_IN_AFL undefined?
This would be fine if the affected cameras have another working method. Otherwise it's a bit painful.
Don't forget what the H stands for.

Re: Setting focus from scripts or menus
« Reply #346 on: 12 / March / 2014, 23:48:22 »
I''m hoping someone with a camera that crashes when Shoot Full is enabled can test and post the ROMLOG.
For complete one was posted here http://chdk.setepontos.com/index.php?topic=11078.msg110961#msg110961 followed by my dissection.
Doesn't seem to match the scenario we worked through tonight in the previous posts about set_aflock() crashes?

Quote
Quote
Or just leave CAN_SD_OVER_IN_AFL undefined?
This would be fine if the affected cameras have another working method. Otherwise it's a bit painful.
So far, almost all cameras work with set_mf().  The few that don't work with set_aflock() the way it is.  Not to say the next three cameras ported won't be different but maybe we cross that bridge when we come to it?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 13673
Re: Setting focus from scripts or menus
« Reply #347 on: 13 / March / 2014, 00:12:52 »
Doesn't seem to match the scenario we worked through tonight in the previous posts about set_aflock() crashes?
You are right, it's the same assert but nafrafs was in capt_seq, which suggest the override hook was trying to set focus. Now that I think about it, that's odd, because it should try to do a set_now in aflock.

Quote
So far, almost all cameras work with set_mf().  The few that don't work with set_aflock() the way it is.  Not to say the next three cameras ported won't be different but maybe we cross that bridge when we come to it?
Yeah, if we don't find anything better that seems like a reasonable option.
Don't forget what the H stands for.


Re: Setting focus from scripts or menus
« Reply #348 on: 13 / March / 2014, 00:20:06 »
You are right, it's the same assert but nafrafs was in capt_seq, which suggest the override hook was trying to set focus. Now that I think about it, that's odd, because it should try to do a set_now in aflock.
Curiously,  in rkomar's tests,  it dies in the keyboard task when he has RAW enabled and in capt_set otherwise. 

It seems that a suitable wait for the previous shooting action to complete clears up the problem  (all the crash results reported have been after the first shot IIRC).  We could either recommend people do that in their script or find a way to let set_focus() know when its okay to start?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #349 on: 13 / March / 2014, 09:30:04 »
The results for the Canon PowerShot S110 (102b).

But testing my self using chdkptp -i, using the following script, I cannot set the focus:

Code: [Select]
con> connect(0)
connected: Canon PowerShot S110, max packet size 512
con> =set_record(1)
con 1> =set_aflock(1)
con 2> =return get_focus()
3:return:207
con 3> =set_prop(require('propcase').AF_LOCK, 1)
con 4> =set_focus(1000)
con 5> =return get_focus()
6:return:207
con 6> =press 'shoot_half'
con 7> =return get_focus()
8:return:207
con 8> =press 'shoot_full'
con 9> =release 'shoot_full'
con 10> =return get_focus()
11:return:207

The value 207 makes sense in my case, since I have an object in front of the camera. The camera mode is P.

Should the above work or am I missing something?
« Last Edit: 13 / March / 2014, 10:43:03 by Chau »

 

Related Topics