CHDKPTP - PC Remote Control Performance Analysis

  • 465 Replies
  • 23638 Views
*

Offline SticK

  • *****
  • 779
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #340 on: 01 / October / 2012, 08:32:58 »
Advertisements
Quote "- does the camera always crash when exiting the menu, or only after "visiting" certain parts of it?"

Visiting, changing parameters and exiting the top-level menu has worked OK every time I've tried it so far.  It's when I go to a 2nd level menu (eg. of the type "Menu item ...") change something there, exit the 2nd level back into the top level (which works), and then when I try to exit the top level is when I get the freeze.  In a couple cases I recall I got the "script already running" message.  Also if I recall correctly in one case, when going to a 3rd level, I was able to set the parameter, but it froze right after attempting to exit the 2nd level.  Basically you could sum it up as "unable to exit the immediate higher-level menu when accessing a lower-level menu".

Quote "- what happened between the powerup and the crash (rec or play mode, any other activities)?"

PUP, REC, Viewfinder ON, UI ON, that's the minimum.  I have not tried it in PUP (PLAY default).

Quote "- can you try with the other build (if you used mine, try reyalp's to prove it's not some compiler toolchain related issue)?"

Good question.  Yes indeed this has happened on reyalp's builds a few times already and I may have mentioned it.  But now that I can't operate the 101a camera directly, it has become more important. 

Also, I can't give you a ROMLOG from that camera because CHDK menus don't respond to =click("menu") (or the MENU button) after setting =enter_alt().  =enter_alt() and =exit_alt() do work however.

edit: correction -- =click("menu"), not =press("menu")
« Last Edit: 01 / October / 2012, 08:43:30 by SticK »

*

Offline srsa_4c

  • ******
  • 3171
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #341 on: 01 / October / 2012, 08:50:53 »
Also, I can't give you a ROMLOG from that camera because CHDK menus don't respond ...
Yes, you can. There's a script named romlog.lua in chdk/scripts/test, which you can execute remotely via ptp. update: Can't find any obvious way to do this directly, so I suggest you to use your other camera to debug

After you get the log, you can try to make a simple script consisting of clicks and sleeps to simulate what chdkptp is doing. Try to execute that remotely and manually (your other camera should show the same symptoms, you can use that).
« Last Edit: 01 / October / 2012, 09:10:55 by srsa_4c »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #342 on: 01 / October / 2012, 09:21:52 »
ROMLOG // That worked // Here you go ... this one is from 101a yesterday, so it's a good one for the Canon menu problem.  Getting a romlog from this camera is important in case of other failures, so it's useful this works.

Quote "After you get the log, you can try to make a simple script consisting of clicks and sleeps to simulate what chdkptp is doing"

I don't have clear what you need here, but if you can give me some clear examples that could help ... perhaps .. are you asking me to write down the button press sequences ??  I might not be too good at this yet!

edit: I used =loadfile('A/chdk/scripts/test/romlog.lua')(), but it took me a long while to figure this out.  I googled and searched the links // nothing ... then I vaguely remembered that reyalp sent me code to ROM dumps wherein I found the syntax.  Examples always help.
« Last Edit: 01 / October / 2012, 09:53:16 by SticK »

*

Offline srsa_4c

  • ******
  • 3171
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #343 on: 01 / October / 2012, 09:53:59 »
ROMLOG // That worked // Here you go ... this one is from 101a yesterday, so it's a good one for the Canon menu problem.  Getting a romlog from this camera is important in case of other failures, so it's useful this works.
Thanks, I'll look at it later.

Quote
I don't have clear what you need here, but if you can give me some clear examples that could help ... perhaps .. are you asking me to write down the button press sequences ??
Exactly. See the click and sleep commands http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page
Code: [Select]
click("menu")
sleep(100)
click("down")
etc...
Quote
edit: I used =loadfile('A/chdk/scripts/test/romlog.lua')()
Thanks, now I know this one too :)


*

Offline SticK

  • *****
  • 779
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #344 on: 01 / October / 2012, 11:00:32 »
my Quote: "are you asking me to write down the button press sequences ??"
your Quote: "Exactly."

The sequence would differ I am sure from my camera to yours because very likely the menu layouts are different.  When you have the time, you can try this basic strategy to see if you can replicate the fault on yours:
  > Put in REC mode
  > Invoke Canon menu
  > scroll down until you find a 2nd level menu entry of the type "Menu item ..." like "Flash Settings ..."
  > MENU go into the 2nd level
  > choose an option to change
  > change the option (on the S90 this still works at this point)
  > MENU back, should work OK
  > MENU back to exit main menu  -->> it's here I get the fault on the S90.

If you can't replicate, we'll figure out another way later.

BTW, I did not intend to distract you from your USB file transfer endeavor // just for now it's good to document these side-issues as they occur for the record (attack later perhaps depending on severity or for general public use) as they are not showstoppers here, AFAICT for now.  Most important is that the 101a does not shut off by issuing =set_config_value(67,3), and we can get a romlog.  Very nice however that you did solve the tearing problem ... because ... right now I am simulating motion control and the ability to stabilize the specimen in the viewport, and your solution is delivering great results.  In fact I can add right now that it is significantly easier to use than Canon RemoteCapture already in so many respects that are too long to list!  Getting in AF point zoom would be really interesting at some point, perhaps after USB file transfer.  I am very interested in testing out post-shoot write detect when you get around to it // cheers!

*

Offline srsa_4c

  • ******
  • 3171
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #345 on: 01 / October / 2012, 11:30:14 »
my Quote: "are you asking me to write down the button press sequences ??"
your Quote: "Exactly."

The sequence would differ I am sure from my camera to yours because very likely the menu layouts are different.  When you have the time, you can try this basic strategy to see if you can replicate the fault on yours:
  > Put in REC mode
  > Invoke Canon menu
  > scroll down until you find a 2nd level menu entry of the type "Menu item ..." like "Flash Settings ..."
  > MENU go into the 2nd level
  > choose an option to change
  > change the option (on the S90 this still works at this point)
  > MENU back, should work OK
  > MENU back to exit main menu  -->> it's here I get the fault on the S90.

If you can't replicate
Me, replicate? No, you should write a very simple script (using the commands in my previous post), that instructs the camera to do this. Just start that script in rec mode. So, again:
Code: [Select]
click("menu")
sleep(100)
click("down")
sleep(100)
click("down")
sleep(100)
click("down")
sleep(100)
click("set")
... and so on.
My favourite testing camera doesn't crash when visiting deeper menu levels, it's an issue with yours.
Please try to make and run a script like this, then report what happens.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #346 on: 01 / October / 2012, 12:04:38 »
Quote "that instructs the camera to do this. "

... "the" means "mine" or "yours"?  That's where the murkiness is?  I thought you wanted to run a script on yours.

Quote "Please try to make and run a script like this, then report what happens."

Mine it seems -- is your objective is to see the difference between a script and pushing buttons on CHDKPTP with my S90?  // I think so since you don't get the fault in yours // OK then.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #347 on: 01 / October / 2012, 14:13:03 »
ZIP attached.  Usage:
  > assumes you have CHDKPTP\  and  CHDKPTP\lua directories
  > assumes your exe is in CHDKPTP\
  > menu.lua goes in your CHDKPTP\lua directory
  > the other two files go in CHDKPTP\
  > to run CHDKPTP I use start.bat
  > I write !menu_problem() in the command line.

I ran the script 20 times and still OK.  However when using CHDKPTP menu button I do get the fault.  What I can determine at present is that there are two possibilities ...
   #1) Related to pushing MENU in rapid-fire ... when returning back up the tendency is to do just that (because one does not need to wait for liveview feedback to read menu items), and I get unrecoverable "error script already running," followed by a disconnect.  QUESTION:  Are the commands not queued?  Do I have to wait between button pushes?  Can you enlighten me?
   #2) So next to be sure I exclude #1, if I take coffee break between button pushes specifically on the way back up, then I *can* get a successful return to liveview after the 1st attempt following reboot.  However ........ on a 2nd attempt, even being careful not get "script already running," I get the freeze where shown in menu.lua.

In other words, certainly for the S90, I sense there is something different between running script and CHDKPTP button usage.  This is the best I can do.

edit: my CHDKPTP is r291.
« Last Edit: 01 / October / 2012, 14:27:07 by SticK »


*

Offline srsa_4c

  • ******
  • 3171
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #348 on: 01 / October / 2012, 16:55:58 »
@SticK
To keep it short: the issue is caused by CHDK's screen refresh routine ( vid_bitmap_refresh() ). Normally, CHDK display is inactive while one is browsing the Canon menu. However, when scripting is involved, the script console gets regularly refreshed which triggers the above mentioned CHDK routine. This seems to clash with something related to the drawing of the Canon menu.
I have made some changes to that routine, you can find test builds (test2) at the usual place.
It's enough to test on only one camera. If the issue is resolved, see whether there are  redrawing problems with anything CHDK-related on the screen.
« Last Edit: 01 / October / 2012, 16:59:31 by srsa_4c »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP - PC Remote Control Performance Analysis
« Reply #349 on: 01 / October / 2012, 18:29:09 »
Behavior is a bit different ... these are typical and may occur on any of the two cameras. 

100c
Reboot
 > MENU
 > Scroll to Custom Display ...
 > RIGHT
 > I see the options
 > SET // OK
 > MENU: up
 > MENU: freeze: ERROR not connected. (no errors in DOS box).
Reboot
 > MENU
 > Scroll to Custom Display ...
 > SET
 > Camera LCD and Liveview go dark
 > SET // OK & Custom Display panel appears on both ==>> even though dark, the option was toggled.
 > MENU: up
 > MENU: up // OK liveview ON // OK

========

101a
Reboot
 > Press MENU
 > Scroll to Custom Display ...
 > Press RIGHT
 > CHDKPTP liveview is dark (as above)
 > If I press a reasonable button, like SET, the operation takes place and panel reappears
 > MENU: up
 > MENU: freeze: ERROR not connected. (no errors in DOS box).

Next .....

Discovery of the day.  I noticed the faults became less frequent when I observed the scrolling hints are the screen bottom.  It would work best when I pressed MENU after the hint pause.  Attached is a case where I intentionally pressed MENU during a hint scroll where the liveview hung as you see in Fig 1.  When I set Hints and Tips OFF, the behavior improved a lot.  Now the worst thing that happens AFAIK, is pressing MENU results in a temporary stall, Fig 2.  Pressing MENU again does eventually return to liveview.  If I try rapid-fire MENU, I do get the "script is already running" but it is benign, camera continues to work. 

The question now is whether or not your previous version will work better, same, or worse.  What do you think?

 

Related Topics