ixus175_elph180_100c porting attempt - page 9 - DryOS Development - CHDK Forum  

ixus175_elph180_100c porting attempt

  • 201 Replies
  • 67655 Views
*

Offline axman

  • ***
  • 145
Re: ixus175_elph180_100c porting attempt
« Reply #80 on: 22 / May / 2017, 17:10:46 »
Advertisements
Regarding ixus180 and chdkptp, some observations.

CHDK PTP Gui - live mode
  shows the PLAY screen viewfinder
  app buttons for rec and play seemingly have no effect
  somehow I raised the ALT menu;
  I could see ALT menu in Viewfinder gui display, it looked and scaled fine.
  did not attempt ALT menu control
  tried command bar at bottom;
> record
ERROR: unknown command 'record'
> rec
ERROR: switch failed

The above hung the camera with no response to power button or any button press.  Led slowly flash.  Battery pull, and all is well.

chdkptp

Sometimes camera is not seen by chdkptp, using chdkptp -i , I see this in syslog;  Ubuntu 16.04 x86_64
Code: [Select]

syslog:
May 22 19:19:37 zeus kernel: [1124301.011015] usb 2-4: new high-speed USB device number 45 using xhci_hcd
May 22 19:19:38 zeus kernel: [1124301.140645] usb 2-4: New USB device found, idVendor=04a9, idProduct=32c1
May 22 19:19:38 zeus kernel: [1124301.140652] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 22 19:19:38 zeus kernel: [1124301.140657] usb 2-4: Product: Canon Digital Camera
May 22 19:19:38 zeus kernel: [1124301.140660] usb 2-4: Manufacturer: Canon Inc.
May 22 19:19:38 zeus kernel: [1124301.140663] usb 2-4: SerialNumber: 9689C1E6DAB54BBFA81EA9705BE77AA9
May 22 19:19:38 zeus mtp-probe: checking bus 2, device 45: "/sys/devices/pci0000:00/0000:00:14.0/usb2/2-4"
May 22 19:19:38 zeus mtp-probe: bus: 2, device: 45 was not an MTP device
May 22 19:19:38 zeus org.gtk.vfs.GPhoto2VolumeMonitor[32446]: (process:309): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
May 22 19:19:38 zeus gnome-session[32573]: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
May 22 19:20:08 zeus kernel: [1124331.478483] usb 2-4: usbfs: interface 0 claimed by usbfs while 'chdkptp' sets config #1
May 22 19:20:08 zeus kernel: [1124331.478526] usb 2-4: usbfs: process 15627 (chdkptp) did not claim interface 0 before use
May 22 19:20:08 zeus kernel: [1124331.478570] usb 2-4: usbfs: process 15627 (chdkptp) did not claim interface 0 before use
May 22 19:20:08 zeus kernel: [1124331.478656] usb 2-4: usbfs: process 15627 (chdkptp) did not claim interface 0 before use
May 22 19:20:08 zeus kernel: [1124331.644283] usb 2-4: reset high-speed USB device number 45 using xhci_hcd

chdkptp cli:
___> connect
open_camera_dev_usb: ptp_opensession failed 0x2ff
open_camera_dev_usb:usb_ptp_device_reset(): Device or resource busy
usb_ptp_get_device_status(): Device or resource busy
connected: Canon PowerShot ELPH 180, max packet size 512

If I boot CHDK on camera first, then run chdkptp -i and plug camera in, the usbfs warnings do not appear.  (I doubled checked and I *do* have the udev rule that excludes all Canon cams).

This lua snip worked;
Code: [Select]
con> =return get_buildinfo()
1:return:table:{platform="ixus175_elph180",build_date="May 14 2017",build_number="1.5.0",build_time="16:24:15",version="CHDK",platsub="100c",build_revision="4759",platformid=12993,os="dryos",}
con 1> imdl --dir=/home/ajm/chdk

a simple 'list' command in chdkptp cli;
Code: [Select]
con 4> list
*1:Canon PowerShot ELPH 180 b=002 d=047 v=0x4a9 p=0x32c1 s=9689C1E6DAB54BBFA81EA9705BE77AA9

Imdl in the cli worked;

Code: [Select]
con 5> imdl -ddir='/home/ajm/chdk'
A/DCIM/100___05/IMG_0003.JPG->/home/ajm/chdk/100___05/IMG_0003.JPG
A/DCIM/100___05/IMG_0004.JPG->/home/ajm/chdk/100___05/IMG_0004.JPG
A/DCIM/100___05/IMG_0005.JPG->/home/ajm/chdk/100___05/IMG_0005.JPG
A/DCIM/100___05/IMG_0006.JPG->/home/ajm/chdk/100___05/IMG_0006.JPG
A/DCIM/100___05/IMG_0007.JPG->/home/ajm/chdk/100___05/IMG_0007.JPG
A/DCIM/100___05/IMG_0008.JPG->/home/ajm/chdk/100___05/IMG_0008.JPG
A/DCIM/100___05/IMG_0009.JPG->/home/ajm/chdk/100___05/IMG_0009.JPG
A/DCIM/100___05/IMG_0010.JPG->/home/ajm/chdk/100___05/IMG_0010.JPG
A/DCIM/100___05/IMG_0011.JPG->/home/ajm/chdk/100___05/IMG_0011.JPG
A/DCIM/100___05/IMG_0012.JPG->/home/ajm/chdk/100___05/IMG_0012.JPG
A/DCIM/100___05/IMG_0013.JPG->/home/ajm/chdk/100___05/IMG_0013.JPG
A/DCIM/100___05/IMG_0014.JPG->/home/ajm/chdk/100___05/IMG_0014.JPG
con 6>

I'm searching for the forum post describing how to use chdkptp dev extras for debugging..  Had it in my notes, but lost that box due to blue smoke..  Tried PTP test according to http://chdk.wikia.com/wiki/Testing 

Code: [Select]
ajm@zeus:~/code/chdkptp/trunk$ ./chdkptp -e"exec require'camtests'.runbatch{bench=true,filexfer=true}"
connect:start
using default device
connected: Canon PowerShot ELPH 180, max packet size 512
connect:ok
list_connected:start
list_connected:ok
wait_status:start
wait_status:ok
exec_errors:start
exec_errors:ok
msgfuncs:start
msgfuncs:ok
exectimes:start
execw 50 mean 0.0453 min 0.0420 max 0.0571 total 2.2664 (22.0615/sec) wall 2.2668 (22.0572/sec)
exec 50 mean 0.0264 min 0.0211 max 0.0289 total 1.3219 (37.8241/sec) wall 2.0439 (24.4627/sec)
exectimes:ok
xfer:start
50 x 1048576 bytes mean 0.0273 min 0.0264 max 0.0292 total 1.3641 (38435705 byte/sec) wall 1.3645 (38422550 byte/sec)
xfer:ok
msgs:start
testing 100 messages size 1-101, inc 1
ran 100 fail 0 time 1.1319
testing 100 messages size 10-1010, inc 10
ran 100 fail 0 time 1.2133
msgs:ok
filexfer:start
camtest/test511.dat->A/test511.dat
A/test511.dat->camtest/d_test511.dat
A/test511.dat: OK
camtest/test512.dat->A/test512.dat
A/test512.dat->camtest/d_test512.dat
A/test512.dat: OK
camtest/test4096.dat->A/test4096.dat
A/test4096.dat->camtest/d_test4096.dat
A/test4096.dat: OK
filexfer:ok
mfilexfer:start
camtest/up/SUB1/SUB.TXT->A/muptest/SUB1/SUB.TXT
camtest/up/ONE.TXT->A/muptest/ONE.TXT
camtest/up/EMPTY.TXT->A/muptest/EMPTY.TXT
mkdir camtest/dn/SUB1
A/muptest/SUB1/SUB.TXT->camtest/dn/SUB1/SUB.TXT
A/muptest/ONE.TXT->camtest/dn/ONE.TXT
A/muptest/EMPTY.TXT->camtest/dn/EMPTY.TXT
mkdir camtest/dn/EMPTYSUB
A/muptest/SUB1/SUB.TXT: OK
A/muptest/SUB1: OK
A/muptest/ONE.TXT: OK
A/muptest/EMPTY.TXT: OK
A/muptest/EMPTYSUB: OK
A/muptest: OK
mfilexfer:ok
reconnect:start
reconnect:ok
disconnect:start
disconnect:ok
not_connected:start
not_connected:ok
passed 13
failed 0

It seems I can communicate well with the camera using chdkptp, with the exception of mode switch to Rec.  Any hints of what I might test or try to make progress on the rec mode issue are appreciated.  I thought I saw a post with source, will try and have a look at that.


Re: ixus175_elph180_100c porting attempt
« Reply #81 on: 22 / May / 2017, 17:45:57 »
That record button issue, in my limited experience, suggests your udev rule is not really working.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline axman

  • ***
  • 145
Re: ixus175_elph180_100c porting attempt
« Reply #82 on: 22 / May / 2017, 20:43:46 »
@ww, thanks for the observation.  I forced the issue, and now booting CHDK with tsamma's build, chdkptp 'rec' command extends the lens.

I tried remoteshoot and rsint; attempts to take picture look as if camera is doing the right thing; LCD goes dark, flash activates, shutter sound is heard, then cam dies with lens extended.

error from rsint:

Code: [Select]
zeus:trunk ajm$ ./chdkptp -i
___> connect
connected: Canon PowerShot ELPH 180, max packet size 512
con> rec
con 1> rsint '/home/ajm/Pictures' -jpg
rsint> s
WARNING: /home/ajm/code/chdkptp/trunk/lua/chdku.lua:1366: I/O error
stack traceback:
    /home/ajm/code/chdkptp/trunk/lua/chdku.lua:1366: in function 'capture_get_data'
    /home/ajm/code/chdkptp/trunk/lua/rsint.lua:135: in function </home/ajm/code/chdkptp/trunk/lua/rsint.lua:86>
    [C]: in function 'xpcall'
    /home/ajm/code/chdkptp/trunk/lua/rsint.lua:259: in function </home/ajm/code/chdkptp/trunk/lua/rsint.lua:152>
    (...tail calls...)
    [C]: in function 'xpcall'
    /home/ajm/code/chdkptp/trunk/lua/cli.lua:285: in function 'execute'
    /home/ajm/code/chdkptp/trunk/lua/cli.lua:400: in function </home/ajm/code/chdkptp/trunk/lua/cli.lua:391>
    (...tail calls...)
    /home/ajm/code/chdkptp/trunk/lua/main.lua:282: in main chunk
    [C]: in function 'require'
    [string "require('main')"]:1: in main chunkWARNING: error waiting for shot script I/O error
ERROR: uninit I/O error
___>

ROMLOG from failed rsint attached.

Trying the gui next to extend with rec and retract with play.

*

Offline axman

  • ***
  • 145
Re: ixus175_elph180_100c porting attempt
« Reply #83 on: 22 / May / 2017, 20:52:49 »
Chdkptp gui correctly switches to rec;  Shoot button works, saves jpg file to sdcard..

Wondering how to jack up the verbosity of the gui, or log its interaction with the camera, and try to compare that successful result to the chdkptp cli unsuccessful result.  Any clue is appreciated.


Re: ixus175_elph180_100c porting attempt
« Reply #84 on: 22 / May / 2017, 22:03:40 »
Remoteshoot not work due to my porting mistake. May be fix it later if I found the solution.
Thank you.

*

Offline axman

  • ***
  • 145
Re: ixus175_elph180_100c porting attempt
« Reply #85 on: 13 / June / 2017, 21:26:44 »
I plan to implement filewrite and liveimage for this port.  I have one, so it's easy to compare to my two working DIGIC IV+ cameras.  If this is considered poaching someone's port, I apologize in advance.  Please let me know.  Otherwise, I'd like to make this into a fully working port with filewrite and liveimage completed, and post it here.

I'd like to pick a starting point that seems reasonable from the perspective of taking this port into trunk/.  Maybe someone has a working-to-this-point tarball that is known and could be used?  If not, I could provide a tarball of my current platform/ixus175_180, as started by tsamma, and modified by me described below.  Can also provide git log of my steps, one at a time.

If this seemed like an acceptable starting point, from this point on, I would post svn diffs, code, etc (changing one thing at a time) for filewrite and liveimage.  Feedback is welcome and appreciated.  Thanks!

how I got from tarball posted in the thread to now:

There is nothing in /trunk about this cam.  I took the tarball provided here: link=topic=13063.msg132121#msg132121 date=1491352746

and placed in my dev tree.  git add.  Try to build, fail;  liveimage is referenced in taskhook.S, but is not present in code_gen.txt.

I alter taskhook such that only boot, capt_seq and init_filemodules are built.  It means I have commented out exp_drv_task, filewrite, and liveimage from taskhook.  Commit those changes.  I strip code_gen.txt so the funcs commented out from taskhook are not present.  make clean, run-code-gen, firzipsubcomplete.

only CHDK/MODULES and DISKBOOT.BIN are built.  CHDK boots in the camera.  Take single image manually, it works.  Commit the resulting *.c, and code_gen.txt.

Then, I copy the files srsa_4c provided here
link=topic=13063.msg132121#msg132121 date=1491352746

to their proper spots, one at a time, with a commit for each.  make clean; make run-code-gen; make firzipsubcomplete.  Camera boots, no scripts.  Takes images, nav CHDK menus ok.  chdkptp can connect, but cannot not switch to record mode.  I commit the resulting *.c, code_gen.txt.

Test long exposure = 1:30, works.
Test short exposure = 0.001, works.

I kinda expected the exposure results, since srsa_4c provided the exp_drv_task in the code_gen.txt.

It also seems to be the place where tsamma kind of left off, after making a couple of builds for guys.  There may be more changes to his builds after that, I don't know.  I hacked on this port after that in May, and came to the realization that I did not know enough to fix it - then - and so went elsewhere to learn about filewrite (sx530hs).

Continuing w/testing, to see if anything noticeable and expected to work is not working, before diving into making filewrite go.

Re: ixus175_elph180_100c porting attempt
« Reply #86 on: 14 / June / 2017, 08:38:03 »
This's my last source code on ixus175 past month ago. comment in source code not clean yet.
A few mod on code_gen.txt about exp_drv_task and filewrite taskhook. result in not success on filewrite and turnoff display. source code
 :)

*

Offline axman

  • ***
  • 145
Re: ixus175_elph180_100c porting attempt
« Reply #87 on: 17 / June / 2017, 19:55:43 »
@tsamma, thanks for the source! 

I got pretty far, but not complete or working correctly.  filewrite.c "looks ok," but:

  chdkptp 'rec' works.
  chdkptp 'shoot' works, it takes two shots, all is good.
  chdkptp remoteshoot makes shutter noise,  crash with lens out.
    battery pull and ok.
    ROMLOG, maybe it points to the spot in filewrite that is wrong.

After reading many porting threads, I think problem is with MakeDirectory_Fut, or maybe apex2us.

I will share my changes, if anyone is interested.


*

Offline reyalp

  • ******
  • 12690
Re: ixus175_elph180_100c porting attempt
« Reply #88 on: 17 / June / 2017, 20:46:58 »
@tsamma, thanks for the source! 

I got pretty far, but not complete or working correctly.  filewrite.c "looks ok," but:

  chdkptp 'rec' works.
  chdkptp 'shoot' works, it takes two shots, all is good.
Normally, shoot should only take one shot.
Quote
  chdkptp remoteshoot makes shutter noise,  crash with lens out.
    battery pull and ok.
    ROMLOG, maybe it points to the spot in filewrite that is wrong.

After reading many porting threads, I think problem is with MakeDirectory_Fut, or maybe apex2us.
apex2us should affect regular shoot and remote shoot equally.

MakeDirectory_Fut shouldn't directly affect shooting. It could be called if raw was enabled.

A romlog could definitely provide clues
Don't forget what the H stands for.

*

Offline axman

  • ***
  • 145
Re: ixus175_elph180_100c porting attempt
« Reply #89 on: 17 / June / 2017, 22:44:37 »
Thanks for having a look.

 

Related Topics