IXUS160/ELPH160 Porting attempt - page 10 - DryOS Development - CHDK Forum supplierdeeply

IXUS160/ELPH160 Porting attempt

  • 497 Replies
  • 173669 Views
Re: IXUS160/ELPH160 Porting attempt
« Reply #90 on: 11 / June / 2015, 16:10:43 »
Advertisements
Hmmm, that patch doesn't even include most of that data :)

Do you mean color profile or some other data ?
This patch just adds support of RAW files from Ixus 160 to dcraw. dcraw can calculate white balance and can produce not so bad results. There is instruction how to create color profile: see "Why does dcraw output have a green tint and weak color?" on the https://www.cybercom.net/~dcoffin/dcraw/.

I used dcraw many years. It looks better than dng4ps-2 since author support dcraw and it's very simple command line tool that can be statically linked.

*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS160/ELPH160 Porting attempt
« Reply #91 on: 11 / June / 2015, 17:01:35 »
Back to this issue.
With only 3 parameters it still crashed.
Looking at the asm and comparing to the ixus140, while the beginning of the function looks the same, the codepath to the sprintf is quite different.

For now I replaced the _GetImageFolder with some C code to test if it worked.
You get the assert because the function does not like what it gets as second argument.
You'll need CAM_FILE_COUNTER_IS_VAR in platform_camera.h and you'll need to find file_counter_var. See the ixus140 port porting thread for hints.

Do you mean color profile or some other data ?
I meant the color profile, I just wanted to emphasize that it's randomly chosen and very likely incorrect.

edit:
The address of file_counter_var is 0x6b4c. Can be found in routines above "FileBackupProperty.c".
« Last Edit: 13 / June / 2015, 08:30:15 by srsa_4c »

*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #92 on: 14 / June / 2015, 05:52:20 »
Yeah found it too, just didn't have the time to build a firmware until today.

Filename is offset by one, I remember reyalp once had this issue but I can't remember which camera it was... I'll dig deeper into this, I do remember you fixed the issue by putting the hook later. Thing is, the next call is the CreateJpeg.c, don't know how to go further down.


Edit: forgot to say that PAUSE_FOR_FILE_COUNTER did not help
« Last Edit: 14 / June / 2015, 06:13:47 by adong »

*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS160/ELPH160 Porting attempt
« Reply #93 on: 14 / June / 2015, 07:18:34 »
Filename is offset by one, I remember reyalp once had this issue but I can't remember which camera it was... I'll dig deeper into this, I do remember you fixed the issue by putting the hook later.
There's a fair chance that the JPEG filename/path is determined in the same routine (later) where you have the raw hook now. That would explain why waiting doesn't help.
However, if the offset is consistent (is it -1?), you can compensate for the offset in the port's shooting.c. Modify get_file_next_counter() and get_target_file_num(). get_file_next_counter() is only used locally, get_target_file_num() will be used for the raw file name.


*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #94 on: 14 / June / 2015, 10:07:58 »
updated github repo.

Yes the offset is always -1, I modified the two functions, although I don't know if I need to keep get_file_next_counter since get_target_file_num is using core/shooting.c's functions.

Re: IXUS160/ELPH160 Porting attempt
« Reply #95 on: 14 / June / 2015, 13:12:48 »
Hi All.

I bought Ixus 160 cameras. Be ready to more questions. ;)

First one is where should I get latest CHDK binaries for Ixus 160 ? I found ixus160_elph160-100a-1.4.0-0-full.zip at the http://chdk.setepontos.com/index.php?topic=12321.msg122817#msg122817, but it doesn't contain PS.FI2. This file exist only in http://chdk.setepontos.com/index.php?topic=12321.msg122348#msg122348, but this is 1.3 CHDK version and says "Update file error".

2adong: what about publishing binaries at the https://github.com/adongy/ixus160_elph160/releases ?

*

Offline adong

  • **
  • 66
Re: IXUS160/ELPH160 Porting attempt
« Reply #96 on: 14 / June / 2015, 13:40:08 »
Did not enable fi2 generation in the 1.4 branch, since I've never used it (diskboot.bin is waaay easier) so I didn't bother to reenable it.

please use stick to install chdk, less headaches that way (stick also has a page for builds that are not on the autobuild)

or you could wait for the port to make it into trunk, since it's not complete yet.

gh releases are a pain to do since I don't usually browse their website.

Re: IXUS160/ELPH160 Porting attempt
« Reply #97 on: 14 / June / 2015, 15:29:18 »
Did not enable fi2 generation in the 1.4 branch, since I've never used it (diskboot.bin is waaay easier) so I didn't bother to reenable it.

please use stick to install chdk, less headaches that way (stick also has a page for builds that are not on the autobuild)

Thank you, it works great.
I tried RAW, live preview, ptp extension, remote shoot.

gh releases are a pain to do since I don't usually browse their website.

Well, I created from your binaries: https://github.com/alex73/ixus160_elph160/releases

BTW, I rebased your changes on the chdk sources. You can see https://github.com/alex73/ixus160_elph160/tree/ixus160_elph160. Update to the latest chdk will be simple: git rebase trunk

Notes about my git:
1. I started from e7a3703961ba04e0588a0a459ac81d5ccf286675(Update to chdk 1.4) but not from "Initial commit" since previous commits were rebased on to /trunk
2. EOL chars converted to DOS in the some files, unix permission changed for some files
3. I leave doc/readme.txt but seems to it should be removed since all these info about Ixus 160 exist in the platform/ixus160_elph160/notes.txt
4. tools/*.bin removed since they are not exist in the origin CHDK code and have zero length
« Last Edit: 14 / June / 2015, 15:36:44 by alex73 »


*

Offline reyalp

  • ******
  • 13432
Re: IXUS160/ELPH160 Porting attempt
« Reply #98 on: 14 / June / 2015, 15:39:37 »
Yes the offset is always -1, I modified the two functions, although I don't know if I need to keep get_file_next_counter since get_target_file_num is using core/shooting.c's functions.
Note that counter reset or wraparound may break the -1 one assumption.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS160/ELPH160 Porting attempt
« Reply #99 on: 14 / June / 2015, 19:03:20 »
Note that counter reset or wraparound may break the -1 one assumption.
That's possible.
One could either research how the prediction works in those corner cases, or, one could try to move the raw hook further (I don't currently have a suggestion for a new location). The latter won't work if compression is started before the file counter is increased.

edit:
3rd possibility: reversing the firmware's "camera object" routines  :P
« Last Edit: 14 / June / 2015, 19:05:46 by srsa_4c »

 

Related Topics