Shot Histogram Request - page 31 - CHDK Releases - CHDK Forum

Shot Histogram Request

  • 467 Replies
  • 141946 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Shot Histogram Request
« Reply #300 on: 25 / April / 2013, 00:28:42 »
Advertisements
0x310252 is the Lres value (confirmed in the script log). "resume yield" means resume is resuming from a yield (rather than starting the script).

Taking the lua load address as 0x309178, this makes the lres 0x70da in the lua module, which is not the same as before, but not far off. According to lua.elf.objdump, this would correspond to
Code: [Select]
000070d8 <luaD_reallocstack>:
    70d8: b5f0      push {r4, r5, r6, r7, lr}
    70da: 6a03      ldr r3, [r0, #32]

There is a 36 byte header loaded as part of the module so you need to go back 36 bytes in the dump to get to the address.

The code at 70da is in the luaD_rawrunprotected function @ 70b6 in the dump:
Code: [Select]
    70b4: b01c      add sp, #112 ; 0x70
    70b6: 6e18      ldr r0, [r3, #96] ; 0x60     <---- here
    70b8: bc10      pop {r4}

So Lres contains the address of the instruction that is loading the status return value into r0  ???

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

  • ******
  • 14114
Re: Shot Histogram Request
« Reply #301 on: 27 / April / 2013, 00:49:10 »
There is a 36 byte header loaded as part of the module so you need to go back 36 bytes in the dump to get to the address.
Good to know. Thinking about this, module code should probably be 32 bit aligned. 2 byte alignment should be fine for thumb, but modules can have ARM too (setjmp in Lua, for example)

I don't think this is the cause of the script problem though, since it's been happening from before Lua was a module.

edit:of course it is.
Quote
So Lres contains the address of the instruction that is loading the status return value into r0  ???
This must be a clue, but damned if I know what it means...
« Last Edit: 27 / April / 2013, 20:54:00 by reyalp »
Don't forget what the H stands for.

Re: Shot Histogram Request
« Reply #302 on: 05 / May / 2013, 11:21:31 »
Hey Lapser, great work.

I've been digging into the CHDK stuff this week before a trip to Juneau (hoping it'll only rain 80% of the time I am there), and I'd be interested in trying this out on my SX260_100b and S100_101b.

I'm planning to run some testing the next couple nights. I can see if I run into the same issue you have been.

Keep up the good work!
s100_101b, sx260HS_100b

*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #303 on: 09 / May / 2013, 23:22:00 »
I'd be interested in trying this out on my SX260_100b and S100_101b.

I'm planning to run some testing the next couple nights. I can see if I run into the same issue you have been.
I think Phil found the bug we were working on and fixed it. The attached CHDK builds should have the fix included. I'll post the latest script in the next message.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


*

Offline lapser

  • *****
  • 1093
Time Lapse Script
« Reply #304 on: 09 / May / 2013, 23:33:51 »
Here's the script that works with the CHDK builds in the last post.

Most of the defaults should work OK. You can change the interval to as short as 500 msec. Try setting the log file parameter to 0 if the camera can't keep up. I usually set the focus to 1 (hyperfocal distance) for sunset time lapsing.

Try putting the camera in manual focus mode before starting the script if you have focus trouble, or the S100 crashes with the first picture.

Put the camera in continuous drive mode for faster shooting, and to see the pictures on the screen between shots. It works best in Av mode, since the script doesn't change the aperture.

The script starts out by setting the metering areas. You press <display> to go to the next meter, or <menu> to start taking pictures. Just press menu if you want a single, centered meter.

I hope you have time try the script before you have to leave. Good luck!
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Shot Histogram Request
« Reply #305 on: 10 / May / 2013, 01:16:50 »
S100 is happily taking photos in a first test, but SX260 is giving me "Fail to load lua.flt: bad import symbol". I haven't seen much on the forums about fail to load errors for ideas about what may have caused that error. *.bas scripts run ok, but nothing *.lua will run with that build on the SX260.

I tried using the lua.flt file from the S100 build, but same error (not sure if that was a useless troubleshooting effort if that's a file that's generated from the build for a specific camera). I remember seeing something about needing to boot from the SD card rather than from the load firmware option for your builds... I used STICK to create the build on this card, then deleted the modules folder and replaced with the one in your file, but the card didn't boot on the SX260 (I used the same method on the S100 and it booted to the card without issue).

A note on the S100... I was only able to move the first metering area. on the S100 the display button is down on the circle (the buttons outside the circle are ring func, movie record, playback, and menu). I tried other buttons to figure which might change metering areas, but did not have much luck. I didn't see a list of possible keys in the CHDK scripting page on the WIKI for that function to update the script for a different button, such as the ring/func?

Thanks for the builds!


s100_101b, sx260HS_100b

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Shot Histogram Request
« Reply #306 on: 10 / May / 2013, 01:31:38 »
S100 is happily taking photos in a first test, but SX260 is giving me "Fail to load lua.flt: bad import symbol". I haven't seen much on the forums about fail to load errors for ideas about what may have caused that error. *.bas scripts run ok, but nothing *.lua will run with that build on the SX260.

Make sure you've copied the entire contents of the build (including the CHDK/MODULES folder) to the SD card.

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)

Re: Shot Histogram Request
« Reply #307 on: 10 / May / 2013, 02:06:13 »
I have tried copying the entire modules folder from the .zip onto the card. I have also tried deleting the CHDK/Modules folder on the card, then copying the entire MODULES folder from the unzipped CHDK folder. Both methods gave me the same error. Is there a different way I should copy or anything I need to do to the files before copying? ( I have a vague recollection of an "@something" that macs append that needs to be removed, but I can't remember what the issue was or if it was related to .zip files, I'll try to keep searching tomorrow).

s100_101b, sx260HS_100b


*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #308 on: 10 / May / 2013, 02:48:36 »
A note on the S100... I was only able to move the first metering area. on the S100 the display button is down on the circle (the buttons outside the circle are ring func, movie record, playback, and menu). I tried other buttons to figure which might change metering areas, but did not have much luck. I didn't see a list of possible keys in the CHDK scripting page on the WIKI for that function to update the script for a different button, such as the ring/func?
It's never simple, is it? Here's the key map for the S100 that's in CHDK:
Code: [Select]
// Keymap values for kbd.c. Additional keys may be present, only common values included here.
static KeyMap keymap[] = {
    { 0, KEY_ERASE           ,0x00000001 },
    { 0, KEY_DOWN            ,0x00000002 }, // Found @0xff45373c, levent 0x05
    { 0, KEY_DISPLAY         ,0x00000002 },
    { 0, KEY_LEFT            ,0x00000004 }, // Found @0xff453744, levent 0x06
    { 0, KEY_MENU            ,0x00000008 }, // Found @0xff45374c, levent 0x09
    { 0, KEY_SET             ,0x00000020 }, // Found @0xff45375c, levent 0x08
    { 0, KEY_UP              ,0x00000040 }, // Found @0xff453764, levent 0x04
    { 0, KEY_RIGHT           ,0x00000080 }, // Found @0xff45376c, levent 0x07
    { 0, KEY_ZOOM_OUT        ,0x00008000 }, // Found @0xff4537ac, levent 0x03
    { 0, KEY_ZOOM_IN         ,0x00010000 }, // Found @0xff4537b4, levent 0x02
    { 0, KEY_VIDEO           ,0x00000100 },

    { 1, KEY_PRINT           ,0x00800000 }, // ALT menu on PLAYBACK button
    { 1, KEY_PLAYBACK        ,0x00800000 },
    { 1, KEY_SHOOT_FULL      ,0x00300000 }, // Found @0xff4537dc, levent 0x01
    { 1, KEY_SHOOT_FULL_ONLY ,0x00200000 }, // Found @0xff4537dc, levent 0x01
    { 1, KEY_SHOOT_HALF      ,0x00100000 }, // Found @0xff4537d4, levent 0x00

    { 0, 0, 0 }
};
I don't see a ring function key in there. It doesn't seem useful to have the CHDK display and down buttons map to the same key. On the G1X, the CHDK display button maps to the lower left key.  Wouldn't it be better to map KEY_DISPLAY to the ring function key, similar to the G1X?

You can edit the script to change the key, with a text editor. You need to change line 147, which currently reads:

    elseif (is_key("display"))then

Try
    elseif (is_key("erase"))then
Or
    elseif (is_key("video"))then

As for the sx260 loading problem, I suggest you erase all the files off the card and download the latest Full version of CHDK for the camera. Set the write protect tab, and make sure it auto boots.

Then unzip my build, select all the files and folders in my build, and drag them to the root of the SD card. Choose the option to overwrite everything. Set the write protect tab and auto boot with my build.

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

Re: Shot Histogram Request
« Reply #309 on: 12 / May / 2013, 17:11:07 »
Thanks for the help! I have everything working now.

The "erase" key is the same as the ring/func key and changing that as you suggested allowed me to switch between metering windows on the S100.

I set my SX260 card to bootable from the CHDK menus then re-copied the autobuild to get it to auto-boot, then copied your build onto the card and it worked. Not sure exactly where I went wrong the first couple times, but I have created a second card that works using and then copying Lapser's build on top.

I tried a couple 'sunrises.' The script worked nicely on the change from dark to light, but my city view is pretty boring,cloudy, and full of lights. I did manage to get a group of pics for Star Trails last night.

Looks pretty Rainy for the trip, but if I get a clear night, I'll let you know how it came out.
s100_101b, sx260HS_100b

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal