Making kbd.c code generic - page 5 - General Discussion and Assistance - CHDK Forum

Making kbd.c code generic

  • 51 Replies
  • 23440 Views
*

Offline reyalp

  • ******
  • 14128
Re: Making kbd.c code generic
« Reply #40 on: 21 / March / 2015, 21:11:13 »
Advertisements
The cam appears to work fine with r4107. This camera's button handling is a bit unusual: most buttons don't appear to toggle bits when viewing the usual MMIO range (0xc0220200, +4, +8) via my memory viewer. It could be that those buttons are only powered when being read out (kbd_pwr_on, etc.).
Thanks for verifying. This camera doesn't have pwr_on/pwr_off in the normal locations, but _GetKbdState is much more complicated than the usual 3 MMIO reads.

I converted SX110 and SX120, expecting them to be similar, but those both do have the pwr functions. The SX110 GetKbdState looks similar to SX100, while the SX120 is the traditional MMIO  ???

Quote
Perhaps these could be turned into alternative input sometime in the future...
One of the things I hope to get out of all this work is to make it easier to improve the CHDK input system.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14128
Re: Making kbd.c code generic
« Reply #41 on: 22 / March / 2015, 21:08:22 »
I converted the ixus65_sd630

In the course of doing this, I changed kbd_update_key_state to return the kbd_process return value, so that platforms that need to do something special in the different cases can do it. I kind of planned to do this before, but hadn't found a need for it until now.

I thought about trying to re-use the jogdial_control for the task suspend/resume, but the logic is a bit different. Another option would be to add an equivalent like feather_control.

Another oddity in the  ixus65_sd630 is that it used sleep(5) for kbd_task instead of sleep(10). The firmware code uses 10, so I switched it to that.

I'm not clear if the suspending / resuming tFeather is required, or if the feather could be ignored while in alt mode by masking some physw_bits like other cameras do.
Don't forget what the H stands for.

*

Offline ADamb

  • **
  • 65
  • sx200is
Re: Making kbd.c code generic
« Reply #42 on: 23 / March / 2015, 13:15:45 »
SX200IS works fine (b4104).

- Cam boots (short press => play mode, long press => record mode) OK
- All native buttons & jogdial function OK
- Switch to rec mode and back OK
- CHDK menu navigation and shortcuts OK
- Long and short press (native and CHDK function) OK
- Scripted key presses & jogdial OK
- USB remote OK
- optional battery door open hack OK
« Last Edit: 23 / March / 2015, 13:17:21 by ADamb »
SX200 IS-100C

*

Offline srsa_4c

  • ******
  • 4451
Re: Making kbd.c code generic
« Reply #43 on: 24 / March / 2015, 17:57:15 »
I thought about trying to re-use the jogdial_control for the task suspend/resume, but the logic is a bit different. Another option would be to add an equivalent like feather_control.
Only 2 cameras seem to have a task named "Feather", this kind of input was quickly discontinued. On the ixus65, the feather can be used sort-of like a jogdial, but it is much less accurate. The manual calls it "touch control dial".
Quote
Another oddity in the  ixus65_sd630 is that it used sleep(5) for kbd_task instead of sleep(10). The firmware code uses 10, so I switched it to that.
I don't see any problems with that.
Quote
I'm not clear if the suspending / resuming tFeather is required, or if the feather could be ignored while in alt mode by masking some physw_bits like other cameras do.
I don't think these show up as physw bits.

The reworked version does not stop the feather input in ALT mode, the firmware continues to receive all events. Not sure where the problem is (the old code was working well).
All other button functions work normally with the reworked version.

*

Offline reyalp

  • ******
  • 14128
Re: Making kbd.c code generic
« Reply #44 on: 24 / March / 2015, 23:05:00 »
Only 2 cameras seem to have a task named "Feather", this kind of input was quickly discontinued. On the ixus65, the feather can be used sort-of like a jogdial, but it is much less accurate. The manual calls it "touch control dial".
Thanks for the information.

If I understand right, we have
"touch control dial" which shows the icons on touch, and also lets you use some gestures like a jogdial. "jogdial" only.
"jogdial" with "feather", where touches on the jogdial show icons, but otherwise works like a normal jogdial. ixus110, sx210 are examples. Some (all?) of these can see the touches in physw bits, and can use a simple mask.

Other than ixus65, I see ixus75_sd750, ixus860_sd870, ixus900_sd900 have references to "touch control dial" in the manual. I didn't do an exhaustive search.

I blew away the feather code in the ixus860 port when I converted, because it looked like it was #if'd out.

The old ixus75 kbd.c didn't have any feather code.

ixus860 and ixus75 call the task "TouchW", while ixus900 uses "Feather"

edit: ixus850_sd950 also mentions "touch control dial"
Quote
The reworked version does not stop the feather input in ALT mode, the firmware continues to receive all events. Not sure where the problem is (the old code was working well).
Please check trunk 4115 or later.
« Last Edit: 24 / March / 2015, 23:10:22 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: Making kbd.c code generic
« Reply #45 on: 25 / March / 2015, 13:34:58 »
Please check trunk 4115 or later.
Thanks, that fixed the issue.
Quote
If I understand right, we have
"touch control dial" which shows the icons on touch, and also lets you use some gestures like a jogdial. "jogdial" only.
"jogdial" with "feather", where touches on the jogdial show icons, but otherwise works like a normal jogdial. ixus110, sx210 are examples. Some (all?) of these can see the touches in physw bits, and can use a simple mask.

Other than ixus65, I see ixus75_sd750, ixus860_sd870, ixus900_sd900 have references to "touch control dial" in the manual. I didn't do an exhaustive search.

I blew away the feather code in the ixus860 port when I converted, because it looked like it was #if'd out.

The old ixus75 kbd.c didn't have any feather code.

ixus860 and ixus75 call the task "TouchW", while ixus900 uses "Feather"

edit: ixus850_sd950 also mentions "touch control dial"
This isn't going to be easy since we have no idea about how most of those cameras actually behave.

I have just noticed something on this ixus65: scripted keypresses on the directional buttons and the FUNC|SET button do not work. This is not a new issue, the old code does the same. This could be related to the feather function.
Perhaps we could introduce an option that allows emitting logical events for buttons that are either not present (video button on touch screen?) or don't work. But I don't think it is urgent.

*

Offline reyalp

  • ******
  • 14128
Re: Making kbd.c code generic
« Reply #46 on: 25 / March / 2015, 22:36:18 »
This isn't going to be easy since we have no idea about how most of those cameras actually behave.
Yes, my goal for the moment is just to try to preserve the existing behavior.

Quote
I have just noticed something on this ixus65: scripted keypresses on the directional buttons and the FUNC|SET button do not work. This is not a new issue, the old code does the same. This could be related to the feather function.
Does shoot or other scripted presses work?

The old code had a comment:
// We still need this sema when simulating key presses
I assume this refers to a semaphore, but the actual code is a task resume. The old ixus860 code (which AFAIK was not actually enabled) had the same comment and did fiddle with a semaphore.

Quote
Perhaps we could introduce an option that allows emitting logical events for buttons that are either not present (video button on touch screen?) or don't work. But I don't think it is urgent.
Agreed on both counts. There's already code to do this for video on touch cameras, but it's one special case.

I would prefer for levents to a be last resort, since it seems likely to add some unexpected differences in key behavior.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: Making kbd.c code generic
« Reply #47 on: 26 / March / 2015, 14:12:01 »
Does shoot or other scripted presses work?
Yes. The only buttons not reacting are those five.

*

Offline reyalp

  • ******
  • 14128
Re: Making kbd.c code generic
« Reply #48 on: 12 / April / 2015, 19:38:58 »
I finally finished going through all the ports. I have a bunch of notes on various oddities that I still need to go through, so I'm not calling the project totally done yet, but it's a good start.

84 (of 129 total) are listed as untested on the testing page.

KBD_CUSTOM_ALL is no longer used by any camera. 9 ports use KBD_CUSTOM_UPDATE_KEY_STATE and four of those also use KBD_CUSTOM_UPDATE_PHYSW_BITS.

This means that all cameras use the same code for press, click, is pressed etc, and almost all of them use the same code for most of the other logic.

The cameras with KBD_CUSTOM_* fall into two general categories
1) Old vxworks cameras that have very different firmware keyboard code in the canon firmware:
ixus30_sd200
ixus40_sd300
ixus50_sd400
ixus700_sd500
s2is

2) Newer cameras that have some special key handling, particularly inverted logic and/or special hacks for limited keys. These are
A470
A490
A495
A800

I don't think these need to be converted to common code, but they may need special attention if improvements are made to the keyboard code in the future.
Don't forget what the H stands for.

*

Offline Srandista

  • *
  • 6
  • IXUS80 1.01A, IXUS140 1.00B
Re: Making kbd.c code generic
« Reply #49 on: 02 / November / 2015, 15:22:48 »
IXUS80 works fine (b4278).

- Cam boots OK
- All native buttons & jogdial function OK.
- Switch to rec mode and back OK
- CHDK menu navigation and shortcuts OK
- Long and short press (native and CHDK function) OK
- Scripted key presses & jogdial  OK
- USB remote OK
« Last Edit: 03 / November / 2015, 04:10:05 by Srandista »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal