SX60HS Porting - page 14 - DryOS Development - CHDK Forum supplierdeeply

SX60HS Porting

  • 915 Replies
  • 371648 Views
Re: SX60HS Porting
« Reply #130 on: 31 / March / 2016, 16:28:32 »
Advertisements
Well I'm monitoring kbd.c kbd_fetch

Code: [Select]
void kbd_fetch_data(long *dst)
{
    _GetKbdState(dst);
    _kbd_read_keys_r2(dst);
    if (*dst != 0x10077fff) {
      _LogCameraEvent(0x20,"kb: %08x %08x %08x",  *dst);
    }

}
0x10077fff is the value when nothing is pressed...
I never see the zoom key, but I see others. In the attached TEST.LOG you can see the UI says I used the zoom, and the trash keys.  only the trash key is captured though. I adjusted the key mask to be like g7x 50fff thinking somehow i might mask the zoom key out...  :(
Just to be ultra clear I'm referring to the zoom ring key around the shoot button.

*

Offline srsa_4c

  • ******
  • 4451
Re: SX60HS Porting
« Reply #131 on: 31 / March / 2016, 17:51:08 »
Well I'm monitoring kbd.c kbd_fetch
Your code snippet only monitors the first physw word, the 2 other hex numbers you're printing are IMHO junk.
That said, the file physw_bits.txt (which is created by the sigfinder) doesn't seem to contain event IDs 3 and 4. That could mean the zoom lever is evaluated in an unusual way (such as through an A/D channel or a counter).

Can you determine the number of available zooming speeds when using the "zoom ring key"? Is it possible that this cam has more than just a slow and a fast zoom speed?

Re: SX60HS Porting
« Reply #132 on: 31 / March / 2016, 18:30:43 »
Two speeds depending on how far you push the ring. 

Re: SX60HS Porting
« Reply #133 on: 31 / March / 2016, 19:28:29 »
I obtained the log while in playback, not shooting mode.  The zoom lever affects the playback display, sometimes zooming the current photo, sometimes zoomout to show many photos. 


*

Offline srsa_4c

  • ******
  • 4451
Re: SX60HS Porting
« Reply #134 on: 31 / March / 2016, 19:54:11 »
I obtained the log while in playback, not shooting mode.  The zoom lever affects the playback display, sometimes zooming the current photo, sometimes zoomout to show many photos.
Since you can't currently block the zoom events, that's expected.

Found something in kbd_read_keys_r2:
sub_fc0e1666 is called, which is actually the low level GetAdChValue. Don't know if it's related to the zoom ring, but it's a possibility.
If you have Lua, you could try calling it with call_func_ptr (with the thumb bit set).
In CHDKPTP:
Code: [Select]
=return call_func_ptr(0xfc0e1667,2)The only argument is 2 (AD channel #2), see if the value it returns is related to the zoom ring's position. You may also want to fix your monitoring function, perhaps there's something in the second and third physw_status words.

*

Offline reyalp

  • ******
  • 14118
Re: SX60HS Porting
« Reply #135 on: 31 / March / 2016, 21:08:02 »
I obtained the log while in playback, not shooting mode.  The zoom lever affects the playback display, sometimes zooming the current photo, sometimes zoomout to show many photos.
As srsa mentioned, your log code is buggy. At the least, you need to do

Code: [Select]
_LogCameraEvent(0x20,"kb: %08x %08x %08x",  dst[0],dst[1],dst[2]);
Detecting change is a bit difficult, since you don't know what bits contain keys, and some probably cycle rapidly.

edit: You could just use a counter to log every Nth kbd_task iteration to keep the rate down.

Personally, I would repeatedly rmem the 3 physw_status words in chdkptp while using with the zoom key held and not held, like
rmem -i32 0x33f64 3

Do it a few times without any keys press to see which ones vary on their own.

That said, the file physw_bits.txt (which is created by the sigfinder) doesn't seem to contain event IDs 3 and 4. That could mean the zoom lever is evaluated in an unusual way (such as through an A/D channel or a counter).
FWIW, zoom keys are also not detected for sx280hs (which as multi speed zoom), but are detected for g7x (which has single speed)

I kind of suspect the some of the differently formatted entries in the table have something to do with the multi-stage zoom, but if so I don't know what it is.

« Last Edit: 31 / March / 2016, 21:10:02 by reyalp »
Don't forget what the H stands for.

Re: SX60HS Porting
« Reply #136 on: 31 / March / 2016, 21:24:51 »
Yeah I was too lazy to change the format when I cut and paste the log stuff.  Anyway I think there's a good chance the other two words contain something because my logic only accepts changes in the first word, and when I did this in kbd_common.c I had output all three elements of kbd_state with this logic. 
A quick xcheck of the adc locations value (suggested by srsa) yield numbers like 2041,2042,2041,2036 independent of Zooming active or position.  I'll check more but it might have responded to camera acceleration.
It'll be a day before I can do more. 

Re: SX60HS Porting
« Reply #137 on: 01 / April / 2016, 22:45:00 »
First things first.  the adc location, does not appear to respond to camera motion.
I'm not very coordinated but I turned, lifted,dropped the camera while sampling the location
=return call_func_ptr(0xfc0e1667,2)

no correlation

 
I fixed my logic to detect changes in more than the first word of physw.

Zoom affects the second word
I've attached the log ...I first zoomed out slow then fast, then zoomed in slow then fast

normally 0x1480043e

we have zoom out 14800436
zoom out fast 4326

zoom in 43a
zoom in fast 438

Its possible my interpretation is wrong, please look at the attached log.
do I need to test something else?
« Last Edit: 02 / April / 2016, 19:42:38 by 62ndidiot »


*

Offline reyalp

  • ******
  • 14118
Re: SX60HS Porting
« Reply #138 on: 02 / April / 2016, 02:35:26 »

normally 0x1480043e

we have zoom out 14800436
zoom out fast 4326
Assuming you mean 426, this makes sense

normal
0011 1110
slow
0011 0110
fast
0010 0110

so the slow bit is 0x8 and the fast bit is 0x10. It looks like fast cannot be done without slow, so if a key is defined for that, it should include both bits like shoot_full. Multi-speed zoom is not really well supported in chdk.

Quote
zoom in 43a
zoom in fast 438
0011 1010
0011 1000

so 0x4 for slow and 0x2 for fast.
Don't forget what the H stands for.

Re: SX60HS Porting
« Reply #139 on: 02 / April / 2016, 20:31:19 »
Actually there may be three speeds of zoom, and its in the third word (not the second)...sorry array subscripts, vs word #. I have to be quick when trying keys, so I've made a log using zoom in followed by menu press and the same thing for zoom out attached.
This took perhaps ten tries to get it in the logs clearly....i also found that for unknown reasons the 14800 part can change (and stay changed) and screw things up ...possibly because I pressed the shoot key to allow the lens to move...I don't know yet, but i think the attached logs confirm three zoom speeds...followed by a menu press so that we can see the no zoom setting. Sorry for the confusion...
Anyway i think i know what to do as far as platform_kbd.h and kbd.c goes...just defining a single speed zoom in/out

no zoom key is
1480043e (quiescent)

1480042e  zoom out
14800426
14800436

14800438 zoom in
1480043a
1480043c

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal