default script and languages, and other propset issues - General Discussion and Assistance - CHDK Forum

default script and languages, and other propset issues

  • 25 Replies
  • 12719 Views
*

Offline reyalp

  • ******
  • 14126
default script and languages, and other propset issues
« on: 14 / May / 2017, 18:43:52 »
Advertisements
Prompted by https://chdk.setepontos.com/index.php?topic=8085.msg132522#msg132522 from dmitrys, I've updated the default.lua script to work on some newer propsets.

I tried to preserve the behavior of the existing script, with the exception that the IDs/values must be defined for each language explicitly. I also changed the code page for english to be 1252 instead of 1250 as it was in the old script, since 1252 is the default for CHDK builds (and more appropriate AFAIK).

I have reservations about this being the default script at all. It's kind of convenient, but having the CHDK language potentially change when you press the shutter in alt mode for the first time seems not very user friendly, and it's highly camera dependent. This script came from CHDK-DE in the CHDK/CHDK-DE merge and hasn't been updated significantly since. I'm unclear on the history before that.

My preference would be for the default script to just print a message along the lines of
"This is the default script"
"Press SET to load a script"
"Exit alt mode to shoot"

Some background links:
Language settings in general https://chdk.setepontos.com/index.php?topic=2761.0
A previous request to add more languages, and possible alternative from srsa_4c https://chdk.setepontos.com/index.php?topic=650.msg128471#msg128471


Script behavior
Camera language - CHDK language - Result
Known Any CHDK language changed to camera language (or unchanged if already the same)
Unknown Known CHDK language unchanged
Unknown Unknown CHDK language changed to default

Known language = one of English, German, Russian. (I may add a few more see below)
CHDK default language = English for standard autobuild, German for CHDK-DE

If the propset is not one of the defined propsets, the script now prints
"unsupported propset N" and treats the camera language as unknown.

If the propset is known, but the value is not one of the known languages, it prints
"unknown language N:M" where N is propset ID, and M is the language value and the treats the camera language as unknown.

I verified the values for propset 1 (a540),2 (d10), 5 (sx160), 6 (elph130) and 7 (g7x). I have assumed that 3 and 4 are the same as 2. The IDs are almost certainly the same, but the values might be different.

edit:
in r4809, I added definitions for all the CHDK languages. It's possible I got some of the code pages wrong, I used the following for reference
http://www.science.co.il/language/Character-sets.php
http://scratchpad.wikia.com/wiki/Character_Encoding_Recommendation_for_Languages

The script uses language file name to detect and the CHDK language, which is fragile since some of them are longer than 8.3 and may be in upper or lower case. The script now attempts to account for this.

A few CHDK languages don't appear in any Canon firmware I have.
« Last Edit: 07 / July / 2021, 20:37:20 by reyalp »
Don't forget what the H stands for.

Re: default script and languages
« Reply #1 on: 18 / May / 2017, 17:29:43 »
It's nice to know that at least some of my posts on this forum are getting attention  :P

Wouldn't using the video language propcase (#196 in propset 1) resolve the value discrepancy issue?
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline reyalp

  • ******
  • 14126
Re: default script and languages
« Reply #2 on: 19 / May / 2017, 17:34:50 »
Wouldn't using the video language propcase (#196 in propset 1) resolve the value discrepancy issue?
I don't follow. The values are different for different propsets. The cameras later cameras have more languages, and the values are in different order.
Don't forget what the H stands for.

Re: default script and languages
« Reply #3 on: 21 / May / 2017, 09:09:48 »
I see that you're already using that. Foot in mouth once again.
Author of CHIMP, Canon Hack Installation and Management Platform

Re: default script and languages
« Reply #4 on: 21 / May / 2017, 09:18:17 »
Here's a patch for the latest and greatest default.lua to display the hint in the proper language for Russian and Ukrainian.

lang1251.lua goes in CHDK/LUALIB.

P.S. The latter seems to have lost its intended encoding in transit (should be 1251, obviously).
« Last Edit: 21 / May / 2017, 09:22:46 by dmitrys »
Author of CHIMP, Canon Hack Installation and Management Platform

Re: default script and languages
« Reply #5 on: 21 / May / 2017, 09:36:43 »
Since the encoding doesn't matter, the separate lang1251.lua may be omitted.
Author of CHIMP, Canon Hack Installation and Management Platform

Re: default script and languages
« Reply #6 on: 25 / May / 2017, 15:02:48 »
Since the encoding doesn't matter, the separate lang1251.lua may be omitted.
However, it may be worth to leave it as initially proposed for the sake of readability.
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline reyalp

  • ******
  • 14126
Re: default script and languages
« Reply #7 on: 25 / May / 2017, 23:20:24 »
Since the encoding doesn't matter, the separate lang1251.lua may be omitted.
However, it may be worth to leave it as initially proposed for the sake of readability.
Thanks. Added in trunk 4813. I think it's better not to make the default script depend on multiple files.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14126
Re: default script and languages
« Reply #8 on: 11 / June / 2021, 00:30:26 »
default.lua strikes again

Based on https://chdk.setepontos.com/index.php?topic=14376.msg146417#msg146417 (and related posts ixus145, ixus265) it appears that what we call "propset 6" actually has different behavior on earlier and later model. Propset 6 cams include dryos r52, r54 and some r55

In r52 cams, language menu values appear to be numbered top to bottom, left to right (English 0, Deutsch 1,...), like earlier propsets. In r54 (and probably r55, I guess), they are numbered left to right, top to bottom (English 0, Deutsch 3), like later propsets. No other differences are known.

default.lua tries to set the CHDK language based on the Canon language, with the mapping defined per propset.

Options
1) Leave it alone. People on these cams play language roulette
2) Make the script work around it some other way, like by checking PID
3) Create a new propset that has identical IDs (13 or 14)
4) Get rid of the script.
5) Obtain the language in some other way

Laziness makes me lean twoward #2, if the propsets really are otherwise equivalent. It would be good to check more carefully, if other CHDK relevant props vary, then #3 is probably the right choice.

I've never been too fond of the default script doing something this complex and obscure, so #4 is also tempting, but it does save people having to navigate wrong-language menus to select their own language.

Suggestions welcome
Don't forget what the H stands for.

*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: default script and languages
« Reply #9 on: 11 / June / 2021, 06:32:54 »
The SX410 is probably the last camera on the propset6, dryos r55.

debug prop display
English 65537
Norsk-right 65793
Deutsch-down 66385


=return get_prop(61)
English
return:1

Norsk
return:257

Deutsch
return:769

 

Related Topics


SimplePortal © 2008-2014, SimplePortal