ELPH300HS aka IXUS220HS - Porting Thread - page 41 - DryOS Development - CHDK Forum

ELPH300HS aka IXUS220HS - Porting Thread

  • 899 Replies
  • 421689 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #400 on: 01 / December / 2011, 04:14:00 »
Advertisements
I noticed .DNG files had ludicrous focal lengths reported in the Exif data.  This because CHDK still had the address of the sx220's focus length table.  I found the table in the ELPH300 (it's in the same place in all three firmwares) and updated main.c and all stubs_min.S files to reflect this.  Now the metadata reports a sane value.

This patch also fixes a few minor problems in platform_camera.h, and adjusts the aperture table in shooting.c to something a bit closer (it's not exact; it's stolen from the ixus200, which has a similar lens; I'm not sure where to find the real info for this - I didn't see it in propcase 26, where some comments referenced).

[EDIT: patch applies to trunk revision 1441]

Added in changeset 1442.
FYI - patches for stuff in the main trunk normally get posted in http://chdk.setepontos.com/index.php?topic=650

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: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #401 on: 01 / December / 2011, 08:18:57 »
Here's another iteration that also crashes:

Code: [Select]
" BL shooting_expo_iso_override\n"      // added

" BL sub_FF88319C \n"

" BL shooting_expo_param_override\n"  // added

" BL sub_FF8800A8 \n"

//" MOV     R0, #0\n" // added
//" STR     R0, [R5,#0x28]\n" // added, fixes overrides  behavior at short shutter press (from S95)

I figured shooting_expo_iso_override was setting some variable that we don't have the right address for, and clobbering something important.  But it doesn't seem to access any model-specific data. 

Still stymied on this one...

Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #402 on: 01 / December / 2011, 21:32:53 »
I got the zebras working by changing lib.c from this:
Code: [Select]
int vid_get_viewport_buffer_width() { return 960; }to this:
Code: [Select]
int vid_get_viewport_buffer_width() { return 360; }
Edge detection works for every other shot.  That is, once you take a shot, the edges from the previous shot keep being displayed--it doesn't update in real-time.  Then when you take another shot, it resumes working.  I would guess the camera has two viewports that it alternates between, and CHDK is only looking at the first.  (As a wild guess, I might say this is how they implement panorama stitch mode - show the previous viewport so you can line up the next shot with the current one.)

Zebras don't quite work right when you choose an aspect ratio other than 4:3.  The borders at the edge of the shot are "underexposed".  I can fix this by adjusting vid_get_viewport_xoffset() / _yoffset() / etc. - actually, I stole the ones from the sx40, because it has the same resolution/aspect ratio screen, and same viewport width.  Problem is, _that_ breaks edge detection: the edges no longer line up with the display.  Oh, and the camera crashes too.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #403 on: 01 / December / 2011, 21:42:48 »
I got the zebras working by changing lib.c from this:
Code: [Select]
int vid_get_viewport_buffer_width() { return 960; }to this:
Code: [Select]
int vid_get_viewport_buffer_width() { return 360; }
Edge detection works for every other shot.  That is, once you take a shot, the edges from the previous shot keep being displayed--it doesn't update in real-time.  Then when you take another shot, it resumes working.  I would guess the camera has two viewports that it alternates between, and CHDK is only looking at the first.  (As a wild guess, I might say this is how they implement panorama stitch mode - show the previous viewport so you can line up the next shot with the current one.)

Zebras don't quite work right when you choose an aspect ratio other than 4:3.  The borders at the edge of the shot are "underexposed".  I can fix this by adjusting vid_get_viewport_xoffset() / _yoffset() / etc. - actually, I stole the ones from the sx40, because it has the same resolution/aspect ratio screen, and same viewport width.  Problem is, _that_ breaks edge detection: the edges no longer line up with the display.  Oh, and the camera crashes too.

In the sub/xxxx/lib.c files you are using the IXUS 310 model for vid_get_viewport_live_fb and vid_get_viewport_fb.
This code is subtracting vid_get_viewport_xoffset()*3 from the actual buffer address.

This is probably wrong - this hack only seems to apply to widescreen cameras where the image is always left justified in the viewport memory. On 4:3 display cameras the image is centered in the viewport. CHDK code assumes the image is centered so the offset is used to fool it.

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)


*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #404 on: 01 / December / 2011, 22:09:44 »
Here's another iteration that also crashes:

Code: [Select]
" BL shooting_expo_iso_override\n"      // added

" BL sub_FF88319C \n"

" BL shooting_expo_param_override\n"  // added

" BL sub_FF8800A8 \n"

//" MOV     R0, #0\n" // added
//" STR     R0, [R5,#0x28]\n" // added, fixes overrides  behavior at short shutter press (from S95)

I figured shooting_expo_iso_override was setting some variable that we don't have the right address for, and clobbering something important.  But it doesn't seem to access any model-specific data. 

Still stymied on this one...

To investigate this sort of problem dump the crash ROM log (option in the debug menu).

This will give the location of where firmware has crashed and the stack trace.
At the top of the log is the line number and source file where the assert was raised in the firmware - you can search the firmware dis-assembly to find these.

Using the stack trace, firmware dis-assembly and the core/main.dump file from the build that crashed you can locate where the error occurred and the call sequence that triggered it. This may give some clues as to what is going wrong.

If you dump the log and upload that along with the main.dump file then I can help you analyse it (also need to know which camera firmware version it is from).

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: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #405 on: 01 / December / 2011, 22:28:14 »
In the sub/xxxx/lib.c files you are using the IXUS 310 model for vid_get_viewport_live_fb and vid_get_viewport_fb.
This code is subtracting vid_get_viewport_xoffset()*3 from the actual buffer address.

This is probably wrong - this hack only seems to apply to widescreen cameras where the image is always left justified in the viewport memory. On 4:3 display cameras the image is centered in the viewport. CHDK code assumes the image is centered so the offset is used to fool it.

Aha!  Thank you for pointing that out.  That was indeed the problem.

I've submitted a patch.

Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #406 on: 02 / December / 2011, 03:31:44 »
That was indeed the problem.
I've submitted a patch.

I tried the latest build and zebra and edge overlay seem to be working fine! :)

*

Offline tommi2water

  • ***
  • 157
  • IXUS 220 HS Firmware: 1.00c
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #407 on: 02 / December / 2011, 10:39:45 »
If you dump the log and upload that along with the main.dump file then I can help you analyse it (also need to know which camera firmware version it is from).

Before uploading log and main.dump I would like to ask about the log file.

My logfile starts with:
Code: [Select]
Exception!! Vector 0x10
Occured Time  2011:11:27 12:58:22
Task ID: 15204383
Task name: SpyTask
Exc Registers:
0x00000008
0x000000FF
...

Date in camera is set correctly. Maybe this is only an old CrashRomLog from my first tests (better call them crashes ;)) on 27.November? There is no other "Occured Time" mentioned in that ROMLOG.LOG file. Probably this logfile is not belonging to the crash when pressing Shutter_Half after override of ISO is set.




Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #408 on: 02 / December / 2011, 11:01:28 »
Hey Guys ! i registered here to thank you for your work !

im using a ixus220hs (1.01c)  with CDHK and the 7upLight for intervall shots !
Works great, the only thing to do is to deactivate the "LCD shutdown" in the script menu than everything is working fine :)

i never worked with CDHK and it took me only 10 minutes to get everything to work ! real beginner friendly pice of software. :)
Thanks a lot !!   :xmas
« Last Edit: 02 / December / 2011, 11:05:31 by hans1234 »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #409 on: 02 / December / 2011, 16:23:25 »
If you dump the log and upload that along with the main.dump file then I can help you analyse it (also need to know which camera firmware version it is from).

Before uploading log and main.dump I would like to ask about the log file.

My logfile starts with:
Code: [Select]
Exception!! Vector 0x10
Occured Time  2011:11:27 12:58:22
Task ID: 15204383
Task name: SpyTask
Exc Registers:
0x00000008
0x000000FF
...

Date in camera is set correctly. Maybe this is only an old CrashRomLog from my first tests (better call them crashes ;)) on 27.November? There is no other "Occured Time" mentioned in that ROMLOG.LOG file. Probably this logfile is not belonging to the crash when pressing Shutter_Half after override of ISO is set.




You can use the memory browser to cause a crash (increase the increment to a high value then browse past the end of RAM). Then dump this log.
Crash the camera with the ISO override and dump another log - if it hasn't changed then you've managed to crash the camera without it doing a DebugAssert call. This is pretty rare in my experience and is going to be a lot tougher to diagnose.

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)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal