IXUS175: Shoot key emulation does not work

  • 11 Replies
  • 2692 Views
*

Offline alvm

  • ***
  • 123
IXUS175: Shoot key emulation does not work
« on: 16 / March / 2016, 17:43:10 »
Advertisements
Hello,

I use key's emulation like

Code: [Select]
kbd_new_state[2] = physw_status[2];
physw_status[2] = (kbd_new_state[2]  & kbd_mod_state[2]);


for shooting.

It works fine for all cameras but not for IXUS175. I see KEY_SHOOT_HALF_BIT is cleared but camera not shoot.  What is cause of problem?

Thanks,
Alex.

*

Offline srsa_4c

  • ******
  • 3530
Re: IXUS175: Shoot key emulation does not work
« Reply #1 on: 16 / March / 2016, 17:53:54 »
It works fine for all cameras but not for IXUS175. I see KEY_SHOOT_HALF_BIT is cleared but camera not shoot.
How did you determine KEY_SHOOT_HALF_BIT? Was USB connected when you tried to shoot?
Some things I could think of (all guesses):
- that's not the right bit
- it's inverted
- the button affects more than one bit
- your physw_status is not the right one
- Canon has changed the way physw task operates

*

Offline alvm

  • ***
  • 123
Re: IXUS175: Shoot key emulation does not work
« Reply #2 on: 16 / March / 2016, 18:21:37 »
How did you determine KEY_SHOOT_HALF_BIT?

Reading of physw_status using ptp. The bit is changed when I press shoot key.

Was USB connected when you tried to shoot?

Yes.


*

Offline srsa_4c

  • ******
  • 3530
Re: IXUS175: Shoot key emulation does not work
« Reply #3 on: 16 / March / 2016, 18:39:23 »
Was USB connected when you tried to shoot?
Yes.
Try without USB?
Note that you're not giving too many details, so I can really only make guesses.
Do other buttons work when you operate them from code?


*

Offline alvm

  • ***
  • 123
Re: IXUS175: Shoot key emulation does not work
« Reply #4 on: 17 / March / 2016, 03:17:04 »
Do other buttons work when you operate them from code?

Rec button works fine.

*

Offline srsa_4c

  • ******
  • 3530
Re: IXUS175: Shoot key emulation does not work
« Reply #5 on: 17 / March / 2016, 13:53:38 »
Do other buttons work when you operate them from code?
Rec button works fine.
OK. Is it only the shoot_half button that fails, or does shoot_full behave the same? What happens if you manually press those buttons (with connected USB, obviously)?
BTW, I wasn't joking when I suggested trying without a USB connection - it could be an issue with the method you're using to switch to record mode.

*

Offline alvm

  • ***
  • 123
Re: IXUS175: Shoot key emulation does not work
« Reply #6 on: 17 / March / 2016, 13:59:39 »
I've tried only shoot_half button using ptp. If I press the shoot_half and then shoot _full they work fine with connected USB.

BTW, I wasn't joking when I suggested trying without a USB connection - it could be an issue with the method you're using to switch to record mode.

I'm using following method

Code: [Select]
void switch_mode(int mode)
{
  if ( mode == 0 )
  {
    _Rec2PB();
    _set_control_event(0x80000302); // 0x10B3 ConnectUSBCable
  } else if ( mode == 1 )
  {
    _set_control_event(0x302); //  0x10B4 DisconnectUSBCable
    _PB2Rec();
  }
}


*

Offline srsa_4c

  • ******
  • 3530
Re: IXUS175: Shoot key emulation does not work
« Reply #7 on: 17 / March / 2016, 19:58:56 »
If I press the shoot_half and then shoot _full they work fine with connected USB.
I assume you mean pressing the buttons physically. Does simulating shoot_full work via PTP?

I remember one case when simulated button presses did not work: on some early Ixus models (Ixus65) the directional buttons (which are pressure sensitive) can't be operated from CHDK.

I'm using following method

Code: [Select]
void switch_mode(int mode)
{
  if ( mode == 0 )
  {
    _Rec2PB();
    _set_control_event(0x80000302); // 0x10B3 ConnectUSBCable
  } else if ( mode == 1 )
  {
    _set_control_event(0x302); //  0x10B4 DisconnectUSBCable
    _PB2Rec();
  }
}
That's similar to our method. I assume 0x302 is the correct event for this camera (it used to be a different in earlier models).

I have noticed that some (or all?) buttons on my DIGIC 4+ cam are accessible through both the old (0xc0220200+) and new (0xc022f484+ on the ixus150) aggregated GPIOs. So, it's not impossible that the button's state also appears in a variable other than physw_status...?


*

Offline alvm

  • ***
  • 123
Re: IXUS175: Shoot key emulation does not work
« Reply #8 on: 18 / March / 2016, 09:06:54 »
Quote
I assume you mean pressing the buttons physically. Does simulating shoot_full work via PTP?

Yes, physically. No, does not work too.

Quote
That's similar to our method. I assume 0x302 is the correct event for this camera (it used to be a different in earlier models).

Yes, the method taken from early chdk. Yes, I've checked the event using TranslateLogicalEventToControl() function.

Quote
So, it's not impossible that the button's state also appears in a variable other than physw_status...?

Thanks, I'll check the assumption.

*

Offline alvm

  • ***
  • 123
Re: IXUS175: Shoot key emulation does not work
« Reply #9 on: 02 / May / 2016, 13:27:37 »
The shoot keys emulation does not work also for sx420 and ixus180.

Code: [Select]
_PostLogicalEventToUI(4484, 0);
               
levent_post_to_ui_by_name("PressRecButton");
msleep(400);
levent_post_to_ui_by_name("UnpressRecButton");

not work too.
« Last Edit: 02 / May / 2016, 13:30:02 by alvm »

 

Related Topics