SX430 - This will be my first porting Attempt - page 11 - DryOS Development - CHDK Forum supplierdeeply

SX430 - This will be my first porting Attempt

  • 166 Replies
  • 175788 Views
Re: SX430 - This will be my first porting Attempt
« Reply #100 on: 19 / November / 2018, 08:56:25 »
Advertisements
The Raw still saves Corrupted

Sample on Google Drive

What should be the reason
Note : the Raw saved with CHDK PTP and DNG Remote Shoot is proper


*

Offline blackhole

  • *****
  • 660
  • A590IS 101b
    • Planetary astrophotography
Re: SX430 - This will be my first porting Attempt
« Reply #101 on: 19 / November / 2018, 09:36:44 »
The Raw still saves Corrupted

Sample on Google Drive

What should be the reason
Note : the Raw saved with CHDK PTP and DNG Remote Shoot is proper
Can you please run HOOKTEST.lua script and upload the hooktest.log (log will be saved to the SD card).
The script is in the SCRIPTS / TEST folder.
If you can,please upload the valid dng file.
« Last Edit: 19 / November / 2018, 09:38:59 by blackhole »

*

Offline srsa_4c

  • ******
  • 3877
Re: SX430 - This will be my first porting Attempt
« Reply #102 on: 19 / November / 2018, 16:32:09 »
I suspect that the raw hook is not placed ideally and firmware processes race with CHDK. I checked that there is indeed only one raw buffer, so that can't be the cause. An in-camera DNG needs some processing time to reverse the byte order of raw data. A DNG created via remote shoot is not processed in camera, processing is done on PC side (AFAIK).

edit:
The "added 3" hook seems to be equivalent to the placement found in ixus175 source. I'm not convinced that the other (added 2) hook is needed.
« Last Edit: 19 / November / 2018, 17:16:10 by srsa_4c »

*

Offline blackhole

  • *****
  • 660
  • A590IS 101b
    • Planetary astrophotography
Re: SX430 - This will be my first porting Attempt
« Reply #103 on: 19 / November / 2018, 18:20:18 »
I suspect that the raw hook is not placed ideally and firmware processes race with CHDK. I checked that there is indeed only one raw buffer, so that can't be the cause. An in-camera DNG needs some processing time to reverse the byte order of raw data. A DNG created via remote shoot is not processed in camera, processing is done on PC side (AFAIK).

edit:
The "added 3" hook seems to be equivalent to the placement found in ixus175 source. I'm not convinced that the other (added 2) hook is needed.
Yes, I found this mistake.The hook in a sub_FF3827C0 reach both (normal and quick) code paths.

@ntstatic
Comment out this line in  capt_seq.c
Code: [Select]
"BL capt_seq_hook_raw_here \ n" //   added 2Compile again and see if there are any differences in the dng.


Re: SX430 - This will be my first porting Attempt
« Reply #104 on: 20 / November / 2018, 07:13:05 »
I suspect that the raw hook is not placed ideally and firmware processes race with CHDK. I checked that there is indeed only one raw buffer, so that can't be the cause. An in-camera DNG needs some processing time to reverse the byte order of raw data. A DNG created via remote shoot is not processed in camera, processing is done on PC side (AFAIK).

edit:
The "added 3" hook seems to be equivalent to the placement found in ixus175 source. I'm not convinced that the other (added 2) hook is needed.
Yes, I found this mistake.The hook in a sub_FF3827C0 reach both (normal and quick) code paths.

@ntstatic
Comment out this line in  capt_seq.c
Code: [Select]
"BL capt_seq_hook_raw_here \ n" //   added 2Compile again and see if there are any differences in the dng.

Yes the corruption in the image seems to have gone

i have one doubt though.... is it possible we are not getting all the channels in the raw file
i think we are getting only the Green Channel - i may be wrong as i have very little experience with using raw images
however i processed the image with
DCRAW with and without the -a flag
tried opening the image in rawtharapee (i tried setting the white balance using spot but there is no effect)
and all i am getting is a green image
even the preview generated by Google Drive is green

i have uploaded the image here on google drive

the jpg image saved along with the CRW file is proper though.
« Last Edit: 20 / November / 2018, 07:15:23 by ntstatic »

*

Offline blackhole

  • *****
  • 660
  • A590IS 101b
    • Planetary astrophotography
Re: SX430 - This will be my first porting Attempt
« Reply #105 on: 20 / November / 2018, 09:48:27 »
Yes the corruption in the image seems to have gone

i have one doubt though.... is it possible we are not getting all the channels in the raw file
i think we are getting only the Green Channel - i may be wrong as i have very little experience with using raw images
however i processed the image with
DCRAW with and without the -a flag
tried opening the image in rawtharapee (i tried setting the white balance using spot but there is no effect)
and all i am getting is a green image
even the preview generated by Google Drive is green

i have uploaded the image here on google drive

the jpg image saved along with the CRW file is proper though.
It looks like the wrong CFA pattern or the raw_hook is still on the wrong place.
Try change, into the platform_camera.h :
Code: [Select]
#define cam_CFAPattern 0x02010100to
Code: [Select]
#define cam_CFAPattern 0x01020001or
Code: [Select]
#define cam_CFAPattern 0x01000201

*

Offline srsa_4c

  • ******
  • 3877
Re: SX430 - This will be my first porting Attempt
« Reply #106 on: 20 / November / 2018, 12:57:08 »
It looks like the wrong CFA pattern
I played a bit with the DNG (extracted the raw data using chdkptp and used DNG4PS2), and I think the CFA is okay. I'd change CAM_COLORMATRIX1. I used the matrix values from ixus175 and the resulting image is much better (but still doesn't match the JPG colors).

If the raw hook is sorted, I'd recommend checking for shooting modes where a valid raw can't be obtained or where enabling DNG causes DNG or JPG corruption.

*

Offline blackhole

  • *****
  • 660
  • A590IS 101b
    • Planetary astrophotography
Re: SX430 - This will be my first porting Attempt
« Reply #107 on: 20 / November / 2018, 13:49:29 »
I played a bit with the DNG (extracted the raw data using chdkptp and used DNG4PS2), and I think the CFA is okay. I'd change CAM_COLORMATRIX1. I used the matrix values from ixus175 and the resulting image is much better (but still doesn't match the JPG colors).

If the raw hook is sorted, I'd recommend checking for shooting modes where a valid raw can't be obtained or where enabling DNG causes DNG or JPG corruption.
This could become a rule for all the newer cameras.
The SX420 suffer from an identical problem.
Here is the dng from sx420:

EDIT: link removed
« Last Edit: 20 / November / 2018, 17:49:56 by blackhole »


*

Offline srsa_4c

  • ******
  • 3877
Re: SX430 - This will be my first porting Attempt
« Reply #108 on: 20 / November / 2018, 17:13:17 »
The SX420 suffer from an identical problem.
Here is the dng from sx420
The same DNG4PS2 profile works for this DNG too, so I guess you could change CAM_COLORMATRIX1 in the sx420 source.

Please remove the sx420 dng gdrive link as I'm not sure if that was intended to be shared publicly.

I think you have at least two ports that are not in svn - if they don't do harm (they are tested at least partially and work more or less) it would be a good idea to submit them for inclusion, with appropriate notes.

*

Offline blackhole

  • *****
  • 660
  • A590IS 101b
    • Planetary astrophotography
Re: SX430 - This will be my first porting Attempt
« Reply #109 on: 20 / November / 2018, 17:47:55 »
The same DNG4PS2 profile works for this DNG too, so I guess you could change CAM_COLORMATRIX1 in the sx420 source.

Please remove the sx420 dng gdrive link as I'm not sure if that was intended to be shared publicly.

I think you have at least two ports that are not in svn - if they don't do harm (they are tested at least partially and work more or less) it would be a good idea to submit them for inclusion, with appropriate notes.
I will replace CAM_COLORMATRIX1 for the SX420 with that of ixus175 and post the final test build. Judging by the reports for the sx420, the port works well, apart from problems with dng that should be solved with this.
Tomorrow I'll make a patch for both cameras, sx420 and sx430, for adding to the svn.
For sx620 I'm waiting for some of the testers familiar with chdkptp, I think it's the best because in the keymap missing many keys.

 

Related Topics