CHDK Control of the Mode Dial for A570IS - page 2 - General Discussion and Assistance - CHDK Forum

CHDK Control of the Mode Dial for A570IS

  • 76 Replies
  • 41480 Views
Re: CHDK Control of the Mode Dial for A570IS
« Reply #10 on: 12 / February / 2008, 11:19:51 »
Advertisements
Deleted
« Last Edit: 22 / April / 2008, 11:48:42 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: CHDK Control of the Mode Dial for A570IS
« Reply #11 on: 12 / February / 2008, 11:32:21 »
I just noticed that it should be possible to set the playback-switch. Any request on this one?

I wonder if this would make remote webcam operation possible even for cameras without remote capture support, by having a script sit in play mode waiting for PTP download (and upload for commands if suitable code would be implemented) commands for most of the time, and periodically switch to rec mode to shoot?

*

Offline jeff666

  • ****
  • 181
  • A720IS
Re: CHDK Control of the Mode Dial for A570IS
« Reply #12 on: 12 / February / 2008, 15:23:59 »
Here's a test for dialmode-support. It works on
* A720, 1.00c
* A570, 1.00e + 1.01a
(out of time for today, so no a620 or s3, sorry).

download: (bin & src) zSHARE - dialmode-test.zip

Code is not in SVN, yet. Testers and Developers are invited to review before I submit experimental code.

This is what I did:
  • in include/keyboard.h: add new key-definitions for the dm-positions. I added DM_M, DM_AV, DM_TV, DM_P, DM_AUTO and DM_MOVIE. Each definition is represented by a number. I started by 50 to identify the dialmode-"keys" and treat them specially in the platform-dependent code.
  • in core/kbd.c: add textual descriptions for those definitions for use in scripts. In a script you just call press "dm_auto" and the dial is set. No further modification needed.
  • in platform/a720/kbd.c (and a570/kbd.c) declare a new struct for the dial (and switches in general), since the old keyboard-struct could only hold a bitmask for one physw-value but we need at least two.
    I modified kbd_key_press and kbd_key_release to test for keys with number >= 50 (see pt.1), get their bits from the new struct and set a flag to indicate dm_override.
    This flag is read in alt-mode and applies the new dial mode.

There's an example in bin/dm-test.bas which changes to each of the supported modes.

Important: If you change the dial position using press "dm_XXX", you must reset to default using release "dm_XXX" or you will probably get the wrong mode on the next press "dm... command (reason: dialmode-bitmask isn't cleared correctly, then).

Quote from: Barney Fife
Huh, I wonder what that is. A secret setting on the mode dial that I never knew was there.

Probably this called the aliens, which will arrive tomorrow and destroy earth. Thank You! Well done!  >:(

Quote
For going to playback mode from record, only line 3 changes when the playback switch is momentarily pressed.

This is great. More confusing stuff. Setting a value to a or b is barely acceptable but setting a value to a then to 0 or to b then to 0 is way to much. Tell your aliens to do it. :D

Quote
For cross-camera compatibility, wouldn't it be best to allow any input number for the command, then each camera could use the full range of what was available. Each series would only need its own little reference list (like these) of what number means what.

Well, partly. Using the original dial and giving each position an ascending number is ok as a method to access every dial-position but it's not platform-independent and scripts will only work on a particular series or even model.

To achieve platform-independency we would either use particular numbers (as planned first) or describing names (as it is now). It's still possible to add device-dependent dial-mode positions called DM_1, DM_2 and so on in addition to the names.

Quote
click "mode_dial" x
press "mode_dial" x
release "mode_dial" x

click wouldn't work unless we create a dummy-position that uses the original dial. This method would be as easy or difficult as any other, so if there's more demand for the click-method just tell and I'll do it this way.

What definitely would not work (without major changes) is click "mode_dial" x because the additional parameter would have to be evaluated. To make this we would need to change uBasic and take the risk on introducing (new) errors.

Overview:
This would work:
* click "dm_auto"
* click "dm_reset"

This does work now:
* press "dm_auto"
* release "dm_auto"

This would not work (without changing uBasic)
* click "mode_dial" "auto"
* click "mode_dial" "reset"

All would have a problem about interference between different switches/dials (which one is active). Further thoughts have to be made on this problem.

Cheers.

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK Control of the Mode Dial for A570IS
« Reply #13 on: 12 / February / 2008, 16:02:30 »
A710: (parameter#2): XXYYYYYY, where XX:
auto: FC
P: AC
Tv: 8C
Av: 9C
M: 5C
video: F4
stitch: 64 or E4 (dial bounce, but no real mode change)
SCN: 6C
night scene: 7C
landscape: 3C
portrait: BC

Re: CHDK Control of the Mode Dial for A570IS
« Reply #14 on: 12 / February / 2008, 16:33:52 »
Deleted
« Last Edit: 22 / April / 2008, 11:49:07 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: CHDK Control of the Mode Dial for A570IS
« Reply #15 on: 12 / February / 2008, 16:34:18 »
Here's a test for dialmode-support. It works on
* A720, 1.00c
* A570, 1.00e + 1.01a
(out of time for today, so no a620 or s3, sorry).

download: (bin & src) zSHARE - dialmode-test.zip

I tried the a570is 1.00e build, your test script worked perfectly. I added a couple of shoot commands to it, and the camera really seems to shoot in those modes.  Nice work! :D

I first put your script in a subdirectory under scripts/ but I noticed that the file browser (both script selection and the standalone one) is somehow broken. I can't get into any subdirectories as they are shown as files 1145M or 1147M big (this is a 1G SD card). I can go to previous directories (..) and a couple of .bin and .fir files I have in the root are shown as < Dir > but they obviously aren't directories. I didn't reset chdk config, should I have? The previous build I booted was from trunk 297, it's file browser works fine.

*

Offline jeff666

  • ****
  • 181
  • A720IS
Re: CHDK Control of the Mode Dial for A570IS
« Reply #16 on: 12 / February / 2008, 18:16:35 »
Quote from: fudgey
I tried the a570is 1.00e build, your test script worked perfectly. I added a couple of shoot commands to it, and the camera really seems to shoot in those modes.  Nice work! :D

Great news. The A570 code is 100% identical to the A720. I just copied the sections that I marked "dialmode" over to the other file.

Quote from: fudgey
I first put your script in a subdirectory under scripts/ but I noticed that the file browser (both script selection and the standalone one) is somehow broken.

My code is based on #269 (+/-2) with some changes I made to test long filename support for DryOS (which is still unfinished) and a little stuff I tested for Microfunguy. It's possible that I broke something.

If you can compile chdk yourself, merge platform/a570/kbd.c, include/keyboard.h and core/kbd.c into the current release. No other files were changed for dial-mode control.


Quote from: Barney Fife
What? You mean you're going to let some stupid little aliens be smarter than you? :D See, this is why they always get to invade other planets. They're smarter. Here's your chance to prove them wrong. :)

In that case I suppose I'm smart enough not to take any chances but my little spacecraft instead and escape to a safe place  8)

The S3 keyboard handler looks a little different, than the A720/A570. So you'll have to be a little patient until we have something that would work everywhere and implement it everywhere afterwards.

Quote
I don't know enough about the kind of programming language that you do to know what can or can't be done.

Actually I don't, either. I just let my neighbour's cat walk over my keyboard and afterwards tweak the characters until the compiler stops complaining. :D

Quote
It was just an idea. I recall when trying to help someone with a script we had to refer to a look-up table in the code somewhere for aperture vs. focal length (model dependent). So I thought the same was possible.

I don't know what that problem was about, but I don't associate "lookup table" with anything useful at the dial-issue.

Quote
Well, my main thinking of the need for click "mode_dial" (instead of just press) was only useful for the play/record toggle on S-series. As that's only a quick press to engage it/change it.

Maybe for S-series extra commands could be made for click "playback" and click "record", then it wouldn't ruin your plan?

Actually that idea is pretty good, since it's actually a click and would be easy to include. It's incompatible with the A-series, though.

The more I think about it, the more I arrange with a new command called "mode" (okay, this sounds silly. Any suggestions on a better name?).

We would call
* mode dialnum 1 for the first dial position (device dependent)
* mode dialmode 1 for the mode with number 1 (device independent)
* mode record 0/1 for record or playback mode (any suggestion for a more generic name than record?)

And maybe even
* mode isodial 2 for dialpos 2 on the G-series iso-dial.

In the dialnum and dialmode commands, argument 0 would switch to non-override behaviour.

Quote
But as far as writing scripts is concerned, it would be MUCH better to have the mode chosen by a variable than a hard-coded label or number.

You're absolutely right. The keypress-method was just easier to implement but eventually we need what you suggested.

Btw, you're mod, right? Could you move this thread to the development board? It is getting slightly off topic, here.

Cheers.
« Last Edit: 12 / February / 2008, 18:33:51 by jeff666 »

Re: CHDK Control of the Mode Dial for A570IS
« Reply #17 on: 12 / February / 2008, 19:10:54 »
Deleted
« Last Edit: 22 / April / 2008, 11:49:47 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: CHDK Control of the Mode Dial for A570IS
« Reply #18 on: 13 / February / 2008, 13:11:26 »
My code is based on #269 (+/-2) with some changes I made to test long filename support for DryOS (which is still unfinished) and a little stuff I tested for Microfunguy. It's possible that I broke something.

If you can compile chdk yourself, merge platform/a570/kbd.c, include/keyboard.h and core/kbd.c into the current release. No other files were changed for dial-mode control.

I replaced those files in trunk 299, didn't compile due to some focus change that has been done after 269 so changed that part to the way it was in trunk and compiled. File browser works, but apparently something's wrong as I know get "Unk key" errors from the new dialmode controls.

*

Offline Jim

  • *
  • 32
Re: CHDK Control of the Mode Dial for A570IS
« Reply #19 on: 13 / February / 2008, 22:15:03 »
Wow - great progress on this request.  Tapping into the "Dial Mode" is like opening up 13 new dimensions (and maybe some hidden functions yet to be discovered)!  I am looking forward to kicking the tires on this with my camera on a kite!

 

Related Topics


SimplePortal © 2008-2014, SimplePortal