G7 X porting thread - DryOS Development - CHDK Forum  

G7 X porting thread

  • 167 Replies
  • 152509 Views
*

Offline reyalp

  • ******
  • 14082
G7 X porting thread
« on: 12 / December / 2015, 22:51:47 »
Advertisements
 :-[ :haha

DryOS 55+p6
Mine has FW 100d, same as dump posted earlier by KayDat http://chdk.setepontos.com/index.php?topic=12513.0

Dancingbits 14 (same as sx530hs)
Firm update gives "update file error" when using the keys I have for sx530hs.

Green LED is the same as sx280

Progress will likely be slow. I haven't got further than blinking an LED in loader yet. May try to work on some thumb2 tools.

edit:
Runs with battery door open. Does not power on when USB connected.
« Last Edit: 18 / January / 2017, 14:43:35 by acseven »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14082
Re: G7 X porting thread
« Reply #1 on: 14 / February / 2016, 02:25:28 »
I checked in the work in progress g7x code. This is not yet useful for photography, no shooting related tasks or hooks are implemented. It may be useful for people working on other d6 ports.

A few other notes
* In the boot code, I found that setting  *(0x4ffc)=0x12345678; in the loader removed the need for any special hacks related to the power on buttons. Holding down power or wifi through boot switches to the appropriate mode. I suspect this would work for sx280 as well.
* CPU info is attached. Identical to sx280 except for region 7
* viewport and bitmap both appear to be 720x480 on a 736 wide buffer. I haven't tested video out. 720x480 matches the physical 3:2 aspect of the screen.
* the busy hack works to redraw the screen
* fi2 loading still gives update file error with latest tools. I haven't investigated. edit: Had a typo in key, boots now.
« Last Edit: 06 / April / 2017, 23:50:16 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: G7 X porting thread
« Reply #2 on: 14 / February / 2016, 09:03:18 »
* In the boot code, I found that setting  *(0x4ffc)=0x12345678; in the loader removed the need for any special hacks related to the power on buttons.
I think that's a flag meaning "cam was rebooted", <D6 cams use the same magic value. Never tried to experiment with it though.

Regarding the benchmark: the g7x seems to be the first (known) CHDK camera with over 20 MB/s card read/write speed...

*

Offline reyalp

  • ******
  • 14082
Re: G7 X porting thread
« Reply #3 on: 14 / February / 2016, 15:14:38 »
* In the boot code, I found that setting  *(0x4ffc)=0x12345678; in the loader removed the need for any special hacks related to the power on buttons.
I think that's a flag meaning "cam was rebooted", <D6 cams use the same magic value. Never tried to experiment with it though.
Yes, it was used on earlier cams. I though the firmware reboot code set it before starting diskboot, but at least on g7x it's not set after diskboot loads.
Quote
Regarding the benchmark: the g7x seems to be the first (known) CHDK camera with over 20 MB/s card read/write speed...
FWIW, the card is a Patriot UHS 1 micro SD.
Don't forget what the H stands for.


*

Offline reyalp

  • ******
  • 14082
Re: G7 X porting thread
« Reply #4 on: 14 / February / 2016, 21:44:33 »
This camera uses a new propset, with a large number of changes from propset 6, mismatches starting after id 23

Other cameras using the same dryos version (R55 p6) include  EOS M3, sx520, sx530 and ixus160
M3 was reported to use a new propset. The sx530 code in the trunk is set to propset 6, but was also reported to use a new propset (http://chdk.setepontos.com/index.php?topic=12418.msg123489#msg123489)
Interestingly, ixus160 is set to propset 6 and appears to be working  :-[

The values jeronymoGustavo used in http://chdk.setepontos.com/index.php?topic=12418.msg123489#msg12348 don't appear to match what I see on g7x either.

This wouldn't be the first time dryos revs don't match propset changes
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14082
Re: G7 X porting thread
« Reply #5 on: 16 / February / 2016, 01:26:59 »
I added the new propset as propset 7.

I've checked most of the IDs, but a few are still uncertain or appear to have a different range of values than previous propsets.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14082
Re: G7 X porting thread
« Reply #6 on: 23 / February / 2016, 01:16:44 »
I haven't found direct equivalent of PROPCASE_SHOOTING yet (edit: and I'm pretty confident one doesn't exist). The one I found is similar to propcase 352 mentioned in https://chdk.setepontos.com/index.php?topic=11604.msg113712#msg113712 but goes to 3 when the shot is being taken. This doesn't work as-is for PROPCASE_SHOOTING, because as noted in phils post it goes to 1 before pre-shoot is done. I've verified on g7x that it goes to 2 right around the same time the override hook is called.

I've called this PROPCASE_SHOOTING_STATE. elph130 (propset 6) seems to have an equivalent propcase at ID 351. sx160 (propset 5) behaves like phils description of g12.

My workaround for this is to add a fake PROPCASE_SHOOTING id (> than any real propcase id), and then use an #ifdef in get_property_case to return 1 if PROPCASE_SHOOTING_STATE is > 1.

The fake PROPCASE_SHOOTING id allows existing code that uses the ID to work unchanged.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14082
Re: G7 X porting thread
« Reply #7 on: 13 / March / 2016, 01:36:15 »
edit 2017 06 11 - builds for firmware 100b and 100d are now available from the autobuild

Attached is a test build for g7x with canon firmware 100d. I could not get ver.req or vers.req to work, you can use the ACID or the Canon basic firmware info script to get the version: http://chdk.wikia.com/wiki/Canon_Basic/Scripts/Firmware_Info

Builds for other firmware versions
* 100b test build https://chdk.setepontos.com/index.php?topic=12692.msg131767#msg131767
* 100c test build https://chdk.setepontos.com/index.php?topic=12692.msg131768#msg131768


This is an early test build on a new platform, so it's probably higher risk than the average CHDK port. I haven't destroyed my camera yet, but I make absolutely no promise it won't destroy yours. If you are not willing to accept the possibility that it might destroy your camera, do not use it.

Aside from the specific issues discussed below, I think most CHDK functionality is working. However, I have not yet used it extensively outside of testing. The camera notes section of the included readme.txt lists most of the things I've tested.

Issues
The same display / viewport issues that apply to other digic 6 ports apply
In brief:
- CHDK UI is erased / flashes every time low battery icons flash
- Edge overlay does not erase properly when shown live
- Zebra "Draw Over Zebra" and Restore options are non-functional

A PS.FI2 is included, but like sx280hs, it crashes if you boot with "firm update" and select "hybrid auto" mode. The orientation sensor also freaks out. I  strongly recommend against using "firm update" loading for anything other than making the card bootable.

This camera uses many different raw buffer addresses. I strongly suggest not attempting to use CHDK DNG or functions that modify the raw buffer (raw hook ops, raw develop etc) in modes other than M, P, Av and Tv. I have not yet added code to disable CHDK raw in other modes. Scripts that rely on reading the raw buffer are also likely to fail outside these modes.

This camera also has many different capt seq code paths. This means that the raw hook and remote hook will not be run in many of more specialized shooting modes (hdr, star timelapse, special effect scene modes). When the raw hook is not called, script shoot() will not work correctly.

The values used in some propcases have changed (e.g. PROPCASE_RESOLUTION) so even "portable" scripts that use propcase.lua may still behave incorrectly. See comments in propset7.h for details.

On a few of occasions, I've seen "card locked" and "memory card error" after booting. This hasn't happened often, and has always gone away after a reboot. It's unclear if this is a card problem, a port bug, or something else. It could be related to the memory card errors seen on some other cameras with certain cards (e.g. https://chdk.setepontos.com/index.php?topic=11487.0)

I have also had a few instances where uploading a chdk build with chdkptp goes very slowly. I think this might be triggered by connecting very soon after boot, but I'm not certain.

edit 2016-03-13:
updated with build 4544.
Main change is correcting the real/market ISO factor (they appear identical on this cam). This probably fixes some of the ISO weirdness I saw in isoinc and rawopint

edit 2016-03-20:
updated with build 4561.
Added rand, srand, playsound, backlight control and hp timer functions, some stubs_min status variables.

edit 2016-03-26:
updated with build 4570
Added jogdial support. This means you can use the control wheels in the CHDK menus, and that they are not seen by the canon firmware when you are in alt mode.

edit 2016-03-30:
updated with build 4580
Fixed incorrect stub for CancelHPTimer (only affects set_remote_timing high precision USB remote stuff)

edit 2016-04-24:
updated with build 4606
Added initial support for PTP remote shoot. The filewrite code is somewhat different from existing ports, so I wouldn't be surprised if there are bugs.
Note that Canon raw is not really supported in the core remoteshoot code. On g7x, if canon raw is enabled, it will be downloaded as a .jpg. If jpeg is also enabled, it will be saved to the SD card.
It's possible that remote shoot is broken in some special shooting modes.

edit 2016-05-19:
updated with build 4631
Fixes OSD not showing outside of alt mode (canon_menu_active stub found)

edit 2016-08-06
updated with build 4666
Includes experimental motion detection support from 62ndidiot https://chdk.setepontos.com/index.php?topic=12918.0
fixed get_video_recording / simple_movie_status

edit 2016-09-05
updated with build 4682
* Includes preliminary PTP live view support https://chdk.setepontos.com/index.php?topic=6231.msg129812#msg129812
* Fixes false triggering in motion detection

edit 2017-03-12
updated with build 4769
* Reversed action of front control dial in CHDK menus
* 100b test build https://chdk.setepontos.com/index.php?topic=12692.msg131767#msg131767
* 100c test build https://chdk.setepontos.com/index.php?topic=12692.msg131768#msg131768

edit 2017-04-02
updated with build 4781
* Includes digic 6 display updates from srsa_4c https://chdk.setepontos.com/index.php?topic=12788.msg131891#msg131891
* Histogram and zebra are now functional, thanks to work by 62ndidiot
* Fixed motion detection issues in the color channel modes from 62ndidiot https://chdk.setepontos.com/index.php?topic=12918.msg131622#msg131622
* Edge overlay is partially working thanks to code form Ant.


edit 2017-04-16
Updated with build r4797

The main change is that raw buffers should now be correct in most cases (technical details). This means you can use CHDK raw in many cases where the Canon firmware does not allow Canon raw: With digital zoom, in Auto mode, with "my colors", etc. Of course,  the visual effects apply only to the jpeg.

CHDK raw is also now disabled in some modes where it known to be non-functional: HDR, "handheld night scene" and "hybrid auto".

edit 2017-05-07
Updated with build r4805

Added workaround for some UHS cards not using full speed under CHDK technical details. I suspect this may fix occasional boot problems, but haven't used it enough to be sure.
« Last Edit: 11 / June / 2017, 20:44:13 by reyalp »
Don't forget what the H stands for.


*

Offline reyalp

  • ******
  • 14082
Re: G7 X porting thread
« Reply #8 on: 14 / March / 2016, 02:52:58 »
Quote
On a few of occasions, I've seen "card locked" and "memory card error" after booting.
Possibly related to this, today I noticed all files in the root directory were listed twice, both in the file browser and os.listdir. Subdirectories looked normal. Browsing the card on a PC showed the same, chkdsk reported errors.

I formatted the card in camera, and it seems to be normal again.

It's unclear if this was due to a bug, or corruption from one of the many crashes in development, or something else.
Don't forget what the H stands for.

*

Offline c_joerg

  • *****
  • 1248
Re: G7 X porting thread
« Reply #9 on: 14 / March / 2016, 06:02:29 »
 
Great work. I did not think that it goes so fast...
 

I had on Saturday briefly G7x in hand. Firmware was 1:00 rev 2:00 . Is this 100d ?
It could be my next...
First think which I notice was that the cam has no ISO100. It starts with ISO125.

For me it’s important the dynamic range of a camera. According DxO the dynamic range of G7x is 2EV better than the G1x. It would be nice if you could start drtest.lua on the camera, and post the results.

Even a few isoinc runs I would be interested...

 
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

 

Related Topics