Multiple Bug's (Live View / Zoom / Shoot) - page 6 - General Discussion and Assistance - CHDK Forum
supplierdeeply

Multiple Bug's (Live View / Zoom / Shoot)

  • 86 Replies
  • 3448 Views
*

Offline reyalp

  • ******
  • 12159
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #50 on: 09 / September / 2019, 23:34:34 »
Advertisements
Do you have something against adding this patch (I mean the core/shooting.c and include/camera.h part)? It's possible that it could be made better, but I'm not sure how.
Seems like a good idea to me.

A few comments:
I think the while (focus_busy) msleep(10) should time out eventually,  and not try to set focus in that case. A second or a few seems like it should be plenty

Rather than the ifdefs in the if statement I'd prefer something like
Code: [Select]
#ifdef PROPCASE_CONTINUOUS_AF
        if(shooting_get_prop(PROPCASE_CONTINUOUS_AF))
         return
#endif
..
You could maybe just use shooting_can_focus, shooting_set_focus will not actually try to set focus if those conditions aren't met, but the video check might be suspect (allowing focus when it wouldn't otherwise be allowed)

Finally, does this need to be a new ifdef? It seems like it should apply or be harmless for most cameras.
Don't forget what the H stands for.

*

Offline Caefix

  • **
  • 54
  • Sorry, busy deleting test shots...
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #51 on: 10 / September / 2019, 13:14:09 »
 ??? SX220 Troublescooting literature...
All lifetime is a loan from eternity.

*

Offline srsa_4c

  • ******
  • 4031
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #52 on: 10 / September / 2019, 18:53:44 »
Thanks for the comments.
I think the while (focus_busy) msleep(10) should time out eventually,  and not try to set focus in that case.
I considered that too, but seeing that it's never done in current code made me decide otherwise.

But I just thought of something. What if we added the focus_busy check (with timeout) to the beginning of lens_set_focus_pos()? That would in theory deal with set_focus crashes too (well, mostly)?

*

Offline reyalp

  • ******
  • 12159
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #53 on: 10 / September / 2019, 23:07:27 »
I considered that too, but seeing that it's never done in current code made me decide otherwise.
Fair point.
Quote
But I just thought of something. What if we added the focus_busy check (with timeout) to the beginning of lens_set_focus_pos()? That would in theory deal with set_focus crashes too (well, mostly)?
That seems OK to me. Should remove the need for the CONTINUOUS_AF / SERVO_AF checks in set_zoom, since lens_set_focus shouldn't be called if shooting_can_focus fails.
Don't forget what the H stands for.


*

Offline Caefix

  • **
  • 54
  • Sorry, busy deleting test shots...
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #54 on: 12 / September / 2019, 14:36:36 »
 ??? SX200 behavior + Ixus870 curiosity...
All lifetime is a loan from eternity.

*

Offline Caefix

  • **
  • 54
  • Sorry, busy deleting test shots...
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #55 on: 19 / September / 2019, 13:37:50 »
 :haha ??? extended Troublescouting ...
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 12159
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #56 on: 19 / September / 2019, 15:08:14 »
:haha ??? extended Troublescouting ...
It would be much more helpful to have minimal reproducible cases than a bunch of romlogs with little context.

I tend to prioritize things that clearly impact real use cases. While it would be great if CHDK never crashed, the fact that spamming zoom/focus calls crashes some cameras is not unexpected.
Don't forget what the H stands for.

*

Offline Caefix

  • **
  • 54
  • Sorry, busy deleting test shots...
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #57 on: 21 / September / 2019, 11:43:15 »
 :haha  :-*  >:(  8)    + + - -

If a pattern like this would appear, then a solution was near.
Probably it needs a year, maybe only one beer or two.
A blizzard could cat-alyze it too, depends on todo and voodoo.
Let´s look, what we can do for You.

I am far above contented how CHDK is implemented.
Far from cry & terror I try & error.
The best for the guest to rest, the rest for us to test a quest.

SX210, 230 & Ixus255 at last already got rid of distortion in Your testbuilds fast.
Some commmon Romlogs became repeatable or switchable, maybe featureable on each cam?
Seems successful somehow, with or without romlogs...
Could be continued right now or after first snow...
All lifetime is a loan from eternity.


*

Offline srsa_4c

  • ******
  • 4031
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #58 on: 21 / September / 2019, 18:12:41 »
Next try of the focus_busy patch (debug version), with the focus_busy check moved to shooting_set_focus().
Code: [Select]
Index: core/main.c
===================================================================
--- core/main.c (revision 5272)
+++ core/main.c (working copy)
@@ -81,6 +81,13 @@
     finished();
 }
 
+// for debug display
+static int misci[2] = {0,0};
+void main_incmisci(int which, int val)
+{
+    misci[which] += val;
+}
+
 int core_get_free_memory()
 {
     cam_meminfo camera_meminfo;
@@ -326,10 +333,10 @@
 
         i = 0;
 
-#ifdef DEBUG_PRINT_TO_LCD
-        sprintf(osd_buf, "%d", cnt ); // modify cnt to what you want to display
+//#ifdef DEBUG_PRINT_TO_LCD
+        sprintf(osd_buf, "%d:%d", misci[0], misci[1] ); // modify cnt to what you want to display
         draw_txt_string(1, i++, osd_buf, user_color(conf.osd_color));
-#endif
+//#endif
 #if defined(OPT_FILEIO_STATS)
         sprintf(osd_buf, "%3d %3d %3d %3d %3d %3d %3d %4d",
                 camera_info.fileio_stats.fileio_semaphore_errors, camera_info.fileio_stats.close_badfile_count,
Index: core/shooting.c
===================================================================
--- core/shooting.c (revision 5272)
+++ core/shooting.c (working copy)
@@ -1250,6 +1250,26 @@
             }
             if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST))
                 s+=shooting_get_lens_to_focal_plane_width();
+
+            // Wait while focus is reported busy, return without setting focus on timeout
+            int rep = 100; // wait up to 1 second
+            while (focus_busy) {
+                if (--rep <= 0) {
+#if 1
+                    extern void main_incmisci(int which, int val);
+                    main_incmisci(0,1);
+#endif
+                    return;
+                }
+                msleep(10);
+            }
+#if 1
+            if (rep < 100) {
+                extern void main_incmisci(int which, int val);
+                main_incmisci(1,1);
+            }
+#endif
+
             lens_set_focus_pos(s);
         }
         else
Index: platform/sx210is/platform_camera.h
===================================================================
--- platform/sx210is/platform_camera.h (revision 5272)
+++ platform/sx210is/platform_camera.h (working copy)
@@ -107,6 +107,10 @@
 
     #define CAM_AV_OVERRIDE_IRIS_FIX        1
 
+    #define CAM_USE_OPTICAL_MAX_ZOOM_STATUS 1   // Use ZOOM_OPTICAL_MAX to reset zoom_status when switching from digital to optical zoom in gui_std_kbd_process()
+    #define CAM_USE_ALT_SET_ZOOM_POINT      1    // Define to use the alternate code in lens_set_zoom_point()
+    #define CAM_USE_ALT_PT_MoveOpticalZoomAt 1    // Define to use the PT_MoveOpticalZoomAt() function in lens_set_zoom_point()
+
     #define CAM_SD_OVER_IN_AFL              1
     #define CAM_SD_OVER_IN_MF               1
 
Index: platform/sx210is/sub/100c/stubs_entry.S
===================================================================
--- platform/sx210is/sub/100c/stubs_entry.S (revision 5272)
+++ platform/sx210is/sub/100c/stubs_entry.S (working copy)
@@ -42,7 +42,7 @@
 DEF(canon_menu_active                       ,0x0000368c) // Found @0xff891c4c
 DEF(canon_shoot_menu_active                 ,0x00008511) // Found @0xff9b5a6c
 DEF(playrec_mode                            ,0x000033bc) // Found @0xff883e64
-//DEF(zoom_status                             ,0x0000d544) // Found @0xffad4e40, ** != ** stubs_min = 0x0000d524 (0xD524)
+DEF(zoom_status                             ,0x0000d544) // Found @0xffad4e40
 DEF(some_flag_for_af_scan                   ,0x000075d8) // Found @0xff970d5c
 // focus_len_table contains zoom focus lengths for use in 'get_focal_length' (main.c).
 // each entry contains 3 int value(s), the first is the zoom focus length.
@@ -50,7 +50,7 @@
 DEF(focus_len_table                         ,0xfffea1cc) // Found @0xfffea1cc
 DEF(zoom_busy                               ,0x00007140) // Found @0xff969464
 DEF(focus_busy                              ,0x00006fc8) // Found @0xff9639d0
-//DEF(recreview_hold                          ,0x00004140) // Found @0xff8a3648, ** != ** stubs_min = 0x00008144 (0x804C+0xF8)
+DEF(recreview_hold                          ,0x00004140) // Found @0xff8a3648
 DEF(viewport_buffers                        ,0xffb64808) // Found @0xff84fd4c
 DEF(active_viewport_buffer                  ,0x00002058) // Found @0xff84fae8
 // Camera appears to have only 1 RAW buffer @ 0x41db3b80 (Found @0xffb2fb2c)
Index: platform/sx210is/sub/100c/stubs_min.S
===================================================================
--- platform/sx210is/sub/100c/stubs_min.S (revision 5272)
+++ platform/sx210is/sub/100c/stubs_min.S (working copy)
@@ -1,7 +1,5 @@
 #include "stubs_asm.h"
 
-DEF(zoom_status,                        0xD524)         // ASM1989  09.19.10 -> FFAD4E40  Like in sx20 at FFAAF3EC search for "TerminateDeliverToZoomController"
-DEF(recreview_hold,                     0x804C + 0xF8)  // ASM1989 08.30.2010 looks like FF9A0B38 0x804C  but not sure about 0x0C -> Not Ok 09.19.10 FF9A1684 like in sx20  was F8
 DEF(enabled_refresh_physical_screen,    0x9D48+0x20)    // found at FFA1EE18 and FFA1EFB4 and FFA1EE5C -> ASM1989 08.21.2010 ?guesswork, FFA1EDDC  ->0x20  , but maybe 24???
 DEF(led_table,                          0x24A0 + 0x04)  // found at FF860EF0 & FF860EEC  -> ASM1989 08.21.2010 double checked
 
It draws two numbers permanently on screen. First one would increase when setting focus failed due to a focus_busy timeout, second one would increase when focus was busy but did not time out. I've yet to find a camera where any of those numbers change from zero. Does anyone want test builds with this change?

*

Offline Caefix

  • **
  • 54
  • Sorry, busy deleting test shots...
Re: Multiple Bug's (Live View / Zoom / Shoot)
« Reply #59 on: 23 / September / 2019, 13:08:14 »
 :D Yes, we canon!  8)
[] [] [] [] [] [] __ __ __
...
Maybe yellow is the wrong color?  :P

How about sx50hs-100c testbuild?

{Finally found charger missing since #5163
...& romlogs, similar untouched sx230:
ASSERT!! FocusLensController.c Line 708
Same headline, but several different stories available...}

Is there a check (zoom_busy or focus_busy) in get_shooting() ?

PS: a list of some other distorted cams ):(( Ixus 120,125,130,230,240,310,870+980, S90,95, SX 200
      Some Zoom lever issues: SX 200,220,240,260,610

SX50-Asserts...
« Last Edit: 03 / October / 2019, 14:02:17 by Caefix »
All lifetime is a loan from eternity.

 

Related Topics