IXUS160/ELPH160 Porting attempt - page 6 - DryOS Development - CHDK Forum  

IXUS160/ELPH160 Porting attempt

  • 497 Replies
  • 231712 Views
*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #50 on: 24 / May / 2015, 14:40:22 »
Advertisements
I know, that's what I did, still gave a crash at that point. Will test more tomorrow.

*

Offline srsa_4c

  • ******
  • 4451
Re: IXUS160/ELPH160 Porting attempt
« Reply #51 on: 24 / May / 2015, 16:33:09 »
I know, that's what I did, still gave a crash at that point.
Try moving the raw hook right after
Code: [Select]
BL      sub_FF99C6C0but before the label.
Can you upload one of those bad DNGs? The first 100kB or so is probably sufficient.

*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #52 on: 25 / May / 2015, 07:09:41 »
That's what I first tried and it didn't work (skips raw saving altogether), I will retry since I saw I made a typo in my code.

Here is a DNG header that I got without the Dvlp hook.
Made with
Code: [Select]
head -c100k CRW_...DNG
Edit: putting it before the label doesn't crash the camera, but it doesn't save it whether I select RAW or DNG.
« Last Edit: 03 / August / 2015, 03:26:59 by adong »

*

Offline srsa_4c

  • ******
  • 4451
Re: IXUS160/ELPH160 Porting attempt
« Reply #53 on: 25 / May / 2015, 16:34:27 »
That's what I first tried and it didn't work (skips raw saving altogether), I will retry since I saw I made a typo in my code.
(...)
Edit: putting it before the label doesn't crash the camera, but it doesn't save it whether I select RAW or DNG.
That's very odd because that seems to be (almost) equivalent to the spot used in the sx170 port (which is known to work).
You could try some debugging (below snippet is just a suggestion):
Code: [Select]
"loc_FF99BD38:\n"
"    LDR     R0, [R1, #8] \n"
"    MOV     R1, #1 \n"
"    BL      sub_FF99C6C0 \n"
"BL debug_func_1\n"
"loc_FF99BD44:\n"

(...)

long debug_func_1(long x) {
  *(int *)(0x40000000) += 1;
  return x;
}
Print *(int *)(0x40000000) somewhere on the screen and see whether it's increasing as you shoot.

edit:
your DNG header snippet has suffered an LF -> CRLF conversion (a 0x0d byte is added before every 0x0a byte)  :blink:
« Last Edit: 25 / May / 2015, 16:41:11 by srsa_4c »


*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #54 on: 26 / May / 2015, 16:40:10 »
nope, doesn't increment at all. Will investigate more this weekend.

As for the crlf issue, cygwin is to blame I think :(
Trusty ol' dd to the rescue!

Sorry for the zip, forums doesn't want me to upload files with weird names
« Last Edit: 03 / August / 2015, 03:27:12 by adong »

*

Offline srsa_4c

  • ******
  • 4451
Re: IXUS160/ELPH160 Porting attempt
« Reply #55 on: 26 / May / 2015, 17:09:34 »
nope, doesn't increment at all.
In this case you'll have to discover what happens when you shoot, in the following tasks:
- capt_seq
- dvlpseq
That usually means logging of the so-called messages received by those tasks. My debug patches made for the sx170 may give some ideas (if not, please ask). See this year's attachments in the sx170 porting thread.

edit:
dng_validate (from the Adobe DNG SDK) shows the following for your DNG head:
*** Error: CFAPattern does not contain all the colors in the CFAPlaneColor tag (SubIFD 1) ***
« Last Edit: 26 / May / 2015, 17:47:35 by srsa_4c »

*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #56 on: 27 / May / 2015, 03:44:08 »
About the DNG: I just read the DNG2PS documentation, I will calibrate the camera this week and try again.

I will read about the debug patches, I think I understood the big idea :-)

Thanks for the help as always!

Edit: With the current raw hook (not in dvlptask), using dng4ps's calibrate crashes the program.
« Last Edit: 30 / May / 2015, 04:45:50 by adong »

*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #57 on: 30 / May / 2015, 06:06:30 »
Back with the debug patchs:

Unfortunately the camera logs show it's not quite the same as sx170, as the dvlp task does not get hit with the correct args.

Excerpt from IXUS160 logs:

Code: [Select]
00271510: UI:_ContiCount->0(5632)
00271510: UI:_ManagePTMProperty
00271510: SS:ModChg
00271510: SS:   Evf=1
00271510: SS:   8241->8000
00271510: SS:   Asp 0000->0000
00271520: SS:ModChg*
00271520: UI:_DecideCaptureMode
00271520: UI:_StillToStill
00271520: UI:_StartStill
00271520: UI:_ContiCount->0(5632)
00271520: UI:DSIC:42,2
00271530: UI:DSIC:d3,0
00271560: UI:Display_CaptInfo
00271570: UI:VTMUnLock
00271570: UI:TerminateDeliverToZoomController
00271570: UI:OPTICAL_ZOOM_POS
00271570: UI:UnpressZoomLever
00271570: UI:DispSwCon_TurnOnDisplayDevice
00271570: UI:LogicalEvent:0x0000313e:adr:0,Para:0
00271590: UI:DSIC:d5,0
00271590: UI:VTMLock
00271600: UI:VTMUnLock
00271600: UI:_DecideModeDial
00271610: UI:LogiEvnt_NotPowerType:0x000009a4:adr:0,Para:0
00271610: UI:LogiEvnt_NotPowerType:0x000009a2:adr:0,Para:0
00271610: UI:DSIC:6a,0
00272400: UI:Button:0x000009A1:PressSwOne
00272400: SS:PreBuf
00272400: SS:BitR
00272400: UI:ShtCon_ResetShootingNumber
00272400: UI:ShootState:0x1
00272400: UI:ShtCon_Activate
00272400: UI:DispSw: Lock
00272400: UI:ShtCon_ShutDownRecModeMenu
00272400: UI:DSIC:61,0
00272400: UI:VTMLock
00272400: UI:VTMUnLock
00272410: UI:VTMLock
00272410: UI:VTMReduuce
00272410: UI:LogicalEvent:0x00003136:adr:0,Para:0
00272410: UI:ShtCon_PrepareCapture
00272410: SS:PreCapt
00272410: UI:ShootState:0x2
00272410: UI:ClearEventComp
00272420: UI:VTM SW
00272420: UI:VTMUnLock
00272720: UI:ShootSeqToUI:0x0000203b:adr:0,Para:0
00272730: UI:ShtCon_SetAFBeep
00272730: UI:DSIC:69,0
00272870: UI:ShootSeqToUI:0x00002006:adr:0x1d5c,Para:7516
00272870: 000c83a3:capt 0
00272870: UI:ShtCon_SetPreCapt
00272870: UI:DSIC:62,1
00272870: UI:VTMLock
00272870: UI:DSIC:d5,0
00272890: UI:Button:0x000009A3:PressSwTwo
00272900: UI:VTMUnLock
00272900: UI:_ResetShootingMode
00272900: UI:_EntryPrepareShoot
00272900: UI:ShootState:0x6
00272910: UI:ShootState:0x7
00272910: UI:ShootState:0x18
00272910: UI:DSIC:12,0
00272910: UI:_MuteOn
00272910: UI:DSIC:43,0
00272910: UI:DispSwCon_MuteOnPhysicalScreen
00272910: UI:Window MuteOn
00272910: UI:MuteOnPhysicalScreen
00272910: SS:StartShoot
00272910: SS:SCtrl:Shoot(1/0x1)
00272920: UI:Button:0x000009A4:UnpressSwTwo
00272920: UI:Button:0x000009A2:UnpressSwOne
00272930: 000d6589:capt 4
00272930: UI:ShootSeqToUI:0x0000203f:adr:0xff99a090,Para:-6709104
00272930: UI:_CaptureCount->1
00272930: UI:DSIC:63,0
00272930: UI:VTMLock
00272940: UI:VTMUnLock
00272940: UI:VTMLock
00272950: UI:VTMReduuce
00272950: UI:VTMLock
00272950: UI:VTMReduuce
00272950: UI:DSIC:6a,0
00272950: UI:VTM SW
00272950: UI:VTMUnLock
00272950: UI:_MuteOff
00272950: UI:DSIC:44,0
00272950: UI:DispSwCon_MuteOffPhysicalScreen
00272950: UI:Window MuteOff
00272950: UI:MuteOffPhysicalScreen
00272980: UI:ShootSeqToUI:0x00002040:adr:0x581a38,Para:5773880
00272980: UI:DSIC:64,0
00273810: 000ad421:capt 2
00273810: 000aeb60:dvlp q1 0 1 1cab0, 0
00273810: UI:DSIC:45,0
00274300: SS:SCtrl:RecReview
00274300: SS:SCtrl:StartReview
00274300: UI:ShootSeqToUI:0x00002041:adr:0x1c974,Para:117108
00274460: UI:ShootSeqToUI:0x0000203e:adr:0,Para:0
00274460: UI:ShootSeqToUI:0x00002001:adr:0x582e68,Para:5779048
00274460: UI:Sht_CancelStrobeChargeTimer
00274460: UI:DSIC:4c,0
00274460: UI:VTMLock
00274460: UI:VTMUnLock
00274460: SS:SCtrl:NextShot(1)
00274460: UI:DSIC:46,0
00274460: UI:_CaptureStanbyForReview
00274460: SS:SCtrl:CompShootPic(0)
00274460: UI:ShootSeqToUI:0x00002029:adr:0x1c980,Para:117120
00274460: UI:_NormalCompleteShootPictureAction
00274460: UI:_CheckNextShotAvailable
00274470: UI:_CaptureCount->0
00274470: UI:ShtCon_ResetShootingNumber
00274470: UI:ShootState:0x8
00274470: UI:ShtCon_StartReview
00274470: UI:_EntryActionReview
00274470: UI:LogicalEvent:0x0000311f:adr:0,Para:0
00274470: UI:_EnableReviewHold:IsPressSwTwo:0
00274470: UI:_EnableReviewHold:IsAvailableShots:1
00274470: UI:RecReviewCon_SetMode:0x0003
00274470: UI:DSIC:4c,0
00274470: UI:VTMLock
00274470: UI:VTMReduuce
00274470: SS:StopRev
00274470: UI:VTMLock
00274470: UI:PB.StartDecodeRecReview_S
00274480: UI:PB.RefPB
00274490: UI:IPS.DrawI
00274490: SS:NextAvail(11),ReviewAvail(9)
00274510: UI:PB.StartDecodeRecReview_E
00274510: UI:StartRecReviewTimer
00274510: UI:ShootState:0x9
00274510: UI:ShtCon_ResetShootingNumber
00274510: SS:ExitShoot
00274710: UI:IPS.DComp:0
00274710: UI:LogicalEvent:0x00003204:adr:0,Para:0
00277330: UI:DSIC:47,0
00278450: UI:DSIC:48,0
00278470: 0001ee65:capt 3
00278470: UI:LogicalEvent:0x0000311e:adr:0,Para:0
00278470: UI:PB.RfrsI
00278480: UI:DispSwCon_MuteOffPhysicalScreen
00278480: UI:Window Reduce MuteOff
00278480: UI:VTMUnLock
00278480: UI:Window Re MuteOff
00278480: UI:Window MuteOff
00278480: UI:MuteOffPhysicalScreen
00278480: UI:_EntryPrepareRecreviewOff
00278480: UI:ShootState:0xB
00278480: UI:ShtCon_StopReview
00278480: UI:StopRecReviewController
00278480: UI:PB.StopDecodeRecReview_S
00278480: UI:PB.StopR
00278480: UI:VTMLock
00278490: UI:VTMReduuce
00278490: UI:LogicalEvent:0x00003120:adr:0,Para:0
00278490: UI:PB.StopDecodeRecReview_E
00278490: UI:ShtCon_ResetShootingNumber
00278490: UI:_ExitSequence
00278490: UI:Sht_CancelStrobeChargeTimer
00278490: UI:DSIC:4c,0
00278490: UI:VTMLock
00278490: UI:VTMReduuce
00278490: UI:_ExitActionReview
00278490: SS:CancelPre
00278720: UI:VTMLock
00278720: UI:VTMUnLock
00278860: UI:DispSwCon_MuteOffPhysicalScreen
00278860: UI:Window MuteOff
00278860: UI:MuteOffPhysicalScreen
00278860: UI:ShootState:0x0
00278860: UI:ShtCon_Deactivate
00278860: UI:DSIC:12,0
00278870: UI:DSIC:60,0
00278870: UI:DispSwCon_TurnOnDisplayDevice
00278870: UI:VTMLock
00278870: UI:DSIC:d5,0
00278900: UI:VTMUnLock
00278900: UI:DispSw: Unlock
00278900: UI:DispSwCon:Unlock
00278900: UI:_ChangeDisplayOut
00278900: UI:TerminateDeliverToZoomController
00278900: UI:OPTICAL_ZOOM_POS
00278900: UI:UnpressZoomLever
00278900: UI:VTMLock
00278900: UI:VTMReduuce
00278900: UI:VTMLock
00278900: UI:VTMReduuce
00278900: UI:_EntryIdleShoot
00278910: UI:ShootState:0x0
00278910: UI:VTM SW
00278910: UI:VTMReduuce
00278910: UI:VTM SW
00278910: UI:VTMReduuce
00278910: UI:VTM SW
00278910: UI:VTMUnLock
00278960: UI:VTMLock
00278960: UI:VTMUnLock
00278960: SS:ChargeComplete
00281630: UI:VTMLock
00281630: UI:VTMUnLock
00282330: UI:VTMLock
00282340: System.Create
00282340: StartRedirectUART
00282340: UI:VTMUnLock
00282350: Printf
00282350: ShowCameraLog
uartr.lua: start UART redirection

(capt indexes are a little bit different, in ixus160 what is called capt 4 is capt 3 in sx170 and capt3 was not in sx170, sorry about that)

So looking at dvlp lines, there is no "dvlp q1 3 x x, x" so the ""    BEQ     loc_FF99BD38 \n"  //  1st msg after shoot" never gets hit.

Successfully tested with putting the debug func at "loc_FF99BD44:\n", I can increment the value.

There is also no SS Raw event, but I don't know if it's just the camera.

(didn't implement the fwt log hooks)
We can also see that the capt 2 call is actually earlier than the dvlp call, so no point if I understood right to put it in dvlpseqtask.


*

Offline srsa_4c

  • ******
  • 4451
Re: IXUS160/ELPH160 Porting attempt
« Reply #58 on: 31 / May / 2015, 11:04:22 »
Edit: With the current raw hook (not in dvlptask), using dng4ps's calibrate crashes the program.
Wwait... Isn't this using a simple RAW file? Did you create a camera profile for your camera? (If you did create one that lets you convert RAWs to usable DNGs, it might be that your 20MP pictures exceed some internal limit and cause the program to crash.)

*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #59 on: 31 / May / 2015, 11:45:39 »
0.2.3 branch does not have calibration features, only the 0.2.2 has (unless there is another build than the google code one)

It does use a RAW file (not DNG), but if I understood right, from the JPG and RAW file (and a picture of a calibration pattern) I can generate a camera profile.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal