supplierdeeply

eos M10 port

  • 208 Replies
  • 88382 Views
Re: eos M10 port
« Reply #170 on: 02 / April / 2018, 11:00:16 »
Advertisements
I have another question about the tv override.

If, from the CHDK menu, I set the Override Tv type to LongExp and the set an override time of, for example 00:05:00 I can get a picture of 5 minutes as expected.

Then I would like to do the same from a program that I am writing and I want to use the chdkptp to set the Override Tv time.
As far as I understood there are several lua methods implemented for this function that are:
set_tv96
set_tv96_direct
set_user_tv96
set_user_tv_id
set_user_tv_id_rel

The set_tv96 and set_tv96_direct to not produce any effect on the camera and when I do the equivalent get function I always get zero as return value.
The only method that seems to work for M10 camera is set_user_tv96.
Here I can specify the time value using the conversion function usec_to_tv96 and apparently the function sets the time correctly because the get_user_tv96 returns the value that I setup.

Unfortunately this value works correctly only up to 32 seconds (or -480), if I try to setup longer exposure time it will stay with 32 seconds, even if the get_user_tv96 gives the value that I setup.

Then I thought that I have to use another method (because I know from the camera menu that I can setup more than 32 seconds).
I found then the function set_user_tv_id that takes the ID from a list contained in the shooting.c file. The available shutter speed for canon M10 in that file starts wi the value:
-24, -768, "250", 250000000
That means that if I set as ID -24 I should have 250 seconds of exposure.
I try and the get_user_tv96 gives me back correctly -768, but the exposure time is still 32 seconds.

What am I doing wrong?

*

Offline srsa_4c

  • ******
  • 3728
Re: eos M10 port
« Reply #171 on: 02 / April / 2018, 11:57:39 »
I have one question: in the live view mode, on the camera, it exists the possibility to zoom the image. It is not a real zoom but a crop of the sensor that shows only a portion of it (in fact it is also possible to select which portion).
I wonder if it exists a way to enable it in the live view of chdk through a lua command or a ptp message.
Not currently, this is a feature that Powershots don't have.
Quote
I tried with libgphoto2 (and the CHDK firmware running) and the function is there and works.
The address used is 0x9158 for the zoom
That's not a bad lead. PTP handlers are easy to find in the disassembly, but their parameters are a bit obscure and need some work, maybe even debugging.
Quote
and 0x9159 for the selected area (but this one seems to have a problem with the M10).
What is that problem?
Also, is there a simple method I could use to experiment with these PTP operations? Maybe through gphoto?

*

Offline srsa_4c

  • ******
  • 3728
Re: eos M10 port
« Reply #172 on: 02 / April / 2018, 12:00:14 »
The set_tv96 and set_tv96_direct to not produce any effect on the camera and when I do the equivalent get function I always get zero as return value.
The only method that seems to work for M10 camera is set_user_tv96.
Here I can specify the time value using the conversion function usec_to_tv96 and apparently the function sets the time correctly because the get_user_tv96 returns the value that I setup.

Unfortunately this value works correctly only up to 32 seconds (or -480), if I try to setup longer exposure time it will stay with 32 seconds, even if the get_user_tv96 gives the value that I setup.

Then I thought that I have to use another method (because I know from the camera menu that I can setup more than 32 seconds).
I found then the function set_user_tv_id that takes the ID from a list contained in the shooting.c file. The available shutter speed for canon M10 in that file starts wi the value:
-24, -768, "250", 250000000
That means that if I set as ID -24 I should have 250 seconds of exposure.
I try and the get_user_tv96 gives me back correctly -768, but the exposure time is still 32 seconds.

What am I doing wrong?
Thanks for the reminder. You managed to bump into some unimplemented stuff. Perhaps it's time to finish them.
I'll take a look.

Re: eos M10 port
« Reply #173 on: 02 / April / 2018, 14:23:14 »
Quote
What is that problem?
Also, is there a simple method I could use to experiment with these PTP operations? Maybe through gphoto?

The problem is that in gphoto when I set the coordinates of the live view zoom the camera crashes. So my guess is that the address used by gphoto is not correct for the M10.

Sure you can try with a simple

gphoto2 --capture-preview --set-config eoszoom=5

and if you want to crash your camera you can simply try

gphoto2 --set-config eoszoomposition=640,320


Re: eos M10 port
« Reply #174 on: 02 / April / 2018, 14:24:51 »
Quote
Thanks for the reminder. You managed to bump into some unimplemented stuff. Perhaps it's time to finish them.
I'll take a look.

Uh, thanks for the quick answer. Please let me know if I can do something as test or code (I know c/c++/python but I know very little of chdk so I do not know if I can be useful in some way).

*

Offline srsa_4c

  • ******
  • 3728
Re: eos M10 port
« Reply #175 on: 02 / April / 2018, 15:45:46 »
Please let me know if I can do something as test
I made some adjustments, so TV related functions should now be more usable. If you could re-try your experiments, that would be useful.

If you can compile from source, changes are below. If not, choose one of the attached diskboot.bin files (the one corresponding to your firmware).

Code: [Select]
Index: include/propset10.h
===================================================================
--- include/propset10.h (revision 5008)
+++ include/propset10.h (working copy)
@@ -76,10 +76,9 @@
 //#define PROPCASE_STITCH_SEQUENCE                 249        // [m10:untested] counts shots in stitch sequence, positive=left>right, negative=right>left
 #define PROPCASE_SUBJECT_DIST1                   256        // [m10:zero]
 #define PROPCASE_SV_MARKET                       257
-// TV vs TV2 not verified
-#define PROPCASE_TV2                             273        // [m10:untested] (philmoz, May 2011) - this value causes overrides to be saved in JPEG and shown on Canon OSD
-#define PROPCASE_TV                              274        // [m10:untested] Need to set this value for overrides to work correctly
-#define PROPCASE_USER_TV                         276        // [m10:untested]
+#define PROPCASE_TV2                             273        // (philmoz, May 2011) - this value causes overrides to be saved in JPEG and shown on Canon OSD
+#define PROPCASE_TV                              274        // Need to set this value for overrides to work correctly
+#define PROPCASE_USER_TV                         276        //
 #define PROPCASE_WB_MODE                         281        // 0 = Auto, 1 = Daylight, 2 = Shade, 3 = Cloudy, 4 = Tungsten, 5 = Fluorescent, 7 = flash, 11 = under water, 6 = Fluorescent H, 9 = Custom 1, 10 = custom 2
 #define PROPCASE_WB_ADJ                          282        // [m10:untested]
 #define PROPCASE_SERVO_AF                        308        // 0 = Servo AF off, 1 = Servo AF on
Index: platform/m10/platform_camera.h
===================================================================
--- platform/m10/platform_camera.h (revision 5008)
+++ platform/m10/platform_camera.h (working copy)
@@ -114,7 +114,7 @@
     #define ISO_REAL_TO_MARKET_SHIFT            0
     #define ISO_REAL_TO_MARKET_ROUND            0
 
-    //#define CAM_EXT_TV_RANGE                    1
+    #define CAM_EXT_TV_RANGE                    1 // note: exp_drv_task not implemented
 
     #undef  CAM_HAS_ERASE_BUTTON
     #define CAM_SHOW_OSD_IN_SHOOT_MENU          1
Index: platform/m10/shooting.c
===================================================================
--- platform/m10/shooting.c (revision 5008)
+++ platform/m10/shooting.c (working copy)
@@ -36,7 +36,6 @@
     { 31, 864, "22.0" },
 };
 
-// note camera supports up to 250s shutter
 const ShutterSpeed shutter_speeds_table[] = {
     { -24, -768, "250", 250000000 },
     { -23, -736, "200", 200000000 },
Index: platform/m10/sub/110d/stubs_entry.S
===================================================================
--- platform/m10/sub/110d/stubs_entry.S (revision 5008)
+++ platform/m10/sub/110d/stubs_entry.S (working copy)
@@ -98,6 +98,7 @@
 //NHSTUB(SetFileTimeStamp                     ,0x00000000) //  0        *** != 0xfc389ad1
 //NHSTUB(SetParameterData                     ,0x00000000) //  0        *** != 0xfc27e64f
 //NHSTUB(WriteSDCard                          ,0x00000000) //  0        *** != 0x010e2c9d
+//NHSTUB(apex2us                              ,0x00000000) //  0        *** != 0xfc1b1d07
 //NHSTUB(displaybusyonscreen                  ,0x00000000) //  0        *** != 0xfc3273d3
 //NHSTUB(strtolx                              ,0x00000000) //  0        *** != 0xfc13b209
 //NHSTUB(undisplaybusyonscreen                ,0x00000000) //  0        *** != 0xfc327469
@@ -179,7 +180,6 @@
 NHSTUB(_pow                                   ,0x01103a40) //  0
 NHSTUB(_sqrt                                  ,0x01105ac0) //  0
 NHSTUB(add_ptp_handler                        ,0xfc307ad7) //  0
-//NHSTUB(apex2us                              ,0x00000000) //  0            == 0x00000000
 NHSTUB(close                                  ,0xfc1ebd5b) //  0
 NHSTUB(exmem_alloc                            ,0xfc081793) //  0
 NHSTUB(exmem_free                             ,0xfc0817d3) //  0
Index: platform/m10/sub/110d/stubs_entry_2.S
===================================================================
--- platform/m10/sub/110d/stubs_entry_2.S (revision 5008)
+++ platform/m10/sub/110d/stubs_entry_2.S (working copy)
@@ -25,7 +25,7 @@
 NHSTUB(SetFileTimeStamp,                       0xfc389ad1)
 NHSTUB(SetParameterData,                       0xfc27e64f) // PTM_BackupUIProperty_FW
 NHSTUB(WriteSDCard,                            0x10e2c9d)  // found @ fc388a84
-NHSTUB(apex2us, NULL_SUB) // todo
+NHSTUB(apex2us,                                0xFC1B1D07)
 NHSTUB(reboot_fw_update, NULL_SUB) // todo
 NHSTUB(strtolx,                                0xfc13b209)
 NHSTUB(CancelHPTimer,                          0xfc1faa7d)
Index: platform/m10/sub/110f/stubs_entry.S
===================================================================
--- platform/m10/sub/110f/stubs_entry.S (revision 5008)
+++ platform/m10/sub/110f/stubs_entry.S (working copy)
@@ -96,6 +96,7 @@
 //NHSTUB(SetFileTimeStamp                     ,0x00000000) //  0        *** != 0xfc389b05
 //NHSTUB(SetParameterData                     ,0x00000000) //  0        *** != 0xfc27e64f
 //NHSTUB(WriteSDCard                          ,0x00000000) //  0        *** != 0x010e2c9d
+//NHSTUB(apex2us                              ,0x00000000) //  0        *** != 0xfc1b1d07
 //NHSTUB(displaybusyonscreen                  ,0x00000000) //  0        *** != 0xfc327407
 //NHSTUB(strtolx                              ,0x00000000) //  0        *** != 0xfc13b209
 //NHSTUB(undisplaybusyonscreen                ,0x00000000) //  0        *** != 0xfc32749d
@@ -179,7 +180,6 @@
 NHSTUB(_pow                                   ,0x01103a40) //  0
 NHSTUB(_sqrt                                  ,0x01105ac0) //  0
 NHSTUB(add_ptp_handler                        ,0xfc307b0b) //  0
-//NHSTUB(apex2us                              ,0x00000000) //  0            == 0x00000000
 NHSTUB(close                                  ,0xfc1ebd5b) //  0
 NHSTUB(exmem_alloc                            ,0xfc081793) //  0
 NHSTUB(exmem_free                             ,0xfc0817d3) //  0
Index: platform/m10/sub/110f/stubs_entry_2.S
===================================================================
--- platform/m10/sub/110f/stubs_entry_2.S (revision 5008)
+++ platform/m10/sub/110f/stubs_entry_2.S (working copy)
@@ -27,7 +27,7 @@
 NHSTUB(SetFileTimeStamp,                       0xfc389b05)
 NHSTUB(SetParameterData,                       0xfc27e64f) // PTM_BackupUIProperty_FW
 NHSTUB(WriteSDCard,                            0x10e2c9d)  // found @ fc388ab8
-NHSTUB(apex2us, NULL_SUB) // todo
+NHSTUB(apex2us,                                0xFC1B1D07)
 NHSTUB(reboot_fw_update, NULL_SUB) // todo
 NHSTUB(strtolx,                                0xfc13b209)
 NHSTUB(CancelHPTimer,                          0xfc1faa7d)
edit: changes are now in svn, binaries removed
« Last Edit: 05 / April / 2018, 15:10:54 by srsa_4c »

*

Offline srsa_4c

  • ******
  • 3728
Re: eos M10 port
« Reply #176 on: 02 / April / 2018, 16:05:12 »
and if you want to crash your camera you can simply try

gphoto2 --set-config eoszoomposition=640,320
That causes a 'division by zero' exception - my preliminary guess is that this operation now has more than 2 parameters.

edit:
... or something isn't initialized properly, since (wired) PTP in rec mode isn't supported by the Canon firmware
« Last Edit: 02 / April / 2018, 16:21:39 by srsa_4c »

Re: eos M10 port
« Reply #177 on: 02 / April / 2018, 16:28:17 »
I tried the DISKBOOT.BIN for the 110f (my firmware).

First the good news: set_tv96_direct now works as expected, thanks!

Then for the other functions.
set_user_tv96 sets the ISO of the camera not the override (maybe is the correct way?) so it is limited to 32 seconds (-480 as maximum).
Both get_tv96 and get_user_tv96 return the value from the camera, not the override, with the difference that get_user_tv96 is immediately updated while get_tv96 requires a shoot_half press button to update.
Anyway if I set TV with set_tv96_direct I have no way to read back the value from the camera because no function reads the override value.

Then the a final note: the set_tv96_direct setting seems to work correctly only with the shoot function, if I use the press("shoot_full") the override doesn't apply. Maybe this is correct.
Thanks again.


Re: eos M10 port
« Reply #178 on: 02 / April / 2018, 16:32:51 »
Quote
... or something isn't initialized properly, since (wired) PTP in rec mode isn't supported by the Canon firmware

what does it means? I use chdkptp in rec mode with the usb cable and works well.

*

Offline srsa_4c

  • ******
  • 3728
Re: eos M10 port
« Reply #179 on: 02 / April / 2018, 20:09:50 »
what does it means? I use chdkptp in rec mode with the usb cable and works well.
Sure it does, but you would not be able to shoot without CHDK.
gphoto --capture-image (and the other variants) fail with
Canon EOS Half-Press failed (0x2019: PTP Device Busy)
ERROR: Could not trigger capture.


This PTP handler (0x9159) seems to work on a big struct that isn't supplied as parameter. And, apparently, some parts of that struct are invalid.
Then for the other functions.
I have to admit that I'm not much into scripting.
After clicking on individual functions on the crossref page, I have the impression that the _user_ functions work with Canon UI values (with their limits). The get_ functions do get their values from camera (and that will not necessarily match what was set_ beforehand).
I'm not sure why you would want to read back your override values (since it was you who set them).

Maybe others can comment?

 

Related Topics