Porting a camera sx530hs - page 7 - DryOS Development - CHDK Forum  

Porting a camera sx530hs

  • 300 Replies
  • 109496 Views
*

Offline blackhole

  • *****
  • 841
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #60 on: 21 / March / 2016, 19:57:00 »
Advertisements
Patch with changes in platform_camera.h, lib.c, shooting.c and platform_palette.c.
Is there a problem in changing about the color palette?

*

Offline srsa_4c

  • ******
  • 4426
Re: Porting a camera sx530hs
« Reply #61 on: 21 / March / 2016, 20:40:43 »
i know that first i must create a dump file (there is one already listed on the forums but its for sx520 firmware v.1.00b so im assuming i need to create a new one for v.1.00c)
If you are sure your cam has the 1.00c firmware, you don't need to upload a new dump. If you're not sure, make a new dump and search for the "GM1." string in it with a hex editor - there are other methods for determining the fw version of course.

The sx530 port (the official source) can't currently be compiled, but his situation will likely change shortly. The port also has an unsolved problem: many SD cards seem to give trouble when CHDK is running - we don't currently have an idea how to solve this.

If you also have the 100c firmware making the port will consist of:
- making a new row in camera_list.csv for the sx520hs
- copying loader/sx530hs to loader/sx520hs (with all its files)
- copying platform/sx530hs to platform/sx520hs (with all files)
under platform/sx520hs
- fixing platform_camera.h (CAM_DNG_LENS_INFO), focus_len_table stuff in main.c (it's wrong for sx530 too)
under platform/sx520hs/sub/100c
- fixing PLATFORMID in makefile.inc

Hope I didn't forget something.

If it turns out that you have a fw version other than 100c, making a port will require some research (for files in platform/sx520hs/sub/{version})
« Last Edit: 21 / March / 2016, 20:56:05 by srsa_4c »

*

Offline srsa_4c

  • ******
  • 4426
Re: Porting a camera sx530hs
« Reply #62 on: 21 / March / 2016, 20:53:59 »
Is there a problem in changing about the color palette?
If you find enough colors in the Canon play and rec palettes, you can get rid of CAM_LOAD_CUSTOM_COLORS - which is what you apparently did.

*

Offline reyalp

  • ******
  • 13391
Re: Porting a camera sx530hs
« Reply #63 on: 22 / March / 2016, 00:00:15 »
The updated file propset_x.h
With these values, the main overrides (TV, AV and ISO) are now working well.
The camera is stable and there is no problems with freezing  or with a other undesirable effects.
Thanks, I checked this in.

A few more to check before we make this official:

SUBJECT_DIST2 / SUBJECT_DIST1
You should be able to check these in MF mode, they should have the same value, and it should change when you adjust the focus distance

DELTA_SV
Put the camera in AUTO ISO and half shoot. SV_MARKET will go to the base value (probably 576 = 200 ISO) and SV_MARKET + SV_DELTA converted to ISO should match the displayed auto ISO value.

DISPLAY_MODE
This should update when you press the disp button in shooting mode (down arrow on this cam)

FLASH_FIRE
Should be 1 after half press if the camera would use flash.

FLASH_EXP_COMP
Should show exp comp value in apex96 units

FOCUS_MODE
This should update when you change between Macro, standard AF and MF

OPTICAL_ZOOM_POSITION
should show the current zoom step, 0 at wide

EXPOSURE_LOCK
should go to one if you use the canon AE lock shortcut (half press, click +/- button)

IS_FLASH_READY
should go to one on half press when flash would be used, goes back to 0 on release.

ORIENTATION_SENSOR
Should be 0 in normal orientation, 90 or 270 in portrait orientation.

TIMER_DELAY
should update when you update the time in custom timer mode

WB_ADJ
should change when you change white balance mode, should give 7 non-zero values with chdkptp
=p=require'propcase' bs=require('binstr') return bs.unpack(get_prop_str(p.WB_ADJ,0x1c))

TIMER_SHOTS
should update when you adjust shot count in custom timer

Don't forget what the H stands for.


*

Offline blackhole

  • *****
  • 841
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #64 on: 22 / March / 2016, 17:38:15 »
Quote
A few more to check before we make this official:

SUBJECT_DIST2----67

SUBJECT_DIST1----251

DELTA_SV----81     can be 88 or 89, I'm really not sure

DISPLAY_MODE----108

FLASH_FIRE----125

FLASH_EXP_COMP----130

FOCUS_MODE----136

OPTICAL_ZOOM_POSITION----201

EXPOSURE_LOCK----212

IS_FLASH_READY----214

ORIENTATION_SENSOR----225

TIMER_DELAY----230

WB_ADJ----276

TIMER_SHOTS----381

*

Offline reyalp

  • ******
  • 13391
Re: Porting a camera sx530hs
« Reply #65 on: 22 / March / 2016, 23:54:42 »
Thanks, I've checked this in as propset 8, and switched the sx530hs platform.h to use it.

For the IDs that aren't verified, I assumed they are the same offset from propset 6 IDs as the closest known ID before (the ps6+... comments). This is much more likely to be right than using the propset 6 values.

DELTA_SV----81     can be 88 or 89, I'm really not sure
This one is important for ISO overrides to work correctly. You can try to isoinc script from https://chdk.setepontos.com/index.php?topic=12165.msg127110#msg127110 and see if you get reasonable results. It doesn't matter to much what range you check, just check that the jpeg brightness increases smoothly.

Also, I had to define DIGITAL_ZOOM_STATE to compile. I'm not sure how you were compiling yours. This is required for with CAM_USE_ALT_SET_ZOOM_POINT unless using the same workaround as propset 7. If the comment for DIGITAL_ZOOM_MODE is correct (standard digital zoom and off both 0), the propset 7 workaround cannot be used.

edit:
Also checked in changes from post #60
Don't forget what the H stands for.

Re: Porting a camera sx530hs
« Reply #66 on: 23 / March / 2016, 01:33:23 »
i know that first i must create a dump file (there is one already listed on the forums but its for sx520 firmware v.1.00b so im assuming i need to create a new one for v.1.00c)
If you are sure your cam has the 1.00c firmware, you don't need to upload a new dump. If you're not sure, make a new dump and search for the "GM1." string in it with a hex editor - there are other methods for determining the fw version of course.

The sx530 port (the official source) can't currently be compiled, but his situation will likely change shortly. The port also has an unsolved problem: many SD cards seem to give trouble when CHDK is running - we don't currently have an idea how to solve this.

If you also have the 100c firmware making the port will consist of:
- making a new row in camera_list.csv for the sx520hs
- copying loader/sx530hs to loader/sx520hs (with all its files)
- copying platform/sx530hs to platform/sx520hs (with all files)
under platform/sx520hs
- fixing platform_camera.h (CAM_DNG_LENS_INFO), focus_len_table stuff in main.c (it's wrong for sx530 too)
under platform/sx520hs/sub/100c
- fixing PLATFORMID in makefile.inc

Hope I didn't forget something.

If it turns out that you have a fw version other than 100c, making a port will require some research (for files in platform/sx520hs/sub/{version})

i doubled checked and mine is fw 100c, it seems that the top 3 should be pretty simple, not sure about the last 2, also seems like the guys on these thread almost have a complete official one for the sx530, i was planing on spending my day off on the weekend working on making the port for the sx520 (or attempting to at least)

*

Offline blackhole

  • *****
  • 841
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #67 on: 23 / March / 2016, 08:47:12 »
Quote
i doubled checked and mine is fw 100c, it seems that the top 3 should be pretty simple, not sure about the last 2, also seems like the guys on these thread almost have a complete official one for the sx530, i was planing on spending my day off on the weekend working on making the port for the sx520 (or attempting to at least)
For the beginning you have to find the P-ID number of your camera.
At this link you can see how to do it:
http://chdk.wikia.com/wiki/P-ID_(Table)


*

Offline blackhole

  • *****
  • 841
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #68 on: 23 / March / 2016, 15:23:42 »
Patch for changes in:
boot.c                        start in rec mode (on / off button)
main.c                       #define NUM_FL
platform_camera.h     removed #define CAM_HAS_ND_FILTER, the camera has no ND filter
propcase.lua               added propset8
propset8.h                  changed TODO status for some items and defined PROPCASE_VIDEO_RESOLUTION


Quote
This one is important for ISO overrides to work correctly. You can try to isoinc script from https://chdk.setepontos.com/index.php?topic=12165.msg127110#msg127110 and see if you get reasonable results. It doesn't matter to much what range you check, just check that the jpeg brightness increases smoothly.
Attached is isoinc.csv file.
Quote
Also, I had to define DIGITAL_ZOOM_STATE to compile. I'm not sure how you were compiling yours. This is required for with CAM_USE_ALT_SET_ZOOM_POINT unless using the same workaround as propset 7. If the comment for DIGITAL_ZOOM_MODE is correct (standard digital zoom and off both 0), the propset 7 workaround cannot be used.
That comment was correct. Checked again.
How can I check up value for PROPCASE_FLASH_SYNC_CURTAIN ?


« Last Edit: 09 / April / 2016, 09:23:39 by blackhole »

*

Offline srsa_4c

  • ******
  • 4426
Re: Porting a camera sx530hs
« Reply #69 on: 23 / March / 2016, 17:11:03 »
How can I check up value for PROPCASE_FLASH_SYNC_CURTAIN ?
As the camera doesn't seem to have this sort of native control over the flash, this propcase will need to be guessed (based on neighbouring known propcases). Other method would be: finding the most recent port where this propcase is known, identifying parts of the firmware where this propcase is accessed and then locating equivalent routines in the sx530 firmware. Success is not guaranteed.
not sure about the last 2
PLATFORMID is the P-ID of this camera (see blackhole's link), the lens related stuff is simply what's written on the lens ({ 43,10, 1806,10, 34,10, 60,10 } for the sx520). In main.c, set NUM_FL to 195. If you do all what's written above and place the sx520 100c PRIMARY.BIN in platform/sx520/sub/100c/, the file "stubs_entry.S" will be re-generated when you compile CHDK for the camera.

Quote
also seems like the guys on these thread almost have a complete official one for the sx530, i was planing on spending my day off on the weekend working on making the port for the sx520 (or attempting to at least)
There's still many things to improve and test. And, the card compatibility issue will need to be solved as well.

 

Related Topics