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

CHDK PTP interface

  • 1241 Replies
  • 492065 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #940 on: 10 / January / 2013, 12:29:04 »
Advertisements
did you check get_flash_ready() ?
Yes.
Code: (lua) [Select]
function rs_shoot(opts)
local rec,vid = get_mode()
if not rec then
return false,'not in rec mode'
end
if type(init_remotecap) ~= 'function' then
return false, 'remotecap not supported'
end
if bitand(get_remotecap_support(),opts.fformat) ~= opts.fformat then
return false, 'unsupported format'
end
if not init_remotecap(opts.fformat,opts.lstart,opts.lcount) then
return false, 'init failed'
end
press('shoot_half')
local shtimeout = get_tick_count()
local gfrtime = 0
repeat
sleep(10)
if get_flash_ready() and (gfrtime==0) then
gfrtime=get_tick_count()-shtimeout
end
until ( get_shooting() and ( get_flash_ready() or (get_flash_mode()==2) ) ) or ( (get_tick_count()-shtimeout)>5000 )
shtimeout=get_tick_count()-shtimeout
reset_shoot_ok()
press('shoot_full')
local gsrtime = get_tick_count()
repeat
sleep(10)
until  ( get_shoot_ok() ) or ( (get_tick_count()-gsrtime)>5000 )
gsrtime=get_tick_count()-gsrtime
release('shoot_full')
return true, 'get_shooting: ' .. shtimeout .. 'ms , gfr: ' .. gfrtime .. 'ms, gsr: ' .. gsrtime .. 'ms'
end
Above version (I haven't removed the debug related lines) works, tried on the A410 and A460 this time.
The below one however frequently fails with flash (A460 is worse).
Code: [Select]
function rs_shoot(opts)
local rec,vid = get_mode()
if not rec then
return false,'not in rec mode'
end
if type(init_remotecap) ~= 'function' then
return false, 'remotecap not supported'
end
if bitand(get_remotecap_support(),opts.fformat) ~= opts.fformat then
return false, 'unsupported format'
end
if not init_remotecap(opts.fformat,opts.lstart,opts.lcount) then
return false, 'init failed'
end
press('shoot_half')
    local shtimeout = get_tick_count()
    local gfrtime = 0
repeat
sleep(10)
        if get_flash_ready() and (gfrtime==0) then
            gfrtime=get_tick_count()-shtimeout
        end
until ( get_shooting() and ( get_flash_ready() or (get_flash_mode()==2) ) ) or ( (get_tick_count()-shtimeout)>5000 )
shtimeout=get_tick_count()-shtimeout
local gsrtime = get_tick_count()
click('shoot_full')
return true, 'get_shooting: ' .. shtimeout .. 'ms , gfr: ' .. gfrtime .. 'ms, gsr: ' .. gsrtime .. 'ms'
end
Of course I'm not trying to say that my "solution" is ideal, especially not when the exposure time is seconds long.
According to the logs, get_shooting() and get_flash ready() seem to become true at the same time.
edit: I'm using capt_seq_hook_set_nr(), not the raw hook, I just forgot about that...
« Last Edit: 10 / January / 2013, 17:57:51 by srsa_4c »

*

Online reyalp

  • ******
  • 14082
Re: CHDK PTP interface
« Reply #941 on: 13 / January / 2013, 00:07:04 »
Please don't check anything into ptp-remote-capture-test. I'll delete it soon (only removes it from the list of current branches)
I have removed the old branches.

Note that the changes in ptp.h and live_view.h in the trunk made the headers no longer directly usable by chdkptp source. For now I've added an define clients can use CHDK_PTP_PROTOCOL_ONLY to exclude everything that isn't strictly related to the ptp protocol. It might make more sense to split the chdk specific stuff into separate headers.

I would like to keep the ability of clients to use the CHDK header directly, since it minimizes the risk of copy/paste errors and the headers act as the protocol specification.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK PTP interface
« Reply #942 on: 13 / January / 2013, 00:39:29 »
It might make more sense to split the chdk specific stuff into separate headers.

For the trunk version, I'd prefer to do things that way, to avoid #ifdef's in the header files used by platform independent code.

I think, the live_view.h file change is best fixed by moving the 'extern int live_view_get_data(ptp_data *data, int flags);' definition into ptp.c - which is the only place where this function is referenced.

I'm doing some other cleanup in the trunk at the moment, so I'll split the ptp.h file in two and move the function reference out of live_view.h as part of the change.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: CHDK PTP interface
« Reply #943 on: 29 / March / 2013, 14:19:38 »
Hey guys... I am fairly new, but I had a couple of questions about PTP.

I have a Canon SX210 is, and I was able to get CHDK running on it. I was also able to get the PTP inteface to run off it as well. I am able to only perform a few functions on it, but the only function I really care about it "taking a picture" and using "liveview". The shoot feature works but the live view does not display the screen correctly. The picture is distorted, showing 1/4 of the picture four times. Is this a known issue? Does anyone have any suggestions on what can be causing this problem?

Your help is greatly appreciated...


*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #944 on: 29 / March / 2013, 17:12:06 »
... but the live view does not display the screen correctly. The picture is distorted, showing 1/4 of the picture four times. Is this a known issue?
Now it is. Can you show a screenshot?

Re: CHDK PTP interface
« Reply #945 on: 01 / April / 2013, 14:20:20 »
... but the live view does not display the screen correctly. The picture is distorted, showing 1/4 of the picture four times. Is this a known issue?
Now it is. Can you show a screenshot?

Yeah, here is the screen shot of what is happening...

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #946 on: 02 / April / 2013, 16:03:45 »
Yeah, here is the screen shot of what is happening...
I see. The reason is that not all liveview related code is implemented in this port. I can probably help with this, but since I don't have access to this camera, I will need feedback. Are you ready to do some testing?
If so, please post your answer to the SX210IS porting thread.

*

Online reyalp

  • ******
  • 14082
Re: CHDK PTP interface
« Reply #947 on: 06 / April / 2013, 22:00:33 »
I updated the remote capture branch with philmoz module re-work. It seems to work, but I haven't tested it carefully. This will probably make it hard to merge back (because there were changes needed to make it build checked in at the same time), but I guess we'll deal with that when we get there...
Don't forget what the H stands for.


*

Online reyalp

  • ******
  • 14082
Re: CHDK PTP interface
« Reply #948 on: 07 / April / 2013, 16:08:20 »
I updated the remote capture branch with philmoz module re-work. It seems to work, but I haven't tested it carefully. This will probably make it hard to merge back (because there were changes needed to make it build checked in at the same time), but I guess we'll deal with that when we get there...
Had second thoughts about this, made a new branch ptp-remote-capture-test3. Future changes should go there.

The issue is that merging the module rework required resolving conflicts and making changes in the new remote cap code. But the checkin to do this also includes the merge of all the trunk changes, so merging it back would be problematic.

Making a new branch from the trunk merging the existing remote cap changes into it resolves this, but makes the history more confusing. This is all a product of my slacking on the remote capture branch :(

I would like to "land" the remote cap branch fairly soon. The main outstanding item is to re-work how DNG is handled so we can get can control header and byte reversing separately. This also requires re-working how chdkptp handles it.
Don't forget what the H stands for.

Re: CHDK PTP interface
« Reply #949 on: 08 / April / 2013, 16:54:10 »
A PTP query in another thread prompted me to comment on PTP support in the forthcoming SDM 1.86 release.
A friend and myself spent a lot of time working on this and it has many useful features including image gallery editor, on-th-fly creation of stop-motion movies, uploading of images one-at-a-time or after a burst sequence, image stacks, stereo image stacks,time-lapse, hdr,etc.etc.

See attached image.

Having seen the sort of problems that people attracted to CHDK can have, it would be far more difficult for the average SDM user to cope with and would require never-ending support.

So, I have removed support for PTP.
I will tell people that if they are convinced they need it, just download the CHDK DISKBOOT.BIN file and Modules folder.

It is that easy  ....  and gives me far more  time to get back to photography.


 

Related Topics