SX260 HS Porting Thread - page 26 - DryOS Development - CHDK Forum

SX260 HS Porting Thread

  • 642 Replies
  • 231131 Views
Re: SX260 HS Porting Thread
« Reply #250 on: 24 / May / 2012, 03:16:52 »
Advertisements
As to the file size, I believe most OS file systems first allocate/reserve the full file size needed and then write the file, this is so not to waste effort writing if the write will fail due to not enough space available.

I would assume, that internal file contents may be 'random' (from previous use of that space) & the 'DNG' structure within the file would not be complete.

Don't know about you, but many times its human (me) error I suspect first, other factors second. So I suggest to 'yuyu' to make sure he had beta5 loaded, for sure, and then see if fast shutter is failing.

Let us hear from all those testing beta5!!

Re corrupted raw/dng:
Some cameras have multiple raw buffers and alternate between them under some circumstances.

Also some reduced resolution modes (usually special high ISO or fast shooting modes) don't produce a valid raw buffer at all.

If it crashed while saving raw, then the filesize should be wrong.

*

Offline yuyu

  • *
  • 11
Re: SX260 HS Porting Thread
« Reply #251 on: 24 / May / 2012, 08:09:42 »
Beta5 was my first install choice after buying the camera, I only tested beta4 after all the issues were evident.

Those files are not from a crash, but regular picture taking. I can easily take several shots by refraining from presing full length. RAW corruption happens no matter what resolution I choose, from 4000x3000 to the smallest ones. RAW file size is always 18MB (whatever full size is). The corrupted "pixels" come out both on CRWs and DNGs, that means is not an issue writing pixels but actually getting wrong data buffer to begin with.
Note that you might need to patch your tools to be able to access CRW files due to nonstandard sensor size (4176x3060 at 12 bit depth).

Yes, I presumed it was something I was doing first, hence I installed beta5 and beta4 several times to make sure. I also played with various settings and nothing changed. I was formatting in between installs of course, no previous files were left in between installs.
It is not random data from previous sector contents on the card, since the card was just low level formatted, happens on all RAW files, and the files look similar on a hex editor but are not exactly the same.

Full automatic and manual ISO selection did change nothing.

I tested chdk using both a class 2 and a class 6 card. I have been using chdk on my ixus 85 IS with both cards with no problems whatsoever and I do not think it is a problem with the cards, in fact jpgs come out fine. Class 2 card suffers on 1080p video due to speed but that's about it. Note that the 85IS creates 10 megapixel raws just fine on that very same card.

Reyalp has voiced what I have in mind, that chdk is accessing wrong pixel buffer. I hope posting my firmware dump sheds some light on it, in case there are some minor differences. A naive binary file comparison shows differences to the dump posted on first post of this thread, but that is no way to make a proper code dump comparison for so many obvious reasons. Code dump address remains the same as that firmware, btw.

I know very little about ARM assembly (curious perusal of iOS code and thats about it) and do not know how to compile chdk myself (sx260 doesn't appear on my chdk-shell-343 panel) but with some pointers and access to an up to date IDA database I might be able to help some.


EDIT: I have uploaded a ZIP file with several pics of different sizes, from 4kx3k to 640x480.
http://dl.dropbox.com/u/81185573/more_pics_different_sizes.zip  (40MB file might take a while to upload)

« Last Edit: 24 / May / 2012, 08:32:39 by yuyu »

*

Offline yuyu

  • *
  • 11
Re: SX260 HS Porting Thread
« Reply #252 on: 24 / May / 2012, 12:52:19 »
UPDATE:
Fixed the fast shutter crash by recompiling CHDK myself from rudi's trunk diff file. Recompiling from asm1989's v10 sources+manual patches did not fix the crash, oddly enough.

RAW files garbage issue is still unresolved however.

Re: SX260 HS Porting Thread
« Reply #253 on: 24 / May / 2012, 19:18:14 »
yuyu, Sorry if I offended you, none was meant, you as a 'newbie' poster and getting contrary results from mine made me skeptical, but you have more experience at using CHDK than I do, just not on the sx260!

Speaking of conflicting results read this!!

'Av' 100 ISO mode:

I just took 16 raw 'DNG' shots without taking my finger off of the shutter button! The first shot I did NOT wait for focus conformation. NO CRASHES

The cam simply showed a new image on the LCD between each shot (about 6 secs), nothing more was seen!

I then took several shots immediately after loading CHDK, press shutter to awaken cam, then shot immediately w/o a crash.

LR v4 can interpret & present/process a perfect 'DNG' image for each of the 20+ shots.

I am using a 16gb ($19) Sandisk Ultra (30MBps) class 6 SDHC card, so certainly nothing special here, and the video is fine @ around 36mbps for full HD.

I also have 100B f/w in my sx260.

So this confuses me & the situation!!

PS: How do you process your CRW files, DPP???  Please explain/tell!!

Thanks!

*

Offline yuyu

  • *
  • 11
Re: SX260 HS Porting Thread
« Reply #254 on: 24 / May / 2012, 21:50:09 »
You did nothing to offend me and I was just focusing on the facts and providing information to rule out alternatives. I guess I should use more emoticons and stop writing multipage posts :p

If I use my own compiled CHDK I do not get crashes either but RAW files keep containing garbage and I have not found the cause yet.

You are better off using DNG files since CRW files are just memory dumps with no metadata and things as basic as image dimensions have to be guessed from the file size.

I have patched show_bad_b to be able to generate badpixel.bin files for sx260 even if it is no longer needed for DNG output. See attachment.

*

Offline reyalp

  • ******
  • 14128
Re: SX260 HS Porting Thread
« Reply #255 on: 24 / May / 2012, 23:37:07 »
RAW corruption happens no matter what resolution I choose, from 4000x3000 to the smallest ones.
The raw is only affected in special modes (like ISO3200 or fast shooting) that force you to use 1/2 resolution. In normal modes, the raw buffer is present and full sized no matter what the selected jpeg size is.
Quote
The corrupted "pixels" come out both on CRWs and DNGs, that means is not an issue writing pixels but actually getting wrong data buffer to begin with.
They both do write in the same way.

DNG reverses all the bytes in the buffer before writing, so if the raw address were incorrect, it would be very likely to cause a crash.
Quote
Reyalp has voiced what I have in mind, that chdk is accessing wrong pixel buffer. I hope posting my firmware dump sheds some light on it, in case there are some minor differences. A naive binary file comparison shows differences to the dump posted on first post of this thread, but that is no way to make a proper code dump comparison for so many obvious reasons. Code dump address remains the same as that firmware, btw.
IMO there zero chance that cameras of the same canon firmware version use different buffers if the settings are the same. The actual hardware addresses don't change between firmware versions either, but if the raw buffer address is taken from a variable, it could be wrong in one firmware version and not in another (edit: but even so, the variable should only pick between several valid hardware addresses)

If I am correct that both you and StealthTaffer have the same canon firmware version, then there must be some difference in the settings you are using, or the CHDK build.

edit:
looking at the lib.c files in sx260-100b_c-alsources-v10.zip posted earlier in this thread, the hook_raw_image_addr and hook_alt_raw_image_addr appear to be identical.
« Last Edit: 24 / May / 2012, 23:43:24 by reyalp »
Don't forget what the H stands for.

*

Offline yuyu

  • *
  • 11
Re: SX260 HS Porting Thread
« Reply #256 on: 25 / May / 2012, 07:39:19 »
Some progress:

RAW data seems to be missing on fully automatic shooting modes but is present on manual modes.
I would appreciate if someone else verifies that RAW works for them both on full auto and manual, or, is it just my cam?


When I shoot on auto the raw pixel data is missing from both rawaddr(44000000) and altrawaddr(4ADB54A0). hook_raw_size() reports the right size at all times (as expected). I patched raw.c to log the above and swap both pointers before calling write_dng() to check alternate contents. I have yet to play with the cached/uncached bit (0x4XXXXXXX). EDIT: cache bit does not help.

If I shoot on Manual and then on auto, raw buffer contains the (potentially pixel swapped) contents from previous successful DNG processing (second last shoot) plus some garbage on top.

Check the DNGs on this link, they should be completely different scenes (as depicted on the JPGs):
http://dl.dropbox.com/u/81185573/second_DNG_is_corrupted_firstone.zip

This happens both on asm1989's binary distribution (beta5) and my own builds.
« Last Edit: 25 / May / 2012, 08:02:57 by yuyu »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX260 HS Porting Thread
« Reply #257 on: 25 / May / 2012, 11:44:20 »
yuyu, you are right it fails to save raw in AUTO mode, seam to work  other modes.

So this may may use diferent buffers for auto mode , strage but seams to be.

I allways use Manual so didn't test it.

Other bug is stichassist fails taking the second picture with or without raw.
« Last Edit: 25 / May / 2012, 11:57:34 by asm1989 »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: SX260 HS Porting Thread
« Reply #258 on: 25 / May / 2012, 18:32:23 »

So this may may use diferent buffers for auto mode , strage but seams to be.


Although it's possible I would say it's unlikely.

In my experience this sort of problem is usually a mistake in the capt_seq.c code, or the placement of the call to capt_seq_hook_set_nr.

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 asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX260 HS Porting Thread
« Reply #259 on: 26 / May / 2012, 00:56:37 »
philmoz , why then it work in all the other modes, and fails only in auto ?

 

Related Topics


SimplePortal © 2008-2014, SimplePortal