SX160 IS porting thread - page 6 - DryOS Development - CHDK Forum

SX160 IS porting thread

  • 101 Replies
  • 54588 Views
Re: SX160 IS porting thread
« Reply #50 on: 04 / November / 2013, 09:55:16 »
Advertisements
Have any "backlight modulation" (quickly turning screen on/off to simulate dim screen) patch (I use myself such on Canon Powershot A470) a chance to be accepted?
Its almost always possible to get something accepted after a suitable discussion here on the forum.  I expect this one to be a conversation about possible permanent damage or shortened LCD backlight lifetime.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14118
Re: SX160 IS porting thread
« Reply #51 on: 04 / November / 2013, 12:44:55 »
P.S. Am I the only here who find the "ultra-dim screen"  feature useful? Even minimum screen brightness can be too bright in a almost completely dark environment, especially when you want to take long exposure shots silently and without emitting any significant light yourself. Have any "backlight modulation" (quickly turning screen on/off to simulate dim screen) patch (I use myself such on Canon Powershot A470) a chance to be accepted?
The eventproc LcdCon_SetLcdBackLightBrightness allows you to set brightness from 0-100 and seems to go quite a bit beyond the range allowed in the menu. See this thread:  http://chdk.setepontos.com/index.php?topic=10551.0 for more information.
Don't forget what the H stands for.

*

Offline vi

  • *
  • 26
Re: SX160 IS porting thread
« Reply #52 on: 04 / November / 2013, 20:42:13 »
The eventproc LcdCon_SetLcdBackLightBrightness allows you to set brightness from 0-100 and seems to go quite a bit beyond the range allowed in the menu. See this thread:  http://chdk.setepontos.com/index.php?topic=10551.0 for more information.

Starting Lua script with

call_event_proc('LcdCon_SetLcdBackLightBrightness',1) -- (or 0 or -1; or "LcdCon_SetLcdBackLightBrightness_FW")

does just nothing - don't turn on/off screen, don't set bright or dim mode. How to correctly use it?

*

Offline vi

  • *
  • 26
Re: SX160 IS porting thread
« Reply #53 on: 04 / November / 2013, 21:34:07 »
Starting Lua script with

call_event_proc('LcdCon_SetLcdBackLightBrightness',1) -- (or 0 or -1; or "LcdCon_SetLcdBackLightBrightness_FW")

does just nothing - don't turn on/off screen, don't set bright or dim mode. How to correctly use it?

Update: with "call_func_ptr(0xff931ce4,0)" or "call_func_ptr(0xff931ce4,20)" I can get backlight somewhat dimmer (maybe twice as dim as usual minimum), but not radically. It's not convenient to use a screen mask made from old floppy disks.
« Last Edit: 04 / November / 2013, 21:36:00 by vi »


*

Offline srsa_4c

  • ******
  • 4451
Re: SX160 IS porting thread
« Reply #54 on: 05 / November / 2013, 16:06:26 »
Update: with "call_func_ptr(0xff931ce4,0)" or "call_func_ptr(0xff931ce4,20)" I can get backlight somewhat dimmer (maybe twice as dim as usual minimum), but not radically.
Note that the function found by the sigfinder is an event procedure, which takes its arguments in a different way (real programmers can probably name that scheme too  :P). It takes two arguments, out of which the first is important. So, you can either use the above function and pass a pointer to it, or you could find and use the non-event procedure version (address is in bold below, sx160 100a):
ff931ce4: push    {r4, r5, r6, lr}
ff931ce8: ldrh    r5, [r0]
ff931cec: ldr     r4, [r0, #4]
ff931cf0: mov     r0, r5
ff931cf4: bl      sub_ff864214
ff931cf8: cmp     r4, #1
ff931cfc: movne   r1, r5
ff931d00: addne   r0, pc, #256   ; ff931e08: *".. Set LCD BackLight Brightness: 0x%04x"
ff931d04: blne    sub_ff811750
ff931d08: mov     r0, #0
ff931d0c: pop     {r4, r5, r6, pc}

According to my trials, a brightness of 0 is still not really dark (although darker than what's available using Canon UI).

*

Offline reyalp

  • ******
  • 14118
Re: SX160 IS porting thread
« Reply #55 on: 05 / November / 2013, 18:05:56 »
The eventproc LcdCon_SetLcdBackLightBrightness allows you to set brightness from 0-100 and seems to go quite a bit beyond the range allowed in the menu. See this thread:  http://chdk.setepontos.com/index.php?topic=10551.0 for more information.

Starting Lua script with

call_event_proc('LcdCon_SetLcdBackLightBrightness',1) -- (or 0 or -1; or "LcdCon_SetLcdBackLightBrightness_FW")

does just nothing - don't turn on/off screen, don't set bright or dim mode. How to correctly use it?
You need to call the registration functions first. This is discussed in the thread I linked.

If you call an eventproc that isn't registered, the return value will be -1 (of course and eventproc could return -1 for other reasons, but in most cases they return 0 on success)

I usually test this kind of thing with chdkptp, so can can do something like
$ chdkptp -c -i
connected: Canon PowerShot D10, max packet size 512
con> =return call_event_proc('DispDev.Create')
1:return:0
con 1> =return call_event_proc('LcdCon_SetLcdBackLightBrightness',1)
2:return:0
con 2>

In my testing, 0 is the same as off. 1 is fairly dim, but perhaps not as dim as you want.
Don't forget what the H stands for.

*

Offline vi

  • *
  • 26
Re: SX160 IS porting thread
« Reply #56 on: 06 / November / 2013, 07:01:18 »
call_event_proc('DispDev.Create')
call_event_proc('LcdCon_SetLcdBackLightBrightness',1)

In my testing, 0 is the same as off. 1 is fairly dim, but perhaps not as dim as you want.

Thanks, "DispDev.Create" fixed the issue. But on my SX160IS I get mimilal brightness on "0", not a turned off screen. "1" is one step above minimal ("minimal" here means the same in "call_func_ptr(0xff931ce4 or 0xff864214,0)") . -1 is maximum brightness...

Does it mean the hardware is incapable to set it to darker?

How to PWM it by CPU more efficiently (without lots of subroutine calls, just turn on and then immediately off)?

*

Offline srsa_4c

  • ******
  • 4451
Re: SX160 IS porting thread
« Reply #57 on: 06 / November / 2013, 11:17:01 »
Does it mean the hardware is incapable to set it to darker?
It can be a limitation of the software layer behind this function.

Quote
How to PWM it by CPU more efficiently (without lots of subroutine calls, just turn on and then immediately off)?
One could either find out how to program the DIGIC's PWM unit (I think brightness adjustment is done by pulse width modulation) and find the used PWM channel, or ...
... find the GPIO responsible for the other end (on/off control) and switch that on/off by using a system timer (nobody has tried using the operating system's timer functions yet).


Re: SX160 IS porting thread
« Reply #58 on: 17 / November / 2013, 22:05:34 »
Hi,

First of all let me thank for the wonderful port for SX160 IS.

Recently I had purchased SX 160 IS. I could install and work with CHDK 1.2/1.3. But, I could not boot with CHDK in 'LOCKED' mode. Whenever I lock the SD card (4GB), it says Memory Card Locked and Card Error. Any help?

Re: SX160 IS porting thread
« Reply #59 on: 17 / November / 2013, 23:32:09 »
Recently I had purchased SX 160 IS. I could install and work with CHDK 1.2/1.3. But, I could not boot with CHDK in 'LOCKED' mode. Whenever I lock the SD card (4GB), it says Memory Card Locked and Card Error. Any help?
Did you read any of this : http://chdk.wikia.com/wiki/Prepare_your_SD_card ?

You probably want to look closely at the blue box at the top where it mentions the STICK utility.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal