Exposure setting problems...again! - General Help and Assistance on using CHDK stable releases - CHDK Forum

Exposure setting problems...again!

  • 10 Replies
  • 2583 Views
Exposure setting problems...again!
« on: 21 / May / 2021, 12:11:59 »
Advertisements
I’m not that stupid, but when it comes to understanding and setting exposures in Lua CHDK, I’m an idiot.


Take the current weirdness I’m experiencing.


My code changes exposure and the changes are seen being reported by the Canon UI and in the histogram and in the LCD’s brightness.


I then attempt to manually change the code changed exposure and the exposure jumps back to the value it was at before the Lua code changed it.


I’ve used half_shutters in an attempt to lock the code changed shutter in, and am mystified why the shutter jumps back to its original value.


As I say, I must be an idiot, as after all this time coding in CHDK Lua, I’m still not ‘getting it’.


If anyone understands what I’ve said and can flag up the error of my ways, I would be grateful.

*

Offline reyalp

  • ******
  • 14080
Re: Exposure setting problems...again!
« Reply #1 on: 21 / May / 2021, 13:26:49 »
I'm having trouble understanding exactly what you are doing. If you can lay out the sequence step by step, listing the specific lua functions and settings used and where half press is entered and released, that might help.

If you are attempting to change the exposure with Canon controls *after* setting values with CHDK, the end result will depend very much on the specifics, but in general I'm having trouble imagining a scenario where it would result in useful behavior.
Don't forget what the H stands for.

Re: Exposure setting problems...again!
« Reply #2 on: 22 / May / 2021, 03:01:30 »
@reyalp

I’ve PMed a video of what’s going on.

The bottom line is: how best to make a CHDK exposure setting be fully locked into the Canon side, without taking an image.

*

Offline reyalp

  • ******
  • 14080
Re: Exposure setting problems...again!
« Reply #3 on: 22 / May / 2021, 04:55:55 »
I’ve PMed a video of what’s going on.

The bottom line is: how best to make a CHDK exposure setting be fully locked into the Canon side, without taking an image.
I'm afraid I really can't tell what's happening in the video. I have no idea which functions are called, or what the half press state is, or which changes are in response to manual inputs. Keep in mind that I have not used your script, and do not own an M3.

If you want to know why a specific sequence of events behaves the way it does, you need to describe that specific sequence, preferably reduced to the minimum needed to demonstrate the behavior.

With that said, it sounds like you are expecting CHDK overrides to work a different way from how they actually work. Overrides are generally applied to shooting, changing values under the hood lower level than the Canon UI. The user* propcases are a bit different, but they're still at a lower level than the Canon UI, so scripted changes being nuked by Canon UI manipulation is expected.

If you want to set initial values from script, and then adjust them further manually, you almost certainly need to either:
1) Control everything through the Canon UI, using script key presses or post_levent_to_ui for the scripted part
or
2) Control everything through script by creating a UI that responds to key presses to further adjust the CHDK settings
Don't forget what the H stands for.


Re: Exposure setting problems...again!
« Reply #4 on: 22 / May / 2021, 05:11:41 »
@reyalp

Thanks for the insight.

I’ll look at what you say in more detail and experiment.

Cheers

Garry

Re: Exposure setting problems...again!
« Reply #5 on: 22 / May / 2021, 05:35:16 »
@reyalp

Quote
Control everything through script by creating a UI that responds to key presses to further adjust the CHDK settings

I understand this, but, unless I've got it wrong, at least on the M3, changing shutter is controlled by Canon through rotating the large dial, and that 'key press' is not detectable by CHDK, ie the direction the wheel is rotated.

Or am I wrong...again  :-[

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: Exposure setting problems...again!
« Reply #6 on: 22 / May / 2021, 11:51:03 »
 ???
Code: [Select]
set_aelock(1)?
All lifetime is a loan from eternity.

Re: Exposure setting problems...again!
« Reply #7 on: 22 / May / 2021, 12:30:17 »
@Caefix

I had thought of that, but 'all' it does is do what it is meant to do: lock the exposure.

Thus when subsequently attempting to change the exposure, it doesn't jump to the original shutter, it simply remains fixed irrespective of what the you try and dial in.

Thanks for the thought.


Re: Exposure setting problems...again!
« Reply #8 on: 22 / May / 2021, 12:40:07 »
@Caefix

...plus, I think I’ve concluded that the functionality I was tying to achieve in my script can’t be done, ie manually adjust exposure after the script has adjusted exposure and before taking an image.

*

Offline reyalp

  • ******
  • 14080
Re: Exposure setting problems...again!
« Reply #9 on: 22 / May / 2021, 16:17:46 »
I understand this, but, unless I've got it wrong, at least on the M3, changing shutter is controlled by Canon through rotating the large dial, and that 'key press' is not detectable by CHDK, ie the direction the wheel is rotated.
Script doesn't *receive* jogdial / control wheel events (at least, not without hackery involving peek at MMIOs or firmware variables), but it can send them, either using wheel_left() and wheel_right() or post_leven_to_ui https://chdk.fandom.com/wiki/Lua/Lua_Reference/Levent

So if you can make the initial scripted histogram based exposure adjustments using one of these (for example, by simulating rotating the dial to change shutter speed) subsequent manual adjustment should work. 

The USER propcases should reflect changes done through the UI almost immediately, so your script can potentially read them back if it needs to.

Attached is the M3 levent list. The exact meanings are generally not known, and not all events are implemented on all cameras, but the names often give a pretty good hint.
Don't forget what the H stands for.

 

Related Topics