CHDK PTP interface - page 42 - General Discussion and Assistance - CHDK Forum  

CHDK PTP interface

  • 1241 Replies
  • 499572 Views
*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: CHDK PTP interface
« Reply #410 on: 13 / February / 2011, 10:42:21 »
Advertisements
However, using ptpcam.exe --chhd with the mode 1 command puts the camera into shooting mode but the mode 0 command does not put it back into playback mode.  Is this normal ?
I don't know, really, but this is how I switch between play and rec with ptp:

ptpcam --chdk="lua set_record(true)"
ptpcam --chdk="lua set_record(false)"

Re: CHDK PTP interface
« Reply #411 on: 13 / February / 2011, 11:50:04 »
ptpcam --chdk="lua set_record(true)"
ptpcam --chdk="lua set_record(false)"

Two steps forward - one step back.  Those doesn't do anything although this puts the camera into shoot mode :

ptpcam --chdk="mode 1"

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: CHDK PTP interface
« Reply #412 on: 13 / February / 2011, 14:50:50 »
@waterwings

Did you check PB2Rec and Rec2PB address too?

SD4000:

Code: [Select]
ROM:FF898B40 AC_PB2Rec                               ; CODE XREF: AC_PB2PC:loc_FF897B44
ROM:FF898B40                                         ; AC_EnryPB+D0 ...
ROM:FF898B40                 STMFD   SP!, {R4,LR}    ; PB2Rec
ROM:FF898B44                 LDR     R0, =0x10A5
ROM:FF898B48                 BL      eventproc_export_IsControlEventActive
ROM:FF898B4C                 CMP     R0, #0
ROM:FF898B50                 LDMNEFD SP!, {R4,PC}
ROM:FF898B54                 MOV     R0, #0x60
ROM:FF898B58                 ADR     R1, aAcPb2rec   ; "AC:PB2Rec"
ROM:FF898B5C                 BL      LogPrintf       ; LOCATION: CameraLog.c:237
ROM:FF898B60                 MOV     R0, #0xD
ROM:FF898B64                 BL      _sub_FF896F60__CameraConState.c__215 ; LOCATION: CameraConState.c:215
ROM:FF898B68                 BL      DispSwCon_MuteOnPhysicalScreen
ROM:FF898B6C                 MOV     R0, #1
ROM:FF898B70                 BL      AC_ExitPB
ROM:FF898B74                 LDMFD   SP!, {R4,LR}
ROM:FF898B78                 MOV     R0, #0
ROM:FF898B7C                 B       sub_FF83C1D8
ROM:FF898B7C ; End of function AC_PB2Rec

Code: [Select]
ROM:FF897590 AC_Rec2PB                               ; CODE XREF: EnrySRec:loc_FF8978EC
ROM:FF897590                 STMFD   SP!, {R4,LR}    ; Rec2PB
ROM:FF897594                 ADR     R1, aAcRec2pb   ; "AC:Rec2PB"
ROM:FF897598                 MOV     R0, #0x60
ROM:FF89759C                 BL      LogPrintf       ; LOCATION: CameraLog.c:237
ROM:FF8975A0                 LDR     R1, =0x3580
ROM:FF8975A4                 MOV     R0, #0
ROM:FF8975A8                 STR     R0, [R1,#0x80]
ROM:FF8975AC                 BL      sub_FF89BBFC
ROM:FF8975B0                 MOV     R0, #1
ROM:FF8975B4                 BL      sub_FF83C1D8
ROM:FF8975B8                 BL      sub_FF97A664
ROM:FF8975BC                 CMP     R0, #0
ROM:FF8975C0                 BEQ     loc_FF8975D0
ROM:FF8975C4                 BL      sub_FF89073C
ROM:FF8975C8                 CMP     R0, #0
ROM:FF8975CC                 BLNE    DispSwCon_MuteOnPhysicalScreen
ROM:FF8975D0
ROM:FF8975D0 loc_FF8975D0                            ; CODE XREF: AC_Rec2PB+30
ROM:FF8975D0                 BL      ShutdownRecMode
ROM:FF8975D4                 LDMFD   SP!, {R4,LR}
ROM:FF8975D8                 MOV     R0, #0x10
ROM:FF8975DC                 B       _sub_FF896F60__CameraConState.c__215 ; LOCATION: CameraConState.c:215
ROM:FF8975DC ; End of function AC_Rec2PB

Else maybe overwrite switch_mode_usb() with different control event id may help?

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: CHDK PTP interface
« Reply #413 on: 13 / February / 2011, 14:53:37 »
I don't know, really, but this is how I switch between play and rec with ptp:

ptpcam --chdk="lua set_record(true)"
ptpcam --chdk="lua set_record(false)"
So does mode command work for you too or only lua command?


Re: CHDK PTP interface
« Reply #414 on: 13 / February / 2011, 15:18:27 »
@waterwingz
Did you check PB2Rec and Rec2PB address too?

Yup - 100% match between what you posted and my source dissassembly (except for addresses of course).

Else maybe overwrite switch_mode_usb() with different control event id may help?

Wow - where do I even start with that?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: CHDK PTP interface
« Reply #415 on: 13 / February / 2011, 15:36:54 »
A little more testing. 

ptpcam --chdk="mode 1"   - extends the lens and enters shooting mode
ptpcam --chdk="mode 0"   - leaves the lens extended and enters playback mode

I guess that is working correctly after all if one doesn't expect the lens to retract in playback mode.

Still no luck with lua set_record(true) though.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14086
Re: CHDK PTP interface
« Reply #416 on: 13 / February / 2011, 15:54:59 »
Still no luck with lua set_record(true) though.
This is expected on dryos cameras. That's why switch_mode_usb exists.

It would really be better to just have one function that does the appropriate thing if USB is connected, but for historical reasons, this isn't the case.
Don't forget what the H stands for.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: CHDK PTP interface
« Reply #417 on: 13 / February / 2011, 16:48:16 »
So does mode command work for you too or only lua command?

All 3 ways work for me:
ptpcam --chdk="mode 1"
ptpcam --chdk="mode 0"
ptpcam --chdk="lua switch_mode_usb(1)"
ptpcam --chdk="lua switch_mode_usb(0)"
ptpcam --chdk="lua set_record(true)"
ptpcam --chdk="lua set_record(false)"

waterwingz: the camera shouldn't be expected to retract the lens because it doesn't do that when you switch to play during normal use either...until a configurable delay.


*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: CHDK PTP interface
« Reply #418 on: 13 / February / 2011, 16:58:51 »
Quote
waterwingz: the camera shouldn't be expected to retract the lens because it doesn't do that when you switch to play during normal use either...until a configurable delay.

This delay can be set to 0 seconds though (at least on my cams)

cheers,

wim

*

Offline achillies

  • ***
  • 227
  • SX130IS
Re: CHDK PTP interface
« Reply #419 on: 14 / February / 2011, 18:05:55 »
Thank you msl and rudi, I can successfully load the ptpcamgui interface.  I will do more homework before asking too many more questions!
Don't let the sands of time get in your lunch.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal