supplierdeeply

SD940 (IXUS120) porting thread

  • 542 Replies
  • 60467 Views
  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #190 on: 04 / January / 2011, 00:51:28 »
    Advertisements
    I use DNG.  To use, create a file called badpixel.bin in \CHDK.  Maybe an empty file will work, otherwise try 8 or 16 bytes of 0x00.
    Needs to be at least 16 0x00's.  I get a CRW file that I can open and see an image.  If I ask FSViewer to show it full size it is a whole lot bigger than my computer screen so I'm hoping its not just scaling up the jpg thumbnail that I think is embedded in each DNG version of a CRW file ?  If not then what this means is that it has been working all along - doh!

    I'd suggest using rawconvert (in the tools directory) to turn it into an 8bpp greyscale. That should be enough to tell if you have the correct dimensions and image buffer.

    Okay - worked out how to get the makefile in the tools directory to build an executable version of rawconvert.  What should I use as command line parameters to get an 8bpp greyscale - that was not obvious and trial & error has not helped.  Also - any suggestiong on what image viewer should understand the resulting output ?

    Thank again!

    *

    Offline reyalp

    • ******
    • 9957
  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #191 on: 04 / January / 2011, 01:59:49 »
    Needs to be at least 16 0x00's.  I get a CRW file that I can open and see an image.
    Don't confuse the *extension* with the *format* of the file. If you have DNG turned on you get a DNG. Some programs are smart enough to figure out a file with a format that doesn't match the extension.

    If you get a working DNG (the image isn't scrambled), your raw parameters are correct, and you can ignore everything below

    Quote
    Okay - worked out how to get the makefile in the tools directory to build an executable version of rawconvert.  What should I use as command line parameters to get an 8bpp greyscale - that was not obvious and trial & error has not helped.  Also - any suggestiong on what image viewer should understand the resulting output ?

    Thank again!
    http://chdk.wikia.com/wiki/CHDK_Tools
    rawconvert -12to8 -w=<width> -h=<height> [-pgm] <infile> <outfile>

    -12to8 says to convert a 12 bit per pixel to an 8 bit per pixel.

    The non-pgm output of rawconvert is understood by many programs (gimp, irfanview http://www.irfanview.com/ photoshop) that have an "open as raw" command where you can enter the bit depth and dimensions.

    Most of those programs probably also understand pgm.

    The width and height don't have to be correct, they just have to match (width*height*bpp)/8 == filesize. Use whatever values you have in camera.h. If you get them wrong it will be obvious in the image, and you can try different values in camera.h.

    In irfanview, you would do
    "open as raw", and enter 8bpp (greyscale, 1 byte per pixel), and the same width and height you used in camera.h

    Don't forget what the H stands for.

  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #192 on: 04 / January / 2011, 07:10:01 »
    to show crw files its also possible to use dng4ps and create a camera profile

    here you can mark a range and this program can create a color profile for you.there is a jpg of same image need for this.

    I can on IX1000 click calc color profile, and i get white too.but i think something work on IX1000 raw wrong, colors are tint not direct exchange.

    I shoot for conversion this image from my monitor

    http://dng4ps2.googlecode.com/files/pallete.PNG

    but not so near, that the monitor dots not see.

    then i mark the range of the testimage and dng4ps2 try to calc a color matrix so the raw image look same as jpg image of same file

    maybe you have more luck with that
    « Last Edit: 04 / January / 2011, 07:14:58 by Bernd R »
    Ixus 1000 HS

  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #193 on: 04 / January / 2011, 09:49:40 »
    With a faked out badpixel.bin file I get working DNG files.  And using rawconvert per reyalp's instructions give me an 8bpp greyscale that looks good with irfanview.  So I think I'm going to declare this one solved and move onto my last problem - getting LUA working.

    Once that's done,  dare I say we might have a release candidate for the main trunk ?


  • Publish
    debugging with the ROM log
    « Reply #194 on: 05 / January / 2011, 22:02:19 »
    I need a little debugging advice here.

    I'm chasing whatever it is that make LUA crash in my port.  I've read through the wiki on debugging http://chdk.wikia.com/wiki/Debugging#Reading_the_romlog

    The good news is that I get what looks like a valid camera dump after each crash.   First line is almost alway "Exception!! Vector 0x10" - an attempt to access an invalid memory address.  I think I also once saw a "Exception!! Vector 0x04" - undefined instruction.  Either way, the camera appears to head off into the void while running LUA scripts.

    Other information :  its always "Task name: SpyTask" in the dump logs.  Why ?  I though LUA and BASIC run from the mykbd_task() ?

    Looking at addresses in the register and stack dumps do not reveal anything like a "return address" - those in ROM areas are usually halfway through some ramdom subroutine.  Not immediately after a BL instruction.

    Not sure what to do with the camera log part.  The last line is usually '00002120: UI:ScreenLock" but not always.


    So, any advice on what to look at?

    *

    Offline reyalp

    • ******
    • 9957
  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #195 on: 05 / January / 2011, 22:49:02 »
    I need a little debugging advice here.

    I'm chasing whatever it is that make LUA crash in my port.  I've read through the wiki on debugging http://chdk.wikia.com/wiki/Debugging#Reading_the_romlog

    The good news is that I get what looks like a valid camera dump after each crash.   First line is almost alway "Exception!! Vector 0x10" - an attempt to access an invalid memory address.  I think I also once saw a "Exception!! Vector 0x04" - undefined instruction.  Either way, the camera appears to head off into the void while running LUA scripts.

    Other information :  its always "Task name: SpyTask" in the dump logs.  Why ?  I though LUA and BASIC run from the mykbd_task() ?
    Maybe stomping on something that ends up killing spytask.

    Since you are getting an exception, you should look at PC (R15) in the register dump. That should be the address of the offending instruction. More likely to be useful with data access exception. If you want to post the register dump and the first bit of the stack dump here, I may be able to provide some help.

    Don't forget what the H stands for.

  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #196 on: 05 / January / 2011, 23:05:23 »
    Since you are getting an exception, you should look at PC (R15) in the register dump. That should be the address of the offending instruction. More likely to be useful with data access exception. If you want to post the register dump and the first bit of the stack dump here, I may be able to provide some help.
    I cut and pasted four ROMLOG files below.  R15 seems only seems to point into ROM once in the four logs.

    Code: [Select]

    ==========================================================================
    Exception!! Vector 0x10
    Occured Time  2011:01:02 09:43:32
    Task ID: 12910616
    Task name: SpyTask
    Exc Registers:
    0x00307534
    0x00197E50
    0x00000001
    0xD1B560C4
    0x0019ACD4
    0x00000000
    0x00000000
    0x00000000
    0x19980218
    0x001611BB
    0x19980218
    0x00307524
    0xFFB0D484
    0x00307518
    0x0016B3E4
    0xFF87E580
    0x00000013
    StackDump:
    0x00307554
    0x00307528
    0x0015F083
    0x0016B3E0
    0x0000B471
    0x00000201
    0x00000000
    0x4D2048C4
    0x0019ACD4
    0x00000100
    0x0019ACD4
    0x00000201
    0x00159B95
    0x00000000
    0x00000140
    0x00000000
    0x0016B51D
    0x0019ACD4
    0x0015A23D
    0x0019554C
    0x00000000
    0x00154055
    0x002F2D44
    0x19980218
    0x19980218
    0xFF816A20
    0x19980218
    0x19980218
    0x00000808

    ==========================================================================
    Exception!! Vector 0x10
    Occured Time  2011:01:05 18:34:06
    Task ID: 12910616
    Task name: SpyTask
    Exc Registers:
    0x00000000
    0x00000000
    0x00000000
    0x00000000
    0x60000013
    0x00000000
    0x00163587
    0x002C2000
    0x00307554
    0x001635CD
    0x003078F4
    0x003078F4
    0x0030761C
    0x00307538
    0x00165FC9
    0x0030762C
    0x00000010
    StackDump:
    0x003078F4
    0x002C1DD0
    0x003078F4
    0x002C5600
    0x0030761C
    0x003078F4
    0x00166073
    0x002C5600
    0x00000004
    0x0016159B
    0x0030761C
    0x00307BA8
    0x0030761C
    0x00162245
    0x0030761C
    0x00307BA8
    0x0030761C
    0x00162387
    0x003078F4
    0x00000024
    0x0000000D

    ==========================================================================
    Exception!! Vector 0x10
    Occured Time  2011:01:05 18:52:24
    Task ID: 12910616
    Task name: SpyTask
    Exc Registers:
    0x00005555
    0x00307558
    0xE12FF001
    0x7A3A834C
    0xE59F110C
    0x1777CD2C
    0xE5911000
    0x003075F1
    0x80000013
    0xFF812C3C
    0x002C4CB8
    0xFF814114
    0x00000000
    0x00307538
    0x002C4CC0
    0x00000362
    0x800000B8
    StackDump:
    0x00154180
    0x00307D58
    0x0030754C
    0x00165C3B
    0x00154180
    0x00005555
    0x00000000
    0x003075F1
    0x00160D89
    0x00000000
    0x00000005
    0x00000004
    0x00000004
    0x002C1908
    0x00160DFF
    0x002C1B08
    0x00000000
    0x002C1AD8
    0x003078F4
    0x00000024
    0x0000000D

    ==========================================================================
    Exception!! Vector 0x10
    Occured Time  2011:01:05 18:52:24
    Task ID: 12910616
    Task name: SpyTask
    Exc Registers:
    0x00005555
    0x00307558
    0xE12FF001
    0x7A3A834C
    0xE59F110C
    0x1777CD2C
    0xE5911000
    0x003075F1
    0x80000013
    0xFF812C3C
    0x002C4CB8
    0xFF814114
    0x00000000
    0x00307538
    0x002C4CC0
    0x00000362
    0x800000B8
    StackDump:
    0x00154180
    0x00307D58
    0x0030754C
    0x00165C3B
    0x00154180
    0x00005555
    0x00000000
    0x003075F1
    0x00160D89
    0x00000000
    0x00000005
    0x00000004
    0x00000004
    0x002C1908
    0x00160DFF
    0x002C1B08
    0x00000000
    0x002C1AD8
    0x003078F4
    0x00000024
    0x0000000D

    ==========================================================================

    *

    Offline reyalp

    • ******
    • 9957
  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #197 on: 05 / January / 2011, 23:31:30 »
    Do you have a link for a 103c dump ?
    Don't forget what the H stands for.


  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #198 on: 06 / January / 2011, 00:08:56 »

  • Publish
    Re: SD940 (IXUS120) porting thread
    « Reply #199 on: 07 / January / 2011, 01:11:51 »
    Crashing problem in LUA fixed - mykbd_task() was running out of stack space.  Changed 1.03c version to use same startup code as 1.02c as that code created the task with a 4X larger stack.

    source ->[http://www.zshare.net/download/848676257e9092d1/
    1.02c ->  http://www.zshare.net/download/84867664e4bf0334/
    1.03c ->  http://www.zshare.net/download/848676892eb6629e/

    At this point,  as far as I know - EVERYTHING WORKS !!!


     

    Related Topics