supplierdeeply

alternative ptp client

  • 953 Replies
  • 100937 Views
*

Offline reyalp

  • ******
  • 10168
Re: alternative ptp client
« Reply #50 on: 19 / February / 2012, 14:45:35 »
Advertisements
I'm afraid I don't understand.  I downloaded ptp.h rev 158, but could not find a reference in it to PTP_OC_CHDK or PTP_CHDK.  Where are those defined?

Look carefully. You need the ptp.h from the CHDK source, and it needs to be in a directory called 'core', otherwise include "ptp.h" would just pick up the chdkptp one. This defines the protocol. For ease of development, I just include it from my chdk source tree. Yes, this isn't user friendly, I should probably keep a default copy in the chdkptp source.

I've added a new binary snapshot r160. The previous one was missing ustime.lua, so wouldn't actually run. Thanks to begin_astro for pointing that out to me.
Don't forget what the H stands for.

*

Offline lyzby

  • **
  • 50
Re: alternative ptp client
« Reply #51 on: 19 / February / 2012, 18:14:28 »
OK, I got it, thank you for your patience.

When I first ran chdkptp I got the following:
Code: [Select]
/usr/lib/chdkptp --help
pcall failed 2
error [string "require('main')"]:1: module 'main' not found:
        no field package.preload['main']
        no file './main.lua'
        no file '/usr/local/share/lua/5.1/main.lua'
        no file '/usr/local/share/lua/5.1/main/init.lua'
        no file '/usr/local/lib/lua/5.1/main.lua'
        no file '/usr/local/lib/lua/5.1/main/init.lua'
        no file '/usr/share/lua/5.1/main.lua'
        no file '/usr/share/lua/5.1/main/init.lua'
        no file './main.so'
        no file '/usr/local/lib/lua/5.1/main.so'
        no file '/usr/lib/lua/5.1/main.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
I noticed that there was a "main.lua" in /usr/src/chdkptp/lua, so I switched to that directory and executed the program successfully.  I assume there is a configuration setting which tells the program where to find "main.lua", but I wasn't sure which that was--one of the two lua configuration settings in config.mk or something else.

I executed the program with "/usr/bin/chdkptp -i -c" and got connected.  I did "h" for help.  I especially appreciate the "ls" command--it's good to be able to get a directory listing easily.

I didn't notice anything like ptpcam's "mode 1" and "mode 0" commands, so I didn't know how to get to where I could "lua set_zoom(3)" and then "lua shoot()"--how to you take a picture with this program in command line mode?

Very good work.  I will be glad to have this program and it's successors running on my little dockstar.

*

Offline reyalp

  • ******
  • 10168
Re: alternative ptp client
« Reply #52 on: 19 / February / 2012, 18:39:41 »
OK, I got it, thank you for your patience.

When I first ran chdkptp I got the following:
...

I noticed that there was a "main.lua" in /usr/src/chdkptp/lua, so I switched to that directory and executed the program successfully.  I assume there is a configuration setting which tells the program where to find "main.lua", but I wasn't sure which that was--one of the two lua configuration settings in config.mk or something else.
Actually, it's not a make config problem, see chdkptp-sample.sh. On linux, the Lua files are not automatically located relative to the program path.

This is one of many loose ends that I still haven't got around to dealing with yet.
Quote
I didn't notice anything like ptpcam's "mode 1" and "mode 0" commands, so I didn't know how to get to where I could "lua set_zoom(3)" and then "lua shoot()"--how to you take a picture with this program in command line mode?
There isn't cli commands for switching mode, but you can easily call the camera function directly:
Code: [Select]
=switch_mode_usb(1)

Quote
Very good work.  I will be glad to have this program and it's successors running on my little dockstar.
Glad you are finding this useful. I noticed http://wiki.openwrt.org/toh/seagate/dockstar says the dockstar is big endian (but can be configured as little ?) It's possible you will run into some endian issues with a big endian host.
Don't forget what the H stands for.

*

Offline lyzby

  • **
  • 50
Re: alternative ptp client
« Reply #53 on: 19 / February / 2012, 22:49:35 »
I hope it's not premature.  I put up wiki articles for ptpcam and chdkptp.  It took me a couple of days of research to find out what I was looking for, and then to learn how to set it up.  Hope these can save time for others.

http://chdk.wikia.com/wiki/Ptpcam_in_headless_linux_Dockstar

http://chdk.wikia.com/wiki/Chdkptp_in_headless_linux_Dockstar_-_remote_control


*

Offline rudi

  • ***
  • 123
  • A590IS_101B, SX260HS_100B
Re: alternative ptp client
« Reply #54 on: 21 / February / 2012, 06:47:31 »
Hi reyalp,

you add palette function for a540 in rev. 1684. Sorry, I don't test LiveView in this moment.
Do you have seen this post? Your a540 have an similar routine on 0xFFD23838 and a convert buffer on 0x5ED8. You get a valid channel value for each channel (A, Y, U, V) by (val1 + val2)div 2.
Hint: White color on a590 use Y=$E0. A test with Y=$FF shows a brighter white on camera display.

rudi

*

Offline reyalp

  • ******
  • 10168
Re: alternative ptp client
« Reply #55 on: 21 / February / 2012, 13:23:21 »
Hi reyalp,

you add palette function for a540 in rev. 1684. Sorry, I don't test LiveView in this moment.
Do you have seen this post? Your a540 have an similar routine on 0xFFD23838 and a convert buffer on 0x5ED8. You get a valid channel value for each channel (A, Y, U, V) by (val1 + val2)div 2.
Hint: White color on a590 use Y=$E0. A test with Y=$FF shows a brighter white on camera display.

rudi
Hi rudi, thanks for that, I hadn't noticed it. The code I have for decoding it in chdkptp (r177-r180) seems to work pretty well but I'm not sure it's totally correct.

Live view is progressing well. I can now play tetris using my camera as a controlling and my computer as display ;)

I've (re)discovered some interesting things about the a540 frame buffers
- normal display is actually 704x240 (or sometimes 264 ?), for both bitmap and viewport. Displaying a 720x viewport shows garbage on the right side. This presumably also affects MD and histogram.
- in 640x480 video mode, the live viewport is 704x528, i.e. the viewport pixels are effectively square instead of 2:1. I believe srsa_4c  mentioned this elsewhere.
- in stitch assist mode, it's tiny.
- if you have a video selected in playback mode, live buffer function returns null (ewavr discovered this a long time ago)
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 10168
Re: alternative ptp client
« Reply #56 on: 26 / February / 2012, 01:52:08 »
I've uploaded a new binary snapshot (r192) to the files area http://www.assembla.com/spaces/chdkptp/documents

This includes support for the live view protocol in the reyalp-ptp-live branch. See http://www.assembla.com/spaces/chdkptp/wiki/Live_view_GUI for details. I can post builds from the branch if anyone needs, just give your camera model and canon firmware version.

The linux version requires that you have the CD libraries available on your LD_LIBRARY_PATH. The windows version is statically linked, so all you need to do is unzip and run the exe.
 
In order to make it easier to support cameras I don't have, I've added a feature to record and play back dumps of the live data.

This is far from finished, don't be surprised if it crashes or exhibits other odd behavior.
Don't forget what the H stands for.

*

Offline Pier

  • ***
  • 128
Re: alternative ptp client
« Reply #57 on: 26 / February / 2012, 03:54:40 »
Hi,
 Just tested on SX130 IS 101c chdkptp live view -r192 with compiled CHDK zip from the reyalp-ptp-live.
Working OK with checked viewfinder and  UI overlay.Tested with 5 to 30 FPS - on the Gui screen
all is OK - any motion is perfect in Gui window....start/stop Recording e.t.c.
But can't dump to file and check in play mode.DCIM 2 Folders on SD card are empty.
Quote
•To record, click on the debug tab, and check “Dump to file”.
No such tab on Gui interface, nor exactly such tab and in CHDK folder..There is Dump data display: Props Params None
What I'm doing wrong ?
I'v compiled reyalp's ptp-live unziped files with Modules in the core folder.Is this wrong ?
BTW these Modules made me nervous...allways... >:(
EXELENT JOB is this CHDKPTP live view !Thanks reyalp !

And Statistic:   Cam was in video mode 1280x720
   
         10 Fps                 30 Fps
Running:         yes         yes
Fps avg:         9.97        19.36
Frame last ms:   30        30
T/P avg kb/s:    4190      8765
X/fer last ms:   20          20
X/fer kb:        421          421
X/fer last kb/s: 21065     21065

YES !
I get it working in play mode too.Debug tab appears after deleting old CGHDK.CFG I'v made copy/paste it from previous CHDK folder-normal build 1659...Either I was blind and I've never seen it ..
On both 10 Fps and 30 Fps (Cam was fixed on the table)  all is Fine !(of course 30 Fps is around 20 but this is nice speed too).
« Last Edit: 26 / February / 2012, 05:29:32 by Pier »


*

Online msl

  • *****
  • 1193
  • A720 IS, SX220 HS 1.01a
    • CHDK inside
Re: alternative ptp client
« Reply #58 on: 26 / February / 2012, 08:48:58 »
Great work!

Tested with A720 1.00c - works fine.
Tested with SX220 1.01a - works not really.

I have create a SX220 liveview dump, maybe usefull for the analysis: edit: deleted because wrong link , see next postings

msl
« Last Edit: 26 / February / 2012, 14:50:51 by msl »
German CHDK pages:  CHDK forum | CHDK inside | CHDK Twitter News by msl | Download CHDK-DE (Autobuild)
Note: SDM violates the GPL rules!

*

Offline reyalp

  • ******
  • 10168
Re: alternative ptp client
« Reply #59 on: 26 / February / 2012, 14:37:32 »
Tested with SX220 1.01a - works not really.
Yes, the newer cameras will need some additional work. I think the dumps I got from philmoz will help me sort most of those out, but more samples is always good.
Quote
I have create a SX220 liveview dump, maybe usefull for the analysis: http://www.box.com/s/58j5asaidvrjr02g740r
I think you linked the wrong file, that says a620update100f.zip

I get it working in play mode too.Debug tab appears after deleting old CGHDK.CFG I'v made copy/paste it
The debug tab I'm talking about appears in the CHDKPTP client, inside the live view tab. You can see it in MSLs screenshot. I don't know what you are looking at in the chdk screens, but it won't help with this.
Don't forget what the H stands for.

 

Related Topics